Skip to content

test(functional): prove across a spec 0 to spec 1 upgrade - #302

Open
prajwolrg wants to merge 4 commits into
mainfrom
functional-asm-upgrade-test
Open

prajwolrg wants to merge 4 commits into
mainfrom
functional-asm-upgrade-test

Conversation

@prajwolrg

@prajwolrg prajwolrg commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Adds a functional test that upgrades a running strata-asm-runner from spec 0 to spec 1 (the claim-v1 ruleset from #291) and checks that proving continues across the switch. Until now, upgrade coverage was asm_upgrade_recovery, which runs native services with a test spec and no prover.

The test loads both programs, activates spec 1 with a signed admin AsmStfVk update, and asserts the spec of every block. Blocks up to and including the enacting block run under spec 0, and every later block runs under spec 1. It then waits for the ASM proof of the first spec 1 block and a Moho proof past it. That Moho proof can only exist if the recursion accepted step proofs from both programs.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor
  • New or updated tests
  • Dependency update
  • Security fix

Notes to Reviewers

Stacked on #291. Review that first; this PR's diff is only the four commits on top.

Entry point: functional-tests/tests/fn_asm_upgrade_test.py, then envs/upgrade_env.py.

The Python suite gets the admin transaction from a new asm-test-cli binary in the integration-tests crate instead of building it in Python. Building it in Python would duplicate the admin signing message, the SSZ wire format, and the envelope assembly, and any drift would show up only as an ignored tx and a timeout. The binary reuses the harness code, so there is one implementation. alpen's strata-test-cli and strata-bridge's dev-cli work the same way.

Every env now uses a known admin key. The old signer came from the MuSig2 test key, whose secret the suite does not have.

The test runs only on the native backend. Each SP1 guest compiles one spec, and spec 1 has no guest yet, so UpgradeEnv fails at startup under ASM_PROVER_BACKEND=sp1 with a clear message. CI runs native only.

Testing: the full functional suite passes locally (21 tests, including the new one). So do asm_admin, asm_upgrade_recovery, asm_admin_to_stf and asm_checkpoint, which use the refactored envelope builder. Each commit passes clippy, rustfmt, ruff and ty on its own.

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.

Related Issues

Part of the ASM upgradability epic, STR-4106.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Commit: b555f71
Baseline: #301 (361bc3a)
SP1 Execution Results

program cycles gas Δ cycles Δ gas
asm-stf 177,777,218 175,550,930 -155 (-0.0%) -81 (-0.0%)
moho 5,193,682 5,504,558 0 (0.0%) 0 (0.0%)

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@prajwolrg
prajwolrg force-pushed the functional-asm-upgrade-test branch from c53e1a9 to c466a8e Compare October 1, 2026 10:28
@prajwolrg
prajwolrg requested a review from irnb October 1, 2026 10:35
@prajwolrg
prajwolrg marked this pull request as ready for review October 1, 2026 10:35
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T11:44:54.854506Z 135fd38 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

🔒 AI Security Review (claude-opus-5-5)

✅ No security issues found.

@irnb
irnb added this pull request to stack #303 October 1, 2026 10:45
Base automatically changed from bridge-claim-version-parameterize to main October 1, 2026 11:41
A standalone test tool needs to post admin envelopes against an
existing regtest node, where there is no harness. Funding and envelope
assembly only need a bitcoind wallet and the magic bytes, so they now
take those directly and the harness methods delegate to them.
The Python functional tests have no way to sign an admin action or
build an envelope, so they cannot activate an ASM upgrade. Shelling out
to a binary built on the integration-test harness keeps a single
implementation of the admin signing message and wire format, the same
approach alpen's strata-test-cli and strata-bridge's dev-cli take.
The admin signer was derived from the MuSig2 test key, whose secret the
suite does not have, so no test could sign an admin action. It is now a
known key. Envs can also lower the admin confirmation depth and list
more than one execution target, which an upgrade test needs.
Upgrade coverage so far ran native services without a prover. This
drives the real runner with both programs loaded through an admin
activation and checks that the recursive proof chain continues past
the switch.

Native backend only: spec 1 has no SP1 guest yet.
@prajwolrg
prajwolrg force-pushed the functional-asm-upgrade-test branch from c466a8e to 135fd38 Compare October 1, 2026 11:41
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

🔒 AI Security Review (claude-opus-5-5)

✅ No security issues found.

This branch has not been deployed

No deployments
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.

1 participant