Sitelet https://github.com/init4tech/node-components/commit/6bdd02d6925271720cf66602c95e835902c78b15
Skip to content

Commit 6bdd02d

Browse files
prestwichclaude
andcommitted
fix: correct rustdoc, off-by-one getLogs range, pending block gas limit
- Fix misleading doc on resolve_evm_block: state is loaded at latest, not finalized - Fix off-by-one in getLogs block range check: inclusive range of from..=to spans to-from+1 blocks, so check >= not > - Remove incorrect override of pending block gas_limit with rpc_gas_cap; the parent header's gas_limit (inherited via into_inner) is correct Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 915ba49 commit 6bdd02d

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎crates/rpc/src/config/ctx.rs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,7 @@ impl<H: HotKv> StorageRpcCtx<H> {
287287
///
288288
/// For `Pending` block IDs, remaps to `Latest` and synthesizes a
289289
/// next-block header (incremented number, timestamp +12s, projected
290-
/// base fee, gas limit from config). State is loaded at the latest
291-
/// finalized block in both cases.
290+
/// base fee). State is loaded at the latest block in both cases.
292291
pub(crate) fn resolve_evm_block(
293292
&self,
294293
id: BlockId,
@@ -311,7 +310,6 @@ impl<H: HotKv> StorageRpcCtx<H> {
311310
header.timestamp += self.constants().host().slot_duration();
312311
header.base_fee_per_gas =
313312
header.next_block_base_fee(alloy::eips::eip1559::BaseFeeParams::ethereum());
314-
header.gas_limit = self.config().rpc_gas_cap;
315313
}
316314

317315
let spec_id = self.spec_id_for_header(&header);

‎crates/rpc/src/eth/endpoints.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ where
981981
return Err("fromBlock must not exceed toBlock".to_string());
982982
}
983983
let max_blocks = ctx.config().max_blocks_per_filter;
984-
if to - from > max_blocks {
984+
if to - from >= max_blocks {
985985
return Err(format!("query exceeds max block range ({max_blocks})"));
986986
}
987987

0 commit comments

Comments
 (0)