Repository navigation
contributor-rewards: retry the merkle root posting - #4468
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the merkle root posting retry change.
No open issues 🎉
What changed in this PR
This PR adds retries for merkle root posting in the contributor rewards worker, reducing failures from transient RPC errors.
Changes:
- The worker retries a failed posting three more times, with a one-minute delay and a warning before each retry.
- The scheduler and
calculate-rewardsboth use the updated posting path. - The changelog records the retry behavior.
| File | Description |
|---|---|
offchain/crates/contributor-rewards/src/calculator/orchestrator.rs |
Adds bounded retries and warning logs around merkle root posting. |
offchain/crates/contributor-rewards/CHANGELOG.md |
Documents the three additional posting attempts and one-minute delays. |
Review effort: Balanced
nikw9944
left a comment
There was a problem hiding this comment.
The retry covers the Block not available for slot error from epoch 241. That error comes from the get_block_time call inside wait_for_grace_period, and the new retry wraps that call. One non-blocking note: the retry also covers the grace-period wait, so a timeout can now stretch to about four times grace_period_max_wait_seconds.
nikw9944
left a comment
There was a problem hiding this comment.
The earlier note about retries stretching the grace-period wait is fixed. orchestrator.rs now computes grace_period_deadline once, before the retry loop, and wait_for_grace_period checks against that deadline. A retry after a timeout now fails within one poll, and grace_period_max_wait_seconds again limits the total wait. The retry still covers the get_block_time error from epoch 241.
Summary of Changes
calculate-rewardsboth post the root through the same call, so both now retry.Testing Verification
RPC response error -32004: Block not available for slot 462537200. This retry covers that error.