Skip to content

fix: keep RTC award workflow actionable when endpoint is down#5530

Merged
Scottcjn merged 3 commits into
Scottcjn:mainfrom
RYB-404:fix/award-manual-notice-5333
May 18, 2026
Merged

fix: keep RTC award workflow actionable when endpoint is down#5530
Scottcjn merged 3 commits into
Scottcjn:mainfrom
RYB-404:fix/award-manual-notice-5333

Conversation

@RYB-404
Copy link
Copy Markdown

@RYB-404 RYB-404 commented May 17, 2026

Summary

  • treat RTC transfer endpoint connection failures as manual-transfer-required instead of hard-failing the award job
  • post the award amount, recipient wallet, source wallet, and memo for maintainer backfill
  • keep manual-required markers retryable so reruns can still award once the endpoint is healthy

Closes #5333

Validation

  • python -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 (42 tests)

@RYB-404 RYB-404 requested a review from Scottcjn as a code owner May 17, 2026 01:59
@github-actions
Copy link
Copy Markdown
Contributor

Welcome to RustChain! Thanks for your first pull request.

Before we review, please make sure:

  • Non-doc PRs have a BCOS-L1 or BCOS-L2 label
  • Doc-only PRs are exempt from BCOS tier labels when they only touch docs/**, *.md, or common image/PDF files
  • New code files include an SPDX license header
  • You've tested your changes against the live node

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!

@github-actions github-actions Bot added BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) ci size/S PR: 11-50 lines labels May 17, 2026
@BossChaos
Copy link
Copy Markdown
Contributor

Code Review

Reviewed 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: 0xdaE5d307339074A24F579dB48e7c639359D94904

Copy link
Copy Markdown

@strongkeep-debug strongkeep-debug left a comment

Choose a reason for hiding this comment

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

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 � OK

I 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.

Copy link
Copy Markdown

@2balmprune 2balmprune left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown

@ZacharyZhang-NY ZacharyZhang-NY left a comment

Choose a reason for hiding this comment

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

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() emits Connection failed: ... for URLError, matching the new branch in main().
  • The connection-failure path now keeps the workflow green, writes awarded=false plus a transfer-failed skip_reason, and posts a manual-transfer notice containing amount, recipient, source wallet, and memo.
  • The new MANUAL-REQUIRED marker is excluded by check_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 FAILED retryable 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.

Copy link
Copy Markdown

@TJCurnutte TJCurnutte left a comment

Choose a reason for hiding this comment

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

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 with Ran 42 tests ... OK.
  • Focused runtime probe confirmed check_already_awarded() still blocks a successful RTC-AutoBounty-Awarded marker, but allows retry after :MANUAL-REQUIRED and :FAILED markers.
  • The same probe simulated transfer_rtc() returning Connection failed: [Errno 111] Connection refused; main() returned 0, posted a RTC Auto-Bounty Manual Transfer Required comment body, and included the RTC-AutoBounty-Awarded:MANUAL-REQUIRED marker 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.

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown

@strongkeep-debug strongkeep-debug left a comment

Choose a reason for hiding this comment

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

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.

@Auren-Innovation
Copy link
Copy Markdown

📝 Code Review: PR #5530

✅ Summary

Reviewed RTC award workflow resilience. Changes look good and well-tested.

💡 Assessment

  • Quality: Standard
  • Test Coverage: ✅ Adequate
  • Code Style: ✅ Follows conventions
  • Documentation: ✅ Clear (where applicable)

🎯 Recommended Reward: 8-12 RTC

✅ Verdict

APPROVE - Solid contribution that addresses the issue effectively.


Review by Herr Amano for Rustchain Bounties

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

@denerbarbosa
Copy link
Copy Markdown

Code Review Summary

Verdict: Comment / Needs follow-up

Warning

  • .github/actions/rtc-auto-bounty/award_rtc.py:246:manual-required is now ignored by check_already_awarded(), which keeps retries alive, but also means a rerun can re-award the same PR if the manual transfer was already completed and the success marker has not been written yet. Consider a distinct terminal marker for manual settlement or a status check before retrying.

Warning

  • .github/actions/rtc-auto-bounty/award_rtc.py:447 — The manual-transfer path only triggers on connection failed:. Other network failures (timeout, DNS, TLS, HTTP 5xx) still hard-fail and skip the operator notice, so the workflow is less actionable than the summary suggests.

Looks Good

  • Regression coverage was added for the new manual-required path.
  • The workflow now surfaces the wallet, amount, and memo when the endpoint is down.

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

@github-actions github-actions Bot added size/M PR: 51-200 lines and removed size/S PR: 11-50 lines labels May 17, 2026
Copy link
Copy Markdown
Contributor

@kekehanshujun kekehanshujun left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown

@2balmprune 2balmprune left a comment

Choose a reason for hiding this comment

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

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.py
  • python3 -B -m py_compile .github/actions/rtc-auto-bounty/award_rtc.py .github/actions/rtc-auto-bounty/test_award_rtc.py
  • python3 .github/actions/rtc-auto-bounty/test_award_rtc.py -> 42 tests passed

No remaining blocker from my review.

Copy link
Copy Markdown
Contributor

@508704820 508704820 left a comment

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown

@strongkeep-debug strongkeep-debug left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@jaxint jaxint left a comment

Choose a reason for hiding this comment

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

LGTM! Great work on this PR. 🚀

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

@Scottcjn Scottcjn merged commit 4eb6ee9 into Scottcjn:main May 18, 2026
2 checks passed
@RYB-404
Copy link
Copy Markdown
Author

RYB-404 commented May 19, 2026

Hi @Scottcjn, thanks for merging this PR.

I noticed the award-rtc workflow failed after merge. Could you please check whether the RTC award needs a manual retry or manual payout?

PR: #5530

@Scottcjn
Copy link
Copy Markdown
Owner

@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 RYB-404 as a phantom balance. To sweep it to a real wallet, please drop a comment here or on either PR with your valid wallet (format: RTC followed by exactly 40 hex chars, OR 0x followed by 40 hex chars) and I'll move it.

@RYB-404
Copy link
Copy Markdown
Author

RYB-404 commented May 20, 2026

Thanks @Scottcjn. Please sweep the 10 RTC phantom balance for RYB-404 to this valid 0x wallet: 0xdaE5d307339074A24F579dB48e7c639359D94904

Copy link
Copy Markdown
Contributor

@BossChaos BossChaos left a comment

Choose a reason for hiding this comment

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

PR #5530 Review - Auto-bounty endpoint unreachable detection

Quality Analysis

This PR adds network error detection for the auto-bounty award workflow.

Key improvements:

  1. _ENDPOINT_UNREACHABLE_PATTERNS: 11 patterns for network failures (connection refused, timed out, etc.)
  2. is_endpoint_unreachable_error(): Centralized detection function
  3. Manual transfer comment: When endpoint unreachable, posts manual transfer instructions with all needed details
  4. Prevents lost awards: Ensures awards aren't silently lost to transient network issues

Recommendation: Merge - improves reliability of auto-bounty awards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) ci size/M PR: 51-200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RTC award workflow still fails after #5266; backfill needed for missed merged PRs