Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion simplex/epoch.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (e *Epoch) HandleMessage(msg *common.Message, from common.NodeID) error {
}

_, known := e.validatorsToPKs[string(from)]

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 think we should enforce this externally, not internally.

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.

agreed, should this be done in a separate pr though?

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.

but if we do that in a separate PR then we don't do it here...

if !known {
if !known || e.isEpochSealed() {
e.Logger.Debug("Received message from a non-validator node", zap.Stringer("nodeID", from))
switch {
case msg.ReplicationRequest != nil && e.ReplicationEnabled:
Expand Down Expand Up @@ -1466,13 +1466,15 @@ func (e *Epoch) indexFinalizations(startRound uint64) error {
}

func (e *Epoch) indexFinalization(block common.VerifiedBlock, finalization common.Finalization) error {
// index only if the epoch is not sealed
if err := e.Storage.Index(e.finishCtx, block, finalization); err != nil {
return err
}
e.Logger.Info("Committed block",
zap.Uint64("round", finalization.Finalization.Round),
zap.Uint64("sequence", finalization.Finalization.Seq),
zap.Stringer("digest", finalization.Finalization.Digest))

e.lastBlock = &common.VerifiedFinalizedBlock{
VerifiedBlock: block,
Finalization: finalization,
Expand Down
Loading