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

fix: pick various v0.4 fixes from main #948

Open
wants to merge 4 commits into
base: release/v0.4
Choose a base branch
from
Open
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
30 changes: 28 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ tower = { version = "0.4.13", features = ["timeout"] }
tracing = "0.1.40"
strum = { version = "0.26.3", features = ["derive"] }
url = "2.5.2"
tiny_http = "0.12.0"
3 changes: 3 additions & 0 deletions bin/rundler/src/cli/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ impl BuilderArgs {
let da_gas_tracking_enabled =
super::lint_da_gas_tracking(common.da_gas_tracking_enabled, &chain_spec);

let provider_client_timeout_seconds = common.provider_client_timeout_seconds;

Ok(BuilderTaskArgs {
entry_points,
chain_spec,
Expand All @@ -358,6 +360,7 @@ impl BuilderArgs {
max_replacement_underpriced_blocks: self.max_replacement_underpriced_blocks,
remote_address,
da_gas_tracking_enabled,
provider_client_timeout_seconds,
})
}

Expand Down
9 changes: 9 additions & 0 deletions bin/rundler/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,14 @@ pub struct CommonArgs {
default_value = "false"
)]
pub da_gas_tracking_enabled: bool,

#[arg(
long = "provider_client_timeout_seconds",
name = "provider_client_timeout_seconds",
env = "PROVIDER_CLIENT_TIMEOUT_SECONDS",
default_value = "10"
)]
pub provider_client_timeout_seconds: u64,
}

const SIMULATION_GAS_OVERHEAD: u64 = 100_000;
Expand Down Expand Up @@ -594,6 +602,7 @@ pub fn construct_providers(
) -> anyhow::Result<impl Providers> {
let provider = Arc::new(rundler_provider::new_alloy_provider(
args.node_http.as_ref().context("must provide node_http")?,
args.provider_client_timeout_seconds,
)?);
let (da_gas_oracle, da_gas_oracle_sync) =
rundler_provider::new_alloy_da_gas_oracle(chain_spec, provider.clone());
Expand Down
9 changes: 8 additions & 1 deletion crates/builder/src/bundle_proposer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,11 @@ impl<UO: UserOperation> ProposalContext<UO> {

fn reject_aggregator(&mut self, address: Address) {
self.groups_by_aggregator.remove(&Some(address));
if let Some(group) = self.groups_by_aggregator.remove(&Some(address)) {
for op in group.ops_with_simulations {
self.rejected_ops.push((op.op, op.simulation.entity_infos));
}
}
}

fn reject_paymaster(&mut self, address: Address) -> Vec<Address> {
Expand All @@ -1310,6 +1315,8 @@ impl<UO: UserOperation> ProposalContext<UO> {
for op in mem::take(&mut group.ops_with_simulations) {
if !filter(&op.op) {
group.ops_with_simulations.push(op);
} else {
self.rejected_ops.push((op.op, op.simulation.entity_infos));
}
}
if group.ops_with_simulations.is_empty() {
Expand Down Expand Up @@ -1998,7 +2005,7 @@ mod tests {
},
]
);
assert_eq!(bundle.rejected_ops, vec![]);
assert_eq!(bundle.rejected_ops, vec![op1, op2, op4, op5]);
assert_eq!(
bundle.ops_per_aggregator,
vec![UserOpsPerAggregator {
Expand Down
9 changes: 7 additions & 2 deletions crates/builder/src/sender/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,17 @@ impl TransactionSenderArgs {
self,
rpc_url: &str,
signer: S,
provider_client_timeout_seconds: u64,
) -> std::result::Result<TransactionSenderEnum<impl EvmProvider, S>, SenderConstructorErrors>
{
let provider = rundler_provider::new_alloy_evm_provider(rpc_url)?;
let provider =
rundler_provider::new_alloy_evm_provider(rpc_url, provider_client_timeout_seconds)?;
let sender = match self {
Self::Raw(args) => {
let submitter = rundler_provider::new_alloy_evm_provider(&args.submit_url)?;
let submitter = rundler_provider::new_alloy_evm_provider(
&args.submit_url,
provider_client_timeout_seconds,
)?;

if args.use_submit_for_status {
TransactionSenderEnum::Raw(RawTransactionSender::new(
Expand Down
12 changes: 7 additions & 5 deletions crates/builder/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ pub struct Args {
pub entry_points: Vec<EntryPointBuilderSettings>,
/// Enable DA tracking
pub da_gas_tracking_enabled: bool,
/// Provider client timeout
pub provider_client_timeout_seconds: u64,
}

/// Builder settings for an entrypoint
Expand Down Expand Up @@ -355,11 +357,11 @@ where
da_gas_tracking_enabled: self.args.da_gas_tracking_enabled,
};

let transaction_sender = self
.args
.sender_args
.clone()
.into_sender(&self.args.rpc_url, signer)?;
let transaction_sender = self.args.sender_args.clone().into_sender(
&self.args.rpc_url,
signer,
self.args.provider_client_timeout_seconds,
)?;

let tracker_settings = transaction_tracker::Settings {
replacement_fee_percent_increase: self.args.replacement_fee_percent_increase,
Expand Down
Loading
Loading