refactor: move MAX_ISSUE_ID to gittensor/constants.py and use it on the validator side - #1015
Closed
ebios-star wants to merge 1 commit into
Closed
Conversation
…he validator side Follow-up to entrius#873 which deduped the 1_000_000 issue-ID bound on the CLI side using the helpers.py-local MAX_ISSUE_ID. The validator-side path in IssueCompetitionContractClient.get_issues_by_status still carried its own local 'MAX_REASONABLE_ISSUE_ID = 1_000_000' with the same value and same intent. Hoists MAX_ISSUE_ID into gittensor/constants.py (alongside the other issues-competition constants) so both consumers share one definition. Validator code stays clean of any cli/* dependency, matching the import-direction precedent in entrius#425 (NETWORK_MAP) and entrius#460 (get_contract_address).
Contributor
Author
8 tasks
Contributor
Author
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to the just-merged #873, which deduped the
1_000_000issue-ID bound on the CLI side using thehelpers.py-localMAX_ISSUE_ID. The validator-side path inIssueCompetitionContractClient.get_issues_by_statusstill carries its own local copy with the same value and same intent:This PR hoists
MAX_ISSUE_IDinto gittensor/constants.py (alongsideCONTRACT_ADDRESS,ISSUES_TREASURY_UID, etc.) so both consumers share a single definition. Validator code stays clean of anycli/*dependency, matching the import-direction precedent already set by #425 (NETWORK_MAP) and #460 (get_contract_address).Changes
MAX_ISSUE_ID = 1_000_000to the Issues Competition section.gittensor.constants. Existing call sites (validate_issue_id,_read_issues_from_child_storage) are unaffected.MAX_REASONABLE_ISSUE_ID, importMAX_ISSUE_IDfromgittensor.constants.Net: +4 / -4 lines across 3 files. No behaviour change — same
1_000_000bound, same comparison.(Happy to fold this into the #955 bundle if that's preferred — easy to cherry-pick.)
Type of Change
Testing
pytest tests/— all 754 tests pass.Checklist