Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ members = [
"crates/exex/exex/",
"crates/exex/test-utils/",
"crates/exex/types/",
"crates/exex/external-proofs/",
"crates/metrics/",
"crates/net/banlist/",
"crates/net/discv4/",
Expand Down
24 changes: 24 additions & 0 deletions crates/exex/external-proofs/Cargo.toml
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
48 changes: 48 additions & 0 deletions crates/exex/external-proofs/src/lib.rs
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,
Comment on lines +22 to +25
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Primitives generic parameter is unused in the implementation. Since Node::Provider: StateReader is already constrained in the struct definition, consider removing the unused Primitives parameter or add a comment explaining why it will be needed for future functionality.

Suggested change
impl<Node, Primitives> ExternalProofExEx<Node>
where
Node: FullNodeComponents<Types: NodeTypes<Primitives = Primitives>>,
Primitives: NodePrimitives,
impl<Node> ExternalProofExEx<Node>
where
Node: FullNodeComponents,
Node::Provider: StateReader,

Copilot uses AI. Check for mistakes.
{
/// 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 &notification {
// _ => {}
// };
Comment on lines +35 to +37
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented-out code. If this is intended as a placeholder for future implementation, consider adding a TODO comment with more specific context about what notification handling will be added.

Suggested change
// match &notification {
// _ => {}
// };
// TODO: Implement notification handling logic here as needed.

Copilot uses AI. Check for mistakes.

if let Some(committed_chain) = notification.committed_chain() {
self.ctx
.events
.send(ExExEvent::FinishedHeight(committed_chain.tip().num_hash()))?;
}
}

Ok(())
}
}
Loading