diff --git a/codec/block-ethereum.avsc b/codec/block-ethereum.avsc index 6125fb84..d8ae44ea 100644 --- a/codec/block-ethereum.avsc +++ b/codec/block-ethereum.avsc @@ -333,39 +333,6 @@ "int" ], "default":"null" - }, - { - "name":"blobTxSidecar", - "type":{ - "name":"blobTxSidecar_record", - "type":"record", - "fields":[ - { - "name":"Blobs", - "type":[ - "null", - "string" - ], - "default":"null" - }, - { - "name":"Commitments", - "type":[ - "null", - "string" - ], - "default":"null" - }, - { - "name":"Proofs", - "type":[ - "null", - "string" - ], - "default":"null" - } - ] - } } ] } @@ -608,6 +575,46 @@ } ], "default":"null" + }, + { + "name":"blobTxSidecar", + "type":[ + "null", + { + "type":"array", + "items":{ + "name":"blobTxSidecar_record", + "type":"record", + "fields":[ + { + "name":"Blobs", + "type":[ + "null", + "string" + ], + "default":"null" + }, + { + "name":"Commitments", + "type":[ + "null", + "string" + ], + "default":"null" + }, + { + "name":"Proofs", + "type":[ + "null", + "string" + ], + "default":"null" + } + ] + } + } + ], + "default":"null" } ] } diff --git a/internal/types/eth.go b/internal/types/eth.go index 23e62b15..d0faceb2 100644 --- a/internal/types/eth.go +++ b/internal/types/eth.go @@ -23,6 +23,7 @@ type BlockReplica struct { Senders []common.Address State *StateSpecimen `json:"State"` Withdrawals []*Withdrawal + BlobTxSidecars []*BlobTxSidecar } type StateSpecimen struct { AccountRead []*AccountRead @@ -89,7 +90,6 @@ type Transaction struct { BlobFeeCap *BigInt `json:"blobFeeCap" rlp:"optional"` BlobHashes []common.Hash `json:"blobHashes" rlp:"optional"` BlobGas uint64 `json:"blobGas" rlp:"optional"` - BlobTxSidecar *BlobTxSidecar `json:"blobTxSidecar" rlp:"nil,optional"` } // AccessList is an EIP-2930 access list. diff --git a/internal/utils/utils.go b/internal/utils/utils.go index 418fb498..9c4c8c7e 100644 --- a/internal/utils/utils.go +++ b/internal/utils/utils.go @@ -241,8 +241,8 @@ func UnwrapAvroUnion(data map[string]interface{}) map[string]interface{} { unwrapType(data, blobFeeCapLens, "bytes") unwrapType(data, blobHashesLens, "array") unwrapType(data, blobGasLens, "int") - - unwrapType(data, blobTxSidecarLens, "record") + + unwrapType(data, blobTxSidecarLens, "array") unwrapType(data, blobsLens, "string") unwrapType(data, commitmentsLens, "string") unwrapType(data, proofsLens, "string") @@ -280,7 +280,7 @@ func MapToAvroUnion(data map[string]interface{}) map[string]interface{} { wrapType(data, blobHashesLens, "array") wrapType(data, blobGasLens, "int") - wrapType(data, blobTxSidecarLens, "record") + wrapType(data, blobTxSidecarLens, "array") wrapType(data, blobsLens, "string") wrapType(data, commitmentsLens, "string") wrapType(data, proofsLens, "string")