-
Notifications
You must be signed in to change notification settings - Fork 111
feat(node): extract base node to customize validator #464
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
Conversation
✅ Heimdall Review Status
|
|
ignore |
| let maybe_pre_bedrock_historical_rpc = historical_rpc | ||
| .and_then(|historical_rpc| { | ||
| ctx.node | ||
| .provider() | ||
| .chain_spec() | ||
| .op_fork_activation(OpHardfork::Bedrock) | ||
| .block_number() | ||
| .filter(|activation| *activation > 0) | ||
| .map(|bedrock_block| (historical_rpc, bedrock_block)) | ||
| }) | ||
| .map(|(historical_rpc, bedrock_block)| -> eyre::Result<_> { | ||
| info!(target: "reth::cli", %bedrock_block, ?historical_rpc, "Using historical RPC endpoint pre bedrock"); | ||
| let provider = ctx.node.provider().clone(); | ||
| let client = HistoricalRpcClient::new(&historical_rpc)?; | ||
| let layer = HistoricalRpc::new(provider, client, bedrock_block); | ||
| Ok(layer) | ||
| }) | ||
| .transpose()? | ||
| ; |
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.
Ah yea this can go
|
Opened an issue here for cleaning up some OP specific stuff we don't need: #467 |
| } | ||
| } | ||
|
|
||
| /// A regular optimism evm and executor builder. |
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.
Maybe we could split everything here and below into a new builder.rs module just so this file doesn't bloat
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.
sounds good, yeah maybe the Addons and AddonsBuilder can be moved. I'll add that to the next PR and take a swing at it today.
refcell
left a comment
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.
As discussed offline, other cleanup can be done in followups :)
This will allow customizing parts of the node further. The main goal is to customize the engine validator which handles executing blocks which need to be validated. (#465 builds on this to implement this)
I copied the
OpNodeimplementation and removed all of the components we're not changing. This left me with just the node, addons and addon builder.We can also probably remove some features we're not using from here, but to keep this PR straightforward, I haven't changed it from the Reth version other than removing code that isn't going to be customized.