Skip to content

Comments

chore: improve delegation error messages#994

Open
thlorenz wants to merge 3 commits intomasterfrom
thlorenz/unresolved-deleg-improved-insight
Open

chore: improve delegation error messages#994
thlorenz wants to merge 3 commits intomasterfrom
thlorenz/unresolved-deleg-improved-insight

Conversation

@thlorenz
Copy link
Collaborator

@thlorenz thlorenz commented Feb 23, 2026

Summary

Improve error messages for unresolved delegations and fetch failures by providing better insight into what caused the timeout or retry limit to be hit.

Helps Triage: #988

Details

Error Message Improvements

Enhanced error diagnostics in the remote account provider to distinguish between two timeout failure modes:

  1. Max Retries Exceeded: Now explicitly states "max retries N" in the error
  2. Total Time Exceeded: Now explicitly states "max total time of X seconds" in the error

This allows operators to quickly understand which limit was hit and adjust configuration accordingly.

fetch_cloner

Changed error logging format from Display (%) to Debug (?) for better error introspection when delegation record fetch fails.

remote_account_provider

Updated error variants to include the specific limit that was hit:

  • SlotsDidNotMatch: Added limit string parameter
  • MatchingSlotsNotSatisfyingMinContextSlot: Added limit string parameter

The timeout/retry logic now checks both conditions simultaneously and includes the appropriate limit description in error messages.

Summary by CodeRabbit

Release Notes

  • Bug Fixes & Improvements
    • Improved retry and timeout handling to enforce both maximum retry count and total time limits simultaneously, preventing incomplete termination conditions.
    • Enhanced error messages to provide clearer information about why retries were terminated, distinguishing between maximum retries and time limits exceeded.

@github-actions
Copy link

github-actions bot commented Feb 23, 2026

Manual Deploy Available

You can trigger a manual deploy of this PR branch to testnet:

Deploy to Testnet 🚀

Alternative: Comment /deploy on this PR to trigger deployment directly.

⚠️ Note: Manual deploy requires authorization. Only authorized users can trigger deployments.

Comment updated automatically when the PR is synchronized.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

📝 Walkthrough

Walkthrough

This pull request updates error handling and retry logic across three files. The fetch_cloner module's error logging is reformatted from Display to Debug style. The RemoteAccountProviderError enum is extended with additional String fields in two variants to track limit information. The try_get_multi_until_slots_match function is refactored to halt retries when either the maximum retry count or overall time limit is reached, with the termination reason propagated into error variants and tests adjusted accordingly. Minor formatting changes include using integer seconds instead of fractional seconds in error messages.

Suggested reviewers

  • bmuddha
  • GabrielePicco
✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch thlorenz/unresolved-deleg-improved-insight

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@magicblock-chainlink/src/remote_account_provider/errors.rs`:
- Around line 65-69: The error strings for SlotsDidNotMatch and
MatchingSlotsNotSatisfyingMinContextSlot need a separator before the appended
"hit limit:" clause; update the #[error(...)] messages for the enum variants
SlotsDidNotMatch and MatchingSlotsNotSatisfyingMinContextSlot to insert a comma
(or other suitable punctuation) just before "hit limit:" so the rendered
messages read naturally (e.g., "... to track slots, hit limit: ..." and "... min
required context slot 43, hit limit: ...").

@thlorenz thlorenz marked this pull request as ready for review February 23, 2026 07:30
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.

1 participant