diff --git a/core/state/journal.go b/core/state/journal.go index 3cc54b93eb..939e66afa7 100644 --- a/core/state/journal.go +++ b/core/state/journal.go @@ -106,6 +106,9 @@ type ( account *common.Address } + // createContractChange represents an account becoming a contract-account. + // This event happens prior to executing initcode. The journal-event simply + // manages the created-flag, in order to allow same-tx destruction. createContractChange struct { account common.Address } @@ -169,7 +172,7 @@ func (ch createObjectChange) revert(s *StateDB) { } func (ch createObjectChange) dirtied() *common.Address { - return ch.account + return nil } func (ch createObjectChange) copy() journalEntry { diff --git a/core/state/state_object.go b/core/state/state_object.go index 2aeb83206c..f892ddf592 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -77,10 +77,7 @@ func (s *stateObject) empty() bool { // newObject creates a state object. func newObject(db *StateDB, address common.Address, acct *types.StateAccount) *stateObject { - var ( - origin = acct - created = acct == nil // true if the account was not existent - ) + origin := acct if acct == nil { acct = types.NewEmptyStateAccount() } @@ -93,7 +90,6 @@ func newObject(db *StateDB, address common.Address, acct *types.StateAccount) *s originStorage: make(Storage), pendingStorage: make(Storage), dirtyStorage: make(Storage), - created: created, } } diff --git a/core/vm/evm.go b/core/vm/evm.go index e6e9cc64c3..c33ad8094e 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -462,10 +462,10 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64, if !evm.StateDB.Exist(address) { evm.StateDB.CreateAccount(address) } - // CreateContract means that regardless of whether the acccount existed - // in the state trie or not, previously, it _now_ becomes created as a - // _contract_ account. This is performed _prior_ to executing the initcode, - // since the initcode acts inside that account. + // CreateContract means that regardless of whether the account previously existed + // in the state trie or not, it _now_ becomes created as a _contract_ account. + // This is performed _prior_ to executing the initcode, since the initcode + // acts inside that account. evm.StateDB.CreateContract(address) if evm.chainRules.IsEIP158 { diff --git a/tests/block_test.go b/tests/block_test.go index be4b6ee37d..1ba84f5f24 100644 --- a/tests/block_test.go +++ b/tests/block_test.go @@ -49,11 +49,6 @@ func TestBlockchain(t *testing.T) { // using 4.6 TGas bt.skipLoad(`.*randomStatetest94.json.*`) - // The tests under Pyspecs are the ones that are published as execution-spect tests. - // We run these tests separately, no need to _also_ run them as part of the - // reference tests. - bt.skipLoad(`^Pyspecs/`) - bt.walk(t, blockTestDir, func(t *testing.T, name string, test *BlockTest) { execBlockTest(t, bt, test) }) @@ -69,14 +64,6 @@ func TestExecutionSpecBlocktests(t *testing.T) { } bt := new(testMatcher) - // These tests fail as of https://github.com/ethereum/go-ethereum/pull/28666, since we - // no longer delete "leftover storage" when deploying a contract. - bt.skipLoad(`^cancun/eip6780_selfdestruct/selfdestruct/self_destructing_initcode_create_tx.json`) - bt.skipLoad(`^cancun/eip6780_selfdestruct/selfdestruct/self_destructing_initcode.json`) - bt.skipLoad(`^cancun/eip6780_selfdestruct/selfdestruct/recreate_self_destructed_contract_different_txs.json`) - bt.skipLoad(`^cancun/eip6780_selfdestruct/selfdestruct/delegatecall_from_new_contract_to_pre_existing_contract.json`) - bt.skipLoad(`^cancun/eip6780_selfdestruct/selfdestruct/create_selfdestruct_same_tx.json`) - bt.walk(t, executionSpecBlockchainTestDir, func(t *testing.T, name string, test *BlockTest) { execBlockTest(t, bt, test) })