Skip to content

feat: introduce ScopedExecutionHook - #152

Draft
leekt wants to merge 8 commits into
devfrom
feat/permission-hook-module-type
Draft

feat: introduce ScopedExecutionHook#152
leekt wants to merge 8 commits into
devfrom
feat/permission-hook-module-type

Conversation

@leekt

@leekt leekt commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace generic type-4 hooks with type-11 execution hooks scoped to validations, executors, and fallback selectors
  • remove ERC-1271 stateless enable-mode handling and switch structured signatures to the validation-type-first format
  • preserve the entry-point gate for unhooked fallback selectors while allowing selector-scoped hooks to make selectors publicly callable
  • update unit, fuzz, invariant, Halmos, Certora, gas snapshot, and README coverage for the scoped-hook model

Why

Kernel v4 needs hook behavior tied to the module or selector it governs instead of a single generic hook path. This makes hook lifecycle and execution boundaries explicit and removes obsolete signature and stateless-validation behavior.

Impact

This changes module installation, validation, executor, selector, fallback, and ERC-1271 behavior. Integrators using generic hooks or the previous ERC-1271 enable-mode encoding will need to migrate to scoped execution hooks and the validation-type-first signature format.

Validation

  • forge fmt --check: passes in source CI
  • forge build --sizes --skip MockKernel: currently blocked in source CI by a deterministic Solc 0.8.33 via-IR internal compiler error: Tag too large for reserved space
  • tests do not start because the build step fails

Source branch: zerodevapp/kernel_v4#60

leekt added 8 commits August 5, 2026 19:18
…ay (M), validity-format ordering (M) (#58)

* fix: gate enable-mode install on root signature success

* test: enable-mode install rejected on failed root signature

* fix: advance factory nonce on direct approval changes

* test: direct factory approval advances nonce

* fix: normalize validity ranges before format classification

* test: validity-format ordering regressions

* fix: RP-01 checkValidation EntryPoint v0.9 parity (#59)

* fix: checkValidation block-mode and exclusive validAfter per EntryPoint v0.9

* test: cover checkValidation EntryPoint v0.9 boundaries

* fix: vendor canonical EntryPoint v0.9 release initcode and address
Remove generic type-4 hooks, hook registration storage, sentinel-based installation state, and embedded hook configuration from validations, executors, and fallback selectors.
Remove stateless ERC-1271 module installation and the validation-mode signature byte. Structured signatures now begin with their validation type while ERC-4337 enable mode remains supported.
Add type-11 hooks scoped to validations, executors, and selectors, with explicit scoped identifiers and lifecycle checks. Route hooked validation execution through executeUserOp and prevent direct validation reentry.
Replace generic-hook coverage with validation-, executor-, and selector-scoped lifecycle and execution tests. Update formal harnesses, invariants, mocks, and gas snapshots for the scoped model.
Replace stateless enable-mode coverage with the validation-type-first structured signature format and Kernel7702 raw-signature cases. Remove obsolete stateless validators and formal tests, and differentially fuzz Lib4337 validity handling against EntryPoint v0.9.
Restore the v0.4.0 entry-point gate on fallback selectors that have no
scoped execution hook installed. Installing a type-11 selector-scoped
execution hook makes a selector publicly callable; without one only the
entry point may route to it.

Update tests to install scoped hooks where public access is asserted,
add a regression test and halmos proofs for the gate, and document the
access control in the README.
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