Skip to content

ci: snapshot-cached runtime checks — split clone shards, required try-runtime snapshots, integrity manifests#2874

Merged
IntiTechnologies merged 3 commits into
mainfrom
split-stake-sdk-clone-shard
Jul 12, 2026
Merged

ci: snapshot-cached runtime checks — split clone shards, required try-runtime snapshots, integrity manifests#2874
IntiTechnologies merged 3 commits into
mainfrom
split-stake-sdk-clone-shard

Conversation

@unarbos

@unarbos unarbos commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Two related speedups for Runtime Checks, which has been the long pole on every runtime-affecting PR.

1. Split the stake-sdk clone shard (fe6edda)

  • stake-sdk keeps the two SDK-facing tests plus the metadata drift gate; a new issuance shard takes test-net-tao-flow-emission-allocation + test-total-issuance-trackers (the ~6-min legitimate wait) along with the 30-minute timeout override. Removes ~10 min from the longest shard.

2. Snapshot-cached try-runtime (348420a, ef43c28 — authored by @UnArbosFive on codex/try-runtime-snapshot-cache-test, cherry-picked here onto current main; conflicts with #2867's workflow changes resolved)

  • Producer (refresh-mainnet-snapshot.yml): snapshots pinned to a finalized block (--at), shipped with a sha256/spec-version manifest, versioned artifact names (try-runtime-snap-v0.10.1-<network>), 7-day retention, max-parallel: 1 so refreshes cannot crowd PR jobs off the tryruntime runner pool.
  • Consumer (runtime-checks.yml): try-runtime jobs now require a fresh (<72h) digest-verified snapshot instead of silently falling back to a 30-40 min live scrape; live state is an explicit label/dispatch bypass. Build split into build-try-runtime (16-core, gates try-runtime) and build-node-release (8-core, gates clone shards) so neither waits on the other. MBM detection auto-adds --disable-mbm-checks while the runtime has no multi-block migrator.
  • New .github/scripts/snapshot-artifact.sh helper (select/download/validate) with contract tests wired in as a snapshot-artifact-tests job.

Conflict resolutions of note: kept main's create-snapshot arg-order fix semantics via UnArbosFive's superset version; merged the changes filter to keep both #2867's python_sdk/sdk_drift outputs and the new snapshot_ci output; sdk-checks keeps the python_sdk trigger and gains the try_runtime_only dispatch exclusion.

Deploy note (important)

After this merges, dispatch refresh-mainnet-snapshot.yml on main once: the artifact names change and snapshots become required, so runtime PRs will fail try-runtime until the first green producer run publishes the v-named artifacts. Validated on the source branch: mainnet snapshot 27 min, testnet 3 min.

Test plan

  • YAML lint on both workflows
  • .github/scripts/test-snapshot-artifact.sh passes locally
  • All four clone shards (balancer, locks, stake-sdk, issuance) green; "Sudo-upgrade mainnet clone and test" gate passes
  • Post-merge: producer dispatched, next runtime PR restores snapshots

… serializing behind the SDK pair

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
subtensor Ready Ready Preview, Comment Jul 12, 2026 8:14pm

Request Review

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

BASELINE scrutiny — repository write access and substantial activity, no Gittensor association; additional scrutiny applied for commits authored by the related UnArbosFive account; split-stake-sdk-clone-shard → main.

Static review covered the expanded snapshot-artifact implementation and workflow changes added since the prior review. Snapshot selection is constrained by repository identity, trusted branch, age, API digest, network genesis, manifest contract, file size, and content checksum; PR-triggered consumers cannot select an arbitrary source branch. The clone shard split preserves the required-check fan-in and test coverage.

Findings

No findings.

Conclusion

No malicious behavior or security vulnerability was found in the current diff.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

UNKNOWN Gittensor association; established, highly active contributor with repository write access.

The snapshot helper contract tests pass, and both modified workflows parse successfully. The producer/consumer integrity checks, fail-closed cached mode, build split, matrix fan-in, and issuance shard preserve the intended coverage.

The overlapping PR #2850 concerns bittensor-core e2e work and is not a duplicate.

Findings

Sev File Finding
MEDIUM .github/workflows/runtime-checks.yml:314 Document the required bootstrap label for this PR inline

Conclusion

The implementation is sound and adequately tested. The one-time bootstrap requirement should be made explicit before merge.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@unarbos unarbos changed the title ci: split the stake-sdk clone shard into stake-sdk and issuance ci: snapshot-cached runtime checks — split clone shards, required try-runtime snapshots, integrity manifests Jul 12, 2026

@github-actions github-actions Bot 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.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment on lines +310 to +314
.github/scripts/snapshot-artifact.sh select \
"try-runtime-snap-v${TRY_RUNTIME_VERSION}-${{ matrix.network.name }}" \
"${{ github.event_name == 'workflow_dispatch' && inputs.snapshot_source_branch || github.event.repository.default_branch }}" \
"${{ github.repository_id }}" \
72 "$GITHUB_OUTPUT" required

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.

[MEDIUM] Document the required bootstrap label for this PR

The default branch cannot yet have artifacts under the new versioned names because the producer naming change is introduced by this PR. With no fresh-try-runtime-state label currently attached, all three PR try-runtime jobs will fail here before the post-merge producer dispatch can occur. Add the label to this PR and update the deploy note to state that this first PR must run against live state; after merge and the initial producer dispatch, subsequent PRs can remain fail-closed on cached snapshots.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@IntiTechnologies IntiTechnologies merged commit 75798da into main Jul 12, 2026
44 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants