Skip to content

Commit

Permalink
Merge pull request bnb-chain#2339 from bnb-chain/fix-with-sidecars
Browse files Browse the repository at this point in the history
fix missing block asigment WithSidecars
  • Loading branch information
MatusKysel authored Mar 26, 2024
2 parents 79cd522 + dddf20e commit eda56e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/rawdb/accessors_chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ func BenchmarkWriteAncientBlocks(b *testing.B) {
blocks := allBlocks[i : i+length]
receipts := batchReceipts[:length]
for j := 0; j < length; j++ {
blocks[i+j].WithSidecars(batchSidecars[j])
blocks[i+j] = blocks[i+j].WithSidecars(batchSidecars[j])
}
writeSize, err := WriteAncientBlocks(db, blocks, receipts, td)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion core/state/pruner/pruner.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ func (p *BlockPruner) backUpOldDb(name string, cache, handles int, namespace str
}
// if there has blobs, it needs to back up too.
blobs := rawdb.ReadRawBlobSidecars(chainDb, blockHash, blockNumber)
block.WithSidecars(blobs)
block = block.WithSidecars(blobs)
// Write into new ancient_back db.
if _, err := rawdb.WriteAncientBlocks(frdbBack, []*types.Block{block}, []types.Receipts{receipts}, td); err != nil {
log.Error("failed to write new ancient", "error", err)
Expand Down

0 comments on commit eda56e2

Please sign in to comment.