build: bump simulator to 0.3.1, mutate private state via updatePrivateState - #755
Conversation
Pulls in live-backend private-state mutation (compact-tools#131) and the serialized updatePrivateState read-modify-write API. Refs: #712
Every helper was a hand-rolled read-merge-write with an unawaited setPrivateState, which would prove against stale state on live. The simulator's updatePrivateState serializes the read-modify-write and resolves to the written state, so the helpers shrink to a patch or an updater function and work on both backends. Refs: #712
Witnesses bind at deploy on a live node, so the 9 specs that swap wit_getRoleCommitmentPath mid-test are gated with an itDryOnly alias (it.skipIf(isLiveBackend())). All 9 still run on dry. Refs: #712
sharedInitCollision and composedTokens still constructed via the pre-0.2.0 synchronous constructor, passing an args array where the simulator now expects prepared deps — every spec in initStateIsolation.spec.ts failed with 'reading kind of undefined'. Construction goes through static create(), circuit wrappers return promises, and the spec awaits them. Closes #754
test:integration and test:harness were never executed by any workflow, which is how the broken integration fixtures went unnoticed. Both run after the unit suite; integration reuses the compile cache via its compile:integration dependency and harness is pure TS, so the added wall-clock is seconds. Closes #753
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (15)
WalkthroughThe simulator dependency is updated, private-state helpers use ChangesSimulator and integration test migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Types of changes
Fixes #712
Fixes #753
Fixes #754
Simulator bump (#712)
@openzeppelin/compact-simulator^0.2.0→^0.3.1(live private-state mutation, compact-tools#131).updatePrivateState— the old read-merge-write leftsetPrivateStateunawaited, so on live they would have proven against stale state.overrideWitnessspecs inShieldedAccessControl.test.tsare dry-only (itDryOnly); witnesses bind at deploy on live. All 9 still run on dry.Integration fixtures (#754)
sharedInitCollision/composedTokensported from the pre-0.2.0 sync constructor tostatic create();initStateIsolation.spec.tsawaits — all 5 previously-broken tests pass.CI (#753)
test.ymlnow runstest:integrationandtest:harness(sequentially — they share the compile cache and finish in seconds).Verified locally: unit 1483 passed / 10 skipped, integration 12 passed, harness 110 passed / 4 skipped,
typesandlintclean.PR Checklist
Summary by CodeRabbit
Bug Fixes
Tests