diff --git a/core/types/inclusion_list.go b/core/types/inclusion_list.go new file mode 100644 index 0000000000..772fd43346 --- /dev/null +++ b/core/types/inclusion_list.go @@ -0,0 +1,48 @@ +// Copyright 2025 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +package types + +import ( + "encoding/json" + + "github.com/ethereum/go-ethereum/common/hexutil" +) + +// InclusionList is a list of transactions that should be included in a payload. +type InclusionList [][]byte + +func (inclusionList InclusionList) MarshalJSON() ([]byte, error) { + inclusionListHex := make([]hexutil.Bytes, len(inclusionList)) + for i, tx := range inclusionList { + inclusionListHex[i] = tx + } + return json.Marshal(inclusionListHex) +} + +func (inclusionList *InclusionList) UnmarshalJSON(input []byte) error { + var inclusionListHex []hexutil.Bytes + if err := json.Unmarshal(input, &inclusionListHex); err != nil { + return err + } + + *inclusionList = make([][]byte, len(inclusionListHex)) + for i, tx := range inclusionListHex { + (*inclusionList)[i] = tx + } + + return nil +} diff --git a/params/protocol_params.go b/params/protocol_params.go index e8b044f450..ebec04d0be 100644 --- a/params/protocol_params.go +++ b/params/protocol_params.go @@ -137,6 +137,8 @@ const ( MaxCodeSize = 24576 // Maximum bytecode to permit for a contract MaxInitCodeSize = 2 * MaxCodeSize // Maximum initcode to permit in a creation transaction and create instructions + MaxBytesPerInclusionList uint64 = 8192 // Maximum size in bytes allowed for each inclusion list. + // Precompiled contract gas prices EcrecoverGas uint64 = 3000 // Elliptic curve sender recovery gas price