Skip to content

Fix Failing Non List Validation Hive Tests#18666

Merged
mh0lt merged 45 commits intomainfrom
oog_test_fixes
Jan 29, 2026
Merged

Fix Failing Non List Validation Hive Tests#18666
mh0lt merged 45 commits intomainfrom
oog_test_fixes

Conversation

@mh0lt
Copy link
Copy Markdown
Contributor

@mh0lt mh0lt commented Jan 14, 2026

This conatains fixes for all outstanding non list validation fails when running:

./hive --sim ethereum/eels/consume-engine --sim.limit=".*amsterdam/.*" --sim.parallelism=8 --docker.nocache=true --client erigon --sim.buildarg branch=hive --sim.buildarg branch=tests-bal@v2.0.0 --sim.buildarg fixtures=https://github.com/ethereum/execution-spec-tests/releases/download/bal%40v2.0.0/fixtures_bal.tar.gz

Which should result in:

Jan 14 12:42:29.470 INF simulation ethereum/eels/consume-engine finished suites=1 tests=483 failed=6

The know failing tests are:

test_block_access_lists_invalid::py::test_bal_invalid_account_order
test_block_access_lists_invalid::py::test_bal_invalid_account
test_block_access_lists_invalid::py::test_bal_invalid_duplicate_account
test_block_access_lists_invalid::py::test_bal_invalid_tx_order
test_block_access_lists_invalid::py::test_bal_invalid_complex_corruption
test_block_access_lists_invalid::py::test_bal_invalid_missing_account

I have also seen a one off fail of when testing but never been able to reproduce it, so am assuming it was a transient error:

test_bal_7702_delegation_clear

The majority of the fixes are adjustments to the order of gas calculations to make sure that statless gas check haooen and fail early so that no storage acces occurs.

There are also some adjustments to when reads and writes occur and how they are reverted to ensure that these conform to the model required by the bals spec. These generally make state accesses more 'sticky' than the journalling process.

@mh0lt mh0lt requested a review from yperbasis as a code owner January 14, 2026 12:44
@yperbasis yperbasis added the Glamsterdam https://eips.ethereum.org/EIPS/eip-7773 label Jan 14, 2026
@yperbasis yperbasis requested a review from shohamc1 January 14, 2026 12:47
@mh0lt mh0lt changed the title Oog test fixes Fix Failing Non List Validation Hive Tests Jan 14, 2026
Copy link
Copy Markdown
Member

@yperbasis yperbasis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the unit tests failing?

@mh0lt
Copy link
Copy Markdown
Contributor Author

mh0lt commented Jan 16, 2026

Why are the unit tests failing?

Becuase this branch is running parallel execution by default and needs some fixes which are in main to make it work.

@yperbasis
Copy link
Copy Markdown
Member

Why are the unit tests failing?

Becuase this branch is running parallel execution by default and needs some fixes which are in main to make it work.

Let's merge this to main instead of bal-devnet-1 since devnet-1 is dead.

@mh0lt mh0lt changed the base branch from bal-devnet-1 to main January 19, 2026 17:11
@mh0lt mh0lt requested a review from canepat as a code owner January 25, 2026 18:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes failing non-list validation Hive tests for Amsterdam fork testing by addressing gas calculation ordering and state access handling issues in the EVM execution layer.

Changes:

  • Reordered gas calculations to ensure stateless checks occur before storage access to fail early and prevent invalid operations
  • Modified state access tracking to be more sticky and less susceptible to journal reversion, ensuring conformity with the BALs spec
  • Added parallel execution requirement for Amsterdam fork testing

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
rpc/jsonrpc/eth_receipts.go Added early return for uninitialized node state
node/endpoints.go Changed timeout sanitization logging from Warn to Debug for zero values; added copy-paste error in idle timeout message
execution/vm/operations_acl.go Reordered gas checks and access list updates to enforce stateless validation before storage access
execution/vm/jump_table.go Added new function signatures for stateless and stateful gas calculation separation
execution/vm/interpreter.go Improved error wrapping to preserve ErrOutOfGas when it's already the error type
execution/vm/gas_table.go Refactored gas calculation functions to separate stateless and stateful components
execution/vm/evm.go Adjusted timing of MarkAddressAccess calls for CREATE operations
execution/tests/mock/mock_sentry.go Added automatic disabling of Amsterdam for non-parallel execution in tests
execution/tests/engine_api_bal_test.go Added test skip for non-parallel execution environments
execution/state/versionmap.go Fixed type conversion for storage values in WriteChanges
execution/state/versionedio.go Modified getStateObject calls to control read recording behavior
execution/state/state_test.go Updated test to use new getStateObject signature and added code resolution test
execution/state/state_object.go Enhanced SetState and SetCode to return change status and improved early returns
execution/state/rw_v3.go Enhanced debug output with stack traces
execution/state/journal.go Renamed touchChange to touchAccount and improved reversion logic for address access
execution/state/intra_block_state_test.go Updated getStateObject calls to include recordRead parameter
execution/state/intra_block_state.go Extensive refactoring of state access tracking with revertable options
execution/stagedsync/stageloop/stageloop.go Fixed condition check for notification handling
execution/stagedsync/stage_execute.go Added experimental BAL flag to parallel execution condition
execution/stagedsync/exec3_serial.go Added Amsterdam fork validation to prevent serial execution
execution/stagedsync/bal_create_test.go Fixed test output formatting for storage changes
execution/protocol/state_transition.go Changed authority marking to non-revertable
execution/execmodule/forkchoice.go Improved background task error handling and pruning conditions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread node/endpoints.go Outdated
if timeouts.IdleTimeout > 0 {
log.Warn("Sanitizing invalid HTTP idle timeout", "provided", timeouts.IdleTimeout, "updated", rpccfg.DefaultHTTPTimeouts.IdleTimeout)
} else {
log.Debug("Sanitizing invalid HTTP write timeout", "provided", timeouts.WriteTimeout, "updated", rpccfg.DefaultHTTPTimeouts.WriteTimeout)
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message incorrectly refers to 'write timeout' but should refer to 'idle timeout' to match the field being sanitized.

Suggested change
log.Debug("Sanitizing invalid HTTP write timeout", "provided", timeouts.WriteTimeout, "updated", rpccfg.DefaultHTTPTimeouts.WriteTimeout)
log.Debug("Sanitizing invalid HTTP idle timeout", "provided", timeouts.IdleTimeout, "updated", rpccfg.DefaultHTTPTimeouts.IdleTimeout)

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by: d9be71e

Comment thread execution/vm/gas_table.go Outdated
Comment on lines +513 to +516
if dbg.TraceDyanmicGas && evm.intraBlockState.Trace() {
fmt.Printf("%d (%d.%d) CallCode Gas: base: %d memory(%d): %d call: %d\n",
evm.intraBlockState.BlockNumber(), evm.intraBlockState.TxIndex(), evm.intraBlockState.Incarnation(), gas-memoryGas, memorySize, memoryGas, callGas)
}
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The debug trace condition on line 513 is duplicated - it's already checked on line 512. This nested condition should be removed to eliminate redundant code.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by: d9be71e

Comment on lines +105 to +107
var value uint256.Int
value.SetBytes32(change.Value[:])
vm.Write(accountChanges.Address, StoragePath, storageChanges.Slot, Version{TxIndex: int(change.Index) - 1}, value, true)
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value variable is declared and set inline when it could be passed directly. Consider using uint256.Int{}.SetBytes32(change.Value[:]) directly in the Write call to reduce variable scope.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong: uint256.Int{}.SetBytes32(change.Value[:]) will cause the following compiler error:
cannot call pointer method SetBytes32 on uint256.Int

currentHeader := rawdb.ReadCurrentHeader(tx)
if (h.notifications.Accumulator != nil) && (currentHeader != nil) {
if currentHeader.Number.Sign() == 0 {
if currentHeader.Number.Sign() >= 0 {
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition will always be true since Sign() returns -1, 0, or 1, and a block number cannot be negative. The original check for Sign() == 0 was checking for the genesis block specifically. This change may introduce unintended behavior.

Suggested change
if currentHeader.Number.Sign() >= 0 {
if currentHeader.Number.Sign() == 0 {

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

making this == 0 introduces a bug which I fixed, because it was only updating block zero. The assertion is correct but the suggested fix is wrong - it should be to remove the if entierly.

Note that this is a bug which was introduced by a previous AI driven refactor.

Fixed by 2f4c99e

@yperbasis yperbasis linked an issue Jan 29, 2026 that may be closed by this pull request

if !dbg.BatchCommitments || shouldGenerateChangesets || se.cfg.syncCfg.KeepExecutionProofs {
if dbg.TraceBlock(blockNum) {
fmt.Println(blockNum, "Commitment")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary println

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only printed if block tracing is turned on. What this print does is make the trace oututput for the trie calculation look like the example below.

This is useful when you have a large file with a lot of trie entries and you want to find the commitment calculation for a particular block. Also if you only have trie tracing tiurned on and don't have this seperator - even in tests its difficult to see where one block starts and the other stops.

At the moment the commitment trace does not include block numbers becuase it may be a bulk calculation so the internal printer does not know the block associated with the particular touch.

The main use of this is to find the cuase of a state root mismatch by performing a comparison between a good and a bad block.

It will only get printed if block tracing is on.

24271547 Commitment
(1/6) plainKey [71562b71999873db5b286df957af199ec94617f7] Flags: [+Balance+Nonce+Code], Balance: [999657745], Nonce: [8], CodeHash: [c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470] hashedKey [00000b0f04090f0404000a010c0d000502070e040d00060e020706050605040c000f05060405020205070501060d0709030a090b080d0600040d0c0f0d0f020a] currentKey []
(2/6) plainKey [3a220f351252089d385b29beca14e27f204c296a] Flags: [+Balance+Nonce+Code], Balance: [0], Nonce: [5], CodeHash: [85a288cf6632a91047b1a2ebbaa77a1ab8e82961b95a7eb13123cd089c38e18b] hashedKey [010c0b020508030704080c02060e08090e0f01090c020a080502090b00050a0207000f0703050505030b040d04040b060f020a010809040908070a07010c080b] currentKey [00000b0f04090f0404000a010c0d000502070e040d00060e020706050605040c000f05060405020205070501060d0709030a090b080d0600040d0c0f0d0f02]
...

@mh0lt mh0lt merged commit c7929b0 into main Jan 29, 2026
17 of 19 checks passed
@mh0lt mh0lt deleted the oog_test_fixes branch January 29, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Glamsterdam https://eips.ethereum.org/EIPS/eip-7773

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bal-devnet-1 spec implementation

4 participants