feat: Add call forwarder

4b793c496b
This commit is contained in:
sprites0
2025-07-05 03:10:26 +00:00
parent 2943ba03a7
commit ba33d9e8ac
4 changed files with 112 additions and 0 deletions

View File

@ -1,6 +1,7 @@
use clap::Parser;
use reth::builder::NodeHandle;
use reth_hl::{
call_forwarder::{self, CallForwarderApiServer},
chainspec::parser::HlChainSpecParser,
hl_node_compliance::install_hl_node_compliance,
node::{
@ -42,6 +43,13 @@ fn main() -> eyre::Result<()> {
)?;
info!("Transaction will be forwarded to {}", upstream_rpc_url);
if ext.forward_call {
ctx.modules.replace_configured(
call_forwarder::CallForwarderExt::new(upstream_rpc_url.clone()).into_rpc(),
)?;
info!("Call/gas estimation will be forwarded to {}", upstream_rpc_url);
}
if ext.hl_node_compliant {
install_hl_node_compliance(ctx)?;
info!("hl-node compliant mode enabled");