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

Add ERC: JSON-RPC API for ERC-4337 #628

Merged

Conversation

forshtat
Copy link
Contributor

When opening a pull request to submit a new EIP, please use the suggested template: https://github.com/ethereum/EIPs/blob/master/eip-template.md

We have a GitHub bot that automatically merges some PRs. It will merge yours immediately if certain criteria are met:

  • The PR edits only existing draft PRs.
  • The build passes.
  • Your GitHub username or email address is listed in the 'author' header of all affected PRs, inside .
  • If matching on email address, the email address is the one publicly listed on your GitHub profile.

@eip-review-bot
Copy link
Collaborator

eip-review-bot commented Sep 10, 2024

✅ All reviewers have approved.

@abcoathup
Copy link
Contributor

@forshtat my understanding is that API standards should be directed to https://github.com/ethereum/execution-apis rather than create an EIP/ERC

@drortirosh
Copy link
Contributor

@forshtat my understanding is that API standards should be directed to https://github.com/ethereum/execution-apis rather than create an EIP/ERC

This is not an ethereum node RPC-API, but an API for an external entity (bundler) that supports the ERC-4337 standard itself.
Currently, the RPC-API is defined inside the ERC-4337 itself. However, the RPC-API is less stable than ERC-4337 itself (which defines the contract interfaces), and prevents us from finalizing the contracts interfaces in ERC-4337 contracts, so we want to extract the RPC from it.
Currently, JSON-RPC's are in the EIP repository, but it would seem a bit odd to create an EIP to define the JSON-RPC of ERC-4337...

ERCS/erc-4337-rpc.md Outdated Show resolved Hide resolved
title: JSON-RPC API for Account Abstraction Using the UserOperation Mempool
description: A set of JSON-RPC API methods that defines a communication between smart contract account wallets and bundlers
author: Vitalik Buterin (@vbuterin), Yoav Weiss (@yoavw), Dror Tirosh (@drortirosh), Shahaf Nacson (@shahafn), Alex Forshtat (@forshtat)
discussions-to:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a discussions topic in Eth Magicians. It just needs to be a link to this PR.

forshtat and others added 2 commits September 18, 2024 14:35
Co-authored-by: Andrew B Coathup <28278242+abcoathup@users.noreply.github.com>
Copy link

The commit 392299c (as a parent of a5fdbec) contains errors.
Please inspect the Run Summary for details.

@eip-review-bot eip-review-bot changed the title ERC-4337 extension: New JSON-RPC APIs Add ERC: JSON-RPC API for ERC-4337 Sep 18, 2024
@github-actions github-actions bot removed the w-ci label Sep 18, 2024
@drortirosh
Copy link
Contributor

@abcoathup : can this PR be merged?

@abcoathup
Copy link
Contributor

@drortirosh you need an ERC editor to review (I am not an editor). There is only a small number of editors, so it can take some time to get reviewed. In the meantime, ensure that the validator doesn’t raise any errors & fix any issues.

There is a fortnightly office hours that you could attend: ethcatherders/EIPIP#360

Comment on lines +52 to +62
##### Parameters:

1. **UserOperation** a full user-operation struct.\
All fields MUST be set as hex values.\
Empty `bytes` block (e.g. empty `initCode`) MUST be set to `"0x"`\
2. **factory** and **factoryData**\
Must provide either both of these parameters, or none.
3. **paymaster**, **paymasterData**, **paymasterValidationGasLimit**, **paymasterPostOpGasLimit**\
Must provide either all of these parameters, or none.
4. **entryPoint** the `EntryPoint` contract address the request should be sent through.\
This MUST be one of the entry points returned by the `supportedEntryPoints` RPC call.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whenever a proposal is specifying anything to do with JSON, I suggest that you seriously consider using JSON Schema to define and document valid JSON. It's machine tractable, has a ton of tooling, and is way more specific than english text.

ERCS/erc-7769.md Outdated
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1234...5678"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the result here actually supposed to have the three dots?

ERCS/erc-7769.md Outdated Show resolved Hide resolved
ERCS/erc-7769.md Outdated Show resolved Hide resolved
ERCS/erc-7769.md Outdated Show resolved Hide resolved
ERCS/erc-7769.md Outdated Show resolved Hide resolved
ERCS/erc-7769.md Outdated Show resolved Hide resolved
drortirosh and others added 6 commits October 28, 2024 21:15
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>

Request:

```json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```json
```js

Not a hard requirement, but if you use js instead of json, it'll still highlight but won't complain about comments.

This operation may also return an error if either the inner call to the account contract reverts,
or paymaster's `postOp` call reverts.

#### * eth_getUserOperationByHash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the star? Also don't forget backticks.

ERCS/erc-7769.md Outdated Show resolved Hide resolved
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
SamWilsn
SamWilsn approved these changes Oct 29, 2024
@eip-review-bot eip-review-bot enabled auto-merge (squash) October 29, 2024 14:13
Copy link
Collaborator

@eip-review-bot eip-review-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Reviewers Have Approved; Performing Automatic Merge...

Copy link
Collaborator

@eip-review-bot eip-review-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Reviewers Have Approved; Performing Automatic Merge...

@eip-review-bot eip-review-bot merged commit 4307a86 into ethereum:master Oct 29, 2024
9 of 13 checks passed
@drortirosh drortirosh deleted the AA-428-extract-rpc-create-new branch October 30, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants