Skip to content

Non Validators Happy Path#358

Open
samliok wants to merge 9 commits into
mainfrom
non-validator
Open

Non Validators Happy Path#358
samliok wants to merge 9 commits into
mainfrom
non-validator

Conversation

@samliok
Copy link
Copy Markdown
Collaborator

@samliok samliok commented Mar 13, 2026

No description provided.

Comment thread nonvalidator/non_validator.go Outdated
@samliok samliok marked this pull request as ready for review March 17, 2026 19:32
samliok and others added 2 commits March 17, 2026 14:36
Signed-off-by: Sam Liokumovich <65994425+samliok@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@yacovm yacovm left a comment

Choose a reason for hiding this comment

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

I made a pass. Generally there is still a lot more to do here, as you noted in TODOs.

I think we should add to the PR a markdown document. Essentially moving the issue you opened to markdown can be a good start.

Comment thread nonvalidator/non_validator.go
Comment thread nonvalidator/non_validator.go Outdated
Comment thread nonvalidator/non_validator.go Outdated
}

// verify the finalization
if err := finalization.Verify(); err != nil {
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.

this just checks the signature. What about checking that the signers constitute a quorum of the validator set?

Comment thread nonvalidator/non_validator.go Outdated
type Config struct {
Logger simplex.Logger
Storage simplex.FullStorage
GenesisValidators []simplex.NodeID
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.

why genesis? the genesis validators might be long gone

// sanity check: should never happen.
if !bytes.Equal(incomplete.finalization.Finalization.Bytes(), finalization.Finalization.Bytes()) {
n.Logger.Warn(
"Mismatching finalizations",
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.

this should be an error that will halt the chain


digest := incomplete.block.BlockHeader().Digest
if !bytes.Equal(bh.Digest[:], digest[:]) {
// TODO: this means the leader has equivocated and sent us a wrong block while another has been finalized.
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.

Just delete the block in such a case. The finalization takes precedence, right?

return nil
}

return n.indexBlock(incomplete.block, finalization)
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.

if we index the block, can't we garbage collect from the incompleteSeqs map?

Comment thread nonvalidator/verifier.go
// triggerVerify wakes up the verifier by attempting to verify the next seq to be verified.
// We verify `block` if it is the next sequence to be verified, otherwise we try to retrieve the next
// block to be verified from storage.
func (v *Verifier) triggerVerify(block simplex.Block) error {
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 don't really need this asynchronous scheduling. We can just verify() and index right after.

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.

2 participants