Merge pull request #93 from hl-archive-node/fix/subscriptions

fix: Prevent #89 from overriding --hl-node-compliant subscriptions
This commit is contained in:
sprites0
2025-10-13 01:27:19 -04:00
committed by GitHub
2 changed files with 13 additions and 11 deletions

View File

@ -347,8 +347,10 @@ where
pubsub.log_stream(filter).filter_map(|log| adjust_log::<Eth>(log, &provider)), pubsub.log_stream(filter).filter_map(|log| adjust_log::<Eth>(log, &provider)),
) )
.await; .await;
} else { } else if kind == SubscriptionKind::NewHeads {
let _ = pipe_from_stream(sink, new_headers_stream::<Eth>(&provider)).await; let _ = pipe_from_stream(sink, new_headers_stream::<Eth>(&provider)).await;
} else {
let _ = pubsub.handle_accepted(sink, kind, params).await;
} }
})); }));
Ok(()) Ok(())

View File

@ -63,16 +63,6 @@ fn main() -> eyre::Result<()> {
info!("Call/gas estimation will be forwarded to {}", upstream_rpc_url); info!("Call/gas estimation will be forwarded to {}", upstream_rpc_url);
} }
if ext.hl_node_compliant {
install_hl_node_compliance(&mut ctx)?;
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");
}
// This is a temporary workaround to fix the issue with custom headers // This is a temporary workaround to fix the issue with custom headers
// affects `eth_subscribe[type=newHeads]` // affects `eth_subscribe[type=newHeads]`
ctx.modules.replace_configured( ctx.modules.replace_configured(
@ -84,6 +74,16 @@ fn main() -> eyre::Result<()> {
.into_rpc(), .into_rpc(),
)?; )?;
if ext.hl_node_compliant {
install_hl_node_compliance(&mut ctx)?;
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");
}
ctx.modules.merge_configured( ctx.modules.merge_configured(
HlBlockPrecompileExt::new(ctx.registry.eth_api().clone()).into_rpc(), HlBlockPrecompileExt::new(ctx.registry.eth_api().clone()).into_rpc(),
)?; )?;