Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Significant fixes to suspected failure modes for builder #186

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

nyospe
Copy link
Contributor

@nyospe nyospe commented Jun 26, 2024

Closes #173

This PR:

Prevents scenarios where the highest view builder is removed, and guarantees that the highest view builder task will always handle incoming proposals if there is not a valid parent builder task.

Key places to review:

Everything. But especially the changes to remove_handles in service.rs

Testing:

This needs to be incorporated into the builder, and a deployment using this should no longer fall over almost immediately.

@nyospe nyospe requested a review from jbearer June 26, 2024 20:10
Copy link
Member

@jbearer jbearer left a comment

Choose a reason for hiding this comment

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

This generally makes sense to me, but I'd like @QuentinI or someone more familiar with the builder than me to approve.

I do have one question: why, when we don't have a matching builder state for a proposal, do we default to the highest builder state? It seems like it should be the highest builder state less than the proposal. Is there a code path where we end up processing a proposal with a builder state that is newer than it, and what are the implications of this?

@nyospe nyospe requested a review from QuentinI June 26, 2024 21:14
@nyospe
Copy link
Contributor Author

nyospe commented Jun 26, 2024

This generally makes sense to me, but I'd like @QuentinI or someone more familiar with the builder than me to approve.

Added @QuentinI, but I'm afraid that most of this was entirely written by Himanshu, so I'm not sure anyone has deep familiarity, aside from me.

I do have one question: why, when we don't have a matching builder state for a proposal, do we default to the highest builder state? It seems like it should be the highest builder state less than the proposal. Is there a code path where we end up processing a proposal with a builder state that is newer than it, and what are the implications of this?

It does make a certain sense for the highest builder state with a parent less than the proposal's parent view (we can call this highest builder state less than the proposal for short) to handle it, but a) we don't have a guarantee that such a state exists, absent the proposal's parent, and b) the logic for each builder state's task to determine whether it would be the correct task to handle this proposal, without ever either having all tasks ignore the proposal, or having multiple tasks branch from the same proposal, would be rather cumbersome, and potentially fraught with race conditions. And both the highest builder state overall and the highest builder state with a parent less than the proposal's parent view have drawbacks. The highest overall may result in some transactions that weren't included due to reorg being permanently dropped. The highest builder state less than the proposer will result in duplicate transactions.

Copy link
Member

@jbearer jbearer left a comment

Choose a reason for hiding this comment

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

Ok. Given no one really has expertise with this code, I will approve based on my best-effort understanding

Copy link
Contributor

@QuentinI QuentinI left a comment

Choose a reason for hiding this comment

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

As Nathan mentioned, I'm not familiar with this code either, but to my understanding this looks good FWIW

@nyospe nyospe merged commit 726db5e into main Jun 27, 2024
5 checks passed
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.

Stability Improvements for Builder under heavy load
3 participants