Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.4 #56

Merged
merged 53 commits into from
Feb 29, 2024
Merged

v2.4 #56

merged 53 commits into from
Feb 29, 2024

Conversation

leekt
Copy link
Collaborator

@leekt leekt commented Dec 13, 2023

No description provided.

de33 and others added 23 commits November 10, 2023 00:54
* Added 1271 wrapper

* Update kernel version to 0.2.3

* use kernel name and version from constants in tests
* Add storage slot documentation & run coverage

* Gas improvment on disabled mode check during execution

Between 1 to 22% gas saved during userOp execution

* Missing funds check gas improvments

* Adding a bit of comments
* Dev (#47)

* Added new ERC1271 signature verification logic in Kernel v0.2.3 (#43)

* Added 1271 wrapper

* Update kernel version to 0.2.3

* use kernel name and version from constants in tests

* added delegatecall support (#44)

* session key validator fixed for batch scenario

* test: fuzz testing for batched options include array

* fix: warning removed, forge fmt (#46)

---------

Co-authored-by: David Eiber <davideiber@gmail.com>

* Initial commit

* Update P256Validator.t.sol

* forge install: FreshCryptoLib

* Refactor with helper functions

* Add P256Validator, tests, deps

* Remove py scripts used for initial testing

* Update foundry.toml

* update deps

* add non-malleable signatures

---------

Co-authored-by: taek <leekt216@gmail.com>
#52)

* ⚡️ Optimise gas usage when enabling p256 validator, add a few comments

- Reducing the number of indexed variable inside a log highly decrease his gas usage, in the p256 validator, we only matter about the kernel account as index (it's 375 gas per topic, so per indexed props, so reducing the index on both key reduce the enabling gas cost by 375 * 4 -> 1500 gas)
 - Add a few reflexion todo comment, do you rly need to send the previous key in the event? Since it's cost with a `sload`& also in the event itself

* ⚡️ Remove the oldKeys for the event signature

* ⚡️ Only compare to raw msg signing instead of eth signed message for p256
* added threshold check to make sure threshold is not zero

* added userOp.sender on callDataAndNonceHash

* added userOp.sender on callDataAndNonceHash

* added check if guardian is msg.sender

* fmt

* ZeroDev-RW-2 : using live weights

* ZeroDev-RW-4 and ZeroDev-RW-2 fix

* fmt
* ✨ Add a new ECDSA Typed validator, using EIP-712 signature to validate userOp

* ✅ Adding unit test arround EcdsaTypedValidator

* ✏️ Rename hash -> userOpHash in AllowUserOp sig
* Dev (#47)

* Added new ERC1271 signature verification logic in Kernel v0.2.3 (#43)

* Added 1271 wrapper

* Update kernel version to 0.2.3

* use kernel name and version from constants in tests

* added delegatecall support (#44)

* session key validator fixed for batch scenario

* test: fuzz testing for batched options include array

* fix: warning removed, forge fmt (#46)

---------

Co-authored-by: David Eiber <davideiber@gmail.com>

* Update recovery audit report

* Added new ERC1271 signature verification logic in Kernel v0.2.3 (#43)

* Added 1271 wrapper

* Update kernel version to 0.2.3

* use kernel name and version from constants in tests

* added delegatecall support (#44)

* session key validator fixed for batch scenario

* test: fuzz testing for batched options include array

* fix: warning removed, forge fmt (#46)

* Documentation & minor gas optimisation during userOpExecution (#50)

* Add storage slot documentation & run coverage

* Gas improvment on disabled mode check during execution

Between 1 to 22% gas saved during userOp execution

* Missing funds check gas improvments

* Adding a bit of comments

* Add p256 validator (#48)

* Dev (#47)

* Added new ERC1271 signature verification logic in Kernel v0.2.3 (#43)

* Added 1271 wrapper

* Update kernel version to 0.2.3

* use kernel name and version from constants in tests

* added delegatecall support (#44)

* session key validator fixed for batch scenario

* test: fuzz testing for batched options include array

* fix: warning removed, forge fmt (#46)

---------

Co-authored-by: David Eiber <davideiber@gmail.com>

* Initial commit

* Update P256Validator.t.sol

* forge install: FreshCryptoLib

* Refactor with helper functions

* Add P256Validator, tests, deps

* Remove py scripts used for initial testing

* Update foundry.toml

* update deps

* add non-malleable signatures

---------

Co-authored-by: taek <leekt216@gmail.com>

* deterministic deploy (#51)

* ⚡️ Optimise gas usage when enabling p256 validator, add a few comments (#52)

* ⚡️ Optimise gas usage when enabling p256 validator, add a few comments

- Reducing the number of indexed variable inside a log highly decrease his gas usage, in the p256 validator, we only matter about the kernel account as index (it's 375 gas per topic, so per indexed props, so reducing the index on both key reduce the enabling gas cost by 375 * 4 -> 1500 gas)
 - Add a few reflexion todo comment, do you rly need to send the previous key in the event? Since it's cost with a `sload`& also in the event itself

* ⚡️ Remove the oldKeys for the event signature

* ⚡️ Only compare to raw msg signing instead of eth signed message for p256

* Fix/audit recovery (#53)

* added threshold check to make sure threshold is not zero

* added userOp.sender on callDataAndNonceHash

* added userOp.sender on callDataAndNonceHash

* added check if guardian is msg.sender

* fmt

* ZeroDev-RW-2 : using live weights

* ZeroDev-RW-4 and ZeroDev-RW-2 fix

* fmt

* rebase master

---------

Co-authored-by: David Eiber <davideiber@gmail.com>
Co-authored-by: Derek Chiang <me@derekchiang.com>
Co-authored-by: Quentin Nivelais <quentin@nivelais.com>
* feat: added delegateCall support in session key

* fix: remove deps

* feat: added wildcard target permission condition in session key

---------

Co-authored-by: taek <leekt216@gmail.com>
* added broadcast to git

* script for recovery deployment

* recovery plugin on arbitrum goerli and base goerli

* deployed to base
* deployed on arbitrum sepolia

* deployed on optimism sepolia

* deployed on base sepolia
* optimism and arbitrum

* optimism mainnet and polygon mainnet

* deployed on avalanche

* deployed on base

* session key deploy completed
Add stealth address plugin to preserve privacy of smart acount owner.
Two modes to validate signature
- 0: signed by private key of stealth address
- 1: signed by owner's private key and secret used to generate stealth
     address.
* script for old factory

* script for stake updated

* events for add/removing guardian

* weighted ecdsa deployed on mumbai
@leekt leekt marked this pull request as ready for review January 3, 2024 04:42
leekt and others added 6 commits January 3, 2024 21:43
* Link to AA SDKs

* script for old factory

* Update deployment addresses for Kernel and KernelLite v2.3 in README (#66)

* Add Kernel factory address

---------

Co-authored-by: Derek Chiang <me@derekchiang.com>
Co-authored-by: David Eiber <davideiber@gmail.com>
* moved to script folder

* moved shell scripts

* added broadcast

* removed Caldera broadcast
* restructured to seprate plugins folder

* removed via-ir based plugins, todo: remove all plugins to kernel-plugins
* restructured to seprate plugins folder

* removed via-ir based plugins, todo: remove all plugins to kernel-plugins

* fix: import path fix for kerneltestbase
* 🚧 Simple webauthn validator

* 🚧 Add deploy script for WebAuthN validator

* 🚧 Fix pre op estimation by removing early exit during webauthn msg format

* ✅ Add webauthn validator unit test

* 🚚 rename WebAuthnValidator -> WebAuthnFclValidator

* ♻️ Lot of WebAuthN review

 - Stay in calldata for webauthn challenge formatting
 - Stay inside the WebAuthN validator contract for challenge preparation etc, only exit for p256 verification
 - Better SoC between validator / webauthn / p256
 - Wrap the p256 verification logic inside a contract that can be easily replaced when RIP-7212 is deployed

* ⚡️ Minor gas optimisation (switching to solady base64 lib)

* ✅ Add more tests on sig validation, dummy sig bypass etc

* ⚡️ Gas optimisation during webauthn msg check / format

* 🐛 Post rebase fix

* 🚚 Move webauthn helper and validator inside subfolder validator/webauthn

* ⚡️ Switched to foundry cheatcode for p256 sig validation during test

And fix deploy script
* feat: implement validateSignature of WeightedECDSAValidator

* fix: init totalWeight as 0 in validateSignature

* Fix validSignature for WeightedECDSAValidator

---------

Co-authored-by: adnpark <aidenp.dev@gmail.com>
Co-authored-by: Derek Chiang <me@derekchiang.com>
leekt and others added 11 commits January 30, 2024 00:55
* updated dependencies

* updates solady to latest

* weighted ecdsa to valdiate the userOp for the last sig

* removed toEthSignedMessage

* test done
* weighted ecdsa to valdiate the userOp for the last sig

* removed toEthSignedMessage

* test done

* allow non-userOpHash signed mode when paymaster != 0
* audit fixes

* fix: update prevSigner to signer on validateSignature and added invariant testing for this
@leekt leekt marked this pull request as draft February 8, 2024 08:17
leekt and others added 13 commits February 8, 2024 17:20
* ✨ Add the options to upgrade to the RIP-7212 p256 verifier

* 🐛 Handle empty response from the pre compiled p256 verifier

* 🐛 Switch between pre-compiled and on chain p256 verifier via a signature flag
* restructured to seprate plugins folder

* added modular permission

* fmt

* synced dev

* fix: shadowed variable

* modular permission encoding checked

* intersect supports validation data with aggregator

* draft for modular permission

* forge fmt

* non-view for validCaller

* fix: test for helper

* changed validCaller to non-view

* removed rawMessage, move this to policy...?

* gas policy example for policy

* execute policy for interval based execution limits

* added natspec for modular permission validator

* added flag to skip validation data

* moved policy config to separate file

* remapping to includ I4337

* temp

* modular permission test without validCaller support

* support requestor feature

* now call it allowed requestor

* forge fmt

* example for eip712

* test fix to check if signature validation result is ok

* fix: nonce fixes in ModularPermissionValidator

* fix: use calldata for sig

* fix: proof fetching in MerklePolicy

* fix : use msg.sender instead of caller for signature verification on eip712 policy

* chore: deploy signaturePolicy

* fix: added validator in the storage mapping of SignaturePolicy to fix unauthenticated state change vuln

* fix: remove p256-verifier lib

* feat: added WebAuthnSigner for ModularPermissionValidator (#83)

* feat: added Sudo policy for ModularPermissionValidator

* fix: nonce for single tx dual enable and ECDSASigner sig

---------

Co-authored-by: Sahil Vasava <sahilvasava@gmail.com>
* fixed execute batch with long return value

* added testcase

* bumped version to 2.4
* Link to AA SDKs

* Update deployment addresses for Kernel and KernelLite v2.3 in README (#66)

* Add Kernel factory address

* Update README.md

---------

Co-authored-by: Derek Chiang <me@derekchiang.com>
Co-authored-by: David Eiber <davideiber@gmail.com>
@leekt leekt marked this pull request as ready for review February 29, 2024 03:15
@leekt leekt changed the title Dev v2.4 Feb 29, 2024
@leekt leekt merged commit 1d4a202 into main Feb 29, 2024
0 of 2 checks passed
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.

7 participants