Skip to content

Commit

Permalink
fix saving of processed blob txs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcindsobczak committed Nov 3, 2023
1 parent 201f590 commit 7c2c556
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
3 changes: 1 addition & 2 deletions src/Nethermind/Nethermind.TxPool/NullBlobTxStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ public bool TryGetBlobTransactionsFromBlock(long blockNumber, out Transaction[]?

public void AddBlobTransactionsFromBlock(long blockNumber, IList<Transaction> blockBlobTransactions) { }

public void DeleteBlobTransactionsFromBlock(long blockNumber)
{ }
public void DeleteBlobTransactionsFromBlock(long blockNumber) { }
}
29 changes: 16 additions & 13 deletions src/Nethermind/Nethermind.TxPool/TxPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,30 +265,33 @@ private void RemoveProcessedTransactions(Block block)

for (int i = 0; i < blockTransactions.Length; i++)
{
Transaction transaction = blockTransactions[i];
Hash256 txHash = transaction.Hash ?? throw new ArgumentException("Hash was unexpectedly null!");
Transaction blockTx = blockTransactions[i];
Hash256 txHash = blockTx.Hash ?? throw new ArgumentException("Hash was unexpectedly null!");

if (!IsKnown(txHash))
if (blockTx.Supports1559)
{
discoveredForHashCache++;
eip1559Txs++;
}

if (!RemoveIncludedTransaction(transaction))
if (blockTx.SupportsBlobs)
{
discoveredForPendingTxs++;
blobs += blockTx.BlobVersionedHashes?.Length ?? 0;

if (_blobTransactions.TryGetValue(blockTx.Hash, out Transaction? fullBlobTx))
{
blobTxs ??= new List<Transaction>(Eip4844Constants.GetMaxBlobsPerBlock());
blobTxs.Add(fullBlobTx);
}
}

if (transaction.Supports1559)
if (!IsKnown(txHash))
{
eip1559Txs++;
discoveredForHashCache++;
}

if (transaction.SupportsBlobs)
if (!RemoveIncludedTransaction(blockTx))
{
blobTxs ??= new List<Transaction>(Eip4844Constants.GetMaxBlobsPerBlock());
blobTxs.Add(transaction);

blobs += transaction.BlobVersionedHashes?.Length ?? 0;
discoveredForPendingTxs++;
}
}

Expand Down

0 comments on commit 7c2c556

Please sign in to comment.