Skip to content

Commit

Permalink
make explicit block number check with type
Browse files Browse the repository at this point in the history
Signed-off-by: Pranay Valson <[email protected]>
  • Loading branch information
noslav committed Mar 28, 2024
1 parent 266e19b commit 3297649
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions core/block_replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ func (bc *BlockChain) createBlockReplica(block *types.Block, replicaConfig *Repl

var blobTxSidecars []*types.BlobTxSidecar
for sidecarData := range types.BlobTxSidecarChan {
// if sidecarData.BlockNumber == block.Header().Number {
// log.Info("Consuming Sidecar From Miner Side Channel: ", sidecarData.BlockNumber)
// blobTxSidecars = append(blobTxSidecars, sidecarData.Blobs)
// } else {
// log.Info("Blob Sidecar did not match block number from Miner Side Channel: ", sidecarData.BlockNumber)
// }
if sidecarData.BlockNumber.Uint64() == block.NumberU64() {
log.Info("Consuming Sidecar From Miner Side Channel: ", sidecarData.BlockNumber)
blobTxSidecars = append(blobTxSidecars, sidecarData.Blobs)
} else {
log.Info("Blob Sidecar did not match block number from Miner Side Channel: ", sidecarData.BlockNumber.Uint64())
}
fmt.Println("side car header block number:", sidecarData.BlockNumber)
fmt.Println("length of sidecar channel:", len(types.BlobTxSidecarChan))

blobTxSidecars = append(blobTxSidecars, sidecarData.Blobs)
// blobTxSidecars = append(blobTxSidecars, sidecarData.Blobs)
}

for _, sidecarData := range blobTxSidecars {
fmt.Println(*sidecarData, "full side car")
}
// for _, sidecarData := range blobTxSidecars {
// fmt.Println(*sidecarData, "full side car")
// }

//block replica
exportBlockReplica, err := bc.createReplica(block, replicaConfig, chainConfig, stateSpecimen, blobTxSidecars)
Expand Down

0 comments on commit 3297649

Please sign in to comment.