mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 02:49:55 +00:00
Compare commits
5 Commits
nb-2025101
...
d46e808b8d
| Author | SHA1 | Date | |
|---|---|---|---|
| d46e808b8d | |||
| 497353fd2f | |||
| eee6eeb2fc | |||
| 611e6867bf | |||
| 6c3ed63c3c |
@ -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(())
|
||||||
|
|||||||
20
src/main.rs
20
src/main.rs
@ -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(),
|
||||||
)?;
|
)?;
|
||||||
|
|||||||
@ -346,7 +346,7 @@ fn migrate_single_static_file<N: HlNodeType>(
|
|||||||
|
|
||||||
// block_ranges into chunks of 50000 blocks
|
// block_ranges into chunks of 50000 blocks
|
||||||
const CHUNK_SIZE: u64 = 50000;
|
const CHUNK_SIZE: u64 = 50000;
|
||||||
for chunk in (0..=block_range.end()).step_by(CHUNK_SIZE as usize) {
|
for chunk in (block_range.start()..=block_range.end()).step_by(CHUNK_SIZE as usize) {
|
||||||
let end = std::cmp::min(chunk + CHUNK_SIZE - 1, block_range.end());
|
let end = std::cmp::min(chunk + CHUNK_SIZE - 1, block_range.end());
|
||||||
let block_range = chunk..=end;
|
let block_range = chunk..=end;
|
||||||
let headers = old_headers_range(sf_in, block_range.clone())?;
|
let headers = old_headers_range(sf_in, block_range.clone())?;
|
||||||
|
|||||||
Reference in New Issue
Block a user