Currently our state journal tracks each storage update to a contract, having the ability to revert those changes to the previously set value.
For the very first modification however, it behaves a bit wonky. Reverting the update doesn't actually remove the dirty-ness of the slot, rather leaves it as "change this slot to it's original value". This can cause issues down the line with for example write witnesses needing to gather an unneeded proof.
This PR modifies the storageChange journal entry to not only track the previous value of a slot, but also whether there was any previous value at all set in the current execution context. In essence, the PR changes the semantic of storageChange so it does not simply track storage changes, rather it tracks dirty storage changes, an important distinction for being able to cleanly revert the journal item.
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Introduce a new simulated backend implementation under ethclient/simulated and migrate bind-facing wrappers/tests to use it.
Key changes:
- Add the new backend entry points and behavior in ethclient/simulated, including chain control helpers used by tests (commit/rollback/fork/time adjustment).
- Update legacy bind wrappers in accounts/abi/bind/backends to delegate to the new simulated backend while preserving old APIs.
- Align bind v2/backend and utility tests to the new simulated backend client surface and transaction flow.
- Refresh abigen/bind tests and shared interfaces impacted by the backend migration.
Compatibility notes:
- Keep backward-compatible wrapper constructors for existing contract test code.
- Preserve legacy transaction paths in tests while supporting EIP-1559-aware flows where applicable.
Validation:
- Verified affected packages compile and pass tests.
- Verified repository-wide go test ./... passes after follow-up compatibility fixes.
* chore: enable reward, penalty and dynamic gas on devnet
* update number to 3420000 for devnet
---------
Co-authored-by: liam.lai <liam.lai@babylonchain.io>
The upstream libray has removed the assembly-based implementation of
keccak. We need to maintain our own library to avoid a peformance
regression.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
The `decodeRef` function used `size > hashLen` to reject oversized
embedded nodes, but this incorrectly allowed nodes of exactly 32 bytes
through. The encoding side (hasher.go, stacktrie.go) consistently uses
`len(enc) < 32` to decide whether to embed a node inline, meaning nodes
of 32+ bytes are always hash-referenced. The error message itself
already stated `want size < 32`, confirming the intended threshold.
Changed `size > hashLen` to `size >= hashLen` in `decodeRef` to align
the decoding validation with the encoding logic, the Yellow Paper spec,
and the surrounding comments.
Co-authored-by: sashass1315 <sashass1315@gmail.com>
This adds a new type wrapper that decodes as a list, but does not
actually decode the contents of the list. The type parameter exists as a
marker, and enables decoding the elements lazily. RawList can also be
used for building a list incrementally.
Co-authored-by: Felix Lange <fjl@twurst.com>
Follow-up to https://github.com/ethereum/go-ethereum/pull/33748
Same issue - ResettingTimer can be registered via loadOrRegister() but
GetAll() silently drops it during JSON export. The prometheus exporter
handles it fine (collector.go:70), so this is just an oversight in the
JSON path.
Note: ResettingTimer.Snapshot() resets the timer by design, which is
consistent with how the prometheus exporter uses it.
Co-authored-by: vickkkkkyy <vickyaviles847@gmail.com>
* use signer pubkey to check for unique signatures and optimize performance
* change waitgroup to errgroup
* optimize
* fix typo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* format files
* after rebase new commits, refactor from snap.NextEpochCandidates to epochInfo.Masternodes
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* revert: use masternodes from snapshot to verify vote
* fix underflow during chain initialization
* add previously removed test
* rename snapshot > snap for consistency
traceBlockParallel replays transactions from the parent state to build per-tx prestate for tracers. In the previous flow, Prague's parent-hash system contract processing was not applied before replay, so the prepared state could diverge from canonical block execution semantics.
This commit keeps the parallel tracing path consistent with block processing rules by applying ProcessParentBlockHash before tx replay when Prague is active.
The regression test TestTraceBlockParallelPragueParentHashSystemCall is strengthened to assert the actual EIP-2935 history slot value (ring-buffer key for block-1) equals block.ParentHash(), instead of relying on an indirect EXTCODESIZE side effect. This makes the test deterministic and directly tied to the bug.
Validation: go test ./eth/tracers -run TestTraceBlockParallelPragueParentHashSystemCall