Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(error): use unexpected error instead #761

Merged
merged 3 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
submodules: 'recursive'

- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@1.79.0
with:
components: llvm-tools-preview

Expand Down
11 changes: 8 additions & 3 deletions crates/pool/src/server/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,14 @@ impl LocalPoolHandle {
response: send,
})
.await
.map_err(|_| anyhow::anyhow!("LocalPoolServer closed"))?;
recv.await
.map_err(|_| anyhow::anyhow!("LocalPoolServer closed"))?
.map_err(|_| {
error!("LocalPoolServer sender closed");
PoolError::UnexpectedResponse
})?;
recv.await.map_err(|_| {
error!("LocalPoolServer receiver closed");
PoolError::UnexpectedResponse
})?
}
}

Expand Down
6 changes: 5 additions & 1 deletion crates/sim/src/gas/gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use std::{cmp, fmt::Debug, sync::Arc};

use anyhow::Context;
use anyhow::{bail, Context};
use ethers::types::U256;
use rundler_provider::{EntryPoint, L1GasProvider, Provider};
use rundler_types::{
Expand Down Expand Up @@ -84,6 +84,10 @@ pub async fn calc_required_pre_verification_gas<
op.max_fee_per_gas(),
);

if gas_price.is_zero() {
bail!("Gas price cannot be zero")
}

let dynamic_gas = entry_point
.calc_l1_gas(entry_point.address(), op.clone(), gas_price)
.await?;
Expand Down
1 change: 0 additions & 1 deletion crates/sim/src/precheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ where
) -> anyhow::Result<U256> {
gas::calc_required_pre_verification_gas(&self.chain_spec, &self.entry_point, &op, base_fee)
.await
.context("should calculate pre-verification gas")
}
}

Expand Down
Loading