Skip to content

Commit

Permalink
move blob side cars to replica head
Browse files Browse the repository at this point in the history
Signed-off-by: Pranay Valson <[email protected]>
  • Loading branch information
noslav committed Mar 27, 2024
1 parent f78acef commit b0699c1
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 37 deletions.
73 changes: 40 additions & 33 deletions codec/block-ethereum.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
}
]
}
Expand Down Expand Up @@ -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"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion internal/types/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type BlockReplica struct {
Senders []common.Address
State *StateSpecimen `json:"State"`
Withdrawals []*Withdrawal
BlobTxSidecars []*BlobTxSidecar
}
type StateSpecimen struct {
AccountRead []*AccountRead
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit b0699c1

Please sign in to comment.