Skip to content

Relax log-level on processLockedKeys() for tx results - #898

Merged
m-Peter merged 1 commit into
mainfrom
mpeter/keystore-relax-log-level
Oct 10, 2025
Merged

Relax log-level on processLockedKeys() for tx results#898
m-Peter merged 1 commit into
mainfrom
mpeter/keystore-relax-log-level

Conversation

@m-Peter

@m-Peter m-Peter commented Oct 9, 2025

Copy link
Copy Markdown
Collaborator

Description

The previous ERR log-level, created unnecessary noise on Grafana panels, as this behavior is not really an error. It might happen because we requested the tx results on a given block, too fast, or the AN hasn't finished indexing them. In any case, this is not critical.
Changed the log-level to WARN.


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

Summary by CodeRabbit

  • Chores
    • Reduced log severity for certain transient lookup errors from Error to Warning to reduce operational noise.
    • Simplified log text to report the error value directly and removed redundant identifiers to make logs easier to scan.
    • No behavior change: processing continues unchanged when these transient errors occur.

@coderabbitai

coderabbitai Bot commented Oct 9, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Changed a log call in processLockedKeys: when COATxLookupEnabled is true and GetTransactionResultsByBlockID returns a non-canceled error, the log level was downgraded from Error to Warning and the message was simplified to log the error via %v (block ID removed). Control flow unchanged.

Changes

Cohort / File(s) Summary
Keystore logging adjustment
services/requester/keystore/key_store.go
Downgraded error log to warning in processLockedKeys when COATxLookupEnabled; simplified message to log the error with %v and removed block ID hex; no control-flow changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • zhangchiqing
  • peterargue

Poem

I nibble logs with careful paw,
A warning now where error saw.
Blocks still march, the keys still hum,
Quieted thump — no panic drum.
Soft hops forward, change feels right. 🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly captures the primary change by indicating a log-level relaxation in the specific function processLockedKeys() for transaction results and is clear and specific without extraneous detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mpeter/keystore-relax-log-level

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1fe28b5 and 3a3895b.

📒 Files selected for processing (1)
  • services/requester/keystore/key_store.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • services/requester/keystore/key_store.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25b8222 and 830b778.

📒 Files selected for processing (1)
  • services/requester/keystore/key_store.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Lint
  • GitHub Check: Test
🔇 Additional comments (1)
services/requester/keystore/key_store.go (1)

214-214: LGTM: Log level change is appropriate.

The change from Err() to Warn() aligns well with the PR objectives. Since this condition can occur transiently when transaction results are requested before the Access Node finishes indexing, treating it as a warning rather than an error reduces unnecessary alert noise while still maintaining visibility.

Comment thread services/requester/keystore/key_store.go
@m-Peter
m-Peter force-pushed the mpeter/keystore-relax-log-level branch from 830b778 to 1fe28b5 Compare October 9, 2025 10:05

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
services/requester/keystore/key_store.go (1)

214-217: Log level change looks good; consider including block ID for better debugging.

The log level change from Error to Warn appropriately reflects that this condition is not critical, as explained in the PR description. The simplified message also resolves the inconsistency flagged in the previous review where the message mentioned "block ID" but logged the error instead.

However, for debugging purposes, including both the block ID and error would provide more context when investigating issues. This was the recommended Option 1 in the previous review.

Consider this enhancement:

-					k.logger.Warn().Msgf(
-						"failed to get transaction results: %v",
-						err,
+					k.logger.Warn().Err(err).Msgf(
+						"failed to get transaction results for block ID: %s",
+						blockHeader.ID.Hex(),
 					)

This uses structured logging to attach the error and includes the block ID in the message, making it easier to trace issues back to specific blocks.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 830b778 and 1fe28b5.

📒 Files selected for processing (1)
  • services/requester/keystore/key_store.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test

if err != nil && status.Code(err) != codes.Canceled {
k.logger.Error().Err(err).Msgf(
"failed to get transaction results for block ID: %s",
blockHeader.ID.Hex(),

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.

should we still add this? blockHeader.ID.Hex()

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.

I did not add it, because it's already included in the error itself:

failed to get transaction results: client: rpc error: code = Internal desc =
failed to get block df6e3694dd5856d4c3c537ca2d4804aeb78fdaeb48679c506e7cd5fca2d3df95:
could not find block with ID df6e3694dd5856d4c3c537ca2d4804aeb78fdaeb48679c506e7cd5fca2d3df95

@m-Peter
m-Peter force-pushed the mpeter/keystore-relax-log-level branch from 1fe28b5 to 3a3895b Compare October 10, 2025 07:51
@m-Peter
m-Peter merged commit 6fae41d into main Oct 10, 2025
2 checks passed
@m-Peter
m-Peter deleted the mpeter/keystore-relax-log-level branch October 10, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants