Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump the tests version to the v13.3 #233

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion state/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,11 @@ func (t *Transition) hasCodeOrNonce(addr types.Address) bool {
}

codeHash := t.state.GetCodeHash(addr)
// EIP-7610 change - rejects the contract deployment if the destination has non-empty storage.
storageRoot := t.state.GetStorageRoot(addr)

return codeHash != types.EmptyCodeHash && codeHash != types.ZeroHash
return (codeHash != types.EmptyCodeHash && codeHash != types.ZeroHash) || // non-empty code
(storageRoot != types.EmptyRootHash && storageRoot != types.ZeroHash) // non-empty storage
}

func (t *Transition) applyCreate(c *runtime.Contract, host runtime.Host) *runtime.ExecutionResult {
Expand Down
11 changes: 11 additions & 0 deletions state/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,17 @@ func (txn *Txn) GetCommittedState(addr types.Address, key types.Hash) types.Hash
return txn.snapshot.GetStorage(addr, obj.Account.Root, key)
}

// GetStorageRoot retrieves the storage root from the given address or empty
// if object not found.
func (txn *Txn) GetStorageRoot(addr types.Address) types.Hash {
obj, ok := txn.getStateObject(addr)
if !ok {
return types.Hash{}
}

return obj.Account.Root
}

// SetFullStorage is used to replace the full state of the address.
// Only used for debugging on the override jsonrpc endpoint.
func (txn *Txn) SetFullStorage(addr types.Address, state map[types.Hash]types.Hash) {
Expand Down
2 changes: 1 addition & 1 deletion tests/tests
Submodule tests updated 5205 files
Loading