From 0d381ece9fd40343a818783e900bc29991c7d8e8 Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Fri, 19 Dec 2025 18:38:23 +0800 Subject: [PATCH] core/types, internal/ethapi: fixes for prague RPC encoding #30926 (#1839) --- core/types/gen_authorization.go | 16 ++++++++-------- core/types/tx_setcode.go | 2 ++ internal/ethapi/transaction_args.go | 1 + 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/types/gen_authorization.go b/core/types/gen_authorization.go index 0d5ae865dc..460f9c4eb3 100644 --- a/core/types/gen_authorization.go +++ b/core/types/gen_authorization.go @@ -20,16 +20,16 @@ func (a Authorization) MarshalJSON() ([]byte, error) { Address common.Address `json:"address" gencodec:"required"` Nonce hexutil.Uint64 `json:"nonce" gencodec:"required"` V hexutil.Uint64 `json:"v" gencodec:"required"` - R uint256.Int `json:"r" gencodec:"required"` - S uint256.Int `json:"s" gencodec:"required"` + R hexutil.U256 `json:"r" gencodec:"required"` + S hexutil.U256 `json:"s" gencodec:"required"` } var enc Authorization enc.ChainID = hexutil.Uint64(a.ChainID) enc.Address = a.Address enc.Nonce = hexutil.Uint64(a.Nonce) enc.V = hexutil.Uint64(a.V) - enc.R = a.R - enc.S = a.S + enc.R = hexutil.U256(a.R) + enc.S = hexutil.U256(a.S) return json.Marshal(&enc) } @@ -40,8 +40,8 @@ func (a *Authorization) UnmarshalJSON(input []byte) error { Address *common.Address `json:"address" gencodec:"required"` Nonce *hexutil.Uint64 `json:"nonce" gencodec:"required"` V *hexutil.Uint64 `json:"v" gencodec:"required"` - R *uint256.Int `json:"r" gencodec:"required"` - S *uint256.Int `json:"s" gencodec:"required"` + R *hexutil.U256 `json:"r" gencodec:"required"` + S *hexutil.U256 `json:"s" gencodec:"required"` } var dec Authorization if err := json.Unmarshal(input, &dec); err != nil { @@ -66,10 +66,10 @@ func (a *Authorization) UnmarshalJSON(input []byte) error { if dec.R == nil { return errors.New("missing required field 'r' for Authorization") } - a.R = *dec.R + a.R = uint256.Int(*dec.R) if dec.S == nil { return errors.New("missing required field 's' for Authorization") } - a.S = *dec.S + a.S = uint256.Int(*dec.S) return nil } diff --git a/core/types/tx_setcode.go b/core/types/tx_setcode.go index 1063f1394e..a9c3ed9620 100644 --- a/core/types/tx_setcode.go +++ b/core/types/tx_setcode.go @@ -83,6 +83,8 @@ type authorizationMarshaling struct { ChainID hexutil.Uint64 Nonce hexutil.Uint64 V hexutil.Uint64 + R hexutil.U256 + S hexutil.U256 } // SignAuth signs the provided authorization. diff --git a/internal/ethapi/transaction_args.go b/internal/ethapi/transaction_args.go index 770cb27973..d41b74a646 100644 --- a/internal/ethapi/transaction_args.go +++ b/internal/ethapi/transaction_args.go @@ -344,6 +344,7 @@ func (args *TransactionArgs) ToMessage(b AccountBackend, baseFee *big.Int, skipN GasTipCap: gasTipCap, Data: args.data(), AccessList: accessList, + AuthList: args.AuthorizationList, SkipNonceChecks: skipNonceCheck, SkipFromEOACheck: skipEoACheck, }