Skip to content

Commit

Permalink
Merge pull request ethereum#103 from mdehoog/opt-al2
Browse files Browse the repository at this point in the history
Optional access list in BlobTx unmarshaling
  • Loading branch information
Inphi committed Feb 9, 2023
2 parents dc1f4a3 + 3098528 commit 3584bf7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions core/types/transaction_marshalling.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -354,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 {
Expand Down

0 comments on commit 3584bf7

Please sign in to comment.