2021-05-25 15:30:21 -05:00
|
|
|
// Copyright 2021 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
package ethapi
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"context"
|
2024-02-08 12:53:32 -06:00
|
|
|
"crypto/sha256"
|
2021-05-25 15:30:21 -05:00
|
|
|
"errors"
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
"fmt"
|
2021-05-25 15:30:21 -05:00
|
|
|
"math/big"
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
|
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
|
|
|
"github.com/ethereum/go-ethereum/common/math"
|
2024-01-17 08:06:14 -06:00
|
|
|
"github.com/ethereum/go-ethereum/consensus/misc/eip4844"
|
core, core/types: plain Message struct (#25977)
Here, the core.Message interface turns into a plain struct and
types.Message gets removed.
This is a breaking change to packages core and core/types. While we do
not promise API stability for package core, we do for core/types. An
exception can be made for types.Message, since it doesn't have any
purpose apart from invoking the state transition in package core.
types.Message was also marked deprecated by the same commit it
got added in, 4dca5d4db7 (November 2016).
The core.Message interface was added in December 2014, in commit
db494170dc, for the purpose of 'testing' state transitions. It's the
same change that made transaction struct fields private. Before that,
the state transition used *types.Transaction directly.
Over time, multiple implementations of the interface accrued across
different packages, since constructing a Message is required whenever
one wants to invoke the state transition. These implementations all
looked very similar, a struct with private fields exposing the fields
as accessor methods.
By changing Message into a struct with public fields we can remove all
these useless interface implementations. It will also hopefully
simplify future changes to the type with less updates to apply across
all of go-ethereum when a field is added to Message.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-03-09 07:19:12 -06:00
|
|
|
"github.com/ethereum/go-ethereum/core"
|
2021-05-25 15:30:21 -05:00
|
|
|
"github.com/ethereum/go-ethereum/core/types"
|
2024-02-08 12:53:32 -06:00
|
|
|
"github.com/ethereum/go-ethereum/crypto/kzg4844"
|
2021-05-25 15:30:21 -05:00
|
|
|
"github.com/ethereum/go-ethereum/log"
|
2024-02-08 12:53:32 -06:00
|
|
|
"github.com/ethereum/go-ethereum/params"
|
2021-05-25 15:30:21 -05:00
|
|
|
"github.com/ethereum/go-ethereum/rpc"
|
2024-01-17 08:06:14 -06:00
|
|
|
"github.com/holiman/uint256"
|
2021-05-25 15:30:21 -05:00
|
|
|
)
|
|
|
|
|
2024-02-08 12:53:32 -06:00
|
|
|
var (
|
|
|
|
maxBlobsPerTransaction = params.MaxBlobGasPerBlock / params.BlobTxBlobGasPerBlob
|
|
|
|
)
|
|
|
|
|
2021-05-25 15:30:21 -05:00
|
|
|
// TransactionArgs represents the arguments to construct a new transaction
|
|
|
|
// or a message call.
|
|
|
|
type TransactionArgs struct {
|
2021-06-08 05:05:41 -05:00
|
|
|
From *common.Address `json:"from"`
|
|
|
|
To *common.Address `json:"to"`
|
|
|
|
Gas *hexutil.Uint64 `json:"gas"`
|
|
|
|
GasPrice *hexutil.Big `json:"gasPrice"`
|
|
|
|
MaxFeePerGas *hexutil.Big `json:"maxFeePerGas"`
|
|
|
|
MaxPriorityFeePerGas *hexutil.Big `json:"maxPriorityFeePerGas"`
|
|
|
|
Value *hexutil.Big `json:"value"`
|
|
|
|
Nonce *hexutil.Uint64 `json:"nonce"`
|
2021-05-25 15:30:21 -05:00
|
|
|
|
|
|
|
// We accept "data" and "input" for backwards-compatibility reasons.
|
|
|
|
// "input" is the newer name and should be preferred by clients.
|
|
|
|
// Issue detail: https://github.com/ethereum/go-ethereum/issues/15628
|
|
|
|
Data *hexutil.Bytes `json:"data"`
|
|
|
|
Input *hexutil.Bytes `json:"input"`
|
|
|
|
|
2021-07-13 05:40:01 -05:00
|
|
|
// Introduced by AccessListTxType transaction.
|
2021-05-25 15:30:21 -05:00
|
|
|
AccessList *types.AccessList `json:"accessList,omitempty"`
|
|
|
|
ChainID *hexutil.Big `json:"chainId,omitempty"`
|
2024-01-17 08:06:14 -06:00
|
|
|
|
2024-02-08 12:53:32 -06:00
|
|
|
// For BlobTxType
|
2024-01-17 08:06:14 -06:00
|
|
|
BlobFeeCap *hexutil.Big `json:"maxFeePerBlobGas"`
|
|
|
|
BlobHashes []common.Hash `json:"blobVersionedHashes,omitempty"`
|
2024-02-08 12:53:32 -06:00
|
|
|
|
|
|
|
// For BlobTxType transactions with blob sidecar
|
|
|
|
Blobs []kzg4844.Blob `json:"blobs"`
|
|
|
|
Commitments []kzg4844.Commitment `json:"commitments"`
|
|
|
|
Proofs []kzg4844.Proof `json:"proofs"`
|
|
|
|
|
|
|
|
// This configures whether blobs are allowed to be passed.
|
|
|
|
blobSidecarAllowed bool
|
2021-05-25 15:30:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// from retrieves the transaction sender address.
|
2022-01-20 02:38:42 -06:00
|
|
|
func (args *TransactionArgs) from() common.Address {
|
|
|
|
if args.From == nil {
|
2021-05-25 15:30:21 -05:00
|
|
|
return common.Address{}
|
|
|
|
}
|
2022-01-20 02:38:42 -06:00
|
|
|
return *args.From
|
2021-05-25 15:30:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// data retrieves the transaction calldata. Input field is preferred.
|
2022-01-20 02:38:42 -06:00
|
|
|
func (args *TransactionArgs) data() []byte {
|
|
|
|
if args.Input != nil {
|
|
|
|
return *args.Input
|
2021-05-25 15:30:21 -05:00
|
|
|
}
|
2022-01-20 02:38:42 -06:00
|
|
|
if args.Data != nil {
|
|
|
|
return *args.Data
|
2021-05-25 15:30:21 -05:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// setDefaults fills in default values for unspecified tx fields.
|
2024-02-22 09:35:23 -06:00
|
|
|
func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend, skipGasEstimation bool) error {
|
2024-02-08 12:53:32 -06:00
|
|
|
if err := args.setBlobTxSidecar(ctx, b); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2022-08-11 03:56:53 -05:00
|
|
|
if err := args.setFeeDefaults(ctx, b); err != nil {
|
|
|
|
return err
|
2021-05-25 15:30:21 -05:00
|
|
|
}
|
2024-02-08 12:53:32 -06:00
|
|
|
|
2021-05-25 15:30:21 -05:00
|
|
|
if args.Value == nil {
|
|
|
|
args.Value = new(hexutil.Big)
|
|
|
|
}
|
|
|
|
if args.Nonce == nil {
|
|
|
|
nonce, err := b.GetPoolNonce(ctx, args.from())
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
args.Nonce = (*hexutil.Uint64)(&nonce)
|
|
|
|
}
|
|
|
|
if args.Data != nil && args.Input != nil && !bytes.Equal(*args.Data, *args.Input) {
|
|
|
|
return errors.New(`both "data" and "input" are set and not equal. Please use "input" to pass transaction call data`)
|
|
|
|
}
|
2024-02-08 12:53:32 -06:00
|
|
|
|
|
|
|
// BlobTx fields
|
2024-01-17 08:06:14 -06:00
|
|
|
if args.BlobHashes != nil && len(args.BlobHashes) == 0 {
|
|
|
|
return errors.New(`need at least 1 blob for a blob transaction`)
|
|
|
|
}
|
2024-02-08 12:53:32 -06:00
|
|
|
if args.BlobHashes != nil && len(args.BlobHashes) > maxBlobsPerTransaction {
|
|
|
|
return fmt.Errorf(`too many blobs in transaction (have=%d, max=%d)`, len(args.BlobHashes), maxBlobsPerTransaction)
|
|
|
|
}
|
|
|
|
|
|
|
|
// create check
|
|
|
|
if args.To == nil {
|
|
|
|
if args.BlobHashes != nil {
|
|
|
|
return errors.New(`missing "to" in blob transaction`)
|
|
|
|
}
|
|
|
|
if len(args.data()) == 0 {
|
|
|
|
return errors.New(`contract creation without any data provided`)
|
|
|
|
}
|
2021-05-25 15:30:21 -05:00
|
|
|
}
|
2024-02-08 12:53:32 -06:00
|
|
|
|
2021-05-25 15:30:21 -05:00
|
|
|
if args.Gas == nil {
|
2024-02-22 09:35:23 -06:00
|
|
|
if skipGasEstimation { // Skip gas usage estimation if a precise gas limit is not critical, e.g., in non-transaction calls.
|
|
|
|
gas := hexutil.Uint64(b.RPCGasCap())
|
|
|
|
if gas == 0 {
|
|
|
|
gas = hexutil.Uint64(math.MaxUint64 / 2)
|
|
|
|
}
|
|
|
|
args.Gas = &gas
|
|
|
|
} else { // Estimate the gas usage otherwise.
|
|
|
|
// These fields are immutable during the estimation, safe to
|
|
|
|
// pass the pointer directly.
|
|
|
|
data := args.data()
|
|
|
|
callArgs := TransactionArgs{
|
|
|
|
From: args.From,
|
|
|
|
To: args.To,
|
|
|
|
GasPrice: args.GasPrice,
|
|
|
|
MaxFeePerGas: args.MaxFeePerGas,
|
|
|
|
MaxPriorityFeePerGas: args.MaxPriorityFeePerGas,
|
|
|
|
Value: args.Value,
|
|
|
|
Data: (*hexutil.Bytes)(&data),
|
|
|
|
AccessList: args.AccessList,
|
2024-02-26 04:02:18 -06:00
|
|
|
BlobFeeCap: args.BlobFeeCap,
|
|
|
|
BlobHashes: args.BlobHashes,
|
2024-02-22 09:35:23 -06:00
|
|
|
}
|
|
|
|
latestBlockNr := rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber)
|
|
|
|
estimated, err := DoEstimateGas(ctx, b, callArgs, latestBlockNr, nil, b.RPCGasCap())
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
args.Gas = &estimated
|
|
|
|
log.Trace("Estimate gas usage automatically", "gas", args.Gas)
|
2021-05-25 15:30:21 -05:00
|
|
|
}
|
|
|
|
}
|
2024-02-08 12:53:32 -06:00
|
|
|
|
2022-07-14 05:17:25 -05:00
|
|
|
// If chain id is provided, ensure it matches the local chain id. Otherwise, set the local
|
|
|
|
// chain id as the default.
|
|
|
|
want := b.ChainConfig().ChainID
|
|
|
|
if args.ChainID != nil {
|
|
|
|
if have := (*big.Int)(args.ChainID); have.Cmp(want) != 0 {
|
|
|
|
return fmt.Errorf("chainId does not match node's (have=%v, want=%v)", have, want)
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
args.ChainID = (*hexutil.Big)(want)
|
2021-05-25 15:30:21 -05:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-08-11 03:56:53 -05:00
|
|
|
// setFeeDefaults fills in default fee values for unspecified tx fields.
|
|
|
|
func (args *TransactionArgs) setFeeDefaults(ctx context.Context, b Backend) error {
|
2024-02-21 05:46:32 -06:00
|
|
|
head := b.CurrentHeader()
|
|
|
|
// Sanity check the EIP-4844 fee parameters.
|
|
|
|
if args.BlobFeeCap != nil && args.BlobFeeCap.ToInt().Sign() == 0 {
|
|
|
|
return errors.New("maxFeePerBlobGas, if specified, must be non-zero")
|
|
|
|
}
|
|
|
|
if err := args.setCancunFeeDefaults(ctx, head, b); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2022-08-11 03:56:53 -05:00
|
|
|
// If both gasPrice and at least one of the EIP-1559 fee parameters are specified, error.
|
|
|
|
if args.GasPrice != nil && (args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil) {
|
|
|
|
return errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified")
|
|
|
|
}
|
2023-12-18 13:09:41 -06:00
|
|
|
// If the tx has completely specified a fee mechanism, no default is needed.
|
|
|
|
// This allows users who are not yet synced past London to get defaults for
|
|
|
|
// other tx values. See https://github.com/ethereum/go-ethereum/pull/23274
|
|
|
|
// for more information.
|
2022-08-11 03:56:53 -05:00
|
|
|
eip1559ParamsSet := args.MaxFeePerGas != nil && args.MaxPriorityFeePerGas != nil
|
2023-12-18 13:09:41 -06:00
|
|
|
// Sanity check the EIP-1559 fee parameters if present.
|
|
|
|
if args.GasPrice == nil && eip1559ParamsSet {
|
|
|
|
if args.MaxFeePerGas.ToInt().Sign() == 0 {
|
|
|
|
return errors.New("maxFeePerGas must be non-zero")
|
|
|
|
}
|
|
|
|
if args.MaxFeePerGas.ToInt().Cmp(args.MaxPriorityFeePerGas.ToInt()) < 0 {
|
2022-08-11 03:56:53 -05:00
|
|
|
return fmt.Errorf("maxFeePerGas (%v) < maxPriorityFeePerGas (%v)", args.MaxFeePerGas, args.MaxPriorityFeePerGas)
|
|
|
|
}
|
2023-12-18 13:09:41 -06:00
|
|
|
return nil // No need to set anything, user already set MaxFeePerGas and MaxPriorityFeePerGas
|
2022-08-11 03:56:53 -05:00
|
|
|
}
|
2024-02-08 12:53:32 -06:00
|
|
|
|
2023-12-18 13:09:41 -06:00
|
|
|
// Sanity check the non-EIP-1559 fee parameters.
|
|
|
|
isLondon := b.ChainConfig().IsLondon(head.Number)
|
|
|
|
if args.GasPrice != nil && !eip1559ParamsSet {
|
|
|
|
// Zero gas-price is not allowed after London fork
|
|
|
|
if args.GasPrice.ToInt().Sign() == 0 && isLondon {
|
|
|
|
return errors.New("gasPrice must be non-zero after london fork")
|
|
|
|
}
|
|
|
|
return nil // No need to set anything, user already set GasPrice
|
|
|
|
}
|
|
|
|
|
|
|
|
// Now attempt to fill in default value depending on whether London is active or not.
|
2024-02-21 05:46:32 -06:00
|
|
|
if isLondon {
|
2022-08-11 03:56:53 -05:00
|
|
|
// London is active, set maxPriorityFeePerGas and maxFeePerGas.
|
|
|
|
if err := args.setLondonFeeDefaults(ctx, head, b); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
2024-02-21 05:46:32 -06:00
|
|
|
if args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil {
|
|
|
|
return errors.New("maxFeePerGas and maxPriorityFeePerGas are not valid before London is active")
|
2022-08-11 03:56:53 -05:00
|
|
|
}
|
|
|
|
// London not active, set gas price.
|
|
|
|
price, err := b.SuggestGasTipCap(ctx)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
args.GasPrice = (*hexutil.Big)(price)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2024-01-17 08:06:14 -06:00
|
|
|
// setCancunFeeDefaults fills in reasonable default fee values for unspecified fields.
|
|
|
|
func (args *TransactionArgs) setCancunFeeDefaults(ctx context.Context, head *types.Header, b Backend) error {
|
|
|
|
// Set maxFeePerBlobGas if it is missing.
|
|
|
|
if args.BlobHashes != nil && args.BlobFeeCap == nil {
|
2024-02-21 05:46:32 -06:00
|
|
|
var excessBlobGas uint64
|
|
|
|
if head.ExcessBlobGas != nil {
|
|
|
|
excessBlobGas = *head.ExcessBlobGas
|
|
|
|
}
|
2024-01-17 08:06:14 -06:00
|
|
|
// ExcessBlobGas must be set for a Cancun block.
|
2024-02-21 05:46:32 -06:00
|
|
|
blobBaseFee := eip4844.CalcBlobFee(excessBlobGas)
|
2024-01-17 08:06:14 -06:00
|
|
|
// Set the max fee to be 2 times larger than the previous block's blob base fee.
|
|
|
|
// The additional slack allows the tx to not become invalidated if the base
|
|
|
|
// fee is rising.
|
|
|
|
val := new(big.Int).Mul(blobBaseFee, big.NewInt(2))
|
|
|
|
args.BlobFeeCap = (*hexutil.Big)(val)
|
|
|
|
}
|
2024-02-21 05:46:32 -06:00
|
|
|
return nil
|
2024-01-17 08:06:14 -06:00
|
|
|
}
|
|
|
|
|
2022-08-11 03:56:53 -05:00
|
|
|
// setLondonFeeDefaults fills in reasonable default fee values for unspecified fields.
|
|
|
|
func (args *TransactionArgs) setLondonFeeDefaults(ctx context.Context, head *types.Header, b Backend) error {
|
|
|
|
// Set maxPriorityFeePerGas if it is missing.
|
|
|
|
if args.MaxPriorityFeePerGas == nil {
|
|
|
|
tip, err := b.SuggestGasTipCap(ctx)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
args.MaxPriorityFeePerGas = (*hexutil.Big)(tip)
|
|
|
|
}
|
|
|
|
// Set maxFeePerGas if it is missing.
|
|
|
|
if args.MaxFeePerGas == nil {
|
|
|
|
// Set the max fee to be 2 times larger than the previous block's base fee.
|
|
|
|
// The additional slack allows the tx to not become invalidated if the base
|
|
|
|
// fee is rising.
|
|
|
|
val := new(big.Int).Add(
|
|
|
|
args.MaxPriorityFeePerGas.ToInt(),
|
|
|
|
new(big.Int).Mul(head.BaseFee, big.NewInt(2)),
|
|
|
|
)
|
|
|
|
args.MaxFeePerGas = (*hexutil.Big)(val)
|
|
|
|
}
|
|
|
|
// Both EIP-1559 fee parameters are now set; sanity check them.
|
|
|
|
if args.MaxFeePerGas.ToInt().Cmp(args.MaxPriorityFeePerGas.ToInt()) < 0 {
|
|
|
|
return fmt.Errorf("maxFeePerGas (%v) < maxPriorityFeePerGas (%v)", args.MaxFeePerGas, args.MaxPriorityFeePerGas)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2024-02-08 12:53:32 -06:00
|
|
|
// setBlobTxSidecar adds the blob tx
|
|
|
|
func (args *TransactionArgs) setBlobTxSidecar(ctx context.Context, b Backend) error {
|
|
|
|
// No blobs, we're done.
|
|
|
|
if args.Blobs == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Passing blobs is not allowed in all contexts, only in specific methods.
|
|
|
|
if !args.blobSidecarAllowed {
|
|
|
|
return errors.New(`"blobs" is not supported for this RPC method`)
|
|
|
|
}
|
|
|
|
|
|
|
|
n := len(args.Blobs)
|
|
|
|
// Assume user provides either only blobs (w/o hashes), or
|
|
|
|
// blobs together with commitments and proofs.
|
|
|
|
if args.Commitments == nil && args.Proofs != nil {
|
|
|
|
return errors.New(`blob proofs provided while commitments were not`)
|
|
|
|
} else if args.Commitments != nil && args.Proofs == nil {
|
|
|
|
return errors.New(`blob commitments provided while proofs were not`)
|
|
|
|
}
|
|
|
|
|
|
|
|
// len(blobs) == len(commitments) == len(proofs) == len(hashes)
|
|
|
|
if args.Commitments != nil && len(args.Commitments) != n {
|
|
|
|
return fmt.Errorf("number of blobs and commitments mismatch (have=%d, want=%d)", len(args.Commitments), n)
|
|
|
|
}
|
|
|
|
if args.Proofs != nil && len(args.Proofs) != n {
|
|
|
|
return fmt.Errorf("number of blobs and proofs mismatch (have=%d, want=%d)", len(args.Proofs), n)
|
|
|
|
}
|
|
|
|
if args.BlobHashes != nil && len(args.BlobHashes) != n {
|
|
|
|
return fmt.Errorf("number of blobs and hashes mismatch (have=%d, want=%d)", len(args.BlobHashes), n)
|
|
|
|
}
|
|
|
|
|
|
|
|
if args.Commitments == nil {
|
|
|
|
// Generate commitment and proof.
|
|
|
|
commitments := make([]kzg4844.Commitment, n)
|
|
|
|
proofs := make([]kzg4844.Proof, n)
|
|
|
|
for i, b := range args.Blobs {
|
2024-03-13 01:51:46 -05:00
|
|
|
c, err := kzg4844.BlobToCommitment(&b)
|
2024-02-08 12:53:32 -06:00
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("blobs[%d]: error computing commitment: %v", i, err)
|
|
|
|
}
|
|
|
|
commitments[i] = c
|
2024-03-13 01:51:46 -05:00
|
|
|
p, err := kzg4844.ComputeBlobProof(&b, c)
|
2024-02-08 12:53:32 -06:00
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("blobs[%d]: error computing proof: %v", i, err)
|
|
|
|
}
|
|
|
|
proofs[i] = p
|
|
|
|
}
|
|
|
|
args.Commitments = commitments
|
|
|
|
args.Proofs = proofs
|
|
|
|
} else {
|
|
|
|
for i, b := range args.Blobs {
|
2024-03-13 01:51:46 -05:00
|
|
|
if err := kzg4844.VerifyBlobProof(&b, args.Commitments[i], args.Proofs[i]); err != nil {
|
2024-02-08 12:53:32 -06:00
|
|
|
return fmt.Errorf("failed to verify blob proof: %v", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
hashes := make([]common.Hash, n)
|
|
|
|
hasher := sha256.New()
|
|
|
|
for i, c := range args.Commitments {
|
|
|
|
hashes[i] = kzg4844.CalcBlobHashV1(hasher, &c)
|
|
|
|
}
|
|
|
|
if args.BlobHashes != nil {
|
|
|
|
for i, h := range hashes {
|
|
|
|
if h != args.BlobHashes[i] {
|
|
|
|
return fmt.Errorf("blob hash verification failed (have=%s, want=%s)", args.BlobHashes[i], h)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
args.BlobHashes = hashes
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-08-23 04:49:39 -05:00
|
|
|
// ToMessage converts the transaction arguments to the Message type used by the
|
2021-06-10 00:02:51 -05:00
|
|
|
// core evm. This method is used in calls and traces that do not require a real
|
|
|
|
// live transaction.
|
core, core/types: plain Message struct (#25977)
Here, the core.Message interface turns into a plain struct and
types.Message gets removed.
This is a breaking change to packages core and core/types. While we do
not promise API stability for package core, we do for core/types. An
exception can be made for types.Message, since it doesn't have any
purpose apart from invoking the state transition in package core.
types.Message was also marked deprecated by the same commit it
got added in, 4dca5d4db7 (November 2016).
The core.Message interface was added in December 2014, in commit
db494170dc, for the purpose of 'testing' state transitions. It's the
same change that made transaction struct fields private. Before that,
the state transition used *types.Transaction directly.
Over time, multiple implementations of the interface accrued across
different packages, since constructing a Message is required whenever
one wants to invoke the state transition. These implementations all
looked very similar, a struct with private fields exposing the fields
as accessor methods.
By changing Message into a struct with public fields we can remove all
these useless interface implementations. It will also hopefully
simplify future changes to the type with less updates to apply across
all of go-ethereum when a field is added to Message.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-03-09 07:19:12 -06:00
|
|
|
func (args *TransactionArgs) ToMessage(globalGasCap uint64, baseFee *big.Int) (*core.Message, error) {
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
// Reject invalid combinations of pre- and post-1559 fee styles
|
2021-06-08 05:05:41 -05:00
|
|
|
if args.GasPrice != nil && (args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil) {
|
core, core/types: plain Message struct (#25977)
Here, the core.Message interface turns into a plain struct and
types.Message gets removed.
This is a breaking change to packages core and core/types. While we do
not promise API stability for package core, we do for core/types. An
exception can be made for types.Message, since it doesn't have any
purpose apart from invoking the state transition in package core.
types.Message was also marked deprecated by the same commit it
got added in, 4dca5d4db7 (November 2016).
The core.Message interface was added in December 2014, in commit
db494170dc, for the purpose of 'testing' state transitions. It's the
same change that made transaction struct fields private. Before that,
the state transition used *types.Transaction directly.
Over time, multiple implementations of the interface accrued across
different packages, since constructing a Message is required whenever
one wants to invoke the state transition. These implementations all
looked very similar, a struct with private fields exposing the fields
as accessor methods.
By changing Message into a struct with public fields we can remove all
these useless interface implementations. It will also hopefully
simplify future changes to the type with less updates to apply across
all of go-ethereum when a field is added to Message.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-03-09 07:19:12 -06:00
|
|
|
return nil, errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified")
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
}
|
2021-05-25 15:30:21 -05:00
|
|
|
// Set sender address or use zero address if none specified.
|
|
|
|
addr := args.from()
|
|
|
|
|
|
|
|
// Set default gas & gas price if none were set
|
|
|
|
gas := globalGasCap
|
|
|
|
if gas == 0 {
|
|
|
|
gas = uint64(math.MaxUint64 / 2)
|
|
|
|
}
|
|
|
|
if args.Gas != nil {
|
|
|
|
gas = uint64(*args.Gas)
|
|
|
|
}
|
|
|
|
if globalGasCap != 0 && globalGasCap < gas {
|
|
|
|
log.Warn("Caller gas above allowance, capping", "requested", gas, "cap", globalGasCap)
|
|
|
|
gas = globalGasCap
|
|
|
|
}
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
var (
|
2024-01-17 08:06:14 -06:00
|
|
|
gasPrice *big.Int
|
|
|
|
gasFeeCap *big.Int
|
|
|
|
gasTipCap *big.Int
|
|
|
|
blobFeeCap *big.Int
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
)
|
|
|
|
if baseFee == nil {
|
|
|
|
// If there's no basefee, then it must be a non-1559 execution
|
|
|
|
gasPrice = new(big.Int)
|
|
|
|
if args.GasPrice != nil {
|
|
|
|
gasPrice = args.GasPrice.ToInt()
|
|
|
|
}
|
2021-06-08 05:05:41 -05:00
|
|
|
gasFeeCap, gasTipCap = gasPrice, gasPrice
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
} else {
|
|
|
|
// A basefee is provided, necessitating 1559-type execution
|
|
|
|
if args.GasPrice != nil {
|
2021-06-10 00:02:51 -05:00
|
|
|
// User specified the legacy gas field, convert to 1559 gas typing
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
gasPrice = args.GasPrice.ToInt()
|
2021-06-08 05:05:41 -05:00
|
|
|
gasFeeCap, gasTipCap = gasPrice, gasPrice
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
} else {
|
2022-08-19 01:01:09 -05:00
|
|
|
// User specified 1559 gas fields (or none), use those
|
2021-06-08 05:05:41 -05:00
|
|
|
gasFeeCap = new(big.Int)
|
|
|
|
if args.MaxFeePerGas != nil {
|
|
|
|
gasFeeCap = args.MaxFeePerGas.ToInt()
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
}
|
2021-06-08 05:05:41 -05:00
|
|
|
gasTipCap = new(big.Int)
|
|
|
|
if args.MaxPriorityFeePerGas != nil {
|
|
|
|
gasTipCap = args.MaxPriorityFeePerGas.ToInt()
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
}
|
2021-06-10 00:02:51 -05:00
|
|
|
// Backfill the legacy gasPrice for EVM execution, unless we're all zeroes
|
|
|
|
gasPrice = new(big.Int)
|
|
|
|
if gasFeeCap.BitLen() > 0 || gasTipCap.BitLen() > 0 {
|
|
|
|
gasPrice = math.BigMin(new(big.Int).Add(gasTipCap, baseFee), gasFeeCap)
|
|
|
|
}
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
}
|
2021-05-25 15:30:21 -05:00
|
|
|
}
|
2024-01-17 08:06:14 -06:00
|
|
|
if args.BlobFeeCap != nil {
|
|
|
|
blobFeeCap = args.BlobFeeCap.ToInt()
|
|
|
|
} else if args.BlobHashes != nil {
|
|
|
|
blobFeeCap = new(big.Int)
|
|
|
|
}
|
2021-05-25 15:30:21 -05:00
|
|
|
value := new(big.Int)
|
|
|
|
if args.Value != nil {
|
|
|
|
value = args.Value.ToInt()
|
|
|
|
}
|
|
|
|
data := args.data()
|
|
|
|
var accessList types.AccessList
|
|
|
|
if args.AccessList != nil {
|
|
|
|
accessList = *args.AccessList
|
|
|
|
}
|
core, core/types: plain Message struct (#25977)
Here, the core.Message interface turns into a plain struct and
types.Message gets removed.
This is a breaking change to packages core and core/types. While we do
not promise API stability for package core, we do for core/types. An
exception can be made for types.Message, since it doesn't have any
purpose apart from invoking the state transition in package core.
types.Message was also marked deprecated by the same commit it
got added in, 4dca5d4db7 (November 2016).
The core.Message interface was added in December 2014, in commit
db494170dc, for the purpose of 'testing' state transitions. It's the
same change that made transaction struct fields private. Before that,
the state transition used *types.Transaction directly.
Over time, multiple implementations of the interface accrued across
different packages, since constructing a Message is required whenever
one wants to invoke the state transition. These implementations all
looked very similar, a struct with private fields exposing the fields
as accessor methods.
By changing Message into a struct with public fields we can remove all
these useless interface implementations. It will also hopefully
simplify future changes to the type with less updates to apply across
all of go-ethereum when a field is added to Message.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-03-09 07:19:12 -06:00
|
|
|
msg := &core.Message{
|
|
|
|
From: addr,
|
|
|
|
To: args.To,
|
|
|
|
Value: value,
|
|
|
|
GasLimit: gas,
|
|
|
|
GasPrice: gasPrice,
|
|
|
|
GasFeeCap: gasFeeCap,
|
|
|
|
GasTipCap: gasTipCap,
|
|
|
|
Data: data,
|
|
|
|
AccessList: accessList,
|
2024-01-17 08:06:14 -06:00
|
|
|
BlobGasFeeCap: blobFeeCap,
|
|
|
|
BlobHashes: args.BlobHashes,
|
core, core/types: plain Message struct (#25977)
Here, the core.Message interface turns into a plain struct and
types.Message gets removed.
This is a breaking change to packages core and core/types. While we do
not promise API stability for package core, we do for core/types. An
exception can be made for types.Message, since it doesn't have any
purpose apart from invoking the state transition in package core.
types.Message was also marked deprecated by the same commit it
got added in, 4dca5d4db7 (November 2016).
The core.Message interface was added in December 2014, in commit
db494170dc, for the purpose of 'testing' state transitions. It's the
same change that made transaction struct fields private. Before that,
the state transition used *types.Transaction directly.
Over time, multiple implementations of the interface accrued across
different packages, since constructing a Message is required whenever
one wants to invoke the state transition. These implementations all
looked very similar, a struct with private fields exposing the fields
as accessor methods.
By changing Message into a struct with public fields we can remove all
these useless interface implementations. It will also hopefully
simplify future changes to the type with less updates to apply across
all of go-ethereum when a field is added to Message.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-03-09 07:19:12 -06:00
|
|
|
SkipAccountChecks: true,
|
|
|
|
}
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
return msg, nil
|
2021-05-25 15:30:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// toTransaction converts the arguments to a transaction.
|
|
|
|
// This assumes that setDefaults has been called.
|
|
|
|
func (args *TransactionArgs) toTransaction() *types.Transaction {
|
|
|
|
var data types.TxData
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
switch {
|
2024-01-17 08:06:14 -06:00
|
|
|
case args.BlobHashes != nil:
|
|
|
|
al := types.AccessList{}
|
|
|
|
if args.AccessList != nil {
|
|
|
|
al = *args.AccessList
|
|
|
|
}
|
|
|
|
data = &types.BlobTx{
|
|
|
|
To: *args.To,
|
|
|
|
ChainID: uint256.MustFromBig((*big.Int)(args.ChainID)),
|
|
|
|
Nonce: uint64(*args.Nonce),
|
|
|
|
Gas: uint64(*args.Gas),
|
|
|
|
GasFeeCap: uint256.MustFromBig((*big.Int)(args.MaxFeePerGas)),
|
|
|
|
GasTipCap: uint256.MustFromBig((*big.Int)(args.MaxPriorityFeePerGas)),
|
|
|
|
Value: uint256.MustFromBig((*big.Int)(args.Value)),
|
|
|
|
Data: args.data(),
|
|
|
|
AccessList: al,
|
|
|
|
BlobHashes: args.BlobHashes,
|
|
|
|
BlobFeeCap: uint256.MustFromBig((*big.Int)(args.BlobFeeCap)),
|
|
|
|
}
|
2024-02-08 12:53:32 -06:00
|
|
|
if args.Blobs != nil {
|
|
|
|
data.(*types.BlobTx).Sidecar = &types.BlobTxSidecar{
|
|
|
|
Blobs: args.Blobs,
|
|
|
|
Commitments: args.Commitments,
|
|
|
|
Proofs: args.Proofs,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-08 05:05:41 -05:00
|
|
|
case args.MaxFeePerGas != nil:
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
al := types.AccessList{}
|
|
|
|
if args.AccessList != nil {
|
|
|
|
al = *args.AccessList
|
2021-05-25 15:30:21 -05:00
|
|
|
}
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
data = &types.DynamicFeeTx{
|
|
|
|
To: args.To,
|
|
|
|
ChainID: (*big.Int)(args.ChainID),
|
|
|
|
Nonce: uint64(*args.Nonce),
|
|
|
|
Gas: uint64(*args.Gas),
|
2021-06-08 05:05:41 -05:00
|
|
|
GasFeeCap: (*big.Int)(args.MaxFeePerGas),
|
|
|
|
GasTipCap: (*big.Int)(args.MaxPriorityFeePerGas),
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
Value: (*big.Int)(args.Value),
|
|
|
|
Data: args.data(),
|
|
|
|
AccessList: al,
|
|
|
|
}
|
2024-02-08 12:53:32 -06:00
|
|
|
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
case args.AccessList != nil:
|
2021-05-25 15:30:21 -05:00
|
|
|
data = &types.AccessListTx{
|
|
|
|
To: args.To,
|
|
|
|
ChainID: (*big.Int)(args.ChainID),
|
|
|
|
Nonce: uint64(*args.Nonce),
|
|
|
|
Gas: uint64(*args.Gas),
|
|
|
|
GasPrice: (*big.Int)(args.GasPrice),
|
|
|
|
Value: (*big.Int)(args.Value),
|
|
|
|
Data: args.data(),
|
|
|
|
AccessList: *args.AccessList,
|
|
|
|
}
|
2024-02-08 12:53:32 -06:00
|
|
|
|
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader
* internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results
* core,eth,les,internal: add support for tip estimation in gas price oracle
* internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap
* core/types,internal: use correct eip1559 terminology for json marshalling
* eth, internal/ethapi: fix rebase problems
* internal/ethapi: fix rpc name of basefee
* internal/ethapi: address review concerns
* core, eth, internal, les: simplify gasprice oracle (#25)
* core, eth, internal, les: simplify gasprice oracle
* eth/gasprice: fix typo
* internal/ethapi: minor tweak in tx args
* internal/ethapi: calculate basefee for pending block
* internal/ethapi: fix panic
* internal/ethapi, eth/tracers: simplify txargs ToMessage
* internal/ethapi: remove unused param
* core, eth, internal: fix regressions wrt effective gas price in the evm
* eth/gasprice: drop weird debug println
* internal/jsre/deps: hack in 1559 gas conversions into embedded web3
* internal/jsre/deps: hack basFee to decimal conversion
* internal/ethapi: init feecap and tipcap for legacy txs too
* eth, graphql, internal, les: fix gas price suggestion on all combos
* internal/jsre/deps: handle decimal tipcap and feecap
* eth, internal: minor review fixes
* graphql, internal: export max fee cap RPC endpoint
* internal/ethapi: fix crash in transaction_args
* internal/ethapi: minor refactor to make the code safer
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-06-02 08:13:10 -05:00
|
|
|
default:
|
|
|
|
data = &types.LegacyTx{
|
|
|
|
To: args.To,
|
|
|
|
Nonce: uint64(*args.Nonce),
|
|
|
|
Gas: uint64(*args.Gas),
|
|
|
|
GasPrice: (*big.Int)(args.GasPrice),
|
|
|
|
Value: (*big.Int)(args.Value),
|
|
|
|
Data: args.data(),
|
|
|
|
}
|
2021-05-25 15:30:21 -05:00
|
|
|
}
|
|
|
|
return types.NewTx(data)
|
|
|
|
}
|
2021-06-09 06:48:47 -05:00
|
|
|
|
2024-01-17 08:06:14 -06:00
|
|
|
// IsEIP4844 returns an indicator if the args contains EIP4844 fields.
|
|
|
|
func (args *TransactionArgs) IsEIP4844() bool {
|
|
|
|
return args.BlobHashes != nil || args.BlobFeeCap != nil
|
|
|
|
}
|