Skip to content

Commit 2f5f2d2

Browse files
fix: Add temp logs and flag
Took 1 hour 20 minutes
1 parent 7576cd9 commit 2f5f2d2

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

src/evm/decoder.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,16 @@ where
225225
let mut contracts_map = HashMap::new();
226226
let mut msg_failed_components = HashSet::new();
227227

228+
{
229+
let state_guard = self.state.read().await;
230+
info!(
231+
" ===== [{:?}] Processing update : n states: {:?}, n components {:?}",
232+
self.registry.keys(),
233+
state_guard.states.len(),
234+
state_guard.components.len()
235+
);
236+
}
237+
228238
let header = msg
229239
.state_msgs
230240
.values()
@@ -306,6 +316,7 @@ where
306316

307317
// Remove components from state and add to removed_pairs
308318
for (id, component) in removed_components {
319+
println!("Removing component {id}");
309320
state_guard.components.remove(&id);
310321
state_guard.states.remove(&id);
311322
removed_pairs.insert(id, component);
@@ -845,6 +856,13 @@ where
845856
.extend(values);
846857
}
847858

859+
info!(
860+
" ===== [{:?}] Processed update : n states: {:?}, n components {:?}",
861+
self.registry.keys(),
862+
state_guard.states.len(),
863+
state_guard.components.len()
864+
);
865+
848866
// Send the tick with all updated states
849867
Ok(Update::new(block_number_or_timestamp, updated_states, new_pairs)
850868
.set_removed_pairs(removed_pairs)

tycho-integration-test/src/main.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ struct Cli {
100100
/// The RFQ stream will skip messages for this duration (in seconds) after processing a message
101101
#[arg(long, default_value_t = 600)]
102102
skip_messages_duration: u64,
103+
104+
/// Disable processing updates (process_update function)
105+
#[arg(long, default_value_t = false)]
106+
disable_process_update: bool,
103107
}
104108

105109
impl Debug for Cli {
@@ -217,8 +221,13 @@ async fn run(cli: Cli) -> miette::Result<()> {
217221
.into_diagnostic()
218222
.wrap_err("Failed to acquire permit")?;
219223
tokio::spawn(async move {
220-
if let Err(e) = process_update(cli, chain, rpc_tools, protocol_pairs, &update).await {
221-
warn!("{}", format_error_chain(&e));
224+
if !cli.disable_process_update {
225+
if let Err(e) = process_update(cli, chain, rpc_tools, protocol_pairs, &update).await
226+
{
227+
warn!("{}", format_error_chain(&e));
228+
}
229+
} else {
230+
info!("Skipping update {:?}", update.update.block_number_or_timestamp)
222231
}
223232
drop(permit);
224233
});

0 commit comments

Comments
 (0)