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

Fix windowing when no validator is available #2529

Merged
merged 6 commits into from
Dec 22, 2023

Conversation

abi87
Copy link
Contributor

@abi87 abi87 commented Dec 21, 2023

Why this should be merged

In case a subnet ends up not having any validator, current windowing system would halt. It should instead allow any non-validator to propose

How this works

Whenever there are no validators to be sampled from, we allow any node to propose. We issue an unsigned block in such a casa

How this was tested

CI

@abi87 abi87 changed the title fixed windowing when no validator is available Fix windowing when no validator is available Dec 21, 2023
@abi87 abi87 marked this pull request as ready for review December 21, 2023 18:07
@@ -37,7 +37,7 @@ const (
var (
_ Windower = (*windower)(nil)

ErrNoProposersAvailable = errors.New("no proposers available")
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 becomes an internal error that does not require a special error. Instead we should singla the case where no validators are available to be able to handle it appropriately

@abi87 abi87 self-assigned this Dec 21, 2023
@@ -401,7 +401,7 @@ func (p *postForkCommonComponents) shouldBuildBlockPostDurango(
parentTimestamp time.Time,
parentPChainHeight uint64,
newTimestamp time.Time,
) error {
) (bool, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

flipped the logic to align with verifyPre/PostDurangoBlockDelay. Signed blocks will be the new normal so I chose to signal "should build signed block/should have a proposer" with true

@StephenButtolph StephenButtolph added this to the v1.10.18 milestone Dec 22, 2023
@StephenButtolph StephenButtolph added the bug Something isn't working label Dec 22, 2023
@StephenButtolph StephenButtolph added this pull request to the merge queue Dec 22, 2023
Merged via the queue into dev with commit f59e46f Dec 22, 2023
17 checks passed
@StephenButtolph StephenButtolph deleted the fix_windowing_for_no_validators_subnets branch December 22, 2023 23:07
tedim52 pushed a commit to tedim52/avalanchego that referenced this pull request Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants