Skip to content

fix(symbolic-spl): discharge AccountState discriminant branches#978

Draft
Stevengre wants to merge 2 commits intocodex/upstream-bootstrap-feature-ptokenfrom
codex/upstream/issue-016-accountstate-discriminant-discharge
Draft

fix(symbolic-spl): discharge AccountState discriminant branches#978
Stevengre wants to merge 2 commits intocodex/upstream-bootstrap-feature-ptokenfrom
codex/upstream/issue-016-accountstate-discriminant-discharge

Conversation

@Stevengre
Copy link
Contributor

Summary

This adds a self-contained prove-rs reproducer for AccountState branch selection and discharges the symbolic discriminant guard by combining explicit AccountState domain constraints with a #lookupDiscrAux(... ) ==Int C normalization rule.

Context

After the multisig proof profile moved to 3 signers, the next live frontier in test_process_revoke_multisig sat on if account.state == AccountState::Frozen. The path constraint already chose a branch, but the <k> cell still carried #lookupDiscrAux(... variantIdx(?SplAccountState)) ==Int 2, so branch selection stayed pending on a syntactic mismatch.

Red vs Green

Red:

  • spl-accountstate-discriminant-branch.rs reaches the AccountState::Frozen check with a symbolic discriminant term.
  • The branch split constrains one side of the guard, but the guard itself remains in the unnormalized #lookupDiscrAux(...) ==Int 2 shape.

Green:

  • cheatcode_is_spl_account now states the explicit 3-variant AccountState discriminant domain.
  • #lookupDiscrAux(DISCRS, IDX) ==Int DISCR is normalized to DISCR ==Int #lookupDiscrAux(DISCRS, IDX), which matches the branch-constraint shape and lets #selectBlock discharge the guard.

References

@Stevengre Stevengre force-pushed the codex/upstream-bootstrap-feature-ptoken branch from 3f8f76e to f3b895f Compare March 12, 2026 09:04
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