mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 21:26:42 +00:00
fix: post-euclid block tracing (#1119)
* fix: post euclid debugs tracers * fix: disallow tracing post-euclid blocks with scroll specific RPC methods * fix panic when tracing pre-euclid blocks on mpt nodes * fix: scroll tracing on mpt nodes * chore: auto version bump [bot] --------- Co-authored-by: omerfirmak <omerfirmak@users.noreply.github.com>
This commit is contained in:
parent
b4f36b2489
commit
684383275b
3 changed files with 17 additions and 3 deletions
|
|
@ -47,10 +47,16 @@ func traceLastNAddressCode(n int) traceFunc {
|
|||
|
||||
func traceCodeWithAddress(l *StructLogger, address common.Address) {
|
||||
code := l.env.StateDB.GetCode(address)
|
||||
|
||||
keccakCodeHash := l.env.StateDB.GetKeccakCodeHash(address)
|
||||
poseidonCodeHash := l.env.StateDB.GetPoseidonCodeHash(address)
|
||||
codeHash := keccakCodeHash
|
||||
poseidonCodeHash := common.Hash{}
|
||||
if !l.env.chainRules.IsEuclid && l.env.chainConfig.Scroll.UseZktrie {
|
||||
poseidonCodeHash = l.env.StateDB.GetPoseidonCodeHash(address)
|
||||
codeHash = poseidonCodeHash
|
||||
}
|
||||
codeSize := l.env.StateDB.GetCodeSize(address)
|
||||
l.bytecodes[poseidonCodeHash] = CodeInfo{
|
||||
l.bytecodes[codeHash] = CodeInfo{
|
||||
codeSize,
|
||||
keccakCodeHash,
|
||||
poseidonCodeHash,
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import (
|
|||
const (
|
||||
VersionMajor = 5 // Major version component of the current release
|
||||
VersionMinor = 8 // Minor version component of the current release
|
||||
VersionPatch = 8 // Patch version component of the current release
|
||||
VersionPatch = 9 // Patch version component of the current release
|
||||
VersionMeta = "mainnet" // Version metadata to append to the version string
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -182,6 +182,14 @@ func CreateTraceEnv(chainConfig *params.ChainConfig, chainContext core.ChainCont
|
|||
}
|
||||
|
||||
func (env *TraceEnv) GetBlockTrace(block *types.Block) (*types.BlockTrace, error) {
|
||||
if !env.chainConfig.Scroll.UseZktrie {
|
||||
return nil, errors.New("scroll tracing methods are not available on MPT-enabled nodes")
|
||||
}
|
||||
|
||||
if env.chainConfig.IsEuclid(block.Time()) {
|
||||
return nil, errors.New("cannot trace post euclid blocks with scroll specific RPC methods")
|
||||
}
|
||||
|
||||
// Execute all the transaction contained within the block concurrently
|
||||
var (
|
||||
txs = block.Transactions()
|
||||
|
|
|
|||
Loading…
Reference in a new issue