Skip to content

apollo_batcher: remove is_round_mismatch_error#13232

Merged
ArniStarkware merged 1 commit intomainfrom
arni/batcher/preconfirmed_block_writter/remove_handle_of_height_mismatch
Mar 16, 2026
Merged

apollo_batcher: remove is_round_mismatch_error#13232
ArniStarkware merged 1 commit intomainfrom
arni/batcher/preconfirmed_block_writter/remove_handle_of_height_mismatch

Conversation

@ArniStarkware
Copy link
Contributor

@ArniStarkware ArniStarkware commented Mar 12, 2026

Note

Medium Risk
Changes pre-confirmed block writing from error-propagating to best-effort by ignoring Cende write failures, which could mask recorder/round issues and affect observability/troubleshooting during proposals.

Overview
Makes the pre-confirmed block writer non-failing: PreconfirmedBlockWriterTrait::run no longer returns a Result, and batcher::spawn_proposal stops discarding an Ok/Err return value.

Removes round-mismatch/error handling in PreconfirmedBlockWriter (including the is_round_mismatch_error path) and instead intentionally ignores errors from in-flight and final write_pre_confirmed_block calls; PreconfirmedCendeClient now logs failures as warn with a TODO to add a failure metric. Test mocks are updated to match the new run() signature.

Written by Cursor Bugbot for commit 5c2415f. This will update automatically on new commits. Configure here.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

ArniStarkware commented Mar 12, 2026

@ArniStarkware ArniStarkware force-pushed the arni/batcher/preconfirmed_block_writter/remove_handle_of_height_mismatch branch from 9121c65 to abafe89 Compare March 15, 2026 15:37
@ArniStarkware
Copy link
Contributor Author

crates/apollo_batcher/src/pre_confirmed_block_writer.rs line 225 at r1 (raw file):

                    pending_tasks.clear();
                    return Err(error.into());
                }

Note, it is implied here that the other error is not raised.

Suggestion:

                if is_round_mismatch_error(&error, next_write_iteration) {
                    // TODO(noamsp): Remove this since we only have one ongoing write task.
                    pending_tasks.clear();
                    return Err(error.into());
                }
                else {
                    // Intentionally ignore write-task errors (including recorder BAD_REQUEST)
                    // to preserve current best-effort pre-confirmed block writer behavior.
                }

@TzahiTaub
Copy link
Contributor

crates/apollo_batcher/src/pre_confirmed_block_writer.rs line 225 at r1 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

Note, it is implied here that the other error is not raised.

Didn't understand your comment. What is the other error? The round mismatch?

@ArniStarkware ArniStarkware force-pushed the arni/batcher/preconfirmed_block_writter/remove_handle_of_height_mismatch branch from abafe89 to 89a3fe5 Compare March 16, 2026 09:28
@ArniStarkware
Copy link
Contributor Author

crates/apollo_batcher/src/pre_confirmed_block_writer.rs line 225 at r1 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

Didn't understand your comment. What is the other error? The round mismatch?

The note I wanted to raise was discussed with @ShahakShama.

What I wanted to say is that, before the change, we didn't handle the other variants of PreconfirmedCendeClientError.

@ArniStarkware ArniStarkware marked this pull request as ready for review March 16, 2026 09:30
Copy link
Contributor

@TzahiTaub TzahiTaub left a comment

Choose a reason for hiding this comment

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

@TzahiTaub reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ArniStarkware).


crates/apollo_batcher/src/pre_confirmed_block_writer.rs line 124 at r3 (raw file):

            // to preserve current best-effort pre-confirmed block writer behavior.
        }
    }

I see that the write_pre_confirmed_block logs a warning upon failure, and with your todo for the metric there, I don't think there should be anything else here. I think the result can just be ignored in this scope.

Code quote:

    // TODO(Arni): handle this error. Make sure it is logged, and that there is a metric for the
    // failure.
    fn handle_pre_confirmed_cende_client_result(result: PreconfirmedCendeClientResult<()>) {
        if result.is_err() {
            // Intentionally ignore write-task errors (including recorder BAD_REQUEST)
            // to preserve current best-effort pre-confirmed block writer behavior.
        }
    }

@ArniStarkware
Copy link
Contributor Author

crates/apollo_batcher/src/pre_confirmed_block_writer.rs line 124 at r3 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

I see that the write_pre_confirmed_block logs a warning upon failure, and with your todo for the metric there, I don't think there should be anything else here. I think the result can just be ignored in this scope.

Done.

@ArniStarkware ArniStarkware force-pushed the arni/batcher/preconfirmed_block_writter/remove_handle_of_height_mismatch branch from 89a3fe5 to 5c2415f Compare March 16, 2026 11:52
Copy link
Collaborator

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

:lgtm:

@ShahakShama reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on TzahiTaub).

@ArniStarkware ArniStarkware added this pull request to the merge queue Mar 16, 2026
Copy link
Contributor

@TzahiTaub TzahiTaub left a comment

Choose a reason for hiding this comment

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

@TzahiTaub reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on ArniStarkware).

Merged via the queue into main with commit 5bc630f Mar 16, 2026
20 of 31 checks passed
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