-
Notifications
You must be signed in to change notification settings - Fork 292
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
Make the encoding require the app version #3134
Comments
Another option is to have the encoding config simply support all versions |
does the user need to specify which version of the encoding is needed at a given point? |
I guess what we are trying to prevent is someone submitting a transaction that is not yet or no longer supported right? Or is there any other use cases you had in mind? |
the main thing is trying to avoid non-determinism when upgrading since being able to decode or not decode a tx could result in that if we didn't get everything perfect. I was worried about differences in the antehandlers during process and even finalize block. Like, if someone submits a new tx type, will that get passed to ante handlers on nodes that have been upgraded where nodes that haven't upgraded won't? by requiring the app version, we ensure that this doesn't occur. We could also ensure that all old tx types are treated as unsupported, instead of quasi-supported |
For the antehandler, I was planning on trying to decode it and if it was successful then checking that the msg type was supported by the current version |
I could see that working as well, can we document that somewhere if its not already? this is marked as while requiring the app version is annoying, imo I think its annoying in a good way similar to a strict type system. Especially if it avoids a bug that requires manually digging through protobuf bytes |
we don't need this because of #3162 |
Ref: #3134 This PR solves the problem of ensuring the messages belonging to modules not part of the current app version aren't executed. It does this in two ways: - Introducing an antehandler decorator to be predominantly used in CheckTx to immediately reject transactions giving users a useful error message (instead of just failing to execute) - Introduces a `CircuitBreaker` implementation to the `MsgServiceRouter` which prevents the execution of messages not belonging to the current app version. We need this because another module may call a message that is not current supported (think a governance proposal) I had several complications with the wiring of this given the structure of the SDK and tried a few different variants - this one I think being the better. It uses the configurator which is reponsible for registering services to read all the methods a modules grpc Server supports and extracting out the message names and mapping them to one or more versions that they are supported for. --------- Co-authored-by: Rootul P <[email protected]>
…estiaorg#3162) Ref: celestiaorg#3134 This PR solves the problem of ensuring the messages belonging to modules not part of the current app version aren't executed. It does this in two ways: - Introducing an antehandler decorator to be predominantly used in CheckTx to immediately reject transactions giving users a useful error message (instead of just failing to execute) - Introduces a `CircuitBreaker` implementation to the `MsgServiceRouter` which prevents the execution of messages not belonging to the current app version. We need this because another module may call a message that is not current supported (think a governance proposal) I had several complications with the wiring of this given the structure of the SDK and tried a few different variants - this one I think being the better. It uses the configurator which is reponsible for registering services to read all the methods a modules grpc Server supports and extracting out the message names and mapping them to one or more versions that they are supported for. --------- Co-authored-by: Rootul P <[email protected]>
Ref: celestiaorg/celestia-app#3134 This PR solves the problem of ensuring the messages belonging to modules not part of the current app version aren't executed. It does this in two ways: - Introducing an antehandler decorator to be predominantly used in CheckTx to immediately reject transactions giving users a useful error message (instead of just failing to execute) - Introduces a `CircuitBreaker` implementation to the `MsgServiceRouter` which prevents the execution of messages not belonging to the current app version. We need this because another module may call a message that is not current supported (think a governance proposal) I had several complications with the wiring of this given the structure of the SDK and tried a few different variants - this one I think being the better. It uses the configurator which is reponsible for registering services to read all the methods a modules grpc Server supports and extracting out the message names and mapping them to one or more versions that they are supported for. --------- Co-authored-by: Rootul P <[email protected]>
The encoding could differ between app versions. This could result in non-determinism. The safest thing to do imo would be to require the app version when creating an encoding config, and we create a new encoding config each height. This way we ensure that there encoding is done deterministically across heights and nodes. There might be other mechanisms for forcing this.
The text was updated successfully, but these errors were encountered: