-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Update EIP-5792: Add status codes #9221
Conversation
lukasrosario
commented
Jan 8, 2025
- Updated status codes as discussed in telegram chat:
- 1xx: Pending states
- 2xx: Confirmed states
- 4xx: Chain rules failures
- 5xx: Offchain failures
Co-authored-by: shahafn <[email protected]>
✅ All reviewers have approved. |
There was a problem hiding this 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...
Head branch was pushed to by a user without write access
There was a problem hiding this 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...
calls: { | ||
to?: `0x${string}` | undefined; | ||
data?: `0x${string}` | undefined; | ||
value?: `0x${string}` | undefined; // Hex value | ||
chainId?: `0x${string}` | undefined; // Hex chain id | ||
capabilitiesData?: Record<string, any> | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep consistent with capabilities
?
capabilitiesData?: Record<string, any> | undefined; | |
capabilities?: Record<string, any> | undefined; |
@@ -122,38 +136,59 @@ Returns the status of a call batch that was sent via `wallet_sendCalls`. The ide | |||
type GetCallsParams = string; | |||
|
|||
type GetCallsResult = { | |||
status: 'PENDING' | 'CONFIRMED'; | |||
callsId: `0x${string}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"calls" seems redundant in this context?
callsId: `0x${string}`; | |
id: `0x${string}`; |
There was a problem hiding this 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...
status: 'PENDING' | 'CONFIRMED'; | ||
callsId: `0x${string}`; | ||
chainId?: `0x${string}`; | ||
batchStatus: string; // See "Status Codes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"batch" seems redundant in this context?
batchStatus: string; // See "Status Codes" | |
status: string; // See "Status Codes" |
blockHash: `0x${string}`; | ||
blockNumber: `0x${string}`; | ||
gasUsed: `0x${string}`; | ||
transactionHash: `0x${string}`; | ||
}[]; | ||
capabilitiesResultsData?: Record<string, any> | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"resultsData" seems redundant in this context?
capabilitiesResultsData?: Record<string, any> | undefined; | |
capabilities?: Record<string, any> | undefined; |
There was a problem hiding this 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...
There was a problem hiding this 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...
@@ -233,15 +268,15 @@ The capabilities below are for illustrative purposes. | |||
{ | |||
"0x2105": { | |||
"paymasterService": { | |||
"supported": true | |||
"version": "1.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does semver work here? Could be a pain to manage the behavior. Should it be consistent with other version
values across other JSON-RPC methods?
"version": "1.0.0" | |
"version": "1" |
There was a problem hiding this 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...
The commit 0a705ca (as a parent of 8df9866) contains errors. |
* 4xx: Chain rules failures | ||
* 5xx: Offchain failures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a total nit, but if we are using the analogy of HTTP status codes here, shouldn't it be the other way round?
4xx: HTTP Client Error ≈ Offchain Error
5xx: HTTP Server Error ≈ Onchain/chain rules Error
I would see "offchain" similarly to a HTTP Client, and "onchain"/chain rules similarly to a HTTP Server.