internal/ethapi: fix transaction APIs (#23179)
* internal/ethapi: fix transaction APIs * internal/ethapi: fix typo * internal/ethapi: address comments * internal/ethapi: address comment from Peter
This commit is contained in:
@@ -49,7 +49,7 @@ type TransactionArgs struct {
|
||||
Data *hexutil.Bytes `json:"data"`
|
||||
Input *hexutil.Bytes `json:"input"`
|
||||
|
||||
// For non-legacy transactions
|
||||
// Introduced by AccessListTxType transaction.
|
||||
AccessList *types.AccessList `json:"accessList,omitempty"`
|
||||
ChainID *hexutil.Big `json:"chainId,omitempty"`
|
||||
}
|
||||
@@ -108,6 +108,9 @@ func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend) error {
|
||||
return err
|
||||
}
|
||||
if b.ChainConfig().IsLondon(head.Number) {
|
||||
// The legacy tx gas price suggestion should not add 2x base fee
|
||||
// because all fees are consumed, so it would result in a spiral
|
||||
// upwards.
|
||||
price.Add(price, head.BaseFee)
|
||||
}
|
||||
args.GasPrice = (*hexutil.Big)(price)
|
||||
|
Reference in New Issue
Block a user