Skip to content

fix(airdrop): scope _determine_tier to org merged PRs (fixes #8184) - #8226

Open
jjb9707 wants to merge 1 commit into
Scottcjn:mainfrom
jjb9707:fix/airdrop-tier-org-scope
Open

fix(airdrop): scope _determine_tier to org merged PRs (fixes #8184)#8226
jjb9707 wants to merge 1 commit into
Scottcjn:mainfrom
jjb9707:fix/airdrop-tier-org-scope

Conversation

@jjb9707

@jjb9707 jjb9707 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

_determine_tier() decided an airdrop claimant's tier — up to CORE = 200 wRTC — from GitHub activity queried with author:<user> merged:true against /search/commits. That counts the user's commits anywhere on GitHub, so any established account reached CORE without ever contributing to RustChain (see #8184).

Root cause

  • Query was /search/commits?q=author:<user> merged:true — no org:/repo: scope, and merged:true is a PR-search qualifier sent to the commits endpoint.
  • Result: total_prs reflected "is this a real GitHub user with history", not "did they contribute here".

Fix

Switch to the issues search scoped to the org and to merged PRs:

contrib_resp = requests.get(
    "https://api.github.com/search/issues",
    headers=headers,
    params={
        "q": f"author:{github_username} org:Scottcjn is:pr is:merged",
        "per_page": 1,
    },
    timeout=10,
)

The tier now reflects actual RustChain contributions, paired with the airdrop's existing per-account/per-wallet dedup.

Verification

  • Updated test_eligibility_with_mock_github to match the new /search/issues endpoint.
  • Added test_determine_tier_scoped_to_org regression test asserting the query is scoped (org:Scottcjn, is:pr, is:merged) and no longer uses the unscoped merged:true qualifier, and that 5 org-merged PRs => CORE.
  • Full suite python -m unittest test_airdrop_v232 passed.

Fixes #8184.

…#8184)

_determine_tier queried /search/commits with `author:<user> merged:true`,
which counts the claimant's commits anywhere on GitHub. Any established
account reached CORE (200 wRTC) without contributing to RustChain.

Switch to /search/issues with `author:<user> org:Scottcjn is:pr is:merged`
so the tier reflects actual RustChain contributions. Adds a regression test
asserting the contribution query is scoped to the org.
@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) BCOS-L2 Beacon Certified Open Source tier BCOS-L2 (required for non-doc PRs) node Node server related size/M PR: 51-200 lines labels Aug 14, 2026
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) BCOS-L2 Beacon Certified Open Source tier BCOS-L2 (required for non-doc PRs) node Node server related size/M PR: 51-200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

airdrop _determine_tier counts GitHub-wide activity, not RustChain contributions — any established account reaches CORE (200 wRTC)

1 participant