-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Purpose of Changes and their Description Solve the unmarshalling issues of `sdk.Msg` implementations of previous `x/emissions` and `x/mint` versions by registering related types in the `InterfaceRegistry`. This change is not consensus breaking as these messages are never manipulated in state mutations, there is no need to update validator nodes with this fix. It'll allow to query transactions containing old versions of proto messages, for example the query below was returning an error: ```bash > allorad --node "https://allora-rpc.testnet.allora.network" query tx 74E327C59995366ECF6009AE68122EB60B24815C78B636B01B52B2E96772932C Error: unable to resolve type URL /emissions.v5.InsertWorkerPayloadRequest: tx parse error Usage: allorad query tx --type=[hash|acc_seq|signature] [hash|acc_seq|signature] [flags] Flags: --grpc-addr string the gRPC endpoint to use for this chain --grpc-insecure allow gRPC over insecure channels, if not the server must use TLS --height int Use a specific height to query state at (this can error if the node is pruning state) -h, --help help for tx --node string <host>:<port> to CometBFT RPC interface for this chain (default "tcp://localhost:26657") -o, --output string Output format (text|json) (default "text") --type string The type to be used when querying tx, can be one of "hash", "acc_seq", "signature" (default "hash") Global Flags: --home string directory for config and data (default "/Users/arnaud/.allorad") --log_format string The logging format (json|plain) (default "plain") --log_level string The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:<level>,<key>:<level>') (default "info") --log_no_color Disable colored logs --trace print out full stack trace on errors unable to resolve type URL /emissions.v5.InsertWorkerPayloadRequest: tx parse error [cosmos/cosmos-sdk@v0.50.10/x/auth/tx/decoder.go:44] ``` I'll mention this in the upgrade checklist so we do the same for future versions. ## Link(s) to Ticket(s) or Issue(s) resolved by this PR https://linear.app/alloralabs/issue/PROTO-3030/investigate-issue-when-querying-transactions-in-testnet ## Are these changes tested and documented? - [x] If tested, please describe how. If not, why tests are not needed. - [x] If documented, please describe where. If not, describe why docs are not needed. - [x] Added to `Unreleased` section of `CHANGELOG.md`?
- Loading branch information
Showing
11 changed files
with
194 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package emissionsv2 | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
// nolint: exhaustruct | ||
func RegisterInterfaces(registry types.InterfaceRegistry) { | ||
registry.RegisterImplementations((*sdk.Msg)(nil), | ||
&MsgUpdateParams{}, | ||
&MsgCreateNewTopic{}, | ||
&MsgRegister{}, | ||
&MsgRemoveRegistration{}, | ||
&MsgAddStake{}, | ||
&MsgRemoveStake{}, | ||
&MsgCancelRemoveStake{}, | ||
&MsgDelegateStake{}, | ||
&MsgRewardDelegateStake{}, | ||
&MsgRemoveDelegateStake{}, | ||
&MsgCancelRemoveDelegateStake{}, | ||
&MsgFundTopic{}, | ||
&MsgAddToWhitelistAdmin{}, | ||
&MsgRemoveFromWhitelistAdmin{}, | ||
&MsgInsertWorkerPayload{}, | ||
&MsgInsertReputerPayload{}, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package emissionsv3 | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
// nolint: exhaustruct | ||
func RegisterInterfaces(registry types.InterfaceRegistry) { | ||
registry.RegisterImplementations((*sdk.Msg)(nil), | ||
&MsgUpdateParams{}, | ||
&MsgCreateNewTopic{}, | ||
&MsgRegister{}, | ||
&MsgRemoveRegistration{}, | ||
&MsgAddStake{}, | ||
&MsgRemoveStake{}, | ||
&MsgCancelRemoveStake{}, | ||
&MsgDelegateStake{}, | ||
&MsgRewardDelegateStake{}, | ||
&MsgRemoveDelegateStake{}, | ||
&MsgCancelRemoveDelegateStake{}, | ||
&MsgFundTopic{}, | ||
&MsgAddToWhitelistAdmin{}, | ||
&MsgRemoveFromWhitelistAdmin{}, | ||
&MsgInsertWorkerPayload{}, | ||
&MsgInsertReputerPayload{}, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package emissionsv4 | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
// nolint: exhaustruct | ||
func RegisterInterfaces(registry types.InterfaceRegistry) { | ||
registry.RegisterImplementations((*sdk.Msg)(nil), | ||
&UpdateParamsRequest{}, | ||
&CreateNewTopicRequest{}, | ||
&RegisterRequest{}, | ||
&RemoveRegistrationRequest{}, | ||
&AddStakeRequest{}, | ||
&RemoveStakeRequest{}, | ||
&CancelRemoveStakeRequest{}, | ||
&DelegateStakeRequest{}, | ||
&RewardDelegateStakeRequest{}, | ||
&RemoveDelegateStakeRequest{}, | ||
&CancelRemoveDelegateStakeRequest{}, | ||
&FundTopicRequest{}, | ||
&AddToWhitelistAdminRequest{}, | ||
&RemoveFromWhitelistAdminRequest{}, | ||
&InsertWorkerPayloadRequest{}, | ||
&InsertReputerPayloadRequest{}, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package emissionsv5 | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
// nolint: exhaustruct | ||
func RegisterInterfaces(registry types.InterfaceRegistry) { | ||
registry.RegisterImplementations((*sdk.Msg)(nil), | ||
&UpdateParamsRequest{}, | ||
&CreateNewTopicRequest{}, | ||
&RegisterRequest{}, | ||
&RemoveRegistrationRequest{}, | ||
&AddStakeRequest{}, | ||
&RemoveStakeRequest{}, | ||
&CancelRemoveStakeRequest{}, | ||
&DelegateStakeRequest{}, | ||
&RewardDelegateStakeRequest{}, | ||
&RemoveDelegateStakeRequest{}, | ||
&CancelRemoveDelegateStakeRequest{}, | ||
&FundTopicRequest{}, | ||
&AddToWhitelistAdminRequest{}, | ||
&RemoveFromWhitelistAdminRequest{}, | ||
&InsertWorkerPayloadRequest{}, | ||
&InsertReputerPayloadRequest{}, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package emissionsv6 | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
// nolint: exhaustruct | ||
func RegisterInterfaces(registry types.InterfaceRegistry) { | ||
registry.RegisterImplementations((*sdk.Msg)(nil), | ||
&UpdateParamsRequest{}, | ||
&CreateNewTopicRequest{}, | ||
&RegisterRequest{}, | ||
&RemoveRegistrationRequest{}, | ||
&AddStakeRequest{}, | ||
&RemoveStakeRequest{}, | ||
&CancelRemoveStakeRequest{}, | ||
&DelegateStakeRequest{}, | ||
&RewardDelegateStakeRequest{}, | ||
&RemoveDelegateStakeRequest{}, | ||
&CancelRemoveDelegateStakeRequest{}, | ||
&FundTopicRequest{}, | ||
&AddToWhitelistAdminRequest{}, | ||
&RemoveFromWhitelistAdminRequest{}, | ||
&InsertWorkerPayloadRequest{}, | ||
&InsertReputerPayloadRequest{}, | ||
&AddToGlobalWhitelistRequest{}, | ||
&RemoveFromGlobalWhitelistRequest{}, | ||
&EnableTopicWorkerWhitelistRequest{}, | ||
&DisableTopicWorkerWhitelistRequest{}, | ||
&EnableTopicReputerWhitelistRequest{}, | ||
&DisableTopicReputerWhitelistRequest{}, | ||
&AddToTopicCreatorWhitelistRequest{}, | ||
&RemoveFromTopicCreatorWhitelistRequest{}, | ||
&AddToTopicWorkerWhitelistRequest{}, | ||
&RemoveFromTopicWorkerWhitelistRequest{}, | ||
&AddToTopicReputerWhitelistRequest{}, | ||
&RemoveFromTopicReputerWhitelistRequest{}, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package mintv1beta1 | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
// nolint: exhaustruct | ||
func RegisterInterfaces(registry types.InterfaceRegistry) { | ||
registry.RegisterImplementations((*sdk.Msg)(nil), | ||
&MsgUpdateParams{}, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package mintv2 | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
// nolint: exhaustruct | ||
func RegisterInterfaces(registry types.InterfaceRegistry) { | ||
registry.RegisterImplementations((*sdk.Msg)(nil), | ||
&UpdateParamsRequest{}, | ||
&RecalculateTargetEmissionRequest{}, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters