Skip to content

Optimize contracts e2e#2718

Open
l0r1s wants to merge 3 commits into
devnet-readyfrom
optimize-contracts-e2e
Open

Optimize contracts e2e#2718
l0r1s wants to merge 3 commits into
devnet-readyfrom
optimize-contracts-e2e

Conversation

@l0r1s
Copy link
Copy Markdown
Collaborator

@l0r1s l0r1s commented Jun 4, 2026

Summary

This PR makes the contract E2E CI faster and less flaky by removing retry-based masking, fixing deterministic test setup issues, and adding explicit caching for the expensive Rust compile path.

Key changes:

  • Remove the GitHub Actions retry wrapper around the contract test suite.
  • Run contract test files directly and collect failures instead of rerunning the whole job.
  • Stop resubmitting finalized transactions; dispatch errors now fail deterministically.
  • Stabilize the wasm contract tests by funding the contract account, using valid limit parameters, fixing stale caller setup, and asserting expected contract reverts.
  • Fix tests that were previously only passing because transaction errors were swallowed.
  • Add explicit Rust artifact caching for:
    • target/fast-runtime, used by scripts/localnet.sh
    • contract-tests/bittensor/target
    • Cargo registry/git cache

Why

The CI job was taking too long because failures could trigger full retries, and the localnet binary compile was still a major bottleneck. CI reported roughly 49m spent compiling, which is not acceptable for a contract E2E job that should mostly be exercising runtime behavior.

The test changes make failures explicit instead of hiding them behind retries. The workflow cache changes target the non-standard Rust target directory used by localnet, so warm-cache CI runs should avoid most of the repeated Subtensor binary compilation.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

Baseline scrutiny: l0r1s has write permission, an established 2018 account, substantial contribution history, matching commit author, and no Gittensor allowlist hit; branch optimize-contracts-e2e -> devnet-ready.

Reviewed the workflow, CI script, and contract-test-only diff statically. The PR does not modify .github/ai-review/* or .github/copilot-instructions.md, does not touch runtime or pallet code, and does not add dependency or lockfile changes. The workflow remains scoped to contents: read; the added cache paths are limited to the contract-test build context.

Findings

No findings.

Conclusion

No malicious behavior or security vulnerability was found in the changed CI and contract-test files. Verdict is SAFE.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

Gittensor: LIKELY; author has write permission and substantial prior subtensor activity, though no direct allowlist match was found.

The PR body is substantive and matches the implementation: it removes the job-level retry wrapper, runs contract tests per file, makes dispatch errors fail deterministically, and adds targeted Rust/Yarn caching for the contract E2E workflow.

Spec version: not required; the diff only touches workflow and contract-test files, not runtime or pallet implementation. Duplicate-work check found one-file overlaps with #2700 and #2685, but the available metadata shows unrelated scopes, so this PR remains the better candidate for the contract E2E optimization work.

Validation performed: git diff --check passed, and bash -n contract-tests/run-ci.sh scripts/localnet.sh passed. I did not run the full contract E2E suite because no finding required runtime confirmation.

Findings

No findings.

Conclusion

Approve. The changes are scoped to CI/test reliability and speed, and the review did not identify a blocking correctness, runtime-safety, or process issue.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@l0r1s l0r1s added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Jun 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

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

Labels

skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant