Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Oct 20, 2023
1 parent a0af6a8 commit 8fb33e1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions crates/erc20_payment_lib/src/sender/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,11 +524,16 @@ pub async fn process_transaction(
replacement_priority_fee =
tx_priority_fee_u256 * U256::from(11) / U256::from(10) + U256::from(1);

//polygon is allowing to send transactions with priority fee greater than max fee per gas
//on other networks this fix is needed
if web3_tx_dao.chain_id != 137 && replacement_priority_fee > replacement_max_fee_per_gas {
//priority fee cannot be greater than max fee per gas
replacement_priority_fee = replacement_max_fee_per_gas;
if replacement_priority_fee > replacement_max_fee_per_gas {
if web3_tx_dao.chain_id == 137 {
//polygon is allowing to send transactions with priority fee greater than max fee per gas
//no additional fixes are needed
} else {
//on other networks this fix is needed
//priority fee cannot be greater than max fee per gas
//it should cover very niche case, because almost always priority fee is lower than max fee per gas
replacement_priority_fee = replacement_max_fee_per_gas;
}
}
log::warn!(
"Replacement priority fee is bumped by 10% from {} to {}",
Expand Down

0 comments on commit 8fb33e1

Please sign in to comment.