Skip to content

chore(account-demo): vendor viem#5004 @47710b6 + source SCOPE from actorScope - #140

Merged
chunter-cb merged 2 commits into
mainfrom
account-demo-viem-8130-actorscope
Sep 2, 2026
Merged

chunter-cb merged 2 commits into
mainfrom
account-demo-viem-8130-actorscope

Conversation

@chunter-cb

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #105 (which vendored an earlier viem#5004 state with the old actorScope). Re-vendors vendor/aa from wevm/viem#5004 at its current head (feat/eip-8130-production @ 47710b6 — "message-signing envelope, dataSuffix→metadata, contract address sync") and makes the demo source its scope bitmask from viem.

Changes

  • Rebuilt vendor/aa/index.js from viem 47710b6, picking up:
    • ERC-1271 message-signing envelope surface (toAccount().signMessage/signTypedData, signMessageEnvelope, signTypedDataEnvelope, replaySafeHash, …) + the validateSignature action.
    • Breaking actorScope change: sender → operator, and the bit values reshuffled (selfPayer 0x08→0x02, sponsorPayer 0x10→0x04, policy 0x02→0x08, nonce 0x04→0x10).
    • Contract/keystore address sync + SignedAccountChanges → SignedAccountChangeBatch signing typehash. (All byte-packing/typehash logic stays inside viem.)
  • model.ts: source SCOPE from viem's actorScope instead of a hardcoded copy. Under the new bits, the old hardcoded values would mis-scope a policy-gated session key (SCOPE.policy | SCOPE.nonce → 0x06 = selfPayer | sponsorPayer). All call sites (scopeChips, presets, trustedExecutor authorization) now get correct values automatically.
  • index.d.ts: update the hand-written actorScope type to the new shape.

Net diff is 3 files: the rebuilt bundle, its types, and the one-line-of-intent SCOPE change.

Test plan

  • tsc --noEmit clean
  • npm test — all pass (309)
  • npm run build — succeeds
  • Manual smoke against vibenet (create / send / session-key policy + rotation) — verifies the new scope bit values on-chain

Notes

viem#5004 is still a draft upstream, so the bundle is built from the fork branch rather than an npm release; collapses to npm install viem@latest once it ships.

…torScope

PR #105 vendored an earlier viem#5004 state (old actorScope). Rebuild
vendor/aa from feat/eip-8130-production @ 47710b6 (message-signing envelope,
contract-address sync), which reshuffles the actorScope bitmask
(sender→operator; policy/nonce/selfPayer/sponsorPayer bit values changed) and
adds signMessage/signTypedData + validateSignature.

Source the demo's SCOPE constant from viem's actorScope instead of a
hardcoded copy so the bits can't drift from the protocol — otherwise a
policy-gated session key (SCOPE.policy | SCOPE.nonce) would be mis-scoped
under the new values. Update the hand-written actorScope type in index.d.ts.

Typecheck clean, tests pass, production build succeeds.
@cb-heimdall

cb-heimdall commented Sep 2, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Heimdall Review Status

Requirement Status More Info
Reviews ✅ 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@vercel

vercel Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
omni-ui Ready Ready Preview Sep 2, 2026 11:22pm UTC

Request Review

Pull latest viem: feat/eip-8130-production advanced to ad18b249
("register drive-only contracts as k1 operators", base/eip-8130 #101).
The TRUSTED_EXECUTOR sentinel is deprecated — key.trustedExecutor(caller)
now resolves to a k1/ecrecover operational actor. The demo already calls
key.trustedExecutor(...), so the new behavior flows through the rebuilt
bundle with no UI code change (types unchanged).

Typecheck clean, 309 tests pass, build succeeds.
@chunter-cb
chunter-cb added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit ea8583b Sep 2, 2026
13 checks passed
@chunter-cb
chunter-cb deleted the account-demo-viem-8130-actorscope branch September 2, 2026 23:38

This branch was successfully deployed

1 active deployment
Preview — 093a6561 Deployed Sep 2, 2026 by vercel[bot]
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.

3 participants