mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
state: avoid EIP-158 for history storage address (#359)
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
This commit is contained in:
parent
afcfa5af07
commit
953338b22b
2 changed files with 8 additions and 2 deletions
|
|
@ -937,7 +937,7 @@ func (s *StateDB) Finalise(deleteEmptyObjects bool) {
|
|||
// Thus, we can safely ignore it here
|
||||
continue
|
||||
}
|
||||
if obj.selfDestructed || (deleteEmptyObjects && obj.empty()) {
|
||||
if (obj.selfDestructed || (deleteEmptyObjects && obj.empty())) && addr != params.HistoryStorageAddress {
|
||||
obj.deleted = true
|
||||
|
||||
// We need to maintain account deletions explicitly (will remain
|
||||
|
|
|
|||
|
|
@ -544,7 +544,7 @@ func TestProcessVerkle(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestProcessVerkleiInvalidContractCreation(t *testing.T) {
|
||||
func TestProcessVerkleInvalidContractCreation(t *testing.T) {
|
||||
var (
|
||||
config = ¶ms.ChainConfig{
|
||||
ChainID: big.NewInt(69420),
|
||||
|
|
@ -682,6 +682,12 @@ func TestProcessVerkleiInvalidContractCreation(t *testing.T) {
|
|||
if stemStateDiff.SuffixDiffs[0].Suffix != 65 {
|
||||
t.Fatalf("invalid suffix diff value found for BLOCKHASH contract at block #2: %d != 65", stemStateDiff.SuffixDiffs[0].Suffix)
|
||||
}
|
||||
if stemStateDiff.SuffixDiffs[0].NewValue == nil {
|
||||
t.Fatalf("missing post state value for BLOCKHASH contract at block #2")
|
||||
}
|
||||
if *stemStateDiff.SuffixDiffs[0].NewValue != common.HexToHash("53abcdfb284720ea59efe923d3dc774bbb7e787d829599f8ec7a81d344dd3d17") {
|
||||
t.Fatalf("invalid post state value for BLOCKHASH contract at block #2: %x != ", (*stemStateDiff.SuffixDiffs[0].NewValue)[:])
|
||||
}
|
||||
} else if suffixDiff.Suffix > 4 {
|
||||
t.Fatalf("invalid suffix diff found for %x in block #2: %d\n", stemStateDiff.Stem, suffixDiff.Suffix)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue