mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-10 18:16:39 +00:00
add new test network 'BPO2ToAmsterdamAtTime15k'. correct invocation of selfdestruct hook for tracers
This commit is contained in:
parent
3e07bb4598
commit
e68fb247b0
2 changed files with 42 additions and 7 deletions
|
|
@ -309,14 +309,17 @@ func (s *hookedStateDB) Finalise(deleteEmptyObjects bool) {
|
||||||
|
|
||||||
// If an initcode invokes selfdestruct, do not emit a code change.
|
// If an initcode invokes selfdestruct, do not emit a code change.
|
||||||
prevCodeHash := s.inner.GetCodeHash(addr)
|
prevCodeHash := s.inner.GetCodeHash(addr)
|
||||||
if prevCodeHash == types.EmptyCodeHash {
|
if prevCodeHash != types.EmptyCodeHash {
|
||||||
continue
|
// Otherwise, trace the change.
|
||||||
|
if s.hooks.OnCodeChangeV2 != nil {
|
||||||
|
s.hooks.OnCodeChangeV2(addr, prevCodeHash, s.inner.GetCode(addr), types.EmptyCodeHash, nil, tracing.CodeChangeSelfDestruct)
|
||||||
|
} else if s.hooks.OnCodeChange != nil {
|
||||||
|
s.hooks.OnCodeChange(addr, prevCodeHash, s.inner.GetCode(addr), types.EmptyCodeHash, nil)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Otherwise, trace the change.
|
|
||||||
if s.hooks.OnCodeChangeV2 != nil {
|
if s.hooks.OnSelfDestructChange != nil {
|
||||||
s.hooks.OnCodeChangeV2(addr, prevCodeHash, s.inner.GetCode(addr), types.EmptyCodeHash, nil, tracing.CodeChangeSelfDestruct)
|
s.hooks.OnSelfDestructChange(addr)
|
||||||
} else if s.hooks.OnCodeChange != nil {
|
|
||||||
s.hooks.OnCodeChange(addr, prevCodeHash, s.inner.GetCode(addr), types.EmptyCodeHash, nil)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -525,6 +525,38 @@ var Forks = map[string]*params.ChainConfig{
|
||||||
BPO2: bpo2BlobConfig,
|
BPO2: bpo2BlobConfig,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"BPO2ToAmsterdamAtTime15k": {
|
||||||
|
ChainID: big.NewInt(1),
|
||||||
|
HomesteadBlock: big.NewInt(0),
|
||||||
|
EIP150Block: big.NewInt(0),
|
||||||
|
EIP155Block: big.NewInt(0),
|
||||||
|
EIP158Block: big.NewInt(0),
|
||||||
|
ByzantiumBlock: big.NewInt(0),
|
||||||
|
ConstantinopleBlock: big.NewInt(0),
|
||||||
|
PetersburgBlock: big.NewInt(0),
|
||||||
|
IstanbulBlock: big.NewInt(0),
|
||||||
|
MuirGlacierBlock: big.NewInt(0),
|
||||||
|
BerlinBlock: big.NewInt(0),
|
||||||
|
LondonBlock: big.NewInt(0),
|
||||||
|
ArrowGlacierBlock: big.NewInt(0),
|
||||||
|
MergeNetsplitBlock: big.NewInt(0),
|
||||||
|
TerminalTotalDifficulty: big.NewInt(0),
|
||||||
|
ShanghaiTime: u64(0),
|
||||||
|
CancunTime: u64(0),
|
||||||
|
PragueTime: u64(0),
|
||||||
|
OsakaTime: u64(0),
|
||||||
|
BPO1Time: u64(0),
|
||||||
|
BPO2Time: u64(0),
|
||||||
|
AmsterdamTime: u64(15_000),
|
||||||
|
DepositContractAddress: params.MainnetChainConfig.DepositContractAddress,
|
||||||
|
BlobScheduleConfig: ¶ms.BlobScheduleConfig{
|
||||||
|
Cancun: params.DefaultCancunBlobConfig,
|
||||||
|
Prague: params.DefaultPragueBlobConfig,
|
||||||
|
Osaka: params.DefaultOsakaBlobConfig,
|
||||||
|
BPO1: bpo1BlobConfig,
|
||||||
|
BPO2: bpo2BlobConfig,
|
||||||
|
},
|
||||||
|
},
|
||||||
"OsakaToBPO1AtTime15k": {
|
"OsakaToBPO1AtTime15k": {
|
||||||
ChainID: big.NewInt(1),
|
ChainID: big.NewInt(1),
|
||||||
HomesteadBlock: big.NewInt(0),
|
HomesteadBlock: big.NewInt(0),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue