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

Commit

Permalink
Add 20% to gas price estimation from RPC (#1226)
Browse files Browse the repository at this point in the history
This should make it unlikely that our transactions are ignored.
  • Loading branch information
sveitser authored Oct 25, 2022
1 parent b386bbc commit 2fdf147
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit 2fdf147

Please sign in to comment.