Skip to content

apollo_committer: add new request handler#14003

Merged
ArielElp merged 1 commit into
mainfrom
ariel/add_request_handler
Jun 3, 2026
Merged

apollo_committer: add new request handler#14003
ArielElp merged 1 commit into
mainfrom
ariel/add_request_handler

Conversation

@ArielElp

@ArielElp ArielElp commented May 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

ArielElp commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ArielElp ArielElp force-pushed the ariel/add_request_handler branch from 3bb9c52 to cd31e55 Compare May 7, 2026 12:40
@ArielElp ArielElp force-pushed the ariel/revert_logic branch from b6af15b to cc78b2a Compare May 7, 2026 12:40
@ArielElp ArielElp force-pushed the ariel/add_request_handler branch from cd31e55 to 1525ea7 Compare May 14, 2026 08:43
@ArielElp ArielElp force-pushed the ariel/revert_logic branch from cc78b2a to 168b164 Compare May 14, 2026 08:43
@ArielElp ArielElp force-pushed the ariel/add_request_handler branch 2 times, most recently from bc9526b to 7f3cc68 Compare May 18, 2026 13:52
@ArielElp ArielElp force-pushed the ariel/revert_logic branch from 2e6e8c8 to 10eb928 Compare May 18, 2026 13:52
@ArielElp ArielElp force-pushed the ariel/add_request_handler branch from 7f3cc68 to e791353 Compare May 19, 2026 06:55
@ArielElp ArielElp force-pushed the ariel/revert_logic branch from 256a296 to ec63490 Compare May 19, 2026 07:08
@ArielElp ArielElp force-pushed the ariel/add_request_handler branch from e791353 to b63892f Compare May 19, 2026 07:08
@ArielElp ArielElp marked this pull request as ready for review May 19, 2026 07:08
@ArielElp ArielElp force-pushed the ariel/add_request_handler branch from fa8519b to b5a5268 Compare May 27, 2026 09:45
@ArielElp ArielElp force-pushed the graphite-base/14003 branch from e720964 to 9c253a8 Compare May 27, 2026 09:45
@ArielElp ArielElp changed the base branch from graphite-base/14003 to ariel/test_revert_flow_with_witnesses May 27, 2026 09:46
@ArielElp ArielElp force-pushed the ariel/test_revert_flow_with_witnesses branch from 9c253a8 to 8a3d6fb Compare May 27, 2026 11:52
@ArielElp ArielElp force-pushed the ariel/add_request_handler branch from b5a5268 to 20bdbc6 Compare May 27, 2026 11:52
Comment thread crates/apollo_committer_types/src/committer_types.rs
Comment thread crates/apollo_committer/src/communication.rs

@yoavGrs yoavGrs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yoavGrs reviewed 2 files and made 1 comment.
Reviewable status: 4 of 6 files reviewed, 3 unresolved discussions (waiting on ArielElp).


crates/apollo_committer_types/src/communication.rs line 68 at r5 (raw file):

    RevertBlock(RevertBlockRequest),
    #[cfg(feature = "os_input")]
    ReadPathsAndCommitBlock(ReadPathsAndCommitBlockRequest),

Consider not adding a new variant, as the committer blocks commit_block API under os_input.

Code quote:

    #[cfg(feature = "os_input")]
    ReadPathsAndCommitBlock(ReadPathsAndCommitBlockRequest),

@yoavGrs yoavGrs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yoavGrs made 1 comment.
Reviewable status: 2 of 7 files reviewed, 2 unresolved discussions (waiting on ArielElp).


crates/apollo_committer_types/src/communication.rs line 68 at r5 (raw file):

Previously, yoavGrs wrote…

Consider not adding a new variant, as the committer blocks commit_block API under os_input.

Or set the commit block under not "os_input". WDYT?

@dorimedini-starkware dorimedini-starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dorimedini-starkware reviewed 7 files and all commit messages, and made 5 comments.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on ArielElp and yoavGrs).


crates/apollo_committer_types/src/communication.rs line 68 at r5 (raw file):

Previously, yoavGrs wrote…

Or set the commit block under not "os_input". WDYT?

yes please, commented above also


crates/apollo_committer/Cargo.toml line 20 at r7 (raw file):

async-trait.workspace = true
starknet_api.workspace = true
starknet_committer = { workspace = true, features = ["os_input"] }

NO
this activates the feature in production!!

Code quote:

starknet_committer = { workspace = true, features = ["os_input"] }

crates/apollo_committer/src/communication.rs line 25 at r7 (raw file):

    for Committer<S, ForestDB>
where
    ForestDB: ForestStorageWithEmptyReadContext<Storage = S> + ForestWriterWithMetadataAndWitnesses,

if the os_input feature is off, why add the ForestWriterWithMetadataAndWitnesses bound?

Code quote:

#[cfg(not(feature = "os_input"))]
#[async_trait]
impl<S: StorageConstructor, ForestDB> ComponentRequestHandler<CommitterRequest, CommitterResponse>
    for Committer<S, ForestDB>
where
    ForestDB: ForestStorageWithEmptyReadContext<Storage = S> + ForestWriterWithMetadataAndWitnesses,

crates/apollo_committer/src/communication.rs line 59 at r7 (raw file):

                    self.read_paths_and_commit_block(req).await,
                )
            }

@yoavGrs @ArielElp IIRC we said that, if the os_input feature is active, CommitBlock is replaced by ReadPathsAndCommitBlock. we shouldn't allow both

Code quote:

            CommitterRequest::CommitBlock(commit_block_request) => {
                CommitterResponse::CommitBlock(self.commit_block(commit_block_request).await)
            }
            CommitterRequest::RevertBlock(revert_block_request) => {
                CommitterResponse::RevertBlock(self.revert_block(revert_block_request).await)
            }
            CommitterRequest::ReadPathsAndCommitBlock(req) => {
                CommitterResponse::ReadPathsAndCommitBlock(
                    self.read_paths_and_commit_block(req).await,
                )
            }

crates/apollo_committer_types/src/communication.rs line 80 at r7 (raw file):

    RevertBlock(CommitterResult<RevertBlockResponse>),
    #[cfg(feature = "os_input")]
    ReadPathsAndCommitBlock(CommitterResult<ReadPathsAndCommitBlockResponse>),

Suggestion:

    #[cfg(not(feature = "os_input"))]
    CommitBlock(CommitterResult<CommitBlockResponse>),
    RevertBlock(CommitterResult<RevertBlockResponse>),
    #[cfg(feature = "os_input")]
    ReadPathsAndCommitBlock(CommitterResult<ReadPathsAndCommitBlockResponse>),

@yoavGrs yoavGrs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yoavGrs made 1 comment.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on ArielElp).


crates/apollo_committer/src/communication.rs line 59 at r7 (raw file):

Previously, dorimedini-starkware wrote…

@yoavGrs @ArielElp IIRC we said that, if the os_input feature is active, CommitBlock is replaced by ReadPathsAndCommitBlock. we shouldn't allow both

In the last team sync, we said that ReadPathsAndCommitBlock is for desicion_reached, and CommitBlock is for syncing.

@dorimedini-starkware dorimedini-starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dorimedini-starkware resolved 2 discussions.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on ArielElp).

@ArielElp ArielElp left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ArielElp made 3 comments.
Reviewable status: 3 of 7 files reviewed, 4 unresolved discussions (waiting on dorimedini-starkware).


crates/apollo_committer/src/communication.rs line 25 at r7 (raw file):

Previously, dorimedini-starkware wrote…

if the os_input feature is off, why add the ForestWriterWithMetadataAndWitnesses bound?

doesn't seem to make sense, reverted

(maybe it used to make sense in some earlier version of the stack when I tried to revert via write_with_metadata_and_witnesses always)


crates/apollo_committer/Cargo.toml line 20 at r7 (raw file):

Previously, dorimedini-starkware wrote…

NO
this activates the feature in production!!

Ups, reverted.


crates/apollo_committer_types/src/communication.rs line 80 at r7 (raw file):

    RevertBlock(CommitterResult<RevertBlockResponse>),
    #[cfg(feature = "os_input")]
    ReadPathsAndCommitBlock(CommitterResult<ReadPathsAndCommitBlockResponse>),

pending resolution to the previous comment

@dorimedini-starkware dorimedini-starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dorimedini-starkware reviewed 4 files and all commit messages, made 1 comment, and resolved 4 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on ArielElp).

Comment thread crates/apollo_committer/src/communication.rs

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ 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 65ddea4. Configure here.

Comment thread crates/apollo_committer/src/communication.rs

@dorimedini-starkware dorimedini-starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dorimedini-starkware reviewed 4 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on ArielElp).


crates/apollo_batcher/src/commitment_manager/commitment_manager_impl.rs line 560 at r10 (raw file):

                         milliseconds."
                    );
                }

hmmmm I would reuse the same metrics for CommitBlock here, with a TODO to create separate metrics if and when the os_input feature reaches production

Code quote:

                #[cfg(feature = "os_input")]
                CommitterRequestLabelValue::ReadPathsAndCommitBlock => {
                    debug!(
                        "Read paths and commit block latency for block {height}: {task_duration} \
                         milliseconds."
                    );
                }

crates/apollo_batcher/src/commitment_manager/types.rs line 132 at r10 (raw file):

            #[cfg(feature = "os_input")]
            CommitterRequestLabelValue::ReadPathsAndCommitBlock => return None,
        };

see above: why not reuse the timer for commit? we won't be mixing the two, right? once we sync, its read-paths-and-commit forever?

Code quote:

            #[cfg(feature = "os_input")]
            CommitterRequestLabelValue::ReadPathsAndCommitBlock => {}
        }
    }

    /// Returns the duration of the task in milliseconds.
    pub(crate) fn stop_timer(
        &mut self,
        task: CommitterRequestLabelValue,
        height: BlockNumber,
    ) -> Option<u128> {
        let map = match task {
            CommitterRequestLabelValue::CommitBlock => &mut self.commit,
            CommitterRequestLabelValue::RevertBlock => &mut self.revert,
            #[cfg(feature = "os_input")]
            CommitterRequestLabelValue::ReadPathsAndCommitBlock => return None,
        };

@ArielElp ArielElp left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ArielElp made 2 comments and resolved 1 discussion.
Reviewable status: 9 of 11 files reviewed, 2 unresolved discussions (waiting on dorimedini-starkware).


crates/apollo_batcher/src/commitment_manager/commitment_manager_impl.rs line 560 at r10 (raw file):

Previously, dorimedini-starkware wrote…

hmmmm I would reuse the same metrics for CommitBlock here, with a TODO to create separate metrics if and when the os_input feature reaches production

Done.


crates/apollo_batcher/src/commitment_manager/types.rs line 132 at r10 (raw file):

Previously, dorimedini-starkware wrote…

see above: why not reuse the timer for commit? we won't be mixing the two, right? once we sync, its read-paths-and-commit forever?

Reusing for now, but I don't think "forever" is accurate. You occasionally go back to sync, so it's not only a prefix of the blocks.

@dorimedini-starkware dorimedini-starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dorimedini-starkware reviewed 2 files and all commit messages, and resolved 2 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on ArielElp).

@ArielElp ArielElp left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ArielElp reviewed 11 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on ArielElp).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants