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

Provide error code for simulation related errors #211

Open
da-bao-jian opened this issue Sep 12, 2023 · 5 comments
Open

Provide error code for simulation related errors #211

da-bao-jian opened this issue Sep 12, 2023 · 5 comments
Labels
A-RPC Area: RPC module T-enhancement Type: Enhancement to existing feature

Comments

@da-bao-jian
Copy link
Contributor

da-bao-jian commented Sep 12, 2023

It'll be nice to have customized error code for each of simulation related errors

Currently, one would have to parse through the error message to get the returned variables. See handle_response function in ethers-userop.

@Vid201
Copy link
Member

Vid201 commented Sep 12, 2023

It'll be nice to have customized error code for each of simulation related errors

Currently, one would have to parse through the error message to get the returned variables. See handle_response function in ethers-userop.

@da-bao-jian Can you please provide more information about which error codes exactly - the ones returned from JSON-RPC API?

We should follow the specs fully for error codes: https://eips.ethereum.org/EIPS/eip-4337#rpc-methods-eth-namespace . Or do you mean that single error code in the specs can mean different things?

@da-bao-jian
Copy link
Contributor Author

Sorry I should've been more clear on that

  1. Yes the ones returned from Json RPC API
  2. and yes, a single error code can have different things. Primarily I was dealing with insufficient verification/call/pre-verification gas errors. They all have the same error code

@Vid201
Copy link
Member

Vid201 commented Sep 12, 2023

Sorry I should've been more clear on that

  1. Yes the ones returned from Json RPC API
  2. and yes, a single error code can have different things. Primarily I was dealing with insufficient verification/call/pre-verification gas errors. They all have the same error code

Ok, got it. Thinking about what would be the best approach, I am not sure if introducing custom codes would be the best approach since it deviates from standard. But maybe structuring the error message in the meaningful way could be the way to go.

@da-bao-jian
Copy link
Contributor Author

What do you recommend for implementation.

I can work on it when my schedule is a little bit better

@Vid201
Copy link
Member

Vid201 commented Sep 12, 2023

What do you recommend for implementation.

I can work on it when my schedule is a little bit better

We could do something similar to errors from the entry points: the message should always start with AA(INT) - https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/core/EntryPoint.sol#L60.

Maybe something like B1 for call gas limit, B2 for preverificationgas ...

@Vid201 Vid201 added T-enhancement Type: Enhancement to existing feature A-RPC Area: RPC module labels Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-RPC Area: RPC module T-enhancement Type: Enhancement to existing feature
Projects
None yet
Development

No branches or pull requests

2 participants