Skip to content

Alpha burn removal & internal service helper - #143

Merged
aliyuldashev merged 5 commits into
mainfrom
dev
Jul 28, 2026
Merged

Alpha burn removal & internal service helper#143
aliyuldashev merged 5 commits into
mainfrom
dev

Conversation

@aliyuldashev

Copy link
Copy Markdown
Collaborator

This pull request introduces several important changes, mainly focused on improving the scoring logic for miners and validators, refactoring the handling of on-chain scores, and ensuring that user identifiers are consistently included in challenge-related API calls. Additionally, it updates documentation references and makes minor cleanup changes.

Scoring Logic and On-Chain Score Calculation:

  • The on-chain scoring mechanism in miner_manager.py has been simplified to rely solely on challenge scores, removing the previous weighting and fallback logic for alpha burn and alpha stake. The methods for calculating alpha burn and alpha stake scores have been removed or commented out, and the final scores now directly reflect challenge performance. [1] [2] [3]

Challenge API and User Tracking:

  • All challenge comparison and validation API calls in controller.py now consistently include the user_id (the miner's Docker Hub ID) in their payloads. This ensures better tracking and association of submissions with users throughout the challenge lifecycle. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Documentation Updates:

  • The validator and miner setup documentation links in README.md have been updated to point to the new locations under the docs/validator/ and docs/miner/ directories.

Repository Maintenance:

  • The flowprint submodule has been updated to a new commit, which may bring in upstream bugfixes or features.

Code Cleanup:

  • The __all__ list in redteam_core/__init__.py has been cleaned up to remove a reference to constant_docs, which no longer exists.

@aliyuldashev
aliyuldashev requested a review from Copilot July 28, 2026 01:02
@aliyuldashev aliyuldashev self-assigned this Jul 28, 2026
@aliyuldashev aliyuldashev added documentation Improvements or additions to documentation enhancement New feature or request minor labels Jul 28, 2026

Copilot AI 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.

Pull request overview

This PR simplifies validator on-chain scoring to rely purely on aggregated challenge performance (removing alpha burn/stake components) and extends challenge comparison/validation requests to include a user_id so internal services can attribute requests to the submitting miner.

Changes:

  • Simplifies MinerManager.get_onchain_scores() to return only challenge-derived scores (with challenge-weight redistribution when some challenges have no submissions).
  • Adds user_id to multiple internal-service request payloads in the challenge controller to improve submission attribution/tracking.
  • Updates documentation links and cleans up redteam_core.__all__.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

File Description
src/redteam_core/validator/miner_manager.py Removes alpha burn/stake influence from on-chain scores and redistributes unused challenge weights; needs doc/code cleanup.
src/redteam_core/challenge_pool/controller.py Adds user_id to compare/validate payloads; reveals return-type inconsistencies that can cause runtime errors.
src/redteam_core/init.py Removes stale constant_docs export from __all__.
README.md Updates validator/miner documentation links to new docs paths.
Comments suppressed due to low confidence (3)

src/redteam_core/challenge_pool/controller.py:477

  • The /compare response parsing defaults data to a list ([]), but callers expect a dict with keys like similarity_score/reason. If the service returns a list, this will break .get(...) usage. Parse data defensively and always return a dict (e.g., use {} as default and, if a list is returned, select the first element).
                "user_id": user_id,
            }
            headers = {
                "Content-Type": "application/json",
                "X-API-KEY": constants.INTERNAL_SERVICES.API_KEY,

src/redteam_core/challenge_pool/controller.py:599

  • The /compare/same-score response parsing defaults data to [], but same_score_comparison() treats the result as a dict (checks membership and indexes by key). Ensure _compare_same_score_outputs() always returns a dict (use {} as default and coerce list responses to a single dict).
                "user_id": user_id,
            }
            headers = {
                "Content-Type": "application/json",
                "X-API-KEY": constants.INTERNAL_SERVICES.API_KEY,

src/redteam_core/validator/miner_manager.py:214

  • Large blocks of commented-out scoring code (_get_alpha_stake_scores, _get_alpha_burn_scores, and the alpha-burn fallback) are kept in the module. This makes the file harder to read/maintain and increases the risk of future confusion about which logic is active. Prefer removing these commented blocks (or moving the historical logic to documentation) now that the PR intentionally removes alpha burn/stake scoring.
    # def _get_alpha_stake_scores(self, n_uids: int) -> np.ndarray:
    #     """
    #     Returns a numpy array of scores based on alpha stake, high for more stake.
    #     Uses square root transformation to reduce the impact of very high stakes, encourage small holders.
    #     """

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/redteam_core/challenge_pool/controller.py
Comment thread src/redteam_core/validator/miner_manager.py
@aliyuldashev
aliyuldashev merged commit 93b817b into main Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants