From b12fc63d44e64718b2aa730b9715d4036a80fad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20Irmak?= Date: Wed, 19 Feb 2025 13:49:12 +0300 Subject: [PATCH 1/5] fix: post euclid debugs tracers --- core/vm/logger_trace.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/vm/logger_trace.go b/core/vm/logger_trace.go index 39f89286c03..a31007c3403 100644 --- a/core/vm/logger_trace.go +++ b/core/vm/logger_trace.go @@ -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 { + 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, From a83f43b3a49384b212aa8aa20d8aa6609a460c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20Irmak?= Date: Wed, 19 Feb 2025 13:51:23 +0300 Subject: [PATCH 2/5] fix: disallow tracing post-euclid blocks with scroll specific RPC methods --- rollup/tracing/tracing.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rollup/tracing/tracing.go b/rollup/tracing/tracing.go index 3cd78149241..fb88680c975 100644 --- a/rollup/tracing/tracing.go +++ b/rollup/tracing/tracing.go @@ -182,6 +182,10 @@ func CreateTraceEnv(chainConfig *params.ChainConfig, chainContext core.ChainCont } func (env *TraceEnv) GetBlockTrace(block *types.Block) (*types.BlockTrace, error) { + 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() From 51f3ab9ade8d987a733be45f6700db047fd12df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20Irmak?= Date: Wed, 19 Feb 2025 14:26:08 +0300 Subject: [PATCH 3/5] fix panic when tracing pre-euclid blocks on mpt nodes --- core/vm/logger_trace.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/vm/logger_trace.go b/core/vm/logger_trace.go index a31007c3403..72b893222d6 100644 --- a/core/vm/logger_trace.go +++ b/core/vm/logger_trace.go @@ -51,7 +51,7 @@ func traceCodeWithAddress(l *StructLogger, address common.Address) { keccakCodeHash := l.env.StateDB.GetKeccakCodeHash(address) codeHash := keccakCodeHash poseidonCodeHash := common.Hash{} - if !l.env.chainRules.IsEuclid { + if !l.env.chainRules.IsEuclid && l.env.chainConfig.Scroll.UseZktrie { poseidonCodeHash = l.env.StateDB.GetPoseidonCodeHash(address) codeHash = poseidonCodeHash } From 8bae826b3aa2f632179f1554078c1cca9a6fc4d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20Irmak?= Date: Wed, 19 Feb 2025 14:32:43 +0300 Subject: [PATCH 4/5] fix: scroll tracing on mpt nodes --- rollup/tracing/tracing.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rollup/tracing/tracing.go b/rollup/tracing/tracing.go index fb88680c975..0658bdb36b5 100644 --- a/rollup/tracing/tracing.go +++ b/rollup/tracing/tracing.go @@ -182,6 +182,10 @@ 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") } From 543ed190dfdb2c5fd4184027b9602aecf27011ce Mon Sep 17 00:00:00 2001 From: omerfirmak Date: Wed, 19 Feb 2025 11:33:22 +0000 Subject: [PATCH 5/5] =?UTF-8?q?chore:=20auto=20version=20bump=E2=80=89[bot?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- params/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params/version.go b/params/version.go index 8f45867a884..b85c4244adc 100644 --- a/params/version.go +++ b/params/version.go @@ -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 )