Skip to content

Commit

Permalink
fix breasking tests
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech authored and ScottyPoi committed Oct 4, 2024
1 parent f2c2206 commit 3dc4d4c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/client/src/service/txpool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,14 @@ export class TxPool {
}

pruneBlobsAndProofsCache() {
const blobGasLimit = this.config.chainCommon.param('maxblobGasPerBlock')
const blobGasPerBlob = this.config.chainCommon.param('blobGasPerBlob')
const allowedBlobs = Number(blobGasLimit / blobGasPerBlob)

// currently common.param errors when not achieved cancun hardfork to do the below calculation
// const blobGasLimit = this.config.chainCommon.param('maxblobGasPerBlock')
// const blobGasPerBlob = this.config.chainCommon.param('blobGasPerBlob')
//
// A better way could be figured out to get allowedBlobsPerBlock
const allowedBlobsPerBlock = 6
const pruneLength =
this.blobsAndProofsByHash.size - allowedBlobs * this.config.blobsAndProofsCacheBlocks
this.blobsAndProofsByHash.size - allowedBlobsPerBlock * this.config.blobsAndProofsCacheBlocks
let pruned = 0
// since keys() is sorted by insertion order this prunes the oldest data in cache
for (const versionedHash of this.blobsAndProofsByHash.keys()) {
Expand Down

0 comments on commit 3dc4d4c

Please sign in to comment.