fix: keep RTC award workflow actionable when endpoint is down#5530
Conversation
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
Code ReviewReviewed fix: keep RTC award workflow actionable when endpoint is down by @RYB-404. This is a bug fix. The changes appear reasonable based on the diff. Wallet: |
strongkeep-debug
left a comment
There was a problem hiding this comment.
Reviewed head b1d6c6467e32e4154358e9af84b1991f0a9d50a7 for the RTC award workflow fallback.
The change keeps the award workflow useful when the transfer endpoint is down: connection failures now produce a manual-transfer notice with the award amount, recipient, source wallet, and memo, while the new MANUAL-REQUIRED marker remains retryable so a later rerun can still perform the on-chain award after the service recovers.
Validation performed:
git diff --check 448e835cd76e28fef9bc76f9ddaaf38be0ffc2b8 HEAD -- .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.py
python -B -m py_compile .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.py
python .github/actions/rtc-auto-bounty/test_award_rtc.py
# Ran 42 tests in 0.071s � OKI also checked the specific retry guard: check_already_awarded() lowercases the marker tail before checking :manual-required, so the emitted <!-- RTC-AWARD:MANUAL-REQUIRED --> marker does not block future retries.
No blocker found.
2balmprune
left a comment
There was a problem hiding this comment.
Reviewed head b1d6c6467e32e4154358e9af84b1991f0a9d50a7 for the manual-transfer fallback.\n\nI found one blocker: when post_pr_comment() returns False in the connection-failure branch, main() still returns 0 after setting awarded=false / skip_reason=transfer_failed: .... That makes the Actions job green even though no RTC transfer happened and no manual-transfer comment was posted, so maintainers have neither an on-chain award nor a visible manual backfill notice. The existing tests only cover the successful comment-posting path. Please either return non-zero when the manual notice cannot be posted, or add another durable signal/artifact before allowing the job to succeed.\n\nValidation performed:\n- git diff --check origin/main...review-pr-5530 -- .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.py\n- python -B -m py_compile .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.py\n- python .github/actions/rtc-auto-bounty/test_award_rtc.py -> 42 tests passed\n- Mocked connection-failure + post_pr_comment=False; observed awarded=false, skip_reason=transfer_failed: ..., but process exit 0.
ZacharyZhang-NY
left a comment
There was a problem hiding this comment.
Disclosure: I am reviewing this under Scottcjn/rustchain-bounties#305.
Reviewed head b1d6c6467e32e4154358e9af84b1991f0a9d50a7 for the RTC award workflow endpoint-down fallback.
What I checked:
transfer_rtc()emitsConnection failed: ...forURLError, matching the new branch inmain().- The connection-failure path now keeps the workflow green, writes
awarded=falseplus a transfer-failedskip_reason, and posts a manual-transfer notice containing amount, recipient, source wallet, and memo. - The new
MANUAL-REQUIREDmarker is excluded bycheck_already_awarded(), so reruns can still perform the real RTC transfer after the endpoint recovers. - Rejected transfer responses still return failure and retain the existing
FAILEDretryable marker behavior.
Validation run locally:
git diff --check origin/main...HEAD -- .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.py
python -B -m py_compile .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.py
python .github/actions/rtc-auto-bounty/test_award_rtc.py
Result: Ran 42 tests ... OK.
No blocker found. This is a focused improvement for the #5333 failure mode: an unavailable transfer endpoint now leaves maintainers with enough structured data to backfill manually, while preserving retryability for the actual award.
TJCurnutte
left a comment
There was a problem hiding this comment.
Validated the award workflow change and the duplicate-marker behavior it depends on.
Proof I ran locally on head b1d6c646:
git diff --check origin/main...HEAD -- .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.py— passed.python3 -B -m py_compile award_rtc.py test_award_rtc.py— passed.python3 -B -m unittest -q test_award_rtc.py— passed withRan 42 tests ... OK.- Focused runtime probe confirmed
check_already_awarded()still blocks a successfulRTC-AutoBounty-Awardedmarker, but allows retry after:MANUAL-REQUIREDand:FAILEDmarkers. - The same probe simulated
transfer_rtc()returningConnection failed: [Errno 111] Connection refused;main()returned0, posted aRTC Auto-Bounty Manual Transfer Requiredcomment body, and included theRTC-AutoBounty-Awarded:MANUAL-REQUIREDmarker for later retry detection.
That keeps the GitHub Action actionable during endpoint outages without treating a manual-required notice as a successful paid award. Real transfer rejections still fail, and already-successful awards still dedupe correctly. Approved.
strongkeep-debug
left a comment
There was a problem hiding this comment.
Follow-up after rechecking head b1d6c64: requesting changes to correct my earlier approval.
The existing unit suite passes, but it only covers the connection-failure path when post_pr_comment() succeeds. If the transfer endpoint is down and posting the manual-transfer notice also fails, main() still returns 0 after writing only awarded=false and skip_reason=transfer_failed: .... That leaves a green workflow with no RTC transfer and no durable/manual-transfer notice for maintainers to act on.
Validation I reran locally:
git diff --check origin/main...HEAD -- .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.py # passed
python -B -m py_compile .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.py # passed
python .github/actions/rtc-auto-bounty/test_award_rtc.py # Ran 42 tests ... OK
Additional probe:
transfer_rtc -> Connection failed: [Errno 111] Connection refused
post_pr_comment -> False
main() -> 0
GITHUB_OUTPUT -> awarded=false, skip_reason=transfer_failed: Connection failed: [Errno 111] Connection refused
The manual fallback is only safe if the manual notice is actually posted, or if another durable artifact is emitted before the job succeeds. Otherwise this can silently skip both the on-chain award and the backfill instruction.
📝 Code Review: PR #5530✅ SummaryReviewed RTC award workflow resilience. Changes look good and well-tested. 💡 Assessment
🎯 Recommended Reward: 8-12 RTC✅ VerdictAPPROVE - Solid contribution that addresses the issue effectively. Review by Herr Amano for Rustchain Bounties |
Code Review SummaryVerdict: Comment / Needs follow-up Warning
Warning
Looks Good
|
kekehanshujun
left a comment
There was a problem hiding this comment.
Re-reviewed head ccd7fc8f6ec221702c676a7c8bd7fed0eb67b901 after the manual-notice failure fix.
The previous blocker is addressed: when the RTC transfer endpoint is unreachable and the workflow cannot post the manual-transfer notice, main() now logs an explicit error, updates skip_reason to manual_notice_failed: ..., and returns 1 instead of leaving a green run with neither an on-chain award nor a visible manual backfill instruction.
Validation performed:
git diff --check origin/main...HEAD -- .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.py
python -B -m py_compile .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.py
python .github/actions/rtc-auto-bounty/test_award_rtc.py
Result: Ran 43 tests ... OK.
I also checked that the :MANUAL-REQUIRED marker remains retryable through check_already_awarded(), so a later rerun can still make the actual transfer once the endpoint is healthy. No blocker found on this updated head.
2balmprune
left a comment
There was a problem hiding this comment.
Re-reviewed updated head ccd7fc8f6ec221702c676a7c8bd7fed0eb67b901 after the manual-notice failure follow-up.
The blocker I raised earlier is resolved. If the transfer endpoint is unreachable and the workflow cannot post the manual-transfer notice, main() now logs the notice-posting failure, writes skip_reason=manual_notice_failed: ..., and returns non-zero instead of leaving a green run with neither an RTC transfer nor a durable manual backfill instruction. The successful manual-notice path still exits green and keeps the :MANUAL-REQUIRED marker retryable.
Validation performed:
git diff --check origin/main...HEAD -- .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.pypython3 -B -m py_compile .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.pypython3 .github/actions/rtc-auto-bounty/test_award_rtc.py-> 42 tests passed
No remaining blocker from my review.
508704820
left a comment
There was a problem hiding this comment.
Keep RTC award workflow actionable when endpoint is down. Verify: (1) Fallback path does not skip signature verification on awards. (2) Cached/stored awards are integrity-checked before use. (3) Error handling does not expose internal service topology. - Xeophon (security review)
strongkeep-debug
left a comment
There was a problem hiding this comment.
Re-reviewed current head ccd7fc8f6ec221702c676a7c8bd7fed0eb67b901 to clear my earlier changes-requested review.
The blocker I raised is addressed. In the connection-failure path, if the workflow cannot post the manual-transfer notice, main() now logs the notice-post failure, sets skip_reason to manual_notice_failed: ..., and returns 1 instead of silently exiting 0 with no award and no durable manual-transfer trail. The existing manual-required marker also remains retryable, so reruns are not blocked once the transfer endpoint is healthy.
Validation run locally:
git diff --check origin/main...HEAD -- .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.py
# passed
py -3 -B -m py_compile .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.py
# passed
py -3 .github/actions/rtc-auto-bounty/test_award_rtc.py
# Ran 43 tests; OK
py -3 tools/bcos_spdx_check.py --base-ref origin/main
# BCOS SPDX check: OK
No further blocker from me on this scoped award-workflow fallback fix.
jaxint
left a comment
There was a problem hiding this comment.
LGTM! Great work on this PR. 🚀
|
@RYB-404 — 10 RTC payout queued (pending_id 1605, confirms in 24h). Covers your merged work on #5474 + #5530. Wallet status: I couldn't find a valid RTC or 0x wallet in your PR bodies, so the 10 RTC has been deposited under the GitHub-username key |
|
Thanks @Scottcjn. Please sweep the 10 RTC phantom balance for |
BossChaos
left a comment
There was a problem hiding this comment.
PR #5530 Review - Auto-bounty endpoint unreachable detection
Quality Analysis
This PR adds network error detection for the auto-bounty award workflow.
Key improvements:
- _ENDPOINT_UNREACHABLE_PATTERNS: 11 patterns for network failures (connection refused, timed out, etc.)
- is_endpoint_unreachable_error(): Centralized detection function
- Manual transfer comment: When endpoint unreachable, posts manual transfer instructions with all needed details
- Prevents lost awards: Ensures awards aren't silently lost to transient network issues
Recommendation: Merge - improves reliability of auto-bounty awards.
Summary
Closes #5333
Validation
python -m py_compile .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.pypython .github/actions/rtc-auto-bounty/test_award_rtc.py(42 tests)