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

#3967 Option<Epoch> for everybody #4007

Merged
merged 2 commits into from
Jan 17, 2025
Merged

#3967 Option<Epoch> for everybody #4007

merged 2 commits into from
Jan 17, 2025

Conversation

pls148
Copy link
Contributor

@pls148 pls148 commented Jan 8, 2025

Closes #3967

This PR:

  • Replaces Epoch with Option throughout the code base
  • Adds QuorumProposalWrapper to abstract QuorumProposal|QuorumProposal2
  • Adds gates in network.rs to only allow pre-epoch messages when view is pre-epoch and only allow post-epoch messages when view is post-epoch

This PR does not:

Key places to review:

@pls148 pls148 requested a review from bfish713 as a code owner January 8, 2025 01:00
@pls148 pls148 marked this pull request as draft January 8, 2025 01:00
crates/hotshot/src/lib.rs Outdated Show resolved Hide resolved
@pls148 pls148 changed the title 3967 with_epoch in leaf2 and quorumproposal2 #3967 Option<Epoch> for everybody Jan 10, 2025
Copy link
Contributor

@lukaszrzasik lukaszrzasik left a comment

Choose a reason for hiding this comment

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

Sorry, I haven't gone through the whole PR yet. I'll try to do it today but I need to first finish some other stuff.

crates/hotshot/src/lib.rs Outdated Show resolved Hide resolved
@pls148 pls148 force-pushed the ps/3967 branch 4 times, most recently from b9b1eb3 to 64559d9 Compare January 11, 2025 05:30
crates/hotshot/src/lib.rs Outdated Show resolved Hide resolved
@pls148 pls148 force-pushed the ps/3967 branch 3 times, most recently from 4feccd4 to 71ab918 Compare January 14, 2025 00:36
Copy link
Contributor

@lukaszrzasik lukaszrzasik left a comment

Choose a reason for hiding this comment

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

There's a lot of comments but that's mainly because I either missed some discussions or we haven't discussed some topics yet.

There are two things unclear to me:

  1. What conditions need to be fulfilled for a node to use epochs.
  2. What is the desired behaviour when we have a mix of nodes with and without epochs enabled communicating together.

crates/examples/infra/mod.rs Outdated Show resolved Hide resolved
crates/hotshot/src/tasks/mod.rs Outdated Show resolved Hide resolved
crates/hotshot/src/lib.rs Outdated Show resolved Hide resolved
crates/hotshot/src/lib.rs Outdated Show resolved Hide resolved
crates/types/src/data.rs Outdated Show resolved Hide resolved
crates/types/src/data.rs Outdated Show resolved Hide resolved
crates/types/src/message.rs Outdated Show resolved Hide resolved
Comment on lines +158 to +159
/// #3967 REVIEW NOTE: This type is kinda ugly, should we Result<Option<Epoch>> instead?
pub fn epoch(&self) -> Option<Option<TYPES::Epoch>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, I agree. Let's do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function gets used in one place, and when I made it with Result<> it just added a bunch of extra ugliness without much point. I'm thinking it makes the most sense to punt on this for now.

crates/types/src/utils.rs Outdated Show resolved Hide resolved
@pls148 pls148 force-pushed the ps/3967 branch 3 times, most recently from a89a250 to 6abf4bc Compare January 15, 2025 00:16
@pls148 pls148 requested review from lukaszrzasik and ss-es January 15, 2025 00:16
@pls148 pls148 force-pushed the ps/3967 branch 3 times, most recently from 2acccd1 to 2b60f1b Compare January 16, 2025 04:54
Copy link
Contributor

@lukaszrzasik lukaszrzasik left a comment

Choose a reason for hiding this comment

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

I hope I didn't miss anything. There's some changes still needed I guess so I'll probably give it another pass.

@@ -71,7 +71,7 @@ impl<TYPES: NodeType> Default for TestStorageState<TYPES> {
next_epoch_high_qc2: None,
high_qc2: None,
action: TYPES::View::genesis(),
epoch: TYPES::Epoch::genesis(),
epoch: None,
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe genesis_epoch_from_version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That one creates a lot of dependency, we should probably talk about. In order to make that work I need to end up with Versions as an argument to NodeImplementation, unless i'm missing something. That seems like it's antithetical to how things are designed. Possible I'm missing something though.

crates/hotshot/src/lib.rs Outdated Show resolved Hide resolved
crates/hotshot/src/lib.rs Outdated Show resolved Hide resolved
crates/types/src/data.rs Outdated Show resolved Hide resolved
crates/hotshot/src/lib.rs Outdated Show resolved Hide resolved
crates/task-impls/src/vid.rs Outdated Show resolved Hide resolved
crates/task-impls/src/vid.rs Outdated Show resolved Hide resolved
crates/task-impls/src/vid.rs Outdated Show resolved Hide resolved
crates/task-impls/src/vid.rs Outdated Show resolved Hide resolved
crates/types/src/data.rs Outdated Show resolved Hide resolved
crates/types/src/data.rs Outdated Show resolved Hide resolved
crates/types/src/data.rs Outdated Show resolved Hide resolved
@pls148 pls148 force-pushed the ps/3967 branch 2 times, most recently from 1a9b798 to 30447e2 Compare January 16, 2025 23:40
@pls148 pls148 marked this pull request as ready for review January 17, 2025 00:13
@pls148 pls148 force-pushed the ps/3967 branch 2 times, most recently from b947a82 to 518b8fc Compare January 17, 2025 02:07
Copy link
Contributor

@lukaszrzasik lukaszrzasik left a comment

Choose a reason for hiding this comment

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

Looks good to me now. Maybe just remove the extra comments before merging.

I'll now have a look at the test failures to help with that.

@pls148 pls148 merged commit fa68e1b into main Jan 17, 2025
17 checks passed
@pls148 pls148 deleted the ps/3967 branch January 17, 2025 23:57
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.

Option<Epoch> change
4 participants