Skip to content

Commit

Permalink
Set default min_gas_price = 50_000_000
Browse files Browse the repository at this point in the history
  • Loading branch information
icodezjb committed Nov 23, 2023
1 parent 1496a63 commit e26759a
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions client/rpc/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,24 +484,27 @@ fn fee_details(
(_, max_fee, max_priority) => {
// eip-1559
// A zero-set max fee is None.
let max_fee = if max_fee.unwrap_or_default().is_zero() {
None
} else {
max_fee
};
// Ensure `max_priority_fee_per_gas` is less or equal to `max_fee_per_gas`.
if let Some(max_priority) = max_priority {
let max_fee = max_fee.unwrap_or_default();
if max_priority > max_fee {
return Err(internal_err(format!(
"Invalid input: `max_priority_fee_per_gas` greater than `max_fee_per_gas`"
)));
}
}
// let max_fee = if max_fee.unwrap_or_default().is_zero() {
// None
// } else {
// max_fee
// };
// // Ensure `max_priority_fee_per_gas` is less or equal to `max_fee_per_gas`.
// if let Some(max_priority) = max_priority {
// let max_fee = max_fee.unwrap_or_default();
// if max_priority > max_fee {
// return Err(internal_err(format!(
// "Invalid input: `max_priority_fee_per_gas` greater than `max_fee_per_gas`"
// )));
// }
// }

// Same as T::FeeCalculator::min_gas_price();
let min_gas_price = Some(U256::from(50_000_000));
Ok(FeeDetails {
gas_price: max_fee,
max_fee_per_gas: max_fee,
max_priority_fee_per_gas: max_priority,
gas_price: min_gas_price,
max_fee_per_gas: min_gas_price,
max_priority_fee_per_gas: None,
})
}
}
Expand Down

0 comments on commit e26759a

Please sign in to comment.