Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lightclient
Copy link
Member

Fixes the issues that was causing CI to break. I see there are still some more issues in the same vein of what was fixed (particularly around the constant error codes), but will probably resolve those in a separate PR.

Copy link
Contributor

@MicahZoltu MicahZoltu left a comment

Choose a reason for hiding this comment

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

The blocker for us merging https://github.com/ethereum/execution-apis/pull/670/files is that CI currently appears to be broken and the checker appears to be checking main when run on PR rather than checking the PR. This means any change that breaks CI will pass until after it is merged, and then everything will fail (including PRs that fix the bug like #670) until main has a fix.

We can ignore this and merge #670 so the checker stops failing for every PR, but we were hoping to wait until CI was fixed so our PR could be properly checked before merging.

That being said, this PR is somehow passing the checker, which surprises me and I'm not sure why that would be. Perhaps because the PR was authored by a contributor while #670 is authored by a non-contributor and permissions on the run are causing it to run differently?

Either way, I recommend merging #670 prior to this, and removing the changes related to eth_simulateV1 from this PR.

Comment on lines +274 to +282
pattern: "^execution reverted.*"
required: [code, message]
- type: object
properties:
code:
const: -32015
message:
type: string
pattern: "^vm execution error.*"
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Member Author

Choose a reason for hiding this comment

The 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

Comment on lines -171 to +169
type: object
type: array
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be an object. See the full proper fix for this issue in https://github.com/ethereum/execution-apis/pull/670/files, which we were waiting to merge until the CI bug was fixed but we could merge that now if we don't want to wait for the bug in the CI checker to get fixed.

Copy link
Member Author

Choose a reason for hiding this comment

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

If #670 is the proper fix and it should be an object, then the tests need to be fixed because it currently returns an array. See the result here: https://github.com/ethereum/execution-apis/blob/main/tests/eth_simulateV1/ethSimulate-set-read-storage.io

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I think I see the problem. This is a oneOf and one of the options is an array and the other is an object. I'm not sure how to capture this in openrpc specs. Do we just remove the type entirely?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the object EthSimulateBlockResultInvalid is also wrong, but there are no tests for it so it doesn't fail the schema. AFAICT, invalid results fail with a JSON-RPC error, not a success response with result field.

Not sure what the expected value for it is.

@@ -20,7 +20,6 @@ Block:
- size
- transactions
- uncles
additionalProperties: false
Copy link

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

Copy link
Member Author

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?

Copy link

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.

Copy link
Member Author

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.

@lightclient
Copy link
Member Author

@MicahZoltu I don't think there are different permissions for running the PRs. When I verify if #670 passes speccheck locally, it fails. This is correctly represented by the CI.

Obviously you and the other people working on eth_simulate have a better idea of what the "spirit" of the spec is. I can only go off what I see in the tests and I believe this PR does resolve the discrepancy between the spec and the tests that causes the CI to fail.

My preference would be to merge this so that CI is no longer broken, then separately if you want to change the implementation of eth_simulate to be more aligned with the original idea of the spec, that can be done.

Otherwise our options are to revert the PR that merged eth_simulate and wait until the spec and tests are in harmony, or we if #670 can be fixed ASAP we could merge it instead.

@MicahZoltu
Copy link
Contributor

#484 was passing all checks at the time of merge. However, it does appear that it is correctly checking now. I propose you remove the eth_simulate changes in this PR and we rebase #670 onto it. Then we can merge 670 into this PR, and you can merge this without breaking the spec and without leaving the repository in a dirty state for an extended period.

That being said, I think both PRs have #675 (comment) wrong, which I don't know how to resolve (spec format question).

@lightclient
Copy link
Member Author

lightclient commented Jul 21, 2025

Unfortunately in #484 it seems since @KillariDev hadn't previously landed a commit, so the CI tests were not running and only this GitGuardian action was running. I guess Felix didn't notice this before merging.

Let me try to bring the changes from #670 here and then we can figure out deal with the types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants