Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
marcindsobczak committed Jan 29, 2025
1 parent 9166df1 commit d68ea29
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/Nethermind/Nethermind.Core/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ private void ClearPreHashInternal()
/// <summary>
/// Encoded transaction length
/// </summary>
public int GetLength(ITransactionSizeCalculator sizeCalculator, bool shouldCountBlobs)
public int GetLength(ITransactionSizeCalculator sizeCalculator)
{
return _size ??= sizeCalculator.GetLength(this, shouldCountBlobs);
return _size ??= sizeCalculator.GetLength(this);
}

public string ToShortString()
Expand Down Expand Up @@ -334,7 +334,7 @@ public class SystemTransaction : Transaction
/// <remarks>Created because of cyclic dependencies between Core and Rlp modules</remarks>
public interface ITransactionSizeCalculator
{
int GetLength(Transaction tx, bool shouldCountBlobs = true);
int GetLength(Transaction tx);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ public NetworkTransactionSizeCalculator(TxDecoder txDecoder)
_txDecoder = txDecoder;
}

public int GetLength(Transaction tx, bool shouldCountBlobs)
public int GetLength(Transaction tx)
{
return shouldCountBlobs
? _txDecoder.GetLength(tx, RlpBehaviors.InMempoolForm | RlpBehaviors.SkipTypedWrapping)
: _txDecoder.GetLength(tx, RlpBehaviors.SkipTypedWrapping);
return _txDecoder.GetLength(tx, RlpBehaviors.InMempoolForm | RlpBehaviors.SkipTypedWrapping);
}
}
4 changes: 2 additions & 2 deletions src/Nethermind/Nethermind.TxPool/TransactionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public static class TransactionExtensions
private static readonly long MaxSizeOfTxForBroadcast = 4.KiB(); //4KB, as in Geth https://github.com/ethereum/go-ethereum/pull/27618
private static readonly ITransactionSizeCalculator _transactionSizeCalculator = new NetworkTransactionSizeCalculator(TxDecoder.Instance);

public static int GetLength(this Transaction tx, bool shouldCountBlobs = true)
public static int GetLength(this Transaction tx)
{
return tx.GetLength(_transactionSizeCalculator, shouldCountBlobs);
return tx.GetLength(_transactionSizeCalculator);
}

public static bool CanPayBaseFee(this Transaction tx, UInt256 currentBaseFee) => tx.MaxFeePerGas >= currentBaseFee;
Expand Down

0 comments on commit d68ea29

Please sign in to comment.