From e236c2f70a29c8de6d8ac7f2bbf06819c9aa2082 Mon Sep 17 00:00:00 2001 From: Peilun Li Date: Tue, 16 Jan 2024 17:54:23 +0800 Subject: [PATCH 1/2] Filter address in log sync. --- node/log_entry_sync/src/sync_manager/log_entry_fetcher.rs | 3 ++- zerog-storage-client | 2 +- zerog-storage-contracts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/node/log_entry_sync/src/sync_manager/log_entry_fetcher.rs b/node/log_entry_sync/src/sync_manager/log_entry_fetcher.rs index eebf938..4eaf410 100644 --- a/node/log_entry_sync/src/sync_manager/log_entry_fetcher.rs +++ b/node/log_entry_sync/src/sync_manager/log_entry_fetcher.rs @@ -143,6 +143,7 @@ impl LogEntryFetcher { let mut filter = contract .submit_filter() .from_block(start_block_number) + .address(contract.address().into()) .filter; debug!("start_watch starts, start={}", start_block_number); let mut filter_id = @@ -160,7 +161,7 @@ impl LogEntryFetcher { { Err(e) => { error!("log sync watch error: e={:?}", e); - filter = filter.from_block(progress); + filter = filter.from_block(progress).address(contract.address()); filter_id = repeat_run_and_log(|| { provider.new_filter(FilterKind::Logs(&filter)) }) diff --git a/zerog-storage-client b/zerog-storage-client index 307f5b1..5d32ed0 160000 --- a/zerog-storage-client +++ b/zerog-storage-client @@ -1 +1 @@ -Subproject commit 307f5b17d178df643dd981d63495bb2c92455f5f +Subproject commit 5d32ed0df9bd0c6e95ffe4d11e06ceed233a23af diff --git a/zerog-storage-contracts b/zerog-storage-contracts index 171cebf..da8aa6e 160000 --- a/zerog-storage-contracts +++ b/zerog-storage-contracts @@ -1 +1 @@ -Subproject commit 171cebffffdd82bf464dea85539458bcafbd73ef +Subproject commit da8aa6ed92aaf0664855211df9370280543742dc From 986bfa412c65f083cf187d9d8977fa381c5893e2 Mon Sep 17 00:00:00 2001 From: Peilun Li Date: Wed, 17 Jan 2024 10:57:07 +0800 Subject: [PATCH 2/2] Add to start_recover. --- node/log_entry_sync/src/sync_manager/log_entry_fetcher.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node/log_entry_sync/src/sync_manager/log_entry_fetcher.rs b/node/log_entry_sync/src/sync_manager/log_entry_fetcher.rs index 4eaf410..d2cbb1f 100644 --- a/node/log_entry_sync/src/sync_manager/log_entry_fetcher.rs +++ b/node/log_entry_sync/src/sync_manager/log_entry_fetcher.rs @@ -71,6 +71,7 @@ impl LogEntryFetcher { .submit_filter() .from_block(progress) .to_block(end_block_number) + .address(contract.address().into()) .filter; let mut stream = LogQuery::new(&provider, &filter, log_query_delay) .with_page_size(log_page_size); @@ -116,7 +117,7 @@ impl LogEntryFetcher { } Err(e) => { error!("log query error: e={:?}", e); - filter = filter.from_block(progress); + filter = filter.from_block(progress).address(contract.address()); stream = LogQuery::new(&provider, &filter, log_query_delay) .with_page_size(log_page_size); tokio::time::sleep(Duration::from_millis(RETRY_WAIT_MS)).await;