From 2a87ce61f6a6df0223d2a169fe78f30af72d3852 Mon Sep 17 00:00:00 2001 From: inphi Date: Wed, 8 Feb 2023 13:29:31 -0500 Subject: [PATCH 1/2] Optional access list in BlobTx unmarshaling --- core/types/transaction_marshalling.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/types/transaction_marshalling.go b/core/types/transaction_marshalling.go index 0a4e7cc778de..4bb8773f6f22 100644 --- a/core/types/transaction_marshalling.go +++ b/core/types/transaction_marshalling.go @@ -296,11 +296,12 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error { case BlobTxType: var itx SignedBlobTx inner = &itx - // Access list should always be non-nil - if dec.AccessList == nil { - return errors.New("found nil access list in blob tx") + // Access list is optional for now + if dec.AccessList != nil { + itx.Message.AccessList = AccessListView(*dec.AccessList) + } else { + itx.Message.AccessList = AccessListView(AccessList{}) } - itx.Message.AccessList = AccessListView(*dec.AccessList) if dec.ChainID == nil { return errors.New("missing required field 'chainId' in transaction") } From 3098528198e7a2c14e2aac0593bf40e73fc3d33d Mon Sep 17 00:00:00 2001 From: inphi Date: Thu, 9 Feb 2023 11:09:19 -0500 Subject: [PATCH 2/2] Require blobVersionedHashes in tx MarshalJSON --- core/types/transaction_marshalling.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/types/transaction_marshalling.go b/core/types/transaction_marshalling.go index 4bb8773f6f22..6dd7a3ea8701 100644 --- a/core/types/transaction_marshalling.go +++ b/core/types/transaction_marshalling.go @@ -355,6 +355,9 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error { return errors.New("missing required field 'maxFeePerDataGas' for txdata") } itx.Message.MaxFeePerDataGas.SetFromBig((*big.Int)(dec.MaxFeePerDataGas)) + if dec.BlobVersionedHashes == nil { + return errors.New("missing required field 'blobVersionedHashes' in transaction") + } itx.Message.BlobVersionedHashes = dec.BlobVersionedHashes // A BlobTx may not contain data if len(dec.Blobs) != 0 || len(dec.BlobKzgs) != 0 {