-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: wire components in EthService #9621
feat: wire components in EthService #9621
Conversation
use tracing::*; | ||
|
||
mod memory_overlay; | ||
pub use memory_overlay::MemoryOverlayStateProvider; | ||
|
||
/// Maximum number of blocks to be kept only in memory without triggering persistence. | ||
const PERSISTENCE_THRESHOLD: u64 = 256; | ||
/// Number of pending blocks that cannot be executed due to missing parent and | ||
/// are kept in cache. | ||
const DEFAULT_BLOCK_BUFFER_LIMIT: u32 = 256; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These constants are defined to be able to instantiate EngineApiTreeState
when building the tree, lmk wdyt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense, given how the block buffer works rn
provider: P, | ||
executor_provider: E, | ||
consensus: Arc<dyn Consensus>, | ||
payload_validator: ExecutionPayloadValidator, | ||
incoming: Receiver<FromEngine<BeaconEngineMessage<T>>>, | ||
state: EngineApiTreeState, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
state and header are initialized in the constructor, is there any case when we want to inject them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking we should have the header as an argument, or initialize it differently. For example we probably want to set it as the highest persisted block on node startup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, done here 7881e2e
@@ -159,22 +158,17 @@ where | |||
|
|||
let pruner_events = pruner.events(); | |||
info!(target: "reth::cli", prune_config=?ctx.prune_config().unwrap_or_default(), "Pruner initialized"); | |||
hooks.add(PruneHook::new(pruner, Box::new(ctx.task_executor().clone()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of in hooks, pruner is consumed when creating the service, otherwise we should be able to clone it or have different pruners, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making the service consume the pruner makes sense to me imo, since we will do things with the pruner in the eth service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, note the comment about the header
@@ -159,22 +158,17 @@ where | |||
|
|||
let pruner_events = pruner.events(); | |||
info!(target: "reth::cli", prune_config=?ctx.prune_config().unwrap_or_default(), "Pruner initialized"); | |||
hooks.add(PruneHook::new(pruner, Box::new(ctx.task_executor().clone()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making the service consume the pruner makes sense to me imo, since we will do things with the pruner in the eth service
use tracing::*; | ||
|
||
mod memory_overlay; | ||
pub use memory_overlay::MemoryOverlayStateProvider; | ||
|
||
/// Maximum number of blocks to be kept only in memory without triggering persistence. | ||
const PERSISTENCE_THRESHOLD: u64 = 256; | ||
/// Number of pending blocks that cannot be executed due to missing parent and | ||
/// are kept in cache. | ||
const DEFAULT_BLOCK_BUFFER_LIMIT: u32 = 256; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense, given how the block buffer works rn
provider: P, | ||
executor_provider: E, | ||
consensus: Arc<dyn Consensus>, | ||
payload_validator: ExecutionPayloadValidator, | ||
incoming: Receiver<FromEngine<BeaconEngineMessage<T>>>, | ||
state: EngineApiTreeState, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking we should have the header as an argument, or initialize it differently. For example we probably want to set it as the highest persisted block on node startup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -159,22 +158,17 @@ where | |||
|
|||
let pruner_events = pruner.events(); | |||
info!(target: "reth::cli", prune_config=?ctx.prune_config().unwrap_or_default(), "Pruner initialized"); | |||
hooks.add(PruneHook::new(pruner, Box::new(ctx.task_executor().clone()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this
incoming_requests: UnboundedReceiverStream<BeaconEngineMessage<EthEngineTypes>>, | ||
pipeline: Pipeline<DB>, | ||
pipeline_task_spawner: Box<dyn TaskSpawner>, | ||
provider: ProviderFactory<DB>, | ||
blockchain_db: BlockchainProvider<DB>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mental note here, that this type will change,
we could also operate on the provider traits here, but for now these seems easier
The inmemory state could then be obtained from this provider as well
7881e2e
to
45ab518
Compare
Closes: #9576