Skip to content

Truncate data logged when fetching commit reports. #1036

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

winder
Copy link
Contributor

@winder winder commented Jun 19, 2025

During a recent incident it was difficult to tell which reports were being returned by the get commit reports query. The token and fee price reports were too spammy. This PR improves the logging situation with two improvements:

  1. Discard token and fee price reports, instead log a number for how many updates there were.
  2. Log an error if there are so many reports returned that results were truncated.

Copy link
Collaborator

@prashantkumar1982 prashantkumar1982 left a comment

Choose a reason for hiding this comment

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

I assume the actual fix to not drop events will be separate PR?

@winder winder marked this pull request as ready for review June 20, 2025 14:18
@winder winder requested a review from a team as a code owner June 20, 2025 14:18
@@ -776,6 +777,11 @@ func (l *DefaultAccessor) processCommitReports(
if len(reports) < limit {
return reports
}
lggr.Errorw("too many commit reports received, commit report results are truncated",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it an error? This can easily happen when we have higher load and not considered an error. I think Infow is good here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is an error. There was a war room last week because of a delayed execution, it turned out the message wasn't being executed because it was truncated from the results.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can't really agree with it being an error if it's smth that's expected to happen. What we do afterwards is the issue.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought we had some logic somewhere where we filter out price-only reports and paginate? Or is that not the case?

func printReports(lggr logger.Logger, reports []cciptypes.CommitPluginReportWithMeta) {
tokenPriceUpdates := 0
gasPriceUpdates := 0
var truncatedReports []cciptypes.CommitPluginReportWithMeta
Copy link
Contributor

Choose a reason for hiding this comment

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

don't think this function cares whether they're truncated or not.

Suggested change
var truncatedReports []cciptypes.CommitPluginReportWithMeta
var reportToPrint []cciptypes.CommitPluginReportWithMeta

asoliman92
asoliman92 previously approved these changes Jun 25, 2025
Copy link

Metric will/truncate-decoded-report main
Coverage 70.1% 70.0%

@winder winder enabled auto-merge July 14, 2025 12:56
lggr.Errorw("too many commit reports received, commit report results are truncated",
"numTruncatedReports", len(reports)-limit)
for l := limit; l < len(reports); l++ {
lggr.Warnw("dropping commit report which doesn't fit in limit", "report", reports[l])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we only log it if it has a merkle root? Otherwise we might spam price reports?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also maybe consider grouping the relevant roots into one log instead?

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.

4 participants