Skip to content

Commit b317c75

Browse files
authored
Add logs for bid limits on amount and gas (#120)
1 parent c968561 commit b317c75

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

auction-server/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

auction-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "auction-server"
3-
version = "0.9.7"
3+
version = "0.9.8"
44
edition = "2021"
55
license-file = "license.txt"
66

auction-server/src/auction.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,13 @@ where
648648
if bid_amount >= minimum_bid_amount {
649649
Ok(())
650650
} else {
651+
tracing::info!(
652+
estimated_gas = estimated_gas.to_string(),
653+
maximum_gas_fee = maximum_gas_fee.to_string(),
654+
priority_fee = priority_fee.to_string(),
655+
minimum_bid_amount = minimum_bid_amount.to_string(),
656+
"Bid amount is too low"
657+
);
651658
Err(RestError::BadParameters(format!(
652659
"Insufficient bid amount based on the current gas fees. estimated gas usage: {}, maximum fee per gas: {}, priority fee per gas: {}, minimum bid amount: {}",
653660
estimated_gas, maximum_gas_fee, priority_fee, minimum_bid_amount
@@ -662,6 +669,11 @@ async fn verify_bid_under_gas_limit(
662669
) -> Result<(), RestError> {
663670
if chain_store.block_gas_limit < estimated_gas * multiplier {
664671
let maximum_allowed_gas = chain_store.block_gas_limit / multiplier;
672+
tracing::info!(
673+
estimated_gas = estimated_gas.to_string(),
674+
maximum_allowed_gas = maximum_allowed_gas.to_string(),
675+
"Bid gas usage is too high"
676+
);
665677
Err(RestError::BadParameters(format!(
666678
"Bid estimated gas usage is higher than maximum gas allowed. estimated gas usage: {}, maximum gas allowed: {}",
667679
estimated_gas, maximum_allowed_gas

0 commit comments

Comments
 (0)