Skip to content

fix(airdrop): scope tiering to RustChain merged PRs - #8202

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

fix(airdrop): scope tiering to RustChain merged PRs#8202
Vyacheslav-Tomashevskiy wants to merge 1 commit into
Scottcjn:mainfrom
Vyacheslav-Tomashevskiy:fix/airdrop-tier-org-scope-forkbase

Conversation

@Vyacheslav-Tomashevskiy

Copy link
Copy Markdown
Contributor

Summary

  • count merged PRs with the GitHub issues search API scoped to org:Scottcjn instead of counting global commit history
  • keep the existing star-based fallback tiering intact
  • add regression tests that pin the org-scoped query contract

Testing

  • PYTHONPATH=node python3 -m pytest -q node/test_airdrop_v2.py

Closes #8184

@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 labels Aug 11, 2026
@github-actions github-actions Bot added the size/M PR: 51-200 lines label Aug 11, 2026

@FlintLeng FlintLeng left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Review: Airdrop Tier Scope to RustChain Merged PRs

Reviewed on: 2026-08-13

Summary

Same fix as #8187 (which I reviewed on 2026-08-07), but this PR also includes updated tests. Switches _determine_tier() from counting GitHub-wide commits to counting merged PRs in the Scottcjn org.

The Fix (Same as #8187) ✅

Old code: /search/commits with author:X merged:true — counts commits authored anywhere on GitHub. Any established account would clear the CORE tier (200 wRTC) without a single RustChain contribution.

New code: /search/issues with author:X org:Scottcjn is:pr is:merged — counts only merged PRs within the RustChain org. Correct.

Removes application/vnd.github.cloak-preview Accept header — only needed for commit search, not issues search.

Test Updates ✅

test_tier_search_ignores_global_commit_history — new test that verifies an account with 0 org-scoped merged PRs gets the STARGAZER tier (lowest), not a higher tier based on global GitHub activity. This is the correct regression test for this vulnerability.

Updated test_check_eligibility_builder_tier — now asserts the exact query string author:testuser org:Scottcjn is:pr is:merged is used. This catches both:

  1. Using the wrong endpoint (would fail on /search/commits)
  2. Using the wrong query (would fail on missing org:Scottcjn)

Relationship to #8187

This PR (#8202) and #8187 implement the same fix. #8187 also adds create_bridge_lock admin auth (reviewed separately). #8202 is a narrower, test-focused PR. Either can be merged; merging both would result in duplicate test coverage (acceptable).

Wallet: RTC019e78d600fb3131c29d7ba80aba8fe644be426e

✅ LGTM — correct fix with strong regression tests. Functionally equivalent to #8187.

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)

2 participants