@@ -10,10 +10,10 @@ import (
1010 builderApiV1 "github.com/attestantio/go-builder-client/api/v1"
1111 "github.com/attestantio/go-eth2-client/spec/bellatrix"
1212 "github.com/attestantio/go-eth2-client/spec/capella"
13+ "github.com/attestantio/go-eth2-client/spec/deneb"
1314 "github.com/attestantio/go-eth2-client/spec/phase0"
1415 ssz "github.com/ferranbt/fastssz"
1516 boostSsz "github.com/flashbots/go-boost-utils/ssz"
16- "github.com/holiman/uint256"
1717)
1818
1919var (
@@ -194,8 +194,8 @@ type BuilderGetValidatorsResponseEntry struct {
194194
195195type BidTraceV2 struct {
196196 builderApiV1.BidTrace
197- BlockNumber uint64 `db:"block_number" json:"block_number,string"`
198- NumTx uint64 `db:"num_tx" json:"num_tx,string"`
197+ BlockNumber uint64 `db:"block_number" json:"block_number,string"`
198+ NumTx uint64 `db:"num_tx" json:"num_tx,string"`
199199}
200200
201201type BidTraceV2JSON struct {
@@ -326,25 +326,93 @@ func (b *BidTraceV2WithTimestampJSON) ToCSVRecord() []string {
326326 }
327327}
328328
329+ type BidTraceV2WithBlobFields struct {
330+ builderApiV1.BidTrace
331+ BlockNumber uint64 `db:"block_number" json:"block_number,string"`
332+ NumTx uint64 `db:"num_tx" json:"num_tx,string"`
333+ NumBlobs uint64 `db:"num_blobs" json:"num_blobs,string"`
334+ BlobGasUsed uint64 `db:"blob_gas_used" json:"blob_gas_used,string"`
335+ ExcessBlobGas uint64 `db:"excess_blob_gas" json:"excess_blob_gas,string"`
336+ }
337+
338+ type BidTraceV2WithBlobFieldsJSON struct {
339+ Slot uint64 `json:"slot,string"`
340+ ParentHash string `json:"parent_hash"`
341+ BlockHash string `json:"block_hash"`
342+ BuilderPubkey string `json:"builder_pubkey"`
343+ ProposerPubkey string `json:"proposer_pubkey"`
344+ ProposerFeeRecipient string `json:"proposer_fee_recipient"`
345+ GasLimit uint64 `json:"gas_limit,string"`
346+ GasUsed uint64 `json:"gas_used,string"`
347+ Value string `json:"value"`
348+ NumTx uint64 `json:"num_tx,string"`
349+ BlockNumber uint64 `json:"block_number,string"`
350+ NumBlobs uint64 `json:"num_blobs,string"`
351+ BlobGasUsed uint64 `json:"blob_gas_used,string"`
352+ ExcessBlobGas uint64 `json:"excess_blob_gas,string"`
353+ }
354+
355+ func (b BidTraceV2WithBlobFields ) MarshalJSON () ([]byte , error ) {
356+ return json .Marshal (& BidTraceV2WithBlobFieldsJSON {
357+ Slot : b .Slot ,
358+ ParentHash : b .ParentHash .String (),
359+ BlockHash : b .BlockHash .String (),
360+ BuilderPubkey : b .BuilderPubkey .String (),
361+ ProposerPubkey : b .ProposerPubkey .String (),
362+ ProposerFeeRecipient : b .ProposerFeeRecipient .String (),
363+ GasLimit : b .GasLimit ,
364+ GasUsed : b .GasUsed ,
365+ Value : b .Value .ToBig ().String (),
366+ NumTx : b .NumTx ,
367+ BlockNumber : b .BlockNumber ,
368+ NumBlobs : b .NumBlobs ,
369+ BlobGasUsed : b .BlobGasUsed ,
370+ ExcessBlobGas : b .ExcessBlobGas ,
371+ })
372+ }
373+
374+ func (b * BidTraceV2WithBlobFields ) UnmarshalJSON (data []byte ) error {
375+ params := & struct {
376+ NumTx uint64 `json:"num_tx,string"`
377+ BlockNumber uint64 `json:"block_number,string"`
378+ NumBlobs uint64 `json:"num_blobs,string"`
379+ BlobGasUsed uint64 `json:"blob_gas_used,string"`
380+ ExcessBlobGas uint64 `json:"excess_blob_gas,string"`
381+ }{}
382+ err := json .Unmarshal (data , params )
383+ if err != nil {
384+ return err
385+ }
386+ b .NumTx = params .NumTx
387+ b .BlockNumber = params .BlockNumber
388+ b .NumBlobs = params .NumBlobs
389+ b .BlobGasUsed = params .BlobGasUsed
390+ b .ExcessBlobGas = params .ExcessBlobGas
391+
392+ bidTrace := new (builderApiV1.BidTrace )
393+ err = json .Unmarshal (data , bidTrace )
394+ if err != nil {
395+ return err
396+ }
397+ b .BidTrace = * bidTrace
398+ return nil
399+ }
400+
329401type BlockSubmissionInfo struct {
330402 BidTrace * builderApiV1.BidTrace
331- Slot uint64
332- BlockHash phase0.Hash32
333- ParentHash phase0.Hash32
334403 ExecutionPayloadBlockHash phase0.Hash32
335404 ExecutionPayloadParentHash phase0.Hash32
336- Builder phase0.BLSPubKey
337- Proposer phase0.BLSPubKey
338- ProposerFeeRecipient bellatrix.ExecutionAddress
339405 GasUsed uint64
340406 GasLimit uint64
341407 Timestamp uint64
342408 BlockNumber uint64
343- Value * uint256.Int
344409 PrevRandao phase0.Hash32
345410 Signature phase0.BLSSignature
346411 Transactions []bellatrix.Transaction
347412 Withdrawals []* capella.Withdrawal
413+ Blobs []deneb.Blob
414+ BlobGasUsed uint64
415+ ExcessBlobGas uint64
348416}
349417
350418/*
0 commit comments