From 89ccc680da96429df7206e583e818ad3b0fe7466 Mon Sep 17 00:00:00 2001 From: Martin HS Date: Mon, 15 Jan 2024 09:15:40 +0100 Subject: [PATCH] tests: update reference tests (#28778) Updates the reference tests to the latest version --- tests/state_test.go | 8 -------- tests/state_test_util.go | 11 +++++++++++ tests/testdata | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/state_test.go b/tests/state_test.go index ae78a53a7e..cc228ea3c6 100644 --- a/tests/state_test.go +++ b/tests/state_test.go @@ -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"), diff --git a/tests/state_test_util.go b/tests/state_test_util.go index 19387b5394..919730089a 100644 --- a/tests/state_test_util.go +++ b/tests/state_test_util.go @@ -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) diff --git a/tests/testdata b/tests/testdata index ee3fa4c86d..fa51c5c164 160000 --- a/tests/testdata +++ b/tests/testdata @@ -1 +1 @@ -Subproject commit ee3fa4c86d05f99f2717f83a6ad08008490ddf07 +Subproject commit fa51c5c164f79140730ccb8fe26a46c3d3994338