Skip to content
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(consensus): set active/obserever height based on batcher height #2736

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

asmaastarkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

github-actions bot commented Dec 17, 2024

Artifacts upload workflows:

Copy link

Benchmark movements:
full_committer_flow performance regressed!
full_committer_flow time: [30.370 ms 30.427 ms 30.491 ms]
change: [+1.1154% +1.4592% +1.7638%] (p = 0.00 < 0.05)
Performance has regressed.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe

Copy link
Contributor

@matan-starkware matan-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @asmaastarkware)


crates/starknet_consensus_manager/src/consensus_manager.rs line 72 at r1 (raw file):

                ConsensusError::InternalNetworkError(
                    "Failed to get height from batcher".to_string(),
                )

This is not a network error. I'm fine with just defining an Other(String) error type. Another option is for us to define another error type in this crate and have it inherit from ConsensusError and then add BatcherError. That feels more "proper," but not sure how much I care. What do you prefer?

Code quote:

                ConsensusError::InternalNetworkError(
                    "Failed to get height from batcher".to_string(),
                )

crates/starknet_consensus_manager/src/consensus_manager.rs line 78 at r1 (raw file):

        } else {
            BlockNumber(observer_height.0 + 1)
        };

Suggestion:

        let active_height = if self.config.consensus_config.start_height == observer_height {
            // Setting `start_height` is only used to enable consensus starting immediately without observing
            // the first height. This means consensus may return to a height it already voted in, risking
            // equivocation. This is only safe to do if we restart all nodes at this height.
            observer_height
        } else {
            BlockNumber(observer_height.0 + 1)
        };

Copy link
Contributor Author

@asmaastarkware asmaastarkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @matan-starkware)


crates/starknet_consensus_manager/src/consensus_manager.rs line 72 at r1 (raw file):

Previously, matan-starkware wrote…

This is not a network error. I'm fine with just defining an Other(String) error type. Another option is for us to define another error type in this crate and have it inherit from ConsensusError and then add BatcherError. That feels more "proper," but not sure how much I care. What do you prefer?

went with Other(String), but can revisit if needed..

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.

3 participants