Skip to content

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
entrius:testfrom
ebios-star:refactor/move-max-issue-id-to-constants
Closed

refactor: move MAX_ISSUE_ID to gittensor/constants.py and use it on the validator side#1015
ebios-star wants to merge 1 commit into
entrius:testfrom
ebios-star:refactor/move-max-issue-id-to-constants

Conversation

@ebios-star

Copy link
Copy Markdown
Contributor

Summary

Follow-up to the just-merged #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 carries its own local copy with the same value and same intent:

# gittensor/validator/issue_competitions/contract_client.py:194-195
MAX_REASONABLE_ISSUE_ID = 1_000_000
if next_issue_id > MAX_REASONABLE_ISSUE_ID:

This PR hoists MAX_ISSUE_ID into gittensor/constants.py (alongside CONTRACT_ADDRESS, ISSUES_TREASURY_UID, etc.) so both consumers share a single definition. Validator code stays clean of any cli/* dependency, matching the import-direction precedent already set by #425 (NETWORK_MAP) and #460 (get_contract_address).

Changes

Net: +4 / -4 lines across 3 files. No behaviour change — same 1_000_000 bound, same comparison.

(Happy to fold this into the #955 bundle if that's preferred — easy to cherry-pick.)

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Testing

  • pytest tests/ — all 754 tests pass.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Changes are documented (if applicable)

…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).
@ebios-star

Copy link
Copy Markdown
Contributor Author

@anderdc whenever you have a moment, this is a small follow-up to the just-merged #873 that hoists the issue-ID bound into gittensor/constants.py so the validator side can share the same constant. Happy to fold into the #955 bundle if that's preferred. Thanks!

@xiao-xiao-mao xiao-xiao-mao Bot added the refactor Code restructuring without behavior change label May 5, 2026
@ebios-star

Copy link
Copy Markdown
Contributor Author

Consolidated into #917 per @anderdc's request — closing in favour of the bundled review.

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

Labels

refactor Code restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant