From 95ac7bdbec133bdc9e9a82d4ef54be477958858c Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Tue, 27 Feb 2024 16:23:57 +0200 Subject: [PATCH] Overestimate. --- go/enclave/rpc/EstimateGas.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/go/enclave/rpc/EstimateGas.go b/go/enclave/rpc/EstimateGas.go index c0821c4874..20708601d0 100644 --- a/go/enclave/rpc/EstimateGas.go +++ b/go/enclave/rpc/EstimateGas.go @@ -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)