You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, thank you for reporting. Can you provide the context where this information is serialized? The ABCI-provided evidence is not of this type, but a Misbehavior, defined using protobuf.
I believe we will have to change the tendermint-rs code to handle both snake_case and PascalCase when deserializing evidence from JSON. I am not 100% sure how to deal with this when serializing, perhaps we will have serialize these fields in both snake_case and PascalCase. Any thoughts on that?
Yes that's what I had in mind for deserialization, but that won't work for serialization.
As I see it, we have two options:
a) tendermint-rs picks a different serialization scheme depending on the version of Comet running on the node, which is doable but cumbersome
b) tendermint-rs include both fields in snake_case and PascalCase, and Comet will deserialize only the fields in the specific format it expects (to be confirmed) which is simpler but comes at the expense of more bytes on the wire
We believe that the backports to v0.38.x and v0.37.x have to be backed out, because the change is breaking the (RPC) API.
We will introduce the new json format (snake_case) for Evidence field starting from v1.x
Now, here are the questions we have for you:
@benluelo, is the snake_case a "nice-to-have"? If not (i.e., something is breaking), please explain what is breaking
@romac how cumbersome would it be that v1.x, from the very first release, contains only the snake format for Evidence JSON tags (and the old PascalCase format totally disappears in v1.x)?
the casing doesn't break anything, it's just inconsistent with the rest of the rpc. it can of course be worked around, but consistency/ least surprise is always best (when it's not breaking existing code of course).
it would be good to document the exact format of the fields for both 1.x and pre-1.x. when I was implementing our rpc client I was unable to find any explicit docs about the json formats and had assumed these fields were snake case like the rest of the rpc - I was very surprised to find our relayer had exploded overnight on a PascalCase value 😁
Activity
cason commentedon Jul 19, 2024
Hey, thank you for reporting. Can you provide the context where this information is serialized? The ABCI-provided evidence is not of this type, but a
Misbehavior, defined using protobuf.cason commentedon Jul 19, 2024
In any case, if we are to add the tags, we should do the same for the
LightClientAttackEvidencetype declared in the same source file.benluelo commentedon Jul 19, 2024
it's in the json rpc, specifically this block is where we noticed the issue: https://berav2-testnet-rpc.polkachu.com/block?height=1376378
3 remaining items
fix(types): Add missing JSON tags to `DuplicateVoteEvidence` and `Lig…
fix(types): Add missing JSON tags to `DuplicateVoteEvidence` and `Lig…
fix(types): Add missing JSON tags to `DuplicateVoteEvidence` and `Lig…
fix(types): Add missing JSON tags to `DuplicateVoteEvidence` and `Lig…
fix(types): Add missing JSON tags to `DuplicateVoteEvidence` and `Lig…
fix(types): Add missing JSON tags to `DuplicateVoteEvidence` and `Lig…
romac commentedon Aug 12, 2024
Sorry for being late, but just wanted to point out that this is is a breaking change for tendermint-rs and Hermes, and will require adaptations in tendermint-rs.
I believe we will have to change the tendermint-rs code to handle both snake_case and PascalCase when deserializing evidence from JSON. I am not 100% sure how to deal with this when serializing, perhaps we will have serialize these fields in both snake_case and PascalCase. Any thoughts on that?
benluelo commentedon Aug 12, 2024
you can use serde aliases: https://serde.rs/field-attrs.html#alias (this is what I have done as well)
romac commentedon Aug 12, 2024
Yes that's what I had in mind for deserialization, but that won't work for serialization.
As I see it, we have two options:
a) tendermint-rs picks a different serialization scheme depending on the version of Comet running on the node, which is doable but cumbersome
b) tendermint-rs include both fields in snake_case and PascalCase, and Comet will deserialize only the fields in the specific format it expects (to be confirmed) which is simpler but comes at the expense of more bytes on the wire
Do you see another way?
sergio-mena commentedon Aug 13, 2024
Hi @romac and @benluelo , after a discussion with @alesforz, this is what we propose:
v0.38.xandv0.37.xhave to be backed out, because the change is breaking the (RPC) API.v1.xNow, here are the questions we have for you:
v1.x, from the very first release, contains only the snake format for Evidence JSON tags (and the old PascalCase format totally disappears inv1.x)?benluelo commentedon Aug 13, 2024
the casing doesn't break anything, it's just inconsistent with the rest of the rpc. it can of course be worked around, but consistency/ least surprise is always best (when it's not breaking existing code of course).
it would be good to document the exact format of the fields for both 1.x and pre-1.x. when I was implementing our rpc client I was unable to find any explicit docs about the json formats and had assumed these fields were snake case like the rest of the rpc - I was very surprised to find our relayer had exploded overnight on a
PascalCasevalue 😁revert(types): Revert #3543 (backport #3549) (#3705)
revert(types): Revert #3543 (backport #3550) (#3704)