Repository navigation
fix(ethrpc): block responses and eth_getLogs - #384
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #384 +/- ##
=======================================
Coverage ? 34.35%
=======================================
Files ? 163
Lines ? 12655
Branches ? 0
=======================================
Hits ? 4348
Misses ? 7966
Partials ? 341
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
sadiq1971
marked this pull request as ready for review
October 7, 2026 09:50
salindne
requested changes
Oct 7, 2026
sadiq1971
added a commit
that referenced
this pull request
Oct 7, 2026
Address review of #384: - Persist a block clock in evm_state (migration 16). The head is the latest mined block or the clock, whichever is ahead, and the miner numbers each new block ahead of the clock, so a number served as an empty block is never mined later. This replaces the per-process start time and the 12-block buffer: replicas agree and the head no longer resets on restart. - Blocks on the clock are timestamped one second apart; older blocks keep their mining time. - eth_getLogs: an omitted fromBlock again means the earliest block, which the reference dApp relies on; toBlock is clamped to the head; addresses and topics per position are capped at 1000; wildcard positions require that many topics; an unknown blockHash is "unknown block" (-32000). - eth_getBlockByHash resolves hashes near the head before the store lookup and renders a block mined mid-request with its transactions. - Receipts report cumulative gas; blocks carry mixHash and transactions blockTimestamp. - Index evm_transactions.block_hash and evm_logs by block position, and backfill legacy log timestamps (migration 17). - Reject empty block numbers and EIP-1898 objects naming both a number and a hash; accept tags in EIP-1898 objects.
sadiq1971
force-pushed
the
fix/ethrpc-blocks-logs
branch
from
October 7, 2026 13:03
6a93428 to
36f2e3a
Compare
- Synthetic blocks carry the empty-list uncle, transaction, receipt and state hashes, so go-ethereum clients accept them. - eth_getLogs fromBlock/toBlock accept block tags, which resolve to the latest mined block. Omitted bounds behave as before. - Unskip the e2e block tests and query logs with an open range.
sadiq1971
force-pushed
the
fix/ethrpc-blocks-logs
branch
from
October 7, 2026 13:28
36f2e3a to
d672845
Compare
salindne
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the facade's blocks and logs readable by standard Ethereum clients (outstanding item O-6, M2-AC2), with the smallest change that does it.
sha3Uncles = EmptyUncleHash,transactionsRoot = EmptyTxsHash,receiptsRoot = EmptyReceiptsHash,stateRoot = EmptyRootHash. Previously go-ethereum'sethclientrejected every block at its uncle-list check.eth_getLogsblock tags.fromBlockandtoBlockacceptlatest,earliest,pending,safe,finalizedor a hex number.ethclientsendslatestby default. Tags resolve to the latest mined block, the last one with logs.fromBlockis 0 andtoBlockis the latest mined block. The reference dApp relies on this.Verification
TestRPC_GetBlockByNumberandTestRPC_GetBlockByHashare unskipped.TestRPC_GetLogsadds an open-range query.Not in scope
Blocks stay synthetic shells:
number × 12timestamps;eth_getBlockByHashfalls back to the latest block for hashes it has not stored.eth_getLogsstill matches a single address and an exacttopic0. Wallets and the dApp read receipts and logs, so none of this blocks them.