diff --git a/core/vm/logger.go b/core/vm/logger.go index 0b6a5e4af..7ea958c12 100644 --- a/core/vm/logger.go +++ b/core/vm/logger.go @@ -17,6 +17,7 @@ package vm import ( + "bytes" "encoding/hex" "encoding/json" "fmt" @@ -502,6 +503,13 @@ func (l *StructLogger) MaybeAddFeeRecipientsToStatesAffected(tx *types.Transacti } } +func (l *StructLogger) MaybeAddL1BlockInfo(tx *types.Transaction) { + if contractAddress := *tx.To(); bytes.Equal(contractAddress[:], types.L1BlockAddr[:]) { + l.storage[contractAddress][types.OverheadSlot] = l.env.StateDB.GetState(contractAddress, types.OverheadSlot) + l.storage[contractAddress][types.L1FeeScalarsSlot] = l.env.StateDB.GetState(contractAddress, types.L1FeeScalarsSlot) + } +} + // WriteTrace writes a formatted trace to the given writer // [Scroll: START] func WriteTrace(writer io.Writer, logs []*StructLog) { diff --git a/eth/tracers/api_blocktrace.go b/eth/tracers/api_blocktrace.go index 991a8e054..b8c277b70 100644 --- a/eth/tracers/api_blocktrace.go +++ b/eth/tracers/api_blocktrace.go @@ -262,6 +262,7 @@ func (api *API) getTxResult(env *traceEnv, state *state.StateDB, index int, bloc } tracer.MaybeAddFeeRecipientsToStatesAffected(tx) + tracer.MaybeAddL1BlockInfo(tx) // merge required proof data proofAccounts := tracer.UpdatedAccounts()