Skip to content

Commit

Permalink
calculate is outside
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishqjasoria committed Dec 10, 2024
1 parent 31d5a22 commit 49b4a25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ protected virtual TransactionResult Execute(Transaction tx, in BlockExecutionCon
bool commit = opts.HasFlag(ExecutionOptions.Commit) || (!opts.HasFlag(ExecutionOptions.Warmup) && !spec.IsEip658Enabled);

TransactionResult result;
if (!(result = ValidateStatic(tx, header, spec, opts, out IntrinsicGas intrinsicGas))) return result;
IntrinsicGas intrinsicGas = IntrinsicGasCalculator.Calculate(tx, spec);
if (!(result = ValidateStatic(tx, header, spec, opts, in intrinsicGas))) return result;

UInt256 effectiveGasPrice = tx.CalculateEffectiveGasPrice(spec.IsEip1559Enabled, header.BaseFeePerGas);

Expand Down Expand Up @@ -351,9 +352,8 @@ protected virtual TransactionResult ValidateStatic(
BlockHeader header,
IReleaseSpec spec,
ExecutionOptions opts,
out IntrinsicGas intrinsicGas)
in IntrinsicGas intrinsicGas)
{
intrinsicGas = IntrinsicGasCalculator.Calculate(tx, spec);

bool validate = !opts.HasFlag(ExecutionOptions.NoValidation);

Expand Down
4 changes: 2 additions & 2 deletions src/Nethermind/Nethermind.Taiko/TaikoTransactionProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public class TaikoTransactionProcessor(
) : TransactionProcessorBase(specProvider, worldState, virtualMachine, codeInfoRepository, logManager)
{
protected override TransactionResult ValidateStatic(Transaction tx, BlockHeader header, IReleaseSpec spec, ExecutionOptions opts,
out IntrinsicGas intrinsicGas)
=> base.ValidateStatic(tx, header, spec, tx.IsAnchorTx ? opts | ExecutionOptions.NoValidation : opts, out intrinsicGas);
in IntrinsicGas intrinsicGas)
=> base.ValidateStatic(tx, header, spec, tx.IsAnchorTx ? opts | ExecutionOptions.NoValidation : opts, intrinsicGas);

protected override TransactionResult BuyGas(Transaction tx, BlockHeader header, IReleaseSpec spec, ITxTracer tracer, ExecutionOptions opts,
in UInt256 effectiveGasPrice, out UInt256 premiumPerGas, out UInt256 senderReservedGasPayment, out UInt256 blobBaseFee)
Expand Down

0 comments on commit 49b4a25

Please sign in to comment.