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

Replaced oneOf with anyOf as it breaks the schema validation due to dupes (both block and tx hashes are hash32) #504

Merged
merged 2 commits into from
Dec 22, 2023

Conversation

lorenzourb
Copy link
Contributor

No description provided.

@lorenzourb lorenzourb changed the title forcing oneOf breaks the schema validation due to dups forcing oneOf breaks the schema validation due to dupes Dec 17, 2023
@lorenzourb lorenzourb changed the title forcing oneOf breaks the schema validation due to dupes forcing oneOf breaks the schema validation due to dupes (both block and tx hashes are hash32) Dec 17, 2023
@lorenzourb lorenzourb changed the title forcing oneOf breaks the schema validation due to dupes (both block and tx hashes are hash32) Replaced oneOf with anyOf as it breaks the schema validation due to dupes (both block and tx hashes are hash32) Dec 17, 2023
@lorenzourb
Copy link
Contributor Author

@lightclient can you please review this?

Copy link
Member

@lightclient lightclient left a comment

Choose a reason for hiding this comment

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

Thanks for catching this. There is clearly an issue here, but I think anyOf is not quite correct either. I don't think it is possible to match both an array of Log and of Hash32, but semantically it is a little confusing. I think changing FilterResults to have 2 items: array of Logs or array of Hash32 is preferable. And in the description of the Hash32 array note it could be either a tx hash or block hash depending on the original filter request.

@lorenzourb
Copy link
Contributor Author

Thanks for catching this. There is clearly an issue here, but I think anyOf is not quite correct either. I don't think it is possible to match both an array of Log and of Hash32, but semantically it is a little confusing. I think changing FilterResults to have 2 items: array of Logs or array of Hash32 is preferable. And in the description of the Hash32 array note it could be either a tx hash or block hash depending on the original filter request.

@lightclient Sounds good to me, changed accordingly.

@lorenzourb
Copy link
Contributor Author

lorenzourb commented Dec 22, 2023

Thanks for catching this. There is clearly an issue here, but I think anyOf is not quite correct either. I don't think it is possible to match both an array of Log and of Hash32, but semantically it is a little confusing. I think changing FilterResults to have 2 items: array of Logs or array of Hash32 is preferable. And in the description of the Hash32 array note it could be either a tx hash or block hash depending on the original filter request.

@lightclient can I get this approve now please I'd rather prefer not add this exception in our codebase?

Copy link
Member

@lightclient lightclient left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@lightclient lightclient merged commit cea7eeb into ethereum:main Dec 22, 2023
3 checks passed
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.

2 participants