Skip to content

Commit

Permalink
agreement: log payloadVerified in tracer
Browse files Browse the repository at this point in the history
  • Loading branch information
algorandskiy committed Aug 6, 2024
1 parent d2c4ca7 commit 0f6024f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
16 changes: 16 additions & 0 deletions agreement/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,22 @@ func (t *tracer) logProposalManagerResult(p player, input messageEvent, output e
logEvent.Type = logspec.BlockCommittable
t.log.with(logEvent).Infof("block committable for %v at (%v, %v)", logEvent.Hash, p.Round, p.Period)
}
case payloadVerified:
if !t.log.IsLevelEnabled(logging.Info) {
return

Check warning on line 396 in agreement/trace.go

View check run for this annotation

Codecov / codecov/patch

agreement/trace.go#L394-L396

Added lines #L394 - L396 were not covered by tests
}
up := input.Input.UnauthenticatedProposal
logEvent := logspec.AgreementEvent{
Type: logspec.ProposalVerified,
Round: uint64(p.Round),
Period: uint64(p.Period),
Step: uint64(p.Step),
Sender: up.OriginalProposer.String(),
Hash: up.Digest().String(),
ObjectRound: uint64(pipelinedRound),
ObjectPeriod: uint64(pipelinedPeriod),

Check warning on line 407 in agreement/trace.go

View check run for this annotation

Codecov / codecov/patch

agreement/trace.go#L398-L407

Added lines #L398 - L407 were not covered by tests
}
t.log.with(logEvent).Infof("payload verified (%v, %v): %v", pipelinedRound, pipelinedPeriod, output.(payloadProcessedEvent).Err)

Check warning on line 409 in agreement/trace.go

View check run for this annotation

Codecov / codecov/patch

agreement/trace.go#L409

Added line #L409 was not covered by tests
}
}

Expand Down
2 changes: 2 additions & 0 deletions logging/logspec/agreement.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ const (
ProposalAccepted
// ProposalRejected is emitted when the source rejects a leader proposal.
ProposalRejected
// ProposalVerified is emitted when the source verifies a proposal.
ProposalVerified

// BlockRejected is emitted when a block is rejected.
// (Since fragmentation is not implemented currently,
Expand Down
31 changes: 16 additions & 15 deletions logging/logspec/agreementtype_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0f6024f

Please sign in to comment.