starknet_committer,apollo_committer: add timers for fetch patricia paths#14189
starknet_committer,apollo_committer: add timers for fetch patricia paths#14189ArielElp wants to merge 1 commit into
Conversation
PR SummaryLow Risk Overview starknet_committer gains new starknet_committer_cli exposes an Reviewed by Cursor Bugbot for commit 0556455. Bugbot is set up for automated code reviews on this repo. Configure here. |
1f931cb to
8f9e24b
Compare
535b5e5 to
8508cca
Compare
8f9e24b to
cddd859
Compare
8508cca to
d204c67
Compare
cddd859 to
a660497
Compare
d204c67 to
b7d225e
Compare
ArielElp
left a comment
There was a problem hiding this comment.
@ArielElp made 2 comments.
Reviewable status: 2 of 7 files reviewed, 3 unresolved discussions (waiting on yoavGrs).
crates/starknet_committer/src/block_committer/commit.rs line 242 at r7 (raw file):
Previously, yoavGrs wrote…
We don't have the number of witnesses?
Yeah, it was a bug, overridden here.
I made some changes; in retrospect, the number of witnesses fetched does not fit in BlockModificationsCount, since the commit_block flow sets all these numbers once. Reintroduced the witness count in BlockMeasurement and added it to the debug log.
crates/starknet_committer_cli/src/utils_test.rs line 20 at r7 (raw file):
Previously, yoavGrs wrote…
Give an interesting value.
Refactored around it.
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs reviewed 5 files and all commit messages, made 3 comments, and resolved 2 discussions.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on ArielElp).
crates/apollo_committer/src/committer.rs line 682 at r9 (raw file):
#[allow(clippy::as_conversions)] // TODO: Consider adding fetch witnesses measurements.
You are doing it here, right?
Code quote:
// TODO: Consider adding fetch witnesses measurements.crates/starknet_committer/src/block_committer/measurements_util.rs line 134 at r9 (raw file):
pub durations: BlockDurations, pub modifications_counts: BlockModificationsCounts, pub fetched_witnesses_count: usize,
It was in BlockModificationsCounts.
I see that it's not only about the first pass now.
Suggestion:
#[cfg(feature = "os_input")]
// Number of witnesses fetched in the first pass (pre-commit).
pub fetched_witnesses_count: usize,crates/starknet_committer/src/block_committer/measurements_util.rs line 167 at r9 (raw file):
Action::FetchWitnessesSecondPass => { self.durations.fetch_witnesses_second_pass = duration_in_seconds; self.fetched_witnesses_count += entries_count;
The intersection between the witnesses in the first and second pass isn't empty...
Code quote:
self.fetched_witnesses_count += entries_count;f63e49c to
6f484b4
Compare
1010f32 to
2123cd0
Compare
6f484b4 to
e32f923
Compare
2123cd0 to
99b209d
Compare
ArielElp
left a comment
There was a problem hiding this comment.
@ArielElp made 3 comments and resolved 4 discussions.
Reviewable status: 6 of 7 files reviewed, 4 unresolved discussions (waiting on yoavGrs).
crates/apollo_committer/src/committer.rs line 682 at r9 (raw file):
Previously, yoavGrs wrote…
You are doing it here, right?
It only goes to the log, no dedicated metric
crates/starknet_committer/src/block_committer/measurements_util.rs line 134 at r9 (raw file):
Previously, yoavGrs wrote…
It was in
BlockModificationsCounts.
I see that it's not only about the first pass now.
Reintroduced
crates/starknet_committer/src/block_committer/measurements_util.rs line 167 at r9 (raw file):
Previously, yoavGrs wrote…
The intersection between the witnesses in the first and second pass isn't empty...
Right... reverting to the previous state (two counts won't be very informative ATM, unless I do something a bit more sophisticated than .len)
99b209d to
fdd5e5d
Compare
| #[cfg(feature = "os_input")] | ||
| Action::FetchWitnessesSecondPass => { | ||
| self.durations.fetch_witnesses_second_pass = duration_in_seconds; | ||
| } |
There was a problem hiding this comment.
Second pass witness count silently discarded in measurement
Low Severity
The FetchWitnessesSecondPass handler in update_after_action records the duration but does not accumulate entries_count into fetched_witnesses_count, unlike FetchWitnessesFirstPass. The caller passes proof_after.len() as the entry count, but it's silently ignored. The log then reports "witness entries" using fetched_witnesses_count, which only reflects the first pass, making the logged metric misleading.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit fdd5e5d. Configure here.
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs made 2 comments and resolved 2 discussions.
Reviewable status: 5 of 7 files reviewed, 3 unresolved discussions (waiting on ArielElp).
crates/starknet_committer/src/block_committer/measurements_util.rs line 134 at r9 (raw file):
Previously, ArielElp wrote…
Reintroduced
With the feature flag
crates/starknet_committer/src/block_committer/measurements_util.rs line 167 at r9 (raw file):
Previously, ArielElp wrote…
Right... reverting to the previous state (two counts won't be very informative ATM, unless I do something a bit more sophisticated than
.len)
You can take the length of the union of the witness sets, but I'm fine with taking the first one.
fdd5e5d to
701d19d
Compare
e32f923 to
48a282a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 7 total unresolved issues (including 6 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 701d19d. Configure here.
48a282a to
0c257d7
Compare
701d19d to
0556455
Compare
ArielElp
left a comment
There was a problem hiding this comment.
@ArielElp resolved 3 discussions.
Reviewable status: 4 of 7 files reviewed, 1 unresolved discussion (waiting on yoavGrs).
ArielElp
left a comment
There was a problem hiding this comment.
@ArielElp made 1 comment.
Reviewable status: 4 of 7 files reviewed, 1 unresolved discussion (waiting on yoavGrs).
crates/starknet_committer/src/block_committer/measurements_util.rs line 134 at r9 (raw file):
Previously, yoavGrs wrote…
With the feature flag
Done.
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs reviewed 3 files and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ArielElp and dorimedini-starkware).
crates/starknet_committer/src/patricia_merkle_tree/types.rs line 72 at r13 (raw file):
self.classes_trie_proof.len() + self.contracts_trie_proof.nodes.len() + self.contracts_trie_proof.leaves.len()
You did both modifications. Does clippy complain if you rename it back to len?
Code quote:
pub fn get_nodes_count(&self) -> usize {
self.classes_trie_proof.len()
+ self.contracts_trie_proof.nodes.len()
+ self.contracts_trie_proof.leaves.len()


No description provided.