Skip to content

Commit 65aef0c

Browse files
committed
fix(coprocessor): fhevm-listner, disable alloy reconnection retry
alloy skips some events while reconnecting
1 parent 2651ab4 commit 65aef0c

4 files changed

Lines changed: 1 addition & 19 deletions

File tree

coprocessor/fhevm-engine/Cargo.lock

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

coprocessor/fhevm-engine/fhevm-listener/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ rustls = { workspace = true }
2626
serde = { workspace = true }
2727
sqlx = { workspace = true }
2828
tokio = { workspace = true }
29-
humantime = { workspace = true }
30-
3129

3230
# local dependencies
3331
fhevm-engine-common = { path = "../fhevm-engine-common" }

coprocessor/fhevm-engine/fhevm-listener/src/cmd/mod.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use alloy::rpc::types::{BlockNumberOrTag, Filter, Log};
1616
use alloy_sol_types::SolEventInterface;
1717

1818
use clap::Parser;
19-
use humantime::parse_duration;
2019

2120
use rustls;
2221

@@ -76,12 +75,6 @@ pub struct Args {
7675
help = "Initial block time, refined on each block"
7776
)]
7877
pub initial_block_time: u64,
79-
80-
#[arg(long, default_value = "1000000")]
81-
pub provider_max_retries: u32,
82-
83-
#[arg(long, default_value = "4s", value_parser = parse_duration)]
84-
pub provider_retry_interval: Duration,
8578
}
8679

8780
type RProvider = FillProvider<
@@ -98,9 +91,6 @@ type RProvider = FillProvider<
9891
// TODO: to merge with Levent works
9992
struct InfiniteLogIter {
10093
url: String,
101-
max_retries: u32,
102-
retry_interval: Duration,
103-
10494
block_time: u64, /* A default value that is refined with real-time
10595
* events data */
10696
no_block_immediate_recheck: bool,
@@ -149,8 +139,6 @@ impl InfiniteLogIter {
149139
current_event: None,
150140
last_block_event_count: 0,
151141
last_block_recheck_planned: 0,
152-
max_retries: args.provider_max_retries,
153-
retry_interval: args.provider_retry_interval,
154142
}
155143
}
156144

@@ -249,8 +237,7 @@ impl InfiniteLogIter {
249237
let mut retry = 20;
250238
loop {
251239
let ws = WsConnect::new(&self.url)
252-
.with_max_retries(self.max_retries)
253-
.with_retry_interval(self.retry_interval);
240+
.with_max_retries(0); // disabled, alloy skips events
254241

255242
match ProviderBuilder::new().connect_ws(ws).await {
256243
Ok(provider) => {

coprocessor/fhevm-engine/fhevm-listener/tests/integration_test.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@ async fn test_listener_restart() -> Result<(), anyhow::Error> {
168168
start_at_block: None,
169169
end_at_block: None,
170170
catchup_margin: 5,
171-
provider_max_retries: 5,
172-
provider_retry_interval: Duration::from_secs(1),
173171
};
174172

175173
// Start listener in background task

0 commit comments

Comments
 (0)