Skip to content
Open
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
47 changes: 31 additions & 16 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ tokio = "1"
anyhow = "1.0.98"
indicatif = "0.17"
zstd = "0.12"
jsonrpsee = "0.26"
jsonrpsee-core = "0.26"
jsonrpsee-types = "0.26"
tower = "0.4"

[target.'cfg(unix)'.dependencies]
tikv-jemalloc-ctl = "0.6"
Expand Down
19 changes: 14 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use crate::{
block::{BlockBody, GnosisBlock, TransactionSigned},
GnosisNodePrimitives,
},
rpc::GnosisNetwork,
rpc::{BlockFloorLayer, GnosisNetwork},
};

mod blobs;
Expand Down Expand Up @@ -144,8 +144,14 @@ impl<N: FullNodeComponents<Types = Self>> DebugNode<N> for GnosisNode {
}

/// Add-ons w.r.t. gnosis
pub type GnosisAddOns<N> =
RpcAddOns<N, EthereumEthApiBuilder<GnosisNetwork>, GnosisEngineValidatorBuilder>;
pub type GnosisAddOns<N, RpcMiddleware = reth_node_builder::rpc::Identity> = RpcAddOns<
N,
EthereumEthApiBuilder<GnosisNetwork>,
GnosisEngineValidatorBuilder,
reth_node_builder::rpc::BasicEngineApiBuilder<GnosisEngineValidatorBuilder>,
reth_node_builder::rpc::BasicEngineValidatorBuilder<GnosisEngineValidatorBuilder>,
RpcMiddleware,
>;

impl<N> Node<N> for GnosisNode
where
Expand All @@ -160,15 +166,18 @@ where
GnosisConsensusBuilder,
>;

type AddOns = GnosisAddOns<NodeAdapter<N>>;
type AddOns = GnosisAddOns<
NodeAdapter<N>,
reth_node_builder::rpc::Stack<reth_node_builder::rpc::Identity, BlockFloorLayer>,
>;

fn components_builder(&self) -> Self::ComponentsBuilder {
let Self { args } = self;
Self::components(args)
}

fn add_ons(&self) -> Self::AddOns {
GnosisAddOns::default()
GnosisAddOns::default().layer_rpc_middleware(BlockFloorLayer::from_env())
}
}

Expand Down
8 changes: 8 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ fn main() {
}
}

// Export chain id for RPC middleware
if let Commands::Node(ref node_cmd) = user_cli.command {
std::env::set_var(
"RETH_GNOSIS_CHAIN_ID",
node_cmd.chain.chain().id().to_string(),
);
}

// Actual program run
run_reth(user_cli);
}
Expand Down
Loading