Skip to content

Rebroadcast request for latest epoch until we have reached enough responses#426

Open
samliok wants to merge 5 commits into
mainfrom
rebroadcast
Open

Rebroadcast request for latest epoch until we have reached enough responses#426
samliok wants to merge 5 commits into
mainfrom
rebroadcast

Conversation

@samliok

@samliok samliok commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

In case the first broadcast message was not responded to by a threshold of validators, we want to continue rebroadcasting requests for the latest epoch until we validate an epoch.

However it's possible that we restarted our non-validator and its already up-to-date. In that case, we limit the number of retries to maxRebroadcastAttempts as to not indefinitely re-broadcast.

@samliok
samliok marked this pull request as ready for review July 17, 2026 19:53
@samliok samliok changed the title rebroadcast latest epoch Rebroadcast request for latest epoch until we have reached enough responses Jul 17, 2026
@samliok
samliok changed the base branch from epoch-tests to main July 20, 2026 16:32
samliok and others added 2 commits July 20, 2026 12:33
Signed-off-by: Sam Liokumovich <65994425+samliok@users.noreply.github.com>
Comment thread nonvalidator/non_validator.go
attempt := taskIds[0] + 1

// too many attempts, don't rebroadcast
if attempt > maxRebroadcastAttempts {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't understand why limit the number of retries... what happens if there is no connectivity and we have exhausted the number of retries?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

However it's possible that we restarted our non-validator and its already up-to-date. In that case, we limit the number of retries to maxRebroadcastAttempts as to not indefinitely re-broadcast.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am not sure what's the point in rebroadcasting it after the validator boots but only for 5 iterations.

What is the problem that we are trying to solve?

}

n.Logger.Debug("Rebroadcasting latest epoch", zap.Uint64("Next to commit", n.nextSeqToCommit()))
n.broadcastLatestEpoch()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

shouldn't this method be called under a lock?

Comment thread nonvalidator/non_validator.go Outdated
// Seed the first attempt, then tick a few intervals past the cap. Each tick
// fires one rebroadcast and schedules the next attempt; ticks past the cap
// should be no-ops.
nv.bootstrapRebroadcastHandler.AddTask(0)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we should not be accessing internal fields in tests in such a manner, but instead relying on exported APIs to drive the test.


// Validating a new epoch should drop every pending rebroadcast task.
nv.bootstrapRebroadcastHandler.AddTask(0)
nv.maybeValidateNextEpoch(tc.appendSealing(testNodes))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same, we should not be doing this.

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.

[non-validators] Keep broadcasting request for latest epoch until we have reached a threshold

2 participants