Skip to content

Commit

Permalink
V2.1 (#25)
Browse files Browse the repository at this point in the history
* v4.0.0-beta.10

* updator draft

* removed temp kernel

* create account 142873

* added validCaller

* forge fmt

* small touch on comments

* validCaller changed

* test for external call

* renamed modifier

* removed callcode test

* forge fmt

* added snapshot

* custom errors

* using gas() for prepay

* removed unused copy

* payable for gas optimization

* using solady for optimization

* forge fmt

* cache storage for optimization

* admin less erc 1967 optimization

* unchecked blocks

* validator to payable

* using constant for gas optimization

* removed return

* via-ir for optimization

* change in order of ecdsa validator to lower the gas cost

* squeezing gas

* more squeezing

* removed exec

* kernel helper in yul

* more optimization

* updated aa dependency

* V2.1 optimize (#20)

* factory merged with erc1967 minimal factory

* Kernel Storage to abstract the initData setting

* only one factory to decrease deployment gas

* test cleanup to properly structure the test

* removing killswitch test too

* KernelLite PoC

* files for setting a proper gas report

* using memory directly to reduce gas

* changed order for validator to reduce gas cost

* optimize only

* remove kernel lite gas report

* internal functions for erc1967factory

* change kernel sig order for validUntil and validAfter (#21)

* forge fmt

* fix: parsing typo and mode(1)

* V2.1 session key (#22)

* session Key debug done

* foundry viaIr setting enabled

* forge fmt

* V2.1 stake factory (#23)

* gas optimization by using memory for validateUserOp

* optimization with calldata parsing

* stake for factory

* stake factory

* report

* fmt

* removed unused file

* session key now filters the operation

* fix: using proper bytes for parsing operation

* script for deploying kernel/kernel factory for v2.1

* script for deploying session key

* deployed to all testnet

* kilswitch (#24)
  • Loading branch information
leekt authored Aug 9, 2023
1 parent bc921a7 commit 5f8e8f4
Show file tree
Hide file tree
Showing 113 changed files with 7,865 additions and 1,650 deletions.
21 changes: 19 additions & 2 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
AccountFactoryTest:testAccountFactory(uint256) (runs: 256, μ: 130276, ~: 130276)
KernelTest:testKernel() (gas: 190)
KernelExecutionTest:test_mode_2() (gas: 593614)
KernelExecutionTest:test_mode_2() (gas: 611256)
KernelExecutionTest:test_mode_2_1() (gas: 589400)
KernelExecutionTest:test_mode_2_erc165() (gas: 2485466)
KernelExecutionTest:test_revert_when_mode_disabled() (gas: 192767)
KernelExecutionTest:test_sudo() (gas: 216219)
KernelHelperTest:testIntersect(uint48,uint48,uint48,uint48) (runs: 256, μ: 2379, ~: 2383)
KernelTest:test_disable_mode() (gas: 170757)
KernelTest:test_disable_mode() (gas: 172824)
KernelTest:test_external_call_default() (gas: 28844)
KernelTest:test_external_call_execution() (gas: 520197)
KernelTest:test_initialize_twice() (gas: 20515)
KernelTest:test_initialize_twice() (gas: 20537)
KernelTest:test_set_default_validator() (gas: 427634)
KernelTest:test_set_default_validator() (gas: 429679)
KernelTest:test_set_execution() (gas: 477930)
KernelTest:test_set_execution() (gas: 479975)
KernelTest:test_validate_signature() (gas: 171911)
KernelTest:test_validate_signature() (gas: 175529)
102 changes: 102 additions & 0 deletions broadcast/DeployKernel.s.sol/10200/run-1691520802.json

Large diffs are not rendered by default.

193 changes: 193 additions & 0 deletions broadcast/DeployKernel.s.sol/10200/run-1691520809.json

Large diffs are not rendered by default.

193 changes: 193 additions & 0 deletions broadcast/DeployKernel.s.sol/10200/run-latest.json

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions broadcast/DeployKernel.s.sol/420/run-1691518086.json

Large diffs are not rendered by default.

193 changes: 193 additions & 0 deletions broadcast/DeployKernel.s.sol/420/run-1691518093.json

Large diffs are not rendered by default.

193 changes: 193 additions & 0 deletions broadcast/DeployKernel.s.sol/420/run-latest.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691518329.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691518368.json

Large diffs are not rendered by default.

93 changes: 93 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691518391.json

Large diffs are not rendered by default.

93 changes: 93 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691518417.json

Large diffs are not rendered by default.

88 changes: 88 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691518464.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691518524.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691518617.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691518753.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691518874.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691518988.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691519086.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691519223.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691519403.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691519415.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691519428.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691519899.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691519919.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691519935.json

Large diffs are not rendered by default.

193 changes: 193 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-1691520179.json

Large diffs are not rendered by default.

193 changes: 193 additions & 0 deletions broadcast/DeployKernel.s.sol/421613/run-latest.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/43113/run-1691520462.json

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions broadcast/DeployKernel.s.sol/43113/run-1691520484.json

Large diffs are not rendered by default.

100 changes: 100 additions & 0 deletions broadcast/DeployKernel.s.sol/43113/run-1691520581.json

Large diffs are not rendered by default.

100 changes: 100 additions & 0 deletions broadcast/DeployKernel.s.sol/43113/run-latest.json

Large diffs are not rendered by default.

98 changes: 98 additions & 0 deletions broadcast/DeployKernel.s.sol/5/run-1691517811.json

Large diffs are not rendered by default.

189 changes: 189 additions & 0 deletions broadcast/DeployKernel.s.sol/5/run-1691517818.json

Large diffs are not rendered by default.

208 changes: 145 additions & 63 deletions broadcast/DeployKernel.s.sol/5/run-latest.json

Large diffs are not rendered by default.

122 changes: 122 additions & 0 deletions broadcast/DeployKernel.s.sol/80001/run-1690749002.json

Large diffs are not rendered by default.

250 changes: 250 additions & 0 deletions broadcast/DeployKernel.s.sol/80001/run-1690749009.json

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions broadcast/DeployKernel.s.sol/80001/run-1691515307.json

Large diffs are not rendered by default.

132 changes: 132 additions & 0 deletions broadcast/DeployKernel.s.sol/80001/run-1691515320.json

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions broadcast/DeployKernel.s.sol/80001/run-1691515779.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"transactions": [
{
"hash": "0x1f4b33237a92b3f848a43afc6346f7ee23436e04edce6510503d439045197058",
"transactionType": "CALL",
"contractName": null,
"contractAddress": "0x85DF6Dc686FBDcAc7da61651D116fc71B2246B50",
"function": null,
"arguments": null,
"transaction": {
"type": "0x00",
"from": "0x9775137314fe595c943712b0b336327dfa80ae8a",
"to": "0x85df6dc686fbdcac7da61651d116fc71b2246b50",
"gas": "0x1da73",
"value": "0x1",
"data": "0x0396cb600000000000000000000000000000000000000000000000000000000000000001",
"nonce": "0xe2"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [],
"libraries": [],
"pending": [
"0x1f4b33237a92b3f848a43afc6346f7ee23436e04edce6510503d439045197058"
],
"returns": {},
"timestamp": 1691515779,
"chain": 80001,
"multi": false,
"commit": "95addde"
}
111 changes: 111 additions & 0 deletions broadcast/DeployKernel.s.sol/80001/run-1691515785.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"transactions": [
{
"hash": "0x1f4b33237a92b3f848a43afc6346f7ee23436e04edce6510503d439045197058",
"transactionType": "CALL",
"contractName": null,
"contractAddress": "0x85DF6Dc686FBDcAc7da61651D116fc71B2246B50",
"function": null,
"arguments": null,
"transaction": {
"type": "0x00",
"from": "0x9775137314fe595c943712b0b336327dfa80ae8a",
"to": "0x85df6dc686fbdcac7da61651d116fc71b2246b50",
"gas": "0x1da73",
"value": "0x1",
"data": "0x0396cb600000000000000000000000000000000000000000000000000000000000000001",
"nonce": "0xe2"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"transactionHash": "0x1f4b33237a92b3f848a43afc6346f7ee23436e04edce6510503d439045197058",
"transactionIndex": "0x1b",
"blockHash": "0x2072a740eb5d01f54ecb0a314ce2ab3428ef6e0c58aaa3ecceb6789f478371cc",
"blockNumber": "0x24fbe2c",
"from": "0x9775137314fE595c943712B0b336327dfa80aE8A",
"to": "0x85DF6Dc686FBDcAc7da61651D116fc71B2246B50",
"cumulativeGasUsed": "0x3f6450",
"gasUsed": "0x14469",
"contractAddress": null,
"logs": [
{
"address": "0x0000000000000000000000000000000000001010",
"topics": [
"0xe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c4",
"0x0000000000000000000000000000000000000000000000000000000000001010",
"0x0000000000000000000000009775137314fe595c943712b0b336327dfa80ae8a",
"0x00000000000000000000000085df6dc686fbdcac7da61651d116fc71b2246b50"
],
"data": "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000014581ff258d0871e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014581ff258d0871d0000000000000000000000000000000000000000000000000000000000000001",
"blockHash": "0x2072a740eb5d01f54ecb0a314ce2ab3428ef6e0c58aaa3ecceb6789f478371cc",
"blockNumber": "0x24fbe2c",
"transactionHash": "0x1f4b33237a92b3f848a43afc6346f7ee23436e04edce6510503d439045197058",
"transactionIndex": "0x1b",
"logIndex": "0x7c",
"removed": false
},
{
"address": "0x0000000000000000000000000000000000001010",
"topics": [
"0xe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c4",
"0x0000000000000000000000000000000000000000000000000000000000001010",
"0x00000000000000000000000085df6dc686fbdcac7da61651d116fc71b2246b50",
"0x0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d2789"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000009041dfa1e9dc475b48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009041dfa1e9dc475b49",
"blockHash": "0x2072a740eb5d01f54ecb0a314ce2ab3428ef6e0c58aaa3ecceb6789f478371cc",
"blockNumber": "0x24fbe2c",
"transactionHash": "0x1f4b33237a92b3f848a43afc6346f7ee23436e04edce6510503d439045197058",
"transactionIndex": "0x1b",
"logIndex": "0x7d",
"removed": false
},
{
"address": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
"topics": [
"0xa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01",
"0x00000000000000000000000085df6dc686fbdcac7da61651d116fc71b2246b50"
],
"data": "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001",
"blockHash": "0x2072a740eb5d01f54ecb0a314ce2ab3428ef6e0c58aaa3ecceb6789f478371cc",
"blockNumber": "0x24fbe2c",
"transactionHash": "0x1f4b33237a92b3f848a43afc6346f7ee23436e04edce6510503d439045197058",
"transactionIndex": "0x1b",
"logIndex": "0x7e",
"removed": false
},
{
"address": "0x0000000000000000000000000000000000001010",
"topics": [
"0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63",
"0x0000000000000000000000000000000000000000000000000000000000001010",
"0x0000000000000000000000009775137314fe595c943712b0b336327dfa80ae8a",
"0x000000000000000000000000f903ba9e006193c1527bfbe65fe2123704ea3f99"
],
"data": "0x00000000000000000000000000000000000000000000000000006ded25461fa40000000000000000000000000000000000000000000000001458c0b6b7c12c8d00000000000000000000000000000000000000000000104dd3240ec165ee9685000000000000000000000000000000000000000000000000145852c9927b0ce900000000000000000000000000000000000000000000104dd3247cae8b34b629",
"blockHash": "0x2072a740eb5d01f54ecb0a314ce2ab3428ef6e0c58aaa3ecceb6789f478371cc",
"blockNumber": "0x24fbe2c",
"transactionHash": "0x1f4b33237a92b3f848a43afc6346f7ee23436e04edce6510503d439045197058",
"transactionIndex": "0x1b",
"logIndex": "0x7f",
"removed": false
}
],
"status": "0x1",
"logsBloom": "0x00080000000000000000000000000000000000000000000000000010000000000000000000000020000200100000000000108000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000200000000080000000000000000000000000000000000004080800000000000000000000000000000000000000000000000000000000000000000080000000000241000000000000000000000000000000000000000000000000002000000004000000000000000000001001000000000000040000000800000108000001000000100000000000000000000000000000000000200000000000000000000100000",
"type": "0x0",
"effectiveGasPrice": "0x56bede15"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1691515785,
"chain": 80001,
"multi": false,
"commit": "95addde"
}
33 changes: 33 additions & 0 deletions broadcast/DeployKernel.s.sol/80001/run-1691517538.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"transactions": [
{
"hash": "0x7c9dc5bc0bea4f4cab67f3b97734dcfef29e3be3e3d81cd9dd63193098bbecfe",
"transactionType": "CALL",
"contractName": null,
"contractAddress": "0x85DF6Dc686FBDcAc7da61651D116fc71B2246B50",
"function": null,
"arguments": null,
"transaction": {
"type": "0x00",
"from": "0x9775137314fe595c943712b0b336327dfa80ae8a",
"to": "0x85df6dc686fbdcac7da61651d116fc71b2246b50",
"gas": "0x10945",
"value": "0x0",
"data": "0xbb30a974000000000000000000000000d2063be7c610eb55492c05385743eddbf5b6b9510000000000000000000000000000000000000000000000000000000000000001",
"nonce": "0xe4"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [],
"libraries": [],
"pending": [
"0x7c9dc5bc0bea4f4cab67f3b97734dcfef29e3be3e3d81cd9dd63193098bbecfe"
],
"returns": {},
"timestamp": 1691517538,
"chain": 80001,
"multi": false,
"commit": "06a62a2"
}
65 changes: 65 additions & 0 deletions broadcast/DeployKernel.s.sol/80001/run-1691517545.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"transactions": [
{
"hash": "0x7c9dc5bc0bea4f4cab67f3b97734dcfef29e3be3e3d81cd9dd63193098bbecfe",
"transactionType": "CALL",
"contractName": null,
"contractAddress": "0x85DF6Dc686FBDcAc7da61651D116fc71B2246B50",
"function": null,
"arguments": null,
"transaction": {
"type": "0x00",
"from": "0x9775137314fe595c943712b0b336327dfa80ae8a",
"to": "0x85df6dc686fbdcac7da61651d116fc71b2246b50",
"gas": "0x10945",
"value": "0x0",
"data": "0xbb30a974000000000000000000000000d2063be7c610eb55492c05385743eddbf5b6b9510000000000000000000000000000000000000000000000000000000000000001",
"nonce": "0xe4"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"transactionHash": "0x7c9dc5bc0bea4f4cab67f3b97734dcfef29e3be3e3d81cd9dd63193098bbecfe",
"transactionIndex": "0x1d",
"blockHash": "0x25de694995c671749e9005775d6fe88e01f3b6e6da92360b28131e4fd259af66",
"blockNumber": "0x24fc0ed",
"from": "0x9775137314fE595c943712B0b336327dfa80aE8A",
"to": "0x85DF6Dc686FBDcAc7da61651D116fc71B2246B50",
"cumulativeGasUsed": "0x46d41e",
"gasUsed": "0xb562",
"contractAddress": null,
"logs": [
{
"address": "0x0000000000000000000000000000000000001010",
"topics": [
"0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63",
"0x0000000000000000000000000000000000000000000000000000000000001010",
"0x0000000000000000000000009775137314fe595c943712b0b336327dfa80ae8a",
"0x000000000000000000000000f903ba9e006193c1527bfbe65fe2123704ea3f99"
],
"data": "0x00000000000000000000000000000000000000000000000000003f58e31cfe000000000000000000000000000000000000000000000000001453449ef89aa24f00000000000000000000000000000000000000000000104e05fb33993489c61000000000000000000000000000000000000000000000000014530546157da44f00000000000000000000000000000000000000000000104e05fb72f217a6c410",
"blockHash": "0x25de694995c671749e9005775d6fe88e01f3b6e6da92360b28131e4fd259af66",
"blockNumber": "0x24fc0ed",
"transactionHash": "0x7c9dc5bc0bea4f4cab67f3b97734dcfef29e3be3e3d81cd9dd63193098bbecfe",
"transactionIndex": "0x1d",
"logIndex": "0xaa",
"removed": false
}
],
"status": "0x1",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000010000000000000000000000020000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000200000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000080000000000201000000000000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000000000000100000001000000000000000000000000000000000000000000000000000000000000000100000",
"type": "0x0",
"effectiveGasPrice": "0x59682f11"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1691517545,
"chain": 80001,
"multi": false,
"commit": "06a62a2"
}
122 changes: 24 additions & 98 deletions broadcast/DeployKernel.s.sol/80001/run-latest.json

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions broadcast/DeployKernel.s.sol/84531/run-1691520712.json

Large diffs are not rendered by default.

193 changes: 193 additions & 0 deletions broadcast/DeployKernel.s.sol/84531/run-1691520719.json

Large diffs are not rendered by default.

193 changes: 193 additions & 0 deletions broadcast/DeployKernel.s.sol/84531/run-latest.json

Large diffs are not rendered by default.

Loading

0 comments on commit 5f8e8f4

Please sign in to comment.