Skip to content

Commit

Permalink
tests: update reference tests (#28778)
Browse files Browse the repository at this point in the history
Updates the reference tests to the latest version
  • Loading branch information
holiman authored Jan 15, 2024
1 parent 1485814 commit 89ccc68
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
8 changes: 0 additions & 8 deletions tests/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ func TestState(t *testing.T) {
// EOF is not part of cancun
st.skipLoad(`^stEOF/`)

// EIP-4844 tests need to be regenerated due to the data-to-blob rename
st.skipLoad(`^stEIP4844-blobtransactions/`)

// Expected failures:
// These EIP-4844 tests need to be regenerated.
st.fails(`stEIP4844-blobtransactions/opcodeBlobhashOutOfRange.json`, "test has incorrect state root")
st.fails(`stEIP4844-blobtransactions/opcodeBlobhBounds.json`, "test has incorrect state root")

// For Istanbul, older tests were moved into LegacyTests
for _, dir := range []string{
filepath.Join(baseDir, "EIPTests", "StateTests"),
Expand Down
11 changes: 11 additions & 0 deletions tests/state_test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,17 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh
}
evm := vm.NewEVM(context, txContext, statedb, config, vmconfig)

{ // Blob transactions may be present after the Cancun fork.
// In production,
// - the header is verified against the max in eip4844.go:VerifyEIP4844Header
// - the block body is verified against the header in block_validator.go:ValidateBody
// Here, we just do this shortcut smaller fix, since state tests do not
// utilize those codepaths
if len(msg.BlobHashes)*params.BlobTxBlobGasPerBlob > params.MaxBlobGasPerBlock {
return nil, nil, nil, common.Hash{}, errors.New("blob gas exceeds maximum")
}
}

// Execute the message.
snapshot := statedb.Snapshot()
gaspool := new(core.GasPool)
Expand Down
2 changes: 1 addition & 1 deletion tests/testdata

0 comments on commit 89ccc68

Please sign in to comment.