Skip to content

Commit

Permalink
Revert "EIP-4788: set nonce of beacon root history address to nonzero… (
Browse files Browse the repository at this point in the history
#8055)

[devnet-8](https://notes.ethereum.org/@ethpandaops/dencun-devnet-8)
doesn't include ethereum/EIPs#7431 since it's
rendered obsolete by upcoming ethereum/EIPs#7456
(to be implemented by PR #8038).

This reverts PR #7952.
  • Loading branch information
yperbasis authored Aug 23, 2023
1 parent 2e29ff3 commit 83d767c
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions consensus/misc/eip4788.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"github.com/holiman/uint256"

libcommon "github.com/ledgerwatch/erigon-lib/common"

"github.com/ledgerwatch/erigon/consensus"
"github.com/ledgerwatch/erigon/core/state"
"github.com/ledgerwatch/erigon/core/types"
Expand All @@ -21,11 +20,4 @@ func ApplyBeaconRootEip4788(chain consensus.ChainHeaderReader, header *types.Hea
parentBeaconBlockRootInt := *uint256.NewInt(0).SetBytes(header.ParentBeaconBlockRoot.Bytes())
state.SetState(historyStorageAddress, &timestampIndex, *uint256.NewInt(header.Time))
state.SetState(historyStorageAddress, &rootIndex, parentBeaconBlockRootInt)

// Ensure that the historyStorageAddress has nonzero nonce to prevent wipe-out of its storage stipulated by EIP-161
// (when the historyStorageAddress has zero balance).
// See https://github.com/ethereum/EIPs/pull/7431
if state.GetNonce(historyStorageAddress) == 0 {
state.SetNonce(historyStorageAddress, 1)
}
}

0 comments on commit 83d767c

Please sign in to comment.