-
Notifications
You must be signed in to change notification settings - Fork 10
feat: create initial external-proofs ExEx crate #181
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| [package] | ||
| name = "external-proofs" | ||
| version = "0.1.0" | ||
| edition.workspace = true | ||
| rust-version.workspace = true | ||
| license.workspace = true | ||
| homepage.workspace = true | ||
| repository.workspace = true | ||
| description = "ExEx to save and serve trie nodes to make proofs faster." | ||
|
|
||
| [lints] | ||
| workspace = true | ||
|
|
||
| [dependencies] | ||
| reth-exex.workspace = true | ||
|
|
||
| # reth | ||
| reth-provider.workspace = true | ||
| reth-node-types.workspace = true | ||
| reth-node-api.workspace = true | ||
|
|
||
| # misc | ||
| eyre.workspace = true | ||
| futures-util.workspace = true |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,48 @@ | ||||||||||
| //! External Proofs ExEx - processes blocks and tracks state changes | ||||||||||
|
|
||||||||||
| use futures_util::TryStreamExt; | ||||||||||
| use reth_node_api::{FullNodeComponents, NodePrimitives}; | ||||||||||
| use reth_node_types::NodeTypes; | ||||||||||
| use reth_provider::StateReader; | ||||||||||
|
|
||||||||||
| use reth_exex::{ExExContext, ExExEvent}; | ||||||||||
|
|
||||||||||
| /// Saves and serves trie nodes to make proofs faster. This handles the process of | ||||||||||
| /// saving the current state, new blocks as they're added, and serving proof RPCs | ||||||||||
| /// based on the saved data. | ||||||||||
| #[derive(Debug)] | ||||||||||
| pub struct ExternalProofExEx<Node> | ||||||||||
| where | ||||||||||
| Node: FullNodeComponents, | ||||||||||
| Node::Provider: StateReader, | ||||||||||
| { | ||||||||||
| ctx: ExExContext<Node>, | ||||||||||
| } | ||||||||||
|
|
||||||||||
| impl<Node, Primitives> ExternalProofExEx<Node> | ||||||||||
| where | ||||||||||
| Node: FullNodeComponents<Types: NodeTypes<Primitives = Primitives>>, | ||||||||||
| Primitives: NodePrimitives, | ||||||||||
| { | ||||||||||
| /// Create a new `ExternalProofExEx` instance | ||||||||||
| pub const fn new(ctx: ExExContext<Node>) -> Self { | ||||||||||
| Self { ctx } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /// Main execution loop for the ExEx | ||||||||||
| pub async fn run(mut self) -> eyre::Result<()> { | ||||||||||
| while let Some(notification) = self.ctx.notifications.try_next().await? { | ||||||||||
| // match ¬ification { | ||||||||||
| // _ => {} | ||||||||||
| // }; | ||||||||||
|
Comment on lines
+35
to
+37
|
||||||||||
| // match ¬ification { | |
| // _ => {} | |
| // }; | |
| // TODO: Implement notification handling logic here as needed. |
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.
The
Primitivesgeneric parameter is unused in the implementation. SinceNode::Provider: StateReaderis already constrained in the struct definition, consider removing the unusedPrimitivesparameter or add a comment explaining why it will be needed for future functionality.