Skip to content

Commit 154f49c

Browse files
committed
add debug logs
1 parent 189db1e commit 154f49c

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

zkstack_cli/crates/zkstack/src/commands/chain/gateway/gateway_common.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ pub(crate) async fn get_migration_transaction(
122122
let chain_asset_handler =
123123
IChainAssetHandlerAbi::new(chain_asset_handler_addr, provider.clone());
124124

125+
logger::info(format!(
126+
"Chain Asset Handler Address: {:#?}",
127+
chain_asset_handler_addr
128+
));
129+
logger::info(format!("L2 Chain ID: {}", l2_chain_id));
130+
125131
let max_interval_to_search = Utc::now() - MAX_SEARCHING_MIGRATION_TXS_INTERVAL;
126132
let latest_tx_hash: Option<H256> = loop {
127133
let lower_bound = search_upper_bound.saturating_sub(DEFAULT_EVENTS_BLOCK_RANGE);
@@ -142,6 +148,30 @@ pub(crate) async fn get_migration_transaction(
142148
break Some(meta.transaction_hash);
143149
}
144150

151+
logger::info("No event found with the filter. Checking all events in the range...");
152+
let all_ev = chain_asset_handler
153+
.migration_started_filter()
154+
.from_block(lower_bound)
155+
.to_block(search_upper_bound);
156+
157+
match all_ev.query_with_meta().await {
158+
Ok(all_results) => {
159+
logger::info(format!(
160+
"Found {} events in total (without topic1 filter)",
161+
all_results.len()
162+
));
163+
for (event, meta) in all_results {
164+
logger::info(format!(
165+
"Event found: chain_id: {:?}, tx: {:#?}",
166+
event.chain_id, meta.transaction_hash
167+
));
168+
}
169+
}
170+
Err(e) => {
171+
logger::info(format!("Failed to query all events: {:?}", e));
172+
}
173+
}
174+
145175
if lower_bound == 0 {
146176
break None;
147177
}

0 commit comments

Comments
 (0)