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

Make Membership::leader() return a Result<_> #3738

Merged
merged 23 commits into from
Oct 23, 2024
Merged

Make Membership::leader() return a Result<_> #3738

merged 23 commits into from
Oct 23, 2024

Conversation

ss-es
Copy link
Contributor

@ss-es ss-es commented Oct 7, 2024

This PR:

Makes the leader function fallible, returning an anyhow::Result. As a consequence of this, a lot of task logic was refactored to also return an anyhow::Result.

This PR does not:

This is not a complete refactor towards returning anyhow::Result from all tasks, but it moves us most of the way towards that.

Key places to review:

It's worth checking that each ensure! is equivalent (or in some cases, more correct) than the original conditional everywhere these were replaced.

@ss-es ss-es requested a review from bfish713 as a code owner October 7, 2024 22:04
Copy link
Collaborator

@bfish713 bfish713 left a comment

Choose a reason for hiding this comment

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

Started reviewing, changing membership and using ensure seems like a good change, but I think we need to resolve the issue with log levels.

Also this pr can get a bit smaller after: #3755 merges

@@ -108,35 +108,31 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions> DaTaskState<TYP
// the `DaProposalRecv` event. Otherwise, the view number subtraction below will
// cause an overflow error.
// TODO ED Come back to this - we probably don't need this, but we should also never receive a DAC where this fails, investigate block ready so it doesn't make one for the genesis block
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we resolve this TODO comment? I don't think receiving a proposal has much to do with the block ready event. A bad leader could send us proposals for old views so we need this check to discard them early.

Longer term follow up, what if we get a valid DAProposal late, is there any value in backfilling the leaf with the full block data?

crates/task-impls/src/da.rs Outdated Show resolved Hide resolved
crates/task-impls/src/da.rs Outdated Show resolved Hide resolved
crates/task-impls/src/da.rs Outdated Show resolved Hide resolved
crates/task-impls/src/da.rs Outdated Show resolved Hide resolved
crates/task-impls/src/da.rs Show resolved Hide resolved
@pls148
Copy link
Contributor

pls148 commented Oct 11, 2024

With my PR having merged (3755) this one will need to be rebased

@ss-es ss-es changed the base branch from main to lr/epoch-config October 16, 2024 18:14
Base automatically changed from lr/epoch-config to main October 18, 2024 18:07
@ss-es ss-es mentioned this pull request Oct 21, 2024
@ss-es ss-es changed the base branch from main to ss/anytrace October 21, 2024 16:49
@ss-es ss-es changed the base branch from ss/anytrace to main October 21, 2024 16:50
@ss-es ss-es modified the milestones: Upgrade (PoS), DRB (PoS) Oct 21, 2024
@ss-es ss-es self-assigned this Oct 22, 2024
@ss-es ss-es merged commit e438036 into main Oct 23, 2024
24 checks passed
@ss-es ss-es deleted the ss/fallible-leader branch October 23, 2024 16:40
@ss-es ss-es mentioned this pull request Oct 23, 2024
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