From 3d09369f448cc8bfff46b82513b1762870736151 Mon Sep 17 00:00:00 2001 From: Vincent | Data Nexus <105891622+datanexus-vincent@users.noreply.github.com> Date: Thu, 16 May 2024 00:51:05 -0400 Subject: [PATCH] feat: Add ethereum account abstraction EIP 4337 (#1423) * Adding EIP 4337 account abstration methods to Ethereum spec as addon * Add params to function template and remove archive extension from the bundler addon * API name typo fix * Added config example for ETH provider with bundler addon * Marking deterministic bundler methods as deterministic --------- Co-authored-by: Vincent Taglia Co-authored-by: oren-lava <111131399+oren-lava@users.noreply.github.com> Co-authored-by: Omer <100387053+omerlavanet@users.noreply.github.com> --- .../eth_provider_with_bundler.yml | 9 ++ cookbook/specs/spec_add_ethereum.json | 123 ++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 config/provider_examples/eth_provider_with_bundler.yml diff --git a/config/provider_examples/eth_provider_with_bundler.yml b/config/provider_examples/eth_provider_with_bundler.yml new file mode 100644 index 0000000000..ad18f2b7b9 --- /dev/null +++ b/config/provider_examples/eth_provider_with_bundler.yml @@ -0,0 +1,9 @@ +endpoints: + - api-interface: jsonrpc + chain-id: ETH1 + network-address: + address: "127.0.0.1:2224" + node-urls: + - url: my-eth-node.com/eth-bundler/ws + addons: + - bundler \ No newline at end of file diff --git a/cookbook/specs/spec_add_ethereum.json b/cookbook/specs/spec_add_ethereum.json index 3ff1f91664..42d573fb05 100644 --- a/cookbook/specs/spec_add_ethereum.json +++ b/cookbook/specs/spec_add_ethereum.json @@ -1353,6 +1353,129 @@ } } ] + }, + { + "enabled": true, + "collection_data": { + "api_interface": "jsonrpc", + "internal_path": "", + "type": "POST", + "add_on": "bundler" + }, + "apis": [ + { + "name": "eth_sendUserOperation", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 200, + "enabled": true, + "category": { + "deterministic": false, + "local": true, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "eth_estimateUserOperationGas", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 200, + "enabled": true, + "category": { + "deterministic": true, + "local": true, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "eth_getUserOperationByHash", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 200, + "enabled": true, + "category": { + "deterministic": true, + "local": true, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "eth_getUserOperationReceipt", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 200, + "enabled": true, + "category": { + "deterministic": true, + "local": true, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, + { + "name": "eth_supportedEntryPoints", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 200, + "enabled": true, + "category": { + "deterministic": false, + "local": true, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + } + ], + "verifications": [ + { + "name": "bundler", + "parse_directive": { + "function_template": "{\"jsonrpc\":\"2.0\",\"method\":\"eth_supportedEntryPoints\",\"params\":[],\"id\":1}", + "function_tag": "VERIFICATION", + "result_parsing": { + "parser_arg": [ + "0" + ], + "parser_func": "PARSE_BY_ARG" + }, + "api_name": "eth_supportedEntryPoints" + }, + "values": [ + { + "expected_value": "*" + } + ] + } + ], + "extensions": [] } ] },