diff --git a/cmd/rpcdaemon/commands/eth_api.go b/cmd/rpcdaemon/commands/eth_api.go index 4ad9f43eb45..aee6c9e6739 100644 --- a/cmd/rpcdaemon/commands/eth_api.go +++ b/cmd/rpcdaemon/commands/eth_api.go @@ -188,8 +188,8 @@ type RPCTransaction struct { From common.Address `json:"from"` Gas hexutil.Uint64 `json:"gas"` GasPrice *hexutil.Big `json:"gasPrice,omitempty"` - Tip *hexutil.Big `json:"tip,omitempty"` - FeeCap *hexutil.Big `json:"feeCap,omitempty"` + Tip *hexutil.Big `json:"maxPriorityFeePerGas,omitempty"` + FeeCap *hexutil.Big `json:"maxFeePerGas,omitempty"` Hash common.Hash `json:"hash"` Input hexutil.Bytes `json:"input"` Nonce hexutil.Uint64 `json:"nonce"` diff --git a/cmd/rpcdaemon/commands/trace_adhoc.go b/cmd/rpcdaemon/commands/trace_adhoc.go index f93e70a6686..194d581a218 100644 --- a/cmd/rpcdaemon/commands/trace_adhoc.go +++ b/cmd/rpcdaemon/commands/trace_adhoc.go @@ -46,8 +46,8 @@ type TraceCallParam struct { To *common.Address `json:"to"` Gas *hexutil.Uint64 `json:"gas"` GasPrice *hexutil.Big `json:"gasPrice"` - Tip *hexutil.Big `json:"tip"` - FeeCap *hexutil.Big `json:"feeCap"` + Tip *hexutil.Big `json:"maxPriorityFeePerGas"` + FeeCap *hexutil.Big `json:"maxFeePerGas"` Value *hexutil.Big `json:"value"` Data hexutil.Bytes `json:"data"` AccessList *types.AccessList `json:"accessList"` diff --git a/core/types/block.go b/core/types/block.go index a2a7ca86ab8..1dbcee8a109 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -86,7 +86,7 @@ type Header struct { Extra []byte `json:"extraData" gencodec:"required"` MixDigest common.Hash `json:"mixHash"` Nonce BlockNonce `json:"nonce"` - BaseFee *big.Int `json:"baseFee"` + BaseFee *big.Int `json:"baseFeePerGas"` Eip1559 bool // to avoid relying on BaseFee != nil for that Seal [][]byte // AuRa POA network field WithSeal bool // to avoid relying on Seal != nil for that @@ -422,7 +422,7 @@ func (h *Header) DecodeRLP(s *rlp.Stream) error { _, err := s.List() if err != nil { return err - //return fmt.Errorf("open header struct: %w", err) + // return fmt.Errorf("open header struct: %w", err) } var b []byte if b, err = s.Bytes(); err != nil { diff --git a/core/types/transaction_marshalling.go b/core/types/transaction_marshalling.go index 398b7c1a27f..a00f5fb1924 100644 --- a/core/types/transaction_marshalling.go +++ b/core/types/transaction_marshalling.go @@ -18,8 +18,8 @@ type txJSON struct { // Common transaction fields: Nonce *hexutil.Uint64 `json:"nonce"` GasPrice *hexutil.Big `json:"gasPrice"` - FeeCap *hexutil.Big `json:"feeCap"` - Tip *hexutil.Big `json:"tip"` + FeeCap *hexutil.Big `json:"maxFeePerGas"` + Tip *hexutil.Big `json:"maxPriorityFeePerGas"` Gas *hexutil.Uint64 `json:"gas"` Value *hexutil.Big `json:"value"` Data *hexutil.Bytes `json:"input"` diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 1d3412824f4..6e5ef012a10 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -329,8 +329,8 @@ type CallArgs struct { To *common.Address `json:"to"` Gas *hexutil.Uint64 `json:"gas"` GasPrice *hexutil.Big `json:"gasPrice"` - Tip *hexutil.Big `json:"tip"` - FeeCap *hexutil.Big `json:"feeCap"` + Tip *hexutil.Big `json:"maxPriorityFeePerGas"` + FeeCap *hexutil.Big `json:"maxFeePerGas"` Value *hexutil.Big `json:"value"` Data *hexutil.Bytes `json:"data"` AccessList *types.AccessList `json:"accessList"` @@ -729,7 +729,7 @@ func FormatLogs(logs []vm.StructLog) []StructLogRes { // RPCMarshalHeader converts the given header to the RPC output . func RPCMarshalHeader(head *types.Header) map[string]interface{} { - return map[string]interface{}{ + result := map[string]interface{}{ "number": (*hexutil.Big)(head.Number), "hash": head.Hash(), "parentHash": head.ParentHash, @@ -748,6 +748,11 @@ func RPCMarshalHeader(head *types.Header) map[string]interface{} { "transactionsRoot": head.TxHash, "receiptsRoot": head.ReceiptHash, } + if head.BaseFee != nil { + result["baseFeePerGas"] = (*hexutil.Big)(head.BaseFee) + } + + return result } // RPCMarshalBlock converts the given block to the RPC output which depends on fullTx. If inclTx is true transactions are @@ -817,8 +822,8 @@ type RPCTransaction struct { From common.Address `json:"from"` Gas hexutil.Uint64 `json:"gas"` GasPrice *hexutil.Big `json:"gasPrice,omitempty"` - Tip *hexutil.Big `json:"tip,omitempty"` - FeeCap *hexutil.Big `json:"feeCap,omitempty"` + Tip *hexutil.Big `json:"maxPriorityFeePerGas,omitempty"` + FeeCap *hexutil.Big `json:"maxFeePerGas,omitempty"` Hash common.Hash `json:"hash"` Input hexutil.Bytes `json:"input"` Nonce hexutil.Uint64 `json:"nonce"`