mirror of
https://github.com/0glabs/0g-storage-node.git
synced 2024-11-20 15:05:19 +00:00
Merge pull request #2 from zero-gravity-labs/filter_address
Filter address in log sync.
This commit is contained in:
commit
877f484dd0
@ -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;
|
||||
@ -143,6 +144,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 +162,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))
|
||||
})
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit b9263529250ff1e3dde863215c1eb81e58973ff7
|
||||
Subproject commit 5d32ed0df9bd0c6e95ffe4d11e06ceed233a23af
|
Loading…
Reference in New Issue
Block a user