diff --git a/core/gen_genesis.go b/core/gen_genesis.go index 82fe48663caf..63ea023f4e82 100644 --- a/core/gen_genesis.go +++ b/core/gen_genesis.go @@ -15,6 +15,7 @@ import ( var _ = (*genesisSpecMarshaling)(nil) +// MarshalJSON marshals as JSON. func (g Genesis) MarshalJSON() ([]byte, error) { type Genesis struct { Config *params.ChainConfig `json:"config"` @@ -29,6 +30,7 @@ func (g Genesis) MarshalJSON() ([]byte, error) { Number math.HexOrDecimal64 `json:"number"` GasUsed math.HexOrDecimal64 `json:"gasUsed"` ParentHash common.Hash `json:"parentHash"` + BaseFee *big.Int `json:"baseFee"` } var enc Genesis enc.Config = g.Config @@ -48,9 +50,11 @@ func (g Genesis) MarshalJSON() ([]byte, error) { enc.Number = math.HexOrDecimal64(g.Number) enc.GasUsed = math.HexOrDecimal64(g.GasUsed) enc.ParentHash = g.ParentHash + enc.BaseFee = g.BaseFee return json.Marshal(&enc) } +// UnmarshalJSON unmarshals from JSON. func (g *Genesis) UnmarshalJSON(input []byte) error { type Genesis struct { Config *params.ChainConfig `json:"config"` @@ -65,6 +69,7 @@ func (g *Genesis) UnmarshalJSON(input []byte) error { Number *math.HexOrDecimal64 `json:"number"` GasUsed *math.HexOrDecimal64 `json:"gasUsed"` ParentHash *common.Hash `json:"parentHash"` + BaseFee *big.Int `json:"baseFee"` } var dec Genesis if err := json.Unmarshal(input, &dec); err != nil { @@ -112,5 +117,8 @@ func (g *Genesis) UnmarshalJSON(input []byte) error { if dec.ParentHash != nil { g.ParentHash = *dec.ParentHash } + if dec.BaseFee != nil { + g.BaseFee = dec.BaseFee + } return nil } diff --git a/core/gen_genesis_account.go b/core/gen_genesis_account.go index 9d3ea26d6814..dd0a6f671967 100644 --- a/core/gen_genesis_account.go +++ b/core/gen_genesis_account.go @@ -14,6 +14,7 @@ import ( var _ = (*genesisAccountMarshaling)(nil) +// MarshalJSON marshals as JSON. func (g GenesisAccount) MarshalJSON() ([]byte, error) { type GenesisAccount struct { Code hexutil.Bytes `json:"code,omitempty"` @@ -36,6 +37,7 @@ func (g GenesisAccount) MarshalJSON() ([]byte, error) { return json.Marshal(&enc) } +// UnmarshalJSON unmarshals from JSON. func (g *GenesisAccount) UnmarshalJSON(input []byte) error { type GenesisAccount struct { Code *hexutil.Bytes `json:"code,omitempty"` diff --git a/core/genesis.go b/core/genesis.go index c45ec967a99c..0e552fb84e12 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -61,6 +61,7 @@ type Genesis struct { Number uint64 `json:"number"` GasUsed uint64 `json:"gasUsed"` ParentHash common.Hash `json:"parentHash"` + BaseFee *big.Int `json:"baseFee"` } // GenesisAlloc specifies the initial state that is part of the genesis block. @@ -265,7 +266,11 @@ func (g *Genesis) ToBlock(db ethdb.Database) *types.Block { head.Difficulty = params.GenesisDifficulty } if g.Config != nil && g.Config.IsEIP1559(common.Big0) { - head.BaseFee = new(big.Int).SetUint64(params.InitialBaseFee) + if g.BaseFee != nil { + head.BaseFee = g.BaseFee + } else { + head.BaseFee = new(big.Int).SetUint64(params.InitialBaseFee) + } } statedb.Commit(false) statedb.Database().TrieDB().Commit(root, true) diff --git a/tests/block_test_util.go b/tests/block_test_util.go index 72e9f210809a..4ad201b8146b 100644 --- a/tests/block_test_util.go +++ b/tests/block_test_util.go @@ -21,17 +21,16 @@ import ( "bytes" "encoding/hex" "encoding/json" - "errors" "fmt" "math/big" - - "github.com/XinFinOrg/XDPoSChain/core/rawdb" + "os" "github.com/XinFinOrg/XDPoSChain/common" "github.com/XinFinOrg/XDPoSChain/common/hexutil" "github.com/XinFinOrg/XDPoSChain/common/math" "github.com/XinFinOrg/XDPoSChain/consensus/ethash" "github.com/XinFinOrg/XDPoSChain/core" + "github.com/XinFinOrg/XDPoSChain/core/rawdb" "github.com/XinFinOrg/XDPoSChain/core/state" "github.com/XinFinOrg/XDPoSChain/core/types" "github.com/XinFinOrg/XDPoSChain/core/vm" @@ -58,9 +57,10 @@ type btJSON struct { } type btBlock struct { - BlockHeader *btHeader - Rlp string - UncleHeaders []*btHeader + BlockHeader *btHeader + ExpectException string + Rlp string + UncleHeaders []*btHeader } //go:generate gencodec -type btHeader -field-override btHeaderMarshaling -out gen_btheader.go @@ -82,6 +82,7 @@ type btHeader struct { GasLimit uint64 GasUsed uint64 Timestamp *big.Int + BaseFee *big.Int } type btHeaderMarshaling struct { @@ -91,6 +92,7 @@ type btHeaderMarshaling struct { GasLimit math.HexOrDecimal64 GasUsed math.HexOrDecimal64 Timestamp *math.HexOrDecimal256 + BaseFee *math.HexOrDecimal256 } func (t *BlockTest) Run() error { @@ -149,6 +151,7 @@ func (t *BlockTest) genesis(config *params.ChainConfig) *core.Genesis { Mixhash: t.json.Genesis.MixHash, Coinbase: t.json.Genesis.Coinbase, Alloc: t.json.Pre, + BaseFee: t.json.Genesis.BaseFee, } } @@ -168,13 +171,13 @@ See https://github.com/ethereum/tests/wiki/Blockchain-Tests-II func (t *BlockTest) insertBlocks(blockchain *core.BlockChain) ([]btBlock, error) { validBlocks := make([]btBlock, 0) // insert the test blocks, which will execute all transactions - for _, b := range t.json.Blocks { + for bi, b := range t.json.Blocks { cb, err := b.decode() if err != nil { if b.BlockHeader == nil { continue // OK - block is supposed to be invalid, continue with next block } else { - return nil, fmt.Errorf("Block RLP decoding failed when expected to succeed: %v", err) + return nil, fmt.Errorf("block RLP decoding failed when expected to succeed: %v", err) } } // RLP decoding worked, try to insert into chain: @@ -184,16 +187,21 @@ func (t *BlockTest) insertBlocks(blockchain *core.BlockChain) ([]btBlock, error) if b.BlockHeader == nil { continue // OK - block is supposed to be invalid, continue with next block } else { - return nil, fmt.Errorf("Block #%v insertion into chain failed: %v", blocks[i].Number(), err) + return nil, fmt.Errorf("block #%v insertion into chain failed: %v", blocks[i].Number(), err) } } if b.BlockHeader == nil { - return nil, errors.New("Block insertion should have failed") + if data, err := json.MarshalIndent(cb.Header(), "", " "); err == nil { + fmt.Fprintf(os.Stderr, "block (index %d) insertion should have failed due to: %v:\n%v\n", + bi, b.ExpectException, string(data)) + } + return nil, fmt.Errorf("block (index %d) insertion should have failed due to: %v", + bi, b.ExpectException) } // validate RLP decoding by checking all values against test file JSON if err = validateHeader(b.BlockHeader, cb.Header()); err != nil { - return nil, fmt.Errorf("Deserialised block header validation failed: %v", err) + return nil, fmt.Errorf("deserialised block header validation failed: %v", err) } validBlocks = append(validBlocks, b) } @@ -202,49 +210,49 @@ func (t *BlockTest) insertBlocks(blockchain *core.BlockChain) ([]btBlock, error) func validateHeader(h *btHeader, h2 *types.Header) error { if h.Bloom != h2.Bloom { - return fmt.Errorf("Bloom: want: %x have: %x", h.Bloom, h2.Bloom) + return fmt.Errorf("bloom: want: %x have: %x", h.Bloom, h2.Bloom) } if h.Coinbase != h2.Coinbase { - return fmt.Errorf("Coinbase: want: %x have: %x", h.Coinbase, h2.Coinbase) + return fmt.Errorf("coinbase: want: %x have: %x", h.Coinbase, h2.Coinbase) } if h.MixHash != h2.MixDigest { return fmt.Errorf("MixHash: want: %x have: %x", h.MixHash, h2.MixDigest) } if h.Nonce != h2.Nonce { - return fmt.Errorf("Nonce: want: %x have: %x", h.Nonce, h2.Nonce) + return fmt.Errorf("nonce: want: %x have: %x", h.Nonce, h2.Nonce) } if h.Number.Cmp(h2.Number) != 0 { - return fmt.Errorf("Number: want: %v have: %v", h.Number, h2.Number) + return fmt.Errorf("number: want: %v have: %v", h.Number, h2.Number) } if h.ParentHash != h2.ParentHash { - return fmt.Errorf("Parent hash: want: %x have: %x", h.ParentHash, h2.ParentHash) + return fmt.Errorf("parent hash: want: %x have: %x", h.ParentHash, h2.ParentHash) } if h.ReceiptTrie != h2.ReceiptHash { - return fmt.Errorf("Receipt hash: want: %x have: %x", h.ReceiptTrie, h2.ReceiptHash) + return fmt.Errorf("receipt hash: want: %x have: %x", h.ReceiptTrie, h2.ReceiptHash) } if h.TransactionsTrie != h2.TxHash { - return fmt.Errorf("Tx hash: want: %x have: %x", h.TransactionsTrie, h2.TxHash) + return fmt.Errorf("tx hash: want: %x have: %x", h.TransactionsTrie, h2.TxHash) } if h.StateRoot != h2.Root { - return fmt.Errorf("State hash: want: %x have: %x", h.StateRoot, h2.Root) + return fmt.Errorf("state hash: want: %x have: %x", h.StateRoot, h2.Root) } if h.UncleHash != h2.UncleHash { - return fmt.Errorf("Uncle hash: want: %x have: %x", h.UncleHash, h2.UncleHash) + return fmt.Errorf("uncle hash: want: %x have: %x", h.UncleHash, h2.UncleHash) } if !bytes.Equal(h.ExtraData, h2.Extra) { - return fmt.Errorf("Extra data: want: %x have: %x", h.ExtraData, h2.Extra) + return fmt.Errorf("extra data: want: %x have: %x", h.ExtraData, h2.Extra) } if h.Difficulty.Cmp(h2.Difficulty) != 0 { - return fmt.Errorf("Difficulty: want: %v have: %v", h.Difficulty, h2.Difficulty) + return fmt.Errorf("difficulty: want: %v have: %v", h.Difficulty, h2.Difficulty) } if h.GasLimit != h2.GasLimit { - return fmt.Errorf("GasLimit: want: %d have: %d", h.GasLimit, h2.GasLimit) + return fmt.Errorf("gasLimit: want: %d have: %d", h.GasLimit, h2.GasLimit) } if h.GasUsed != h2.GasUsed { - return fmt.Errorf("GasUsed: want: %d have: %d", h.GasUsed, h2.GasUsed) + return fmt.Errorf("gasUsed: want: %d have: %d", h.GasUsed, h2.GasUsed) } if h.Timestamp.Cmp(h2.Time) != 0 { - return fmt.Errorf("Timestamp: want: %v have: %v", h.Timestamp, h2.Time) + return fmt.Errorf("timestamp: want: %v have: %v", h.Timestamp, h2.Time) } return nil } diff --git a/tests/gen_btheader.go b/tests/gen_btheader.go index 003ca5fb39ef..abe99159cc9b 100644 --- a/tests/gen_btheader.go +++ b/tests/gen_btheader.go @@ -14,6 +14,7 @@ import ( var _ = (*btHeaderMarshaling)(nil) +// MarshalJSON marshals as JSON. func (b btHeader) MarshalJSON() ([]byte, error) { type btHeader struct { Bloom types.Bloom @@ -32,6 +33,7 @@ func (b btHeader) MarshalJSON() ([]byte, error) { GasLimit math.HexOrDecimal64 GasUsed math.HexOrDecimal64 Timestamp *math.HexOrDecimal256 + BaseFee *math.HexOrDecimal256 } var enc btHeader enc.Bloom = b.Bloom @@ -50,9 +52,11 @@ func (b btHeader) MarshalJSON() ([]byte, error) { enc.GasLimit = math.HexOrDecimal64(b.GasLimit) enc.GasUsed = math.HexOrDecimal64(b.GasUsed) enc.Timestamp = (*math.HexOrDecimal256)(b.Timestamp) + enc.BaseFee = (*math.HexOrDecimal256)(b.BaseFee) return json.Marshal(&enc) } +// UnmarshalJSON unmarshals from JSON. func (b *btHeader) UnmarshalJSON(input []byte) error { type btHeader struct { Bloom *types.Bloom @@ -71,6 +75,7 @@ func (b *btHeader) UnmarshalJSON(input []byte) error { GasLimit *math.HexOrDecimal64 GasUsed *math.HexOrDecimal64 Timestamp *math.HexOrDecimal256 + BaseFee *math.HexOrDecimal256 } var dec btHeader if err := json.Unmarshal(input, &dec); err != nil { @@ -124,5 +129,8 @@ func (b *btHeader) UnmarshalJSON(input []byte) error { if dec.Timestamp != nil { b.Timestamp = (*big.Int)(dec.Timestamp) } + if dec.BaseFee != nil { + b.BaseFee = (*big.Int)(dec.BaseFee) + } return nil } diff --git a/tests/gen_stenv.go b/tests/gen_stenv.go index 9248bebc7ab5..5a43270a9a5d 100644 --- a/tests/gen_stenv.go +++ b/tests/gen_stenv.go @@ -21,6 +21,7 @@ func (s stEnv) MarshalJSON() ([]byte, error) { GasLimit math.HexOrDecimal64 `json:"currentGasLimit" gencodec:"required"` Number math.HexOrDecimal64 `json:"currentNumber" gencodec:"required"` Timestamp math.HexOrDecimal64 `json:"currentTimestamp" gencodec:"required"` + BaseFee *math.HexOrDecimal256 `json:"currentBaseFee" gencodec:"optional"` } var enc stEnv enc.Coinbase = common.UnprefixedAddress(s.Coinbase) @@ -28,6 +29,7 @@ func (s stEnv) MarshalJSON() ([]byte, error) { enc.GasLimit = math.HexOrDecimal64(s.GasLimit) enc.Number = math.HexOrDecimal64(s.Number) enc.Timestamp = math.HexOrDecimal64(s.Timestamp) + enc.BaseFee = (*math.HexOrDecimal256)(s.BaseFee) return json.Marshal(&enc) } @@ -39,6 +41,7 @@ func (s *stEnv) UnmarshalJSON(input []byte) error { GasLimit *math.HexOrDecimal64 `json:"currentGasLimit" gencodec:"required"` Number *math.HexOrDecimal64 `json:"currentNumber" gencodec:"required"` Timestamp *math.HexOrDecimal64 `json:"currentTimestamp" gencodec:"required"` + BaseFee *math.HexOrDecimal256 `json:"currentBaseFee" gencodec:"optional"` } var dec stEnv if err := json.Unmarshal(input, &dec); err != nil { @@ -64,5 +67,8 @@ func (s *stEnv) UnmarshalJSON(input []byte) error { return errors.New("missing required field 'currentTimestamp' for stEnv") } s.Timestamp = uint64(*dec.Timestamp) + if dec.BaseFee != nil { + s.BaseFee = (*big.Int)(dec.BaseFee) + } return nil } diff --git a/tests/gen_sttransaction.go b/tests/gen_sttransaction.go index fdf0d5df2a87..ac8989372780 100644 --- a/tests/gen_sttransaction.go +++ b/tests/gen_sttransaction.go @@ -16,17 +16,21 @@ var _ = (*stTransactionMarshaling)(nil) // MarshalJSON marshals as JSON. func (s stTransaction) MarshalJSON() ([]byte, error) { type stTransaction struct { - GasPrice *math.HexOrDecimal256 `json:"gasPrice"` - Nonce math.HexOrDecimal64 `json:"nonce"` - To string `json:"to"` - Data []string `json:"data"` - AccessLists []*types.AccessList `json:"accessLists,omitempty"` - GasLimit []math.HexOrDecimal64 `json:"gasLimit"` - Value []string `json:"value"` - PrivateKey hexutil.Bytes `json:"secretKey"` + GasPrice *math.HexOrDecimal256 `json:"gasPrice"` + MaxFeePerGas *math.HexOrDecimal256 `json:"maxFeePerGas"` + MaxPriorityFeePerGas *math.HexOrDecimal256 `json:"maxPriorityFeePerGas"` + Nonce math.HexOrDecimal64 `json:"nonce"` + To string `json:"to"` + Data []string `json:"data"` + AccessLists []*types.AccessList `json:"accessLists,omitempty"` + GasLimit []math.HexOrDecimal64 `json:"gasLimit"` + Value []string `json:"value"` + PrivateKey hexutil.Bytes `json:"secretKey"` } var enc stTransaction enc.GasPrice = (*math.HexOrDecimal256)(s.GasPrice) + enc.MaxFeePerGas = (*math.HexOrDecimal256)(s.MaxFeePerGas) + enc.MaxPriorityFeePerGas = (*math.HexOrDecimal256)(s.MaxPriorityFeePerGas) enc.Nonce = math.HexOrDecimal64(s.Nonce) enc.To = s.To enc.Data = s.Data @@ -45,14 +49,16 @@ func (s stTransaction) MarshalJSON() ([]byte, error) { // UnmarshalJSON unmarshals from JSON. func (s *stTransaction) UnmarshalJSON(input []byte) error { type stTransaction struct { - GasPrice *math.HexOrDecimal256 `json:"gasPrice"` - Nonce *math.HexOrDecimal64 `json:"nonce"` - To *string `json:"to"` - Data []string `json:"data"` - AccessLists []*types.AccessList `json:"accessLists,omitempty"` - GasLimit []math.HexOrDecimal64 `json:"gasLimit"` - Value []string `json:"value"` - PrivateKey *hexutil.Bytes `json:"secretKey"` + GasPrice *math.HexOrDecimal256 `json:"gasPrice"` + MaxFeePerGas *math.HexOrDecimal256 `json:"maxFeePerGas"` + MaxPriorityFeePerGas *math.HexOrDecimal256 `json:"maxPriorityFeePerGas"` + Nonce *math.HexOrDecimal64 `json:"nonce"` + To *string `json:"to"` + Data []string `json:"data"` + AccessLists []*types.AccessList `json:"accessLists,omitempty"` + GasLimit []math.HexOrDecimal64 `json:"gasLimit"` + Value []string `json:"value"` + PrivateKey *hexutil.Bytes `json:"secretKey"` } var dec stTransaction if err := json.Unmarshal(input, &dec); err != nil { @@ -61,6 +67,12 @@ func (s *stTransaction) UnmarshalJSON(input []byte) error { if dec.GasPrice != nil { s.GasPrice = (*big.Int)(dec.GasPrice) } + if dec.MaxFeePerGas != nil { + s.MaxFeePerGas = (*big.Int)(dec.MaxFeePerGas) + } + if dec.MaxPriorityFeePerGas != nil { + s.MaxPriorityFeePerGas = (*big.Int)(dec.MaxPriorityFeePerGas) + } if dec.Nonce != nil { s.Nonce = uint64(*dec.Nonce) } diff --git a/tests/state_test_util.go b/tests/state_test_util.go index 36e882b14cd9..a09fb119925f 100644 --- a/tests/state_test_util.go +++ b/tests/state_test_util.go @@ -80,6 +80,7 @@ type stEnv struct { GasLimit uint64 `json:"currentGasLimit" gencodec:"required"` Number uint64 `json:"currentNumber" gencodec:"required"` Timestamp uint64 `json:"currentTimestamp" gencodec:"required"` + BaseFee *big.Int `json:"currentBaseFee" gencodec:"optional"` } type stEnvMarshaling struct { @@ -88,26 +89,31 @@ type stEnvMarshaling struct { GasLimit math.HexOrDecimal64 Number math.HexOrDecimal64 Timestamp math.HexOrDecimal64 + BaseFee *math.HexOrDecimal256 } //go:generate gencodec -type stTransaction -field-override stTransactionMarshaling -out gen_sttransaction.go type stTransaction struct { - GasPrice *big.Int `json:"gasPrice"` - Nonce uint64 `json:"nonce"` - To string `json:"to"` - Data []string `json:"data"` - AccessLists []*types.AccessList `json:"accessLists,omitempty"` - GasLimit []uint64 `json:"gasLimit"` - Value []string `json:"value"` - PrivateKey []byte `json:"secretKey"` + GasPrice *big.Int `json:"gasPrice"` + MaxFeePerGas *big.Int `json:"maxFeePerGas"` + MaxPriorityFeePerGas *big.Int `json:"maxPriorityFeePerGas"` + Nonce uint64 `json:"nonce"` + To string `json:"to"` + Data []string `json:"data"` + AccessLists []*types.AccessList `json:"accessLists,omitempty"` + GasLimit []uint64 `json:"gasLimit"` + Value []string `json:"value"` + PrivateKey []byte `json:"secretKey"` } type stTransactionMarshaling struct { - GasPrice *math.HexOrDecimal256 - Nonce math.HexOrDecimal64 - GasLimit []math.HexOrDecimal64 - PrivateKey hexutil.Bytes + GasPrice *math.HexOrDecimal256 + MaxFeePerGas *math.HexOrDecimal256 + MaxPriorityFeePerGas *math.HexOrDecimal256 + Nonce math.HexOrDecimal64 + GasLimit []math.HexOrDecimal64 + PrivateKey hexutil.Bytes } // Subtests returns all valid subtests of the test. @@ -131,8 +137,17 @@ func (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config) (*state.StateD db := rawdb.NewMemoryDatabase() statedb := MakePreState(db, t.json.Pre) + var baseFee *big.Int + if config.IsEIP1559(new(big.Int)) { + baseFee = t.json.Env.BaseFee + if baseFee == nil { + // Retesteth uses `0x10` for genesis baseFee. Therefore, it defaults to + // parent - 2 : 0xa as the basefee for 'this' context. + baseFee = big.NewInt(common.BaseFee.Int64()) + } + } post := t.json.Post[subtest.Fork][subtest.Index] - msg, err := t.json.Tx.toMessage(post, block.Number()) + msg, err := t.json.Tx.toMessage(post, block.Number(), baseFee) if err != nil { return nil, err } @@ -141,6 +156,7 @@ func (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config) (*state.StateD txContext := core.NewEVMTxContext(msg) context := core.NewEVMBlockContext(block.Header(), nil, &t.json.Env.Coinbase) context.GetHash = vmTestBlockHash + context.BaseFee = baseFee evm := vm.NewEVM(context, txContext, statedb, nil, config, vmconfig) // Execute the message. @@ -197,7 +213,7 @@ func (t *StateTest) genesis(config *params.ChainConfig) *core.Genesis { } } -func (tx *stTransaction) toMessage(ps stPostState, number *big.Int) (core.Message, error) { +func (tx *stTransaction) toMessage(ps stPostState, number *big.Int, baseFee *big.Int) (core.Message, error) { // Derive sender from private key if present. var from common.Address if len(tx.PrivateKey) > 0 { @@ -246,7 +262,23 @@ func (tx *stTransaction) toMessage(ps stPostState, number *big.Int) (core.Messag if tx.AccessLists != nil && tx.AccessLists[ps.Indexes.Data] != nil { accessList = *tx.AccessLists[ps.Indexes.Data] } - msg := types.NewMessage(from, to, tx.Nonce, value, gasLimit, tx.GasPrice, nil, nil, data, accessList, true, nil, number) + // If baseFee provided, set gasPrice to effectiveGasPrice. + gasPrice := tx.GasPrice + if baseFee != nil { + if tx.MaxFeePerGas == nil { + tx.MaxFeePerGas = gasPrice + } + if tx.MaxFeePerGas == nil { + tx.MaxFeePerGas = new(big.Int) + } + if tx.MaxPriorityFeePerGas == nil { + tx.MaxPriorityFeePerGas = tx.MaxFeePerGas + } + gasPrice = math.BigMin(new(big.Int).Add(tx.MaxPriorityFeePerGas, baseFee), + tx.MaxFeePerGas) + } + + msg := types.NewMessage(from, to, tx.Nonce, value, gasLimit, tx.GasPrice, tx.MaxFeePerGas, tx.MaxPriorityFeePerGas, data, accessList, true, nil, number) return msg, nil }