Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Add 20% to gas price estimation from RPC #1226

Merged
merged 1 commit into from
Oct 25, 2022
Merged
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: 4 additions & 0 deletions contracts/rust/src/cape/submit_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ pub async fn submit_cape_block_with_memos(
.fill_transaction(&mut tx, Some(block_number.into()))
.await?;

// Increase the gas price by 20% to increase the chances for the transaction
// to be mined.
tx.set_gas_price(tx.gas_price().unwrap() * 12 / 10);

// The estimated gas cost can be too low. For example, if a deposit is made
// in an earlier transaction in the same block the estimate would not include
// the cost for crediting the deposit.
Expand Down