Skip to content

erc20-vault on the 0.15.0 path-notification protocol set - #12

Open
BRBussy wants to merge 1 commit into
mainfrom
feat/notification-field-path
Open

erc20-vault on the 0.15.0 path-notification protocol set#12
BRBussy wants to merge 1 commit into
mainfrom
feat/notification-field-path

Conversation

@BRBussy

@BRBussy BRBussy commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

What

Moves the examples onto the @sig-net 0.15.0 matched set, in which the V1 SignBidirectionalEventNotification carries the resolved ledger-tree path of the caller's request map (requestsPathDepth + up to 4 requestsPath indices) instead of a flat field ordinal.

  • @sig-net/midnight, @sig-net/midnight-contract, @sig-net/midnight-contract-deploy: 0.14.0 → 0.15.0; fakenet compose image: 0.9.0 → 0.10.0 (built against the same set)
  • The vault's two notifier calls (depositErc20, withdrawErc20) pack depth 1 + path [0, 0, 0, 0]. The compiled contract-info.json records the map's "index" as 0, which is the source the docs teach integrators to read
  • VAULT_REQUESTS_INDEX_FIELD / VAULT_NONCE_FIELD become VAULT_REQUESTS_PATH / VAULT_NONCE_PATH, the test-harness reader option becomes requesterRequestsPath, and the contract tests read raw state through signetFieldNodeByPath
  • The root integrator guide gains a "request map's ledger-tree path" section (why the path exists, the 15-entry chunk tree, and how to read the path out of the compiled artifacts), with the vault as the worked flat example

Why

Past 15 ledger fields, compactc packs a contract's public state into a chunk tree, so a flat field index cannot address every contract's request map. The path-carrying notification makes the MPC's read deterministic: it follows the compiler-recorded path node for node and never re-derives the chunk structure by inspecting array shapes.

Matched counterparts: sig-net/midnight-integration#48 (the protocol change and 0.15.0 release) and sig-net/solana-signet-program#56 (the fakenet 0.10.0 responder).

Testing

  • Unit tests green (53 + 24 + 11 across the workspace)
  • The full e2e suite green locally in one uninterrupted run (6 files, 60 tests, ~23 min) against the fakenet:0.10.0 image: three request/attest round trips plus the failure-refund, false-claimer and bearer-transfer flows
  • A workflow_dispatch full-suite CI run is in flight on this branch: https://github.com/sig-net/midnight-examples/actions/runs/30636958025

🤖 Generated with Claude Code

The V1 SignBidirectionalEventNotification now carries the resolved
ledger-tree path of the caller's request map (requestsPathDepth +
requestsPath) instead of a flat field ordinal, so the MPC follows the
compiler-recorded path through raw state and chunked (>15 field)
contracts can integrate. On this set:

- @sig-net/midnight, @sig-net/midnight-contract and
  @sig-net/midnight-contract-deploy pinned at 0.15.0, fakenet compose
  image at 0.10.0 (built against the same set)
- the vault's two notifier calls pack depth 1 + path [0, 0, 0, 0]; the
  compiled contract-info.json records the map's "index" as 0
- VAULT_REQUESTS_INDEX_FIELD / VAULT_NONCE_FIELD become
  VAULT_REQUESTS_PATH / VAULT_NONCE_PATH, the harness option becomes
  requesterRequestsPath, and the raw-state reads go through
  signetFieldNodeByPath
- the integrator guides explain the chunk-tree layout and how to read a
  map's path from the compiled artifacts

Verified locally: unit tests green, and the full e2e suite (6 files,
60 tests) green in one run against the fakenet 0.10.0 image.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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