Skip to content

Commit

Permalink
Overestimate.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanIliev545 committed Feb 27, 2024
1 parent 5e057c6 commit 881f6f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions go/enclave/rpc/EstimateGas.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ func EstimateGasExecute(builder *CallBuilder[CallParamsWithBlock, hexutil.Uint64
// where BaseFee is bigger than the l1cost.
publishingGas = big.NewInt(0).Add(publishingGas, gethcommon.Big1)

// Overestimate the publishing cost in case of spikes.
// Batch execution still deducts normally.
// TODO: Change to fixed time period quotes, rather than this.
publishingGas = publishingGas.Mul(publishingGas, gethcommon.Big2)

executionGasEstimate, err := rpc.doEstimateGas(txArgs, blockNumber, rpc.config.GasLocalExecutionCapFlag)
if err != nil {
err = fmt.Errorf("unable to estimate transaction - %w", err)
Expand Down

0 comments on commit 881f6f5

Please sign in to comment.