Skip to content

Conversation

@yoavGrs
Copy link
Contributor

@yoavGrs yoavGrs commented Jan 7, 2026

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

yoavGrs commented Jan 7, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

@yoavGrs yoavGrs requested a review from amosStarkware January 7, 2026 14:07
@yoavGrs yoavGrs self-assigned this Jan 7, 2026
@yoavGrs yoavGrs marked this pull request as ready for review January 7, 2026 14:07
@yoavGrs yoavGrs force-pushed the yoav/apollo_batcher/commitment_manager_types/add_revert_task branch from 1d2982e to 39094bb Compare January 7, 2026 15:17
@yoavGrs yoavGrs force-pushed the yoav/apollo_batcher/commitment_manager_types/call_revert branch from 8c68397 to 1cdf338 Compare January 7, 2026 15:17
@yoavGrs yoavGrs force-pushed the yoav/apollo_batcher/commitment_manager_types/add_revert_task branch from 39094bb to 11fb788 Compare January 8, 2026 10:02
@yoavGrs yoavGrs force-pushed the yoav/apollo_batcher/commitment_manager_types/call_revert branch from 1cdf338 to 30578d3 Compare January 8, 2026 10:06
@yoavGrs yoavGrs force-pushed the yoav/apollo_batcher/commitment_manager_types/add_revert_task branch from 11fb788 to e711805 Compare January 8, 2026 10:58
@yoavGrs yoavGrs force-pushed the yoav/apollo_batcher/commitment_manager_types/call_revert branch from 30578d3 to 97355da Compare January 8, 2026 10:59
Copy link
Collaborator

@amosStarkware amosStarkware left a comment

Choose a reason for hiding this comment

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

@amosStarkware reviewed 2 files and all commit messages, and made 7 comments.
Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @yoavGrs).


crates/apollo_batcher/src/batcher.rs line 1118 at r3 (raw file):

        self.revert_commitment(height).await;

        self.storage_writer.revert_block(height);

This function should also delete the global root, block hash, etc

Code quote:

 self.storage_writer.revert_block(height);

crates/apollo_batcher/src/batcher.rs line 1251 at r3 (raw file):

        self.write_commitment_results_to_storage(commitment_results)
            .await
            // Consider continuing the revert and not panicking here.

This may throw off the task offset - I don't think we want this

Code quote:

// Consider continuing the revert and not panicking here.

crates/apollo_batcher/src/batcher.rs line 1255 at r3 (raw file):

        self.validate_revert_task_result(revert_task_result, height).await;
        self.commitment_manager.decrease_commitment_task_offset();

should be done when adding the revert task, IMO - like it's increased when adding commitment tasks.

Code quote:

self.commitment_manager.decrease_commitment_task_offset();

crates/apollo_batcher/src/batcher.rs line 1262 at r3 (raw file):

        &self,
        revert_task_output: RevertTaskOutput,
        request_height: BlockNumber,

what does request mean in this context?

Code quote:

request_height

crates/apollo_batcher/src/batcher.rs line 1269 at r3 (raw file):

        );

        match revert_task_output.response {

Please log each branch

Code quote:

match revert_task_output.response {

crates/apollo_batcher/src/batcher.rs line 1271 at r3 (raw file):

        match revert_task_output.response {
            RevertBlockResponse::RevertedTo(global_root)
            | RevertBlockResponse::AlreadyReverted(global_root) => {

Why does the Committer distinguish between these two responses?
Also - how will it distinguish between AlreadyReverted & Uncommitted, once the state roots and state diff commitment will be deleted from the Committer's storage during a revert?

Code quote:

            RevertBlockResponse::RevertedTo(global_root)
            | RevertBlockResponse::AlreadyReverted(global_root) => {

crates/apollo_batcher/src/batcher.rs line 1280 at r3 (raw file):

                    .storage_reader
                    .global_root(new_latest_height)
                    // Consider continuing the revert and not panicking here.

If the global root doesn't exist in storage something is broken - IMO it makes sense to panic.
If you don't agree please put this in a TODO under your name

Code quote:

// Consider continuing the revert and not panicking here.

@yoavGrs yoavGrs force-pushed the yoav/apollo_batcher/commitment_manager_types/add_revert_task branch from e711805 to 2d834f1 Compare January 8, 2026 14:17
@yoavGrs yoavGrs force-pushed the yoav/apollo_batcher/commitment_manager_types/call_revert branch from 97355da to b1634dd Compare January 8, 2026 14:17
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