mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
Merge pull request #51 from hl-archive-node/feat/no-eth-proof
fix: Disable eth_getProof by default
This commit is contained in:
@ -659,7 +659,7 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn install_hl_node_compliance<Node, EthApi>(
|
pub fn install_hl_node_compliance<Node, EthApi>(
|
||||||
ctx: RpcContext<Node, EthApi>,
|
ctx: &mut RpcContext<Node, EthApi>,
|
||||||
) -> Result<(), eyre::Error>
|
) -> Result<(), eyre::Error>
|
||||||
where
|
where
|
||||||
Node: FullNodeComponents,
|
Node: FullNodeComponents,
|
||||||
|
|||||||
@ -39,7 +39,7 @@ fn main() -> eyre::Result<()> {
|
|||||||
let (node, engine_handle_tx) = HlNode::new(ext.block_source_args.parse().await?);
|
let (node, engine_handle_tx) = HlNode::new(ext.block_source_args.parse().await?);
|
||||||
let NodeHandle { node, node_exit_future: exit_future } = builder
|
let NodeHandle { node, node_exit_future: exit_future } = builder
|
||||||
.node(node)
|
.node(node)
|
||||||
.extend_rpc_modules(move |ctx| {
|
.extend_rpc_modules(move |mut ctx| {
|
||||||
let upstream_rpc_url =
|
let upstream_rpc_url =
|
||||||
ext.upstream_rpc_url.unwrap_or_else(|| default_upstream_rpc_url.to_owned());
|
ext.upstream_rpc_url.unwrap_or_else(|| default_upstream_rpc_url.to_owned());
|
||||||
|
|
||||||
@ -60,10 +60,15 @@ fn main() -> eyre::Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ext.hl_node_compliant {
|
if ext.hl_node_compliant {
|
||||||
install_hl_node_compliance(ctx)?;
|
install_hl_node_compliance(&mut ctx)?;
|
||||||
info!("hl-node compliant mode enabled");
|
info!("hl-node compliant mode enabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !ext.experimental_eth_get_proof {
|
||||||
|
ctx.modules.remove_method_from_configured("eth_getProof");
|
||||||
|
info!("eth_getProof is disabled by default");
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.apply(|builder| {
|
.apply(|builder| {
|
||||||
|
|||||||
@ -55,6 +55,24 @@ pub struct HlNodeArgs {
|
|||||||
/// This is useful when read precompile is needed for gas estimation.
|
/// This is useful when read precompile is needed for gas estimation.
|
||||||
#[arg(long, env = "FORWARD_CALL")]
|
#[arg(long, env = "FORWARD_CALL")]
|
||||||
pub forward_call: bool,
|
pub forward_call: bool,
|
||||||
|
|
||||||
|
/// Experimental: enables the eth_getProof RPC method.
|
||||||
|
///
|
||||||
|
/// Note: Due to the state root difference, trie updates* may not function correctly in all
|
||||||
|
/// scenarios. For example, incremental root updates are not possible, which can cause
|
||||||
|
/// eth_getProof to malfunction in some cases.
|
||||||
|
///
|
||||||
|
/// This limitation does not impact normal node functionality, except for state root (which is
|
||||||
|
/// unused) and eth_getProof. The archival state is maintained by block order, not by trie
|
||||||
|
/// updates. As a precaution, nanoreth disables eth_getProof by default to prevent
|
||||||
|
/// potential issues.
|
||||||
|
///
|
||||||
|
/// Use --experimental-eth-get-proof to forcibly enable eth_getProof, assuming trie updates are
|
||||||
|
/// working as intended. Enabling this by default will be tracked in #15.
|
||||||
|
///
|
||||||
|
/// * Refers to the Merkle trie used for eth_getProof and state root, not actual state values.
|
||||||
|
#[arg(long, env = "EXPERIMENTAL_ETH_GET_PROOF")]
|
||||||
|
pub experimental_eth_get_proof: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The main reth_hl cli interface.
|
/// The main reth_hl cli interface.
|
||||||
|
|||||||
Reference in New Issue
Block a user