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

refactor(consensus): move the sync check into run_height #2499

Merged
merged 1 commit into from
Dec 15, 2024

Conversation

matan-starkware
Copy link
Contributor

The goal is to remove the nested selects to make cancellation logic simpler.

@reviewable-StarkWare
Copy link

This change is Reviewable

@matan-starkware matan-starkware marked this pull request as ready for review December 5, 2024 15:12
@matan-starkware matan-starkware force-pushed the matan/consensus/manager_test_timeout branch from 6dab128 to 3f1941d Compare December 5, 2024 15:18
@matan-starkware matan-starkware force-pushed the matan/consensus/manager_single_select_sync branch from c1149d1 to 57f1b5a Compare December 5, 2024 15:18
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 9.65%. Comparing base (af0e37d) to head (270de19).

Additional details and impacted files
@@                           Coverage Diff                           @@
##           matan/consensus/manager_test_timeout   #2499      +/-   ##
=======================================================================
- Coverage                                  9.76%   9.65%   -0.12%     
=======================================================================
  Files                                        87      87              
  Lines                                     10491   10476      -15     
  Branches                                  10491   10476      -15     
=======================================================================
- Hits                                       1024    1011      -13     
  Misses                                     9430    9430              
+ Partials                                     37      35       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matan-starkware matan-starkware force-pushed the matan/consensus/manager_test_timeout branch from 3f1941d to 6763c05 Compare December 9, 2024 11:28
@matan-starkware matan-starkware force-pushed the matan/consensus/manager_single_select_sync branch from 57f1b5a to cd7996a Compare December 9, 2024 11:28
@matan-starkware matan-starkware force-pushed the matan/consensus/manager_test_timeout branch 2 times, most recently from 47b5c52 to dc9907a Compare December 9, 2024 11:44
@matan-starkware matan-starkware force-pushed the matan/consensus/manager_single_select_sync branch from cd7996a to 29db716 Compare December 9, 2024 11:44
Copy link
Contributor

@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.

:lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dan-starkware)

@dan-starkware
Copy link
Collaborator

crates/sequencing/papyrus_consensus/src/manager.rs line 185 at r1 (raw file):

                sync_height = sync_height(height, sync_receiver) => {
                    return Ok(RunHeightRes::Sync(sync_height?));
                }

Should we move the logic into an habdle_ function and have only the next() here?

Code quote:

                sync_height = sync_height(height, sync_receiver) => {
                    return Ok(RunHeightRes::Sync(sync_height?));
                }

Copy link
Contributor Author

@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.

Reviewable status: 0 of 2 files reviewed, all discussions resolved (waiting on @asmaastarkware and @dan-starkware)


crates/sequencing/papyrus_consensus/src/manager.rs line 185 at r1 (raw file):

Previously, dan-starkware wrote…

Should we move the logic into an habdle_ function and have only the next() here?

Well we can't actually put this neatly into a handle_ function since I want to continue, but I can just put the logic inline since it is fairly straightforward.

I think that they benefit of simplifying the cancellation logic is more important than avoiding code in the macro.

Copy link
Collaborator

@dan-starkware dan-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 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @matan-starkware)

@matan-starkware matan-starkware force-pushed the matan/consensus/manager_test_timeout branch from 8201792 to 6a663bb Compare December 10, 2024 11:55
@matan-starkware matan-starkware force-pushed the matan/consensus/manager_single_select_sync branch from a1767a4 to a29a735 Compare December 10, 2024 11:55
@matan-starkware matan-starkware force-pushed the matan/consensus/manager_test_timeout branch from 6a663bb to af0e37d Compare December 15, 2024 07:51
@matan-starkware matan-starkware force-pushed the matan/consensus/manager_single_select_sync branch from a29a735 to 270de19 Compare December 15, 2024 07:52
Copy link
Contributor Author

@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 1 of 2 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @matan-starkware)

Copy link
Contributor Author

matan-starkware commented Dec 15, 2024

Merge activity

  • Dec 15, 3:44 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Dec 15, 4:12 AM EST: Graphite couldn't merge this PR because it was not satisfying all requirements (Failed CI: 'merge-gatekeeper').
  • Dec 15, 4:54 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Dec 15, 4:55 AM EST: A user merged this pull request with Graphite.

@matan-starkware matan-starkware changed the base branch from matan/consensus/manager_test_timeout to graphite-base/2499 December 15, 2024 08:45
@matan-starkware matan-starkware changed the base branch from graphite-base/2499 to main December 15, 2024 08:45
The goal is to remove the nested selects to make cancellation logic simpler.
@matan-starkware matan-starkware force-pushed the matan/consensus/manager_single_select_sync branch from 270de19 to 7e20c5d Compare December 15, 2024 08:46
@matan-starkware matan-starkware merged commit fd7bae0 into main Dec 15, 2024
14 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants