diff --git a/core/vm/logger.go b/core/vm/logger.go index dd1e277dd6..04d81e4e3e 100644 --- a/core/vm/logger.go +++ b/core/vm/logger.go @@ -208,6 +208,8 @@ func (l *StructLogger) CaptureStart(env *EVM, from common.Address, to common.Add // because contract creation is not allowed in set code transactions for _, auth := range authorizationResults { if auth.Success { + // Does not record the createdAccount account yet, since it will change the return value of CreatedAccount, + // which is used in assigning the "to" field of transaction in scroll_getBlockTraceByNumberOrHash. l.statesAffected[auth.Authority] = struct{}{} } } diff --git a/params/version.go b/params/version.go index a2a606e490..f904740d65 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 = 12 // Patch version component of the current release + VersionPatch = 13 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string ) diff --git a/rollup/fees/rollup_fee.go b/rollup/fees/rollup_fee.go index 9df6c215c5..2c46aeedbf 100644 --- a/rollup/fees/rollup_fee.go +++ b/rollup/fees/rollup_fee.go @@ -5,6 +5,8 @@ import ( "math" "math/big" + "github.com/holiman/uint256" + "github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/crypto" @@ -35,6 +37,7 @@ type Message interface { Data() []byte AccessList() types.AccessList IsL1MessageTx() bool + SetCodeAuthorizations() []types.SetCodeAuthorization } // StateDB represents the StateDB interface @@ -92,7 +95,11 @@ func asUnsignedTx(msg Message, baseFee, chainID *big.Int) *types.Transaction { return asUnsignedAccessListTx(msg, chainID) } - return asUnsignedDynamicTx(msg, chainID) + if msg.SetCodeAuthorizations() == nil { + return asUnsignedDynamicTx(msg, chainID) + } + + return asUnsignedSetCodeTx(msg, chainID) } func asUnsignedLegacyTx(msg Message) *types.Transaction { @@ -133,6 +140,24 @@ func asUnsignedDynamicTx(msg Message, chainID *big.Int) *types.Transaction { }) } +func asUnsignedSetCodeTx(msg Message, chainID *big.Int) *types.Transaction { + tx := types.SetCodeTx{ + Nonce: msg.Nonce(), + Value: uint256.MustFromBig(msg.Value()), + Gas: msg.Gas(), + GasFeeCap: uint256.MustFromBig(msg.GasFeeCap()), + GasTipCap: uint256.MustFromBig(msg.GasTipCap()), + Data: msg.Data(), + AccessList: msg.AccessList(), + AuthList: msg.SetCodeAuthorizations(), + ChainID: uint256.MustFromBig(chainID), + } + if msg.To() != nil { + tx.To = *msg.To() + } + return types.NewTx(&tx) +} + func readGPOStorageSlots(addr common.Address, state StateDB) gpoState { var gpoState gpoState gpoState.l1BaseFee = state.GetState(addr, rcfg.L1BaseFeeSlot).Big()