Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/scripts/rpc_version.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
RPC_VERSION=v2.8.1
RPC_VERSION=v2.8.2
3 changes: 0 additions & 3 deletions .github/workflows/scripts/run_rpc_tests_ethereum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ DISABLED_TEST_LIST=(
net_listening/test_1.json
# Temporary disable required block 24298763
debug_traceBlockByNumber/test_51.json
# Temporary disable after merge #20830, waiting for new rpc-tests tag after merge PR #552
debug_traceBlockByNumber/test_33.tar
debug_traceBlockByNumber/test_34.tar
# to investigate
engine_exchangeCapabilities/test_1.json
engine_exchangeTransitionConfigurationV1/test_01.json
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/scripts/run_rpc_tests_remote_ethereum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ DISABLED_TEST_LIST=(
# these tests/apis are disabled because some methods are not implmented on grpc
eth_getProof
eth_simulateV1
# Temporary disable after merge #20830, waiting for new rpc-tests tag after merge PR #552
debug_traceBlockByNumber/test_33.tar
debug_traceBlockByNumber/test_34.tar
# Temporary disable required block 24298763
debug_traceBlockByNumber/test_51.json
# Temporary disable required block 23917742
Expand Down
20 changes: 10 additions & 10 deletions execution/tracing/tracers/native/prestate.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,24 +283,24 @@ func (t *prestateTracer) processDiffState() {

newBalance, _ := t.env.IntraBlockState.GetBalance(addr)
newNonce, _ := t.env.IntraBlockState.GetNonce(addr)
// GetCodeHash returns common.Hash{} for deleted accounts; GetCode cannot make
// that distinction (empty bytes for both deleted and codeless accounts).
// GetCode returns empty bytes for both deleted and codeless accounts;
// GetCodeHash distinguishes them (deleted → zero hash).
codeHash, _ := t.env.IntraBlockState.GetCodeHash(addr)
newCodeHash := codeHash.Value()

newBalanceBig := newBalance.ToBig()
if newBalanceBig.Cmp(t.pre[addr].Balance) != 0 {
if newBalanceBig.Cmp(state.Balance) != 0 {
modified = true
postAccount.Balance = newBalanceBig
}
if newNonce != t.pre[addr].Nonce {
if newNonce != state.Nonce {
modified = true
postAccount.Nonce = newNonce
}

prevCodeHash := empty.CodeHash
if t.pre[addr].CodeHash != nil {
prevCodeHash = *t.pre[addr].CodeHash
if state.CodeHash != nil {
prevCodeHash = *state.CodeHash
}

if newCodeHash != prevCodeHash {
Expand All @@ -311,8 +311,8 @@ func (t *prestateTracer) processDiffState() {
if !t.config.DisableCode {
newCode, _ := t.env.IntraBlockState.GetCode(addr)
var prevCode []byte
if t.pre[addr].Code != nil {
prevCode = *t.pre[addr].Code
if state.Code != nil {
prevCode = *state.Code
}
if !bytes.Equal(newCode, prevCode) {
modified = true
Expand All @@ -324,13 +324,13 @@ func (t *prestateTracer) processDiffState() {
for key, val := range state.Storage {
// don't include the empty slot
if val == (common.Hash{}) {
delete(t.pre[addr].Storage, key)
delete(state.Storage, key)
}

newVal, _ := t.env.IntraBlockState.GetState(addr, accounts.InternKey(key))
if new(uint256.Int).SetBytes(val[:]).Eq(&newVal) {
// Omit unchanged slots
delete(t.pre[addr].Storage, key)
delete(state.Storage, key)
} else {
modified = true
if !newVal.IsZero() {
Expand Down
13 changes: 7 additions & 6 deletions execution/tracing/tracers/native/prestate_deleted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import (
"github.com/erigontech/erigon/execution/types/accounts"
)

var _ tracing.IntraBlockState = (*postTxIBS)(nil)

// postTxIBS simulates the IntraBlockState *after* a transaction where deletedAddr
// no longer exists (GetCodeHash returns NilCodeHash) and all other accounts are
// codeless-but-existent (EmptyCodeHash).
Expand All @@ -39,17 +41,17 @@ type postTxIBS struct {
func (m *postTxIBS) GetBalance(accounts.Address) (uint256.Int, error) { return uint256.Int{}, nil }
func (m *postTxIBS) GetNonce(accounts.Address) (uint64, error) { return 0, nil }
func (m *postTxIBS) GetCode(accounts.Address) ([]byte, error) { return nil, nil }
func (m *postTxIBS) GetState(accounts.Address, accounts.StorageKey) (uint256.Int, error) {
return uint256.Int{}, nil
}
func (m *postTxIBS) Exist(accounts.Address) (bool, error) { return false, nil }
func (m *postTxIBS) GetRefund() mdgas.MdGas { return mdgas.MdGas{} }
func (m *postTxIBS) GetCodeHash(addr accounts.Address) (accounts.CodeHash, error) {
if addr == m.deletedAddr {
return accounts.NilCodeHash, nil
}
return accounts.EmptyCodeHash, nil
}
func (m *postTxIBS) GetState(accounts.Address, accounts.StorageKey) (uint256.Int, error) {
return uint256.Int{}, nil
}
func (m *postTxIBS) Exist(accounts.Address) (bool, error) { return false, nil }
func (m *postTxIBS) GetRefund() mdgas.MdGas { return mdgas.MdGas{} }

// TestPrestateTracerDiffModeDeletedAccount verifies that an account deleted during
// a tx appears in the diff-mode post state with codeHash == 0x000...000.
Expand All @@ -64,7 +66,6 @@ func TestPrestateTracerDiffModeDeletedAccount(t *testing.T) {
deleted: make(map[accounts.Address]bool),
}

// Pre-tx: codeless account — no CodeHash set, balance = 0.
tr.pre[deletedAddr] = &account{Balance: big.NewInt(0)}

tr.env = &tracing.VMContext{
Expand Down
Loading