ethereum / execution-apis

Collection of APIs provided by Ethereum execution layer clients
Creative Commons Zero v1.0 Universal
908 stars 352 forks source link

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

Closed lorenzourb closed 6 months ago

lorenzourb commented 7 months ago

@lightclient can you please review this?

lorenzourb commented 6 months ago

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 commented 6 months ago

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?