-
Notifications
You must be signed in to change notification settings - Fork 436
Fix invalid eth_simulate schema #675
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,6 @@ Block: | |
- size | ||
- transactions | ||
- uncles | ||
additionalProperties: false | ||
properties: | ||
hash: | ||
title: Hash | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,7 +149,7 @@ Withdrawals: | |
description: This array can have a maximum length of 16. | ||
type: array | ||
items: | ||
- $ref: '#/components/schemas/Withdrawal' | ||
$ref: '#/components/schemas/Withdrawal' | ||
Withdrawal: | ||
title: A withdrawal made by a validator | ||
type: object | ||
|
@@ -168,7 +168,7 @@ Withdrawal: | |
$ref: '#/components/schemas/uint64' | ||
EthSimulateResult: | ||
title: Full results of multi call | ||
type: object | ||
type: array | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If #670 is the proper fix and it should be an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I think I see the problem. This is a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the object Not sure what the expected value for it is. |
||
oneOf: | ||
- $ref: '#/components/schemas/EthSimulateBlockResultInvalid' | ||
- $ref: '#/components/schemas/EthSimulateBlockResultSuccess' | ||
|
@@ -182,7 +182,8 @@ EthSimulateBlockResultSingleSuccess: | |
type: object | ||
allOf: | ||
- $ref: '#/components/schemas/Block' | ||
- title: Eth Simulate call results | ||
- type: object | ||
title: Eth Simulate call results | ||
required: | ||
- calls | ||
properties: | ||
|
@@ -265,10 +266,21 @@ CallResultFailure: | |
$ref: '#/components/schemas/uint64' | ||
error: | ||
oneOf: | ||
- code: -32000 | ||
message: 'Execution reverted' | ||
- code: -32015 | ||
message: 'VM execution error' | ||
- type: object | ||
properties: | ||
code: | ||
const: -32000 | ||
message: | ||
type: string | ||
pattern: "^execution reverted.*" | ||
required: [code, message] | ||
- type: object | ||
properties: | ||
code: | ||
const: -32015 | ||
message: | ||
type: string | ||
pattern: "^vm execution error.*" | ||
Comment on lines
+275
to
+283
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does case matter here? I haven't tested, but I thought that these were both capital first letter casing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you could make the regex support both cases, but currently the response is lowercase. See the test here: https://github.com/ethereum/execution-apis/blob/main/tests/eth_simulateV1/ethSimulate-eth-send-should-not-produce-logs-on-revert.io |
||
CallResultSuccess: | ||
title: Result of call success | ||
type: object | ||
|
@@ -298,7 +310,7 @@ CallResultLog: | |
type: object | ||
required: | ||
- logIndex | ||
- blockhash | ||
- blockHash | ||
- blockNumber | ||
- transactionHash | ||
- transactionIndex | ||
|
This file was deleted.
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 feels like this might be problematic, going forward. I think I see why you want, it's because you want to reuse the block schema with the additional property calls, without specifying an additional schema for Block.
But for more clarity we don't support later version of the json draft spec yet officially. So technically unevaluatedProperties is not supported.
I peeked at the problem, and it seemed as though the issue with the original PR that landed was that calls, was set as required, but not defined in properties which, was one of the reasons why build broke
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.
To clarify, you think removing
additionalProperties
is problematic or you think keeping it is?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.
actually sorry, misread the additionalProperties as being additionalProperties:True. The additionalProperties:False should be fine.
unevaluatedProperties
portion is not officially supported so if it's possible to rm that I would probably rm that, until the open-rpc spec supports a later json schema draft spec.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.
Okay gotcha. Yeah agree we should remove the
unevaluatedProperties
.