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

RFC 12 Implementation: Do not handle no-op proposals #3752

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions pkg/tbtc/coordination.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,15 @@ func (ce *coordinationExecutor) coordinate(
return nil, fmt.Errorf("failed to compute coordination seed: [%v]", err)
}

execLogger.Info("coordination seed is: [0x%x]", seed)
execLogger.Infof("coordination seed is: [0x%x]", seed)

leader := ce.getLeader(seed)

execLogger.Info("coordination leader is: [%s]", leader)
execLogger.Infof("coordination leader is: [%s]", leader)

actionsChecklist := ce.getActionsChecklist(window.index(), seed)

execLogger.Info("actions checklist is: [%v]", actionsChecklist)
execLogger.Infof("actions checklist is: [%v]", actionsChecklist)

// Set up a context that is automatically cancelled when the active phase
// of the coordination window ends.
Expand Down Expand Up @@ -414,7 +414,7 @@ func (ce *coordinationExecutor) coordinate(
)
}

execLogger.Info("broadcasted proposal: [%s]", proposal.ActionType())
execLogger.Infof("broadcasted proposal: [%s]", proposal.ActionType())
} else {
execLogger.Info("executing follower's routine")

Expand All @@ -434,7 +434,7 @@ func (ce *coordinationExecutor) coordinate(
)
}

execLogger.Info(
execLogger.Infof(
"received proposal: [%s]; observed faults: [%v]",
proposal.ActionType(),
faults,
Expand All @@ -454,7 +454,7 @@ func (ce *coordinationExecutor) coordinate(
faults: faults,
}

execLogger.Info("coordination completed with result: [%s]", result)
execLogger.Infof("coordination completed with result: [%s]", result)

return result, nil
}
Expand Down
10 changes: 9 additions & 1 deletion pkg/tbtc/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -755,10 +755,18 @@ func processCoordinationResult(node *node, result *coordinationResult) {
// TODO: In the future, create coordination faults cache and
// record faults from the processed results there.

proposedAction := result.proposal.ActionType()

if proposedAction == ActionNoop {
// No-op proposal cannot be processed so return early to avoid
// panicking on the ValidityBlocks call.
return
}

startBlock := result.window.endBlock()
expiryBlock := startBlock + result.proposal.ValidityBlocks()

switch result.proposal.ActionType() {
switch proposedAction {
case ActionHeartbeat:
if proposal, ok := result.proposal.(*HeartbeatProposal); ok {
node.handleHeartbeatProposal(
Expand Down