Skip to content

chore(logs): include account_id and chunk_production_key in chunk-endorsement error#15634

Open
wacban wants to merge 2 commits intomasterfrom
waclaw/chunk-endorsement-error-details
Open

chore(logs): include account_id and chunk_production_key in chunk-endorsement error#15634
wacban wants to merge 2 commits intomasterfrom
waclaw/chunk-endorsement-error-details

Conversation

@wacban
Copy link
Copy Markdown
Contributor

@wacban wacban commented Apr 24, 2026

Helps attribute InvalidChunkEndorsement at INFO level without enabling debug logs for the stateless_validation target.

Seen via alert:
https://grafana.nearone.org/a/grafana-irm-app/alert-groups/IKHSU3P2Q5YG4

…orsement error

Helps attribute InvalidChunkEndorsement at INFO level without enabling
debug logs for the stateless_validation target.

Seen via alert:
https://grafana.nearone.org/a/grafana-irm-app/alert-groups/IKHSU3P2Q5YG4
Copilot AI review requested due to automatic review settings April 24, 2026 10:42
@wacban wacban requested a review from a team as a code owner April 24, 2026 10:42
@wacban wacban requested a review from saketh-are April 24, 2026 10:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves observability for chunk-endorsement processing failures by adding identifying context (validator account_id and chunk_production_key) to the client error log, making it easier to attribute InvalidChunkEndorsement events without enabling verbose stateless_validation debug logs.

Changes:

  • Extract account_id and chunk_production_key from incoming ChunkEndorsementMessage.
  • Include these fields in the tracing::error! event emitted when processing the endorsement fails.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +10 to +13
let endorsement = msg.0;
let account_id = endorsement.account_id().clone();
let key = endorsement.chunk_production_key();
if let Err(err) = self.chunk_endorsement_tracker.process_chunk_endorsement(endorsement) {
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.41%. Comparing base (42eeb26) to head (636d24f).

Files with missing lines Patch % Lines
chain/client/src/chunk_endorsement_handler.rs 50.00% 3 Missing ⚠️
...src/stateless_validation/state_witness_producer.rs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #15634   +/-   ##
=======================================
  Coverage   69.41%   69.41%           
=======================================
  Files         938      938           
  Lines      213336   213340    +4     
  Branches   213336   213340    +4     
=======================================
+ Hits       148079   148096   +17     
+ Misses      59366    59357    -9     
+ Partials     5891     5887    -4     
Flag Coverage Δ
pytests-nightly 1.14% <0.00%> (-0.01%) ⬇️
unittests 68.82% <60.00%> (+0.01%) ⬆️
unittests-nightly 68.95% <60.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Avoids an AccountId clone (heap alloc + memcpy) on every received
endorsement, and lets the error log read account_id/key directly off
the still-owned value at the call site.
@wacban wacban changed the title log(client): include account_id and chunk_production_key in chunk-endorsement error chore(logs): include account_id and chunk_production_key in chunk-endorsement error Apr 24, 2026
@wacban wacban requested review from Wiezzel and jancionear and removed request for saketh-are April 24, 2026 11:54
target: "client",
?err,
account_id = %endorsement.account_id(),
key = ?endorsement.chunk_production_key(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In early validator kickout we're moving away from the ChunkProductionKey. Not sure if it makes sense to include it, it might get removed a moment later. /cc @stedfn

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it is fine, it will take a while longer than a moment

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