Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ethstorage/miner/l1_mining_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ func (m *l1MiningAPI) SubmitMinedResult(ctx context.Context, contract common.Add
return common.Hash{}, errDropped{reason: errMessage}
}

estimatedGas, err := m.EstimateGas(ctx, ethereum.CallMsg{
estimatedGas, err := m.EstimateGasAtBlock(ctx, ethereum.CallMsg{
From: cfg.SignerAddr,
To: &contract,
GasTipCap: tip,
GasFeeCap: gasFeeCap,
Value: common.Big0,
Data: calldata,
})
}, big.NewInt(rpc.PendingBlockNumber.Int64()))
if err != nil {
errMessage := parseErr(err)
m.lg.Error("Estimate gas failed", "error", errMessage)
Expand Down
7 changes: 0 additions & 7 deletions ethstorage/miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,6 @@ func (w *worker) resultLoop() {
continue
}
w.lg.Info("Mining result loop get result", "shard", result.startShardId, "block", result.blockNumber, "nonce", result.nonce)

// Mining result comes within the same block time window
if tillNextSlot := int64(result.timestamp) + int64(w.config.Slot) - time.Now().Unix(); tillNextSlot > 0 {
// Wait until next block comes to avoid empty blockhash on gas estimation
w.lg.Info("Hold on submitting mining result till block+1", "block", result.blockNumber, "secondsToWait", tillNextSlot)
time.Sleep(time.Duration(tillNextSlot) * time.Second)
}
txHash, err := w.l1API.SubmitMinedResult(
context.Background(),
w.storageMgr.ContractAddress(),
Expand Down
Loading