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

Fall back to the confirmed state if the agreed state is nil. #2854

Merged
merged 3 commits into from
Dec 30, 2024

Conversation

eljobe
Copy link
Member

@eljobe eljobe commented Dec 24, 2024

This way, the block validators will get updates even for non-staked nodes.

Fixes NIT-3009

This way, the block validators will get updates even for non-staked nodes.

Fixes NIT-3009
@cla-bot cla-bot bot added the s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA. label Dec 24, 2024
amsanghi
amsanghi previously approved these changes Dec 26, 2024
tsahee
tsahee previously approved these changes Dec 26, 2024
Copy link
Contributor

@tsahee tsahee left a comment

Choose a reason for hiding this comment

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

approved with comment/ suggestion

@@ -260,6 +260,13 @@ func (b *BOLDStaker) Start(ctxIn context.Context) {
}

if confirmedGlobalState != nil {
if agreedGlobalState == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I can live with that.. but seems better to read confirmedState before agreedState, and to set agreedGlobalState = confirmedGlobalState if it's nil. That way theres's no need to duplicate logic, and it makes sense (that any node sees confirmed as something it agreed to)

This way, the behavior of falling back to the confirmed state is more readable.
@eljobe eljobe dismissed stale reviews from tsahee and amsanghi via 2fe54e7 December 30, 2024 01:21
@eljobe eljobe enabled auto-merge December 30, 2024 01:24
@eljobe eljobe requested review from tsahee and amsanghi December 30, 2024 02:17
@eljobe eljobe merged commit c767dfe into master Dec 30, 2024
16 checks passed
@eljobe eljobe deleted the fall-back-confirmed branch December 30, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design-approved s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants