-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: map l1 batch numbers to their l1 block number equivalent #113
Conversation
06885c4
to
9e30635
Compare
src/processor/snapshot/exporter.rs
Outdated
@@ -108,17 +111,17 @@ impl SnapshotExporter { | |||
.database | |||
.iterator_cf(index_to_key_map, rocksdb::IteratorMode::Start); | |||
|
|||
let chunk_size = num_logs / num_chunks as u64; | |||
let num_chunks = (num_logs / SNAPSHOT_CHUNK_SIZE as u64) + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't that produce an empty last chunk, when num_logs
is exactly divisible by SNAPSHOT_CHUNK_SIZE
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, but that println!
probably shouldn't have stayed...
@@ -232,13 +222,14 @@ impl L1Fetcher { | |||
let tx_handle = self.spawn_tx_handler( | |||
hash_rx, | |||
calldata_tx, | |||
token.clone(), | |||
self.cancellation_token.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is odd; if the cancellation token is included in L1Fetcher
, it doesn't have to be passed separately - no?
num_chunks
argument. We now use the default chunk size of1_000_000
to calculate how many chunks we need instead.