-
Notifications
You must be signed in to change notification settings - Fork 46
feat: trace all previous blockhashes #2353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: trace all previous blockhashes #2353
Conversation
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
…cks of the chain Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
testing/src/main/java/net/consensys/linea/testing/ToyExecutionEnvironmentV2.java
Outdated
Show resolved
Hide resolved
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
This changes the type of the field parentBeaconBlockRoot in BlockHeaderSnapshot to be an (optional) String instead of a Bytes32 instance. This is to avoid decoding issues because the GSONDecoder is not aware of the Bytes32 type.
The clique consensus protocol was only used prior to shanghai, hence we cannot extract key information from block headers generated from Shanghai nodes and onwards.
This restores this component, whilst retaining flexibility around the use of Map<Long,Hash>. The goal is simply to ensure all block hashes are stored in the JSON file as hex strings.
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
This puts in fixes for the methods Reaper.touchBlockHash() and also ConflationSnapshot.from(), and applies spotless.
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
Signed-off-by: F Bojarski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not much of a review. One potential issue in the logic wrt the keys at which the EIP4788_BEACONROOT_ADDRESS contract's storage gets probed.
| final UInt256 timestamp = UInt256.valueOf(header.getTimestamp()); | ||
| final UInt256 keyTimestamp = timestamp.mod(HISTORY_BUFFER_LENGTH); | ||
| conflationStorage.touch(EIP4788_BEACONROOT_ADDRESS, timestamp); | ||
| conflationStorage.touch(EIP4788_BEACONROOT_ADDRESS, keyTimestamp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The keys that are touched by 4788 system transactions are
brKey := timestamp mod 8191
tsKey := brKey + 8191
Am I misunderstanding here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, you're right
| replay(OLD_MAINNET_TESTCONFIG, "4323985.mainnet.json.gz", testInfo); | ||
| } | ||
|
|
||
| @Disabled("Fails to create the ConflationSnapshot from the gson file") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this read json ? (Several cases in this file, but I also see gson in other places)
| checkBlockHashConsistancies(e); | ||
| } | ||
|
|
||
| private void checkBlockHashConsistancies(BlockhashOperation op) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo checkBlockHashConsistencies
Note
Plumbs historical block-hash collection into tracing and replay: gather prior hashes, add last-block hash, and wire through BlockCapturer, ZkTracer/Hub, RPC, and tests with EIP-2935/4788 touches.
BlockHashReaperwith map-based storage inReaper; add consistency checks; include EIP-2935/4788 system-tx touches.module/blockhashto track first/last blocks, inject historical hashes, add parent-hash op, auto-emit missing historical calls, and include last-block placeholder;BlockhashOperationnow usesHash.ConflationSnapshot: newfrom(...),historicalBlockHashes(), refinedtoBlockHashLookup.ZkTracerand all*Hubconstructors accept historical hashes and pass toBlockhash.Fork.getForkFromBesuBlockchainServiceoverload forBlockchainService.ZkCounter: count blockhash lines at conflation start; fix counting loops and report unchecked modules as 0.CaptureToFile/GenerateConflatedTracesV2: fetch fork and historical block hashes fromBlockchainServiceand pass toBlockCapturer/ZkTracer.BlockCapturer: accept historical hashes, record end-block hash, and simplify per-opcode handling.BlockHeaderSnapshot: storeparentBeaconBlockRootas optional hex string with null-guard.Written by Cursor Bugbot for commit 077d742. This will update automatically on new commits. Configure here.