diff --git a/core/types/transaction_marshalling.go b/core/types/transaction_marshalling.go index 8602e1a83f1a..137ac2febc98 100644 --- a/core/types/transaction_marshalling.go +++ b/core/types/transaction_marshalling.go @@ -52,7 +52,7 @@ type txJSON struct { Hash common.Hash `json:"hash"` // L1 message transaction fields: - Sender common.Address `json:"sender,omitempty"` + Sender *common.Address `json:"sender,omitempty"` QueueIndex *hexutil.Uint64 `json:"queueIndex,omitempty"` } @@ -130,6 +130,14 @@ func (tx *Transaction) MarshalJSON() ([]byte, error) { yparity := itx.V.Uint64() enc.YParity = (*hexutil.Uint64)(&yparity) + case *L1MessageTx: + enc.QueueIndex = (*hexutil.Uint64)(&itx.QueueIndex) + enc.Gas = (*hexutil.Uint64)(&itx.Gas) + enc.To = tx.To() + enc.Value = (*hexutil.Big)(itx.Value) + enc.Input = (*hexutil.Bytes)(&itx.Data) + enc.Sender = &itx.Sender + case *BlobTx: enc.ChainID = (*hexutil.Big)(itx.ChainID.ToBig()) enc.Nonce = (*hexutil.Uint64)(&itx.Nonce) @@ -425,7 +433,10 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error { return errors.New("missing required field 'input' in transaction") } itx.Data = *dec.Input - itx.Sender = dec.Sender + if dec.Sender == nil { + return errors.New("missing required field 'sender' in transaction") + } + itx.Sender = *dec.Sender default: return ErrTxTypeNotSupported diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 9b3925ca6237..a9198a031494 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1294,7 +1294,7 @@ type RPCTransaction struct { S *hexutil.Big `json:"s"` // L1 message transaction fields: - Sender common.Address `json:"sender,omitempty"` + Sender *common.Address `json:"sender,omitempty"` QueueIndex *hexutil.Uint64 `json:"queueIndex,omitempty"` } @@ -1344,7 +1344,7 @@ func NewRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber } case types.L1MessageTxType: msg := tx.AsL1MessageTx() - result.Sender = msg.Sender + result.Sender = &msg.Sender result.QueueIndex = (*hexutil.Uint64)(&msg.QueueIndex) } return result diff --git a/params/version.go b/params/version.go index 0fa8fd5f9552..e9366e4fa4fc 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major version component of the current release VersionMinor = 1 // Minor version component of the current release - VersionPatch = 19 // Patch version component of the current release + VersionPatch = 20 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string )