diff --git a/Makefile b/Makefile index fb4121f7f..c1005d86b 100644 --- a/Makefile +++ b/Makefile @@ -85,7 +85,7 @@ ldflags := $(strip $(ldflags)) BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' # check for nostrip option ifeq (,$(findstring nostrip,$(ATOMONE_BUILD_OPTIONS))) - BUILD_FLAGS += -trimpath +# BUILD_FLAGS += -trimpath endif ############################################################################### diff --git a/app/app.go b/app/app.go index 0e6a6b6c8..c31740e4a 100644 --- a/app/app.go +++ b/app/app.go @@ -11,6 +11,9 @@ import ( "github.com/gorilla/mux" "github.com/spf13/cast" + // Force registration of gno proto types + _ "github.com/atomone-hub/atomone/modules/10-gno" + abci "github.com/cometbft/cometbft/abci/types" dbm "github.com/cosmos/cosmos-db" diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 1e410cb40..34d2daefc 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -51,6 +51,7 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + ibcgno "github.com/atomone-hub/atomone/modules/10-gno" coredaoskeeper "github.com/atomone-hub/atomone/x/coredaos/keeper" coredaostypes "github.com/atomone-hub/atomone/x/coredaos/types" dynamicfeekeeper "github.com/atomone-hub/atomone/x/dynamicfee/keeper" @@ -95,6 +96,7 @@ type AppKeepers struct { ICAModule ica.AppModule TransferModule transfer.AppModule TMClientModule ibctm.AppModule + GnoModule ibcgno.AppModule } func NewAppKeeper( @@ -347,10 +349,14 @@ func NewAppKeeper( storeProvider := clientKeeper.GetStoreProvider() tmLightClientModule := ibctm.NewLightClientModule(appCodec, storeProvider) + + gnoLightClientModule := ibcgno.NewLightClientModule(appCodec, storeProvider) + appKeepers.IBCKeeper.ClientKeeper.AddRoute(ibctm.ModuleName, &tmLightClientModule) + appKeepers.IBCKeeper.ClientKeeper.AddRoute(ibcgno.ModuleName, &gnoLightClientModule) appKeepers.TMClientModule = ibctm.NewAppModule(tmLightClientModule) - + appKeepers.GnoModule = ibcgno.NewAppModule(gnoLightClientModule) return appKeepers } @@ -369,12 +375,12 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino //nolint: staticcheck // SA1019: moduletypes.ParamKeyTable is deprecated paramsKeeper.Subspace(authtypes.ModuleName).WithKeyTable(authtypes.ParamKeyTable()) - paramsKeeper.Subspace(stakingtypes.ModuleName).WithKeyTable(stakingtypes.ParamKeyTable()) //nolint:staticcheck // SA1019 - paramsKeeper.Subspace(banktypes.ModuleName).WithKeyTable(banktypes.ParamKeyTable()) //nolint:staticcheck // SA1019 - paramsKeeper.Subspace(minttypes.ModuleName).WithKeyTable(minttypes.ParamKeyTable()) //nolint:staticcheck // SA1019 - paramsKeeper.Subspace(distrtypes.ModuleName).WithKeyTable(distrtypes.ParamKeyTable()) //nolint:staticcheck // SA1019 - paramsKeeper.Subspace(slashingtypes.ModuleName).WithKeyTable(slashingtypes.ParamKeyTable()) //nolint:staticcheck // SA1019 - paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint:staticcheck // SA1019 + paramsKeeper.Subspace(stakingtypes.ModuleName).WithKeyTable(stakingtypes.ParamKeyTable()) + paramsKeeper.Subspace(banktypes.ModuleName).WithKeyTable(banktypes.ParamKeyTable()) //nolint:staticcheck // SA1019 + paramsKeeper.Subspace(minttypes.ModuleName).WithKeyTable(minttypes.ParamKeyTable()) //nolint:staticcheck // SA1019 + paramsKeeper.Subspace(distrtypes.ModuleName).WithKeyTable(distrtypes.ParamKeyTable()) + paramsKeeper.Subspace(slashingtypes.ModuleName).WithKeyTable(slashingtypes.ParamKeyTable()) + paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint:staticcheck // SA1019 paramsKeeper.Subspace(ibctransfertypes.ModuleName) paramsKeeper.Subspace(ibcexported.ModuleName) paramsKeeper.Subspace(icahosttypes.SubModuleName) diff --git a/app/modules.go b/app/modules.go index 19644a285..d573f32bc 100644 --- a/app/modules.go +++ b/app/modules.go @@ -104,6 +104,7 @@ func appModules( app.TransferModule, app.ICAModule, app.TMClientModule, + app.GnoModule, } } diff --git a/docs/static/openapi.json b/docs/static/openapi.json new file mode 100644 index 000000000..0aa5c83d2 --- /dev/null +++ b/docs/static/openapi.json @@ -0,0 +1 @@ +{"id":"github.com/atomone-hub/atomone","consumes":["application/json"],"produces":["application/json"],"swagger":"2.0","info":{"description":"Chain github.com/atomone-hub/atomone REST API","title":"HTTP API Console","contact":{"name":"github.com/atomone-hub/atomone"},"version":"version not set"},"paths":{"/atomone/coredaos/v1/params":{"get":{"tags":["Query"],"summary":"Parameters queries the parameters of the module.","operationId":"GithubComatomoneHubatomoneParams","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.coredaos.v1.QueryParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/dynamicfee/v1/gas_price/{denom}":{"get":{"tags":["Query"],"summary":"GasPrice returns the current dynamicfee module gas price\nfor specified denom.","operationId":"GithubComatomoneHubatomoneGasPrice","parameters":[{"type":"string","description":"denom we are querying gas price in","name":"denom","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.dynamicfee.v1.GasPriceResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/dynamicfee/v1/gas_prices":{"get":{"tags":["Query"],"summary":"GasPrices returns the current dynamicfee module list of gas prices\nin all available denoms.","operationId":"GithubComatomoneHubatomoneGasPrices","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.dynamicfee.v1.GasPricesResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/dynamicfee/v1/params":{"get":{"tags":["Query"],"summary":"Params returns the current dynamicfee module parameters.","operationId":"GithubComatomoneHubatomoneParamsMixin6","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.dynamicfee.v1.ParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/dynamicfee/v1/state":{"get":{"tags":["Query"],"summary":"State returns the current dynamicfee module state.","operationId":"GithubComatomoneHubatomoneState","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.dynamicfee.v1.StateResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1/constitution":{"get":{"tags":["Query"],"summary":"Constitution queries the chain's constitution.","operationId":"GithubComatomoneHubatomoneConstitution","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1.QueryConstitutionResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1/mindeposit":{"get":{"tags":["Query"],"summary":"MinDeposit queries the minimum deposit currently\nrequired for a proposal to enter voting period.","operationId":"GithubComatomoneHubatomoneMinDeposit","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1.QueryMinDepositResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1/mininitialdeposit":{"get":{"tags":["Query"],"summary":"MinInitialDeposit queries the minimum initial deposit\ncurrently required for a proposal to be submitted.","operationId":"GithubComatomoneHubatomoneMinInitialDeposit","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1.QueryMinInitialDepositResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1/params/{params_type}":{"get":{"tags":["Query"],"summary":"Params queries all parameters of the gov module.","operationId":"GithubComatomoneHubatomoneParamsMixin10","parameters":[{"type":"string","description":"params_type defines which parameters to query for, can be one of \"voting\",\n\"tallying\" or \"deposit\".","name":"params_type","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1.QueryParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1/participationemas":{"get":{"tags":["Query"],"summary":"ParticipationEMAs queries the state of the proposal participation\nexponential moving averages.","operationId":"GithubComatomoneHubatomoneParticipationEMAs","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1.QueryParticipationEMAsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1/proposals":{"get":{"tags":["Query"],"summary":"Proposals queries all proposals based on given status.","operationId":"GithubComatomoneHubatomoneProposals","parameters":[{"enum":["PROPOSAL_STATUS_UNSPECIFIED","PROPOSAL_STATUS_DEPOSIT_PERIOD","PROPOSAL_STATUS_VOTING_PERIOD","PROPOSAL_STATUS_PASSED","PROPOSAL_STATUS_REJECTED","PROPOSAL_STATUS_FAILED","PROPOSAL_STATUS_VETOED"],"type":"string","default":"PROPOSAL_STATUS_UNSPECIFIED","description":"proposal_status defines the status of the proposals.\n\n - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status.\n - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit\nperiod.\n - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting\nperiod.\n - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has\npassed.\n - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has\nbeen rejected.\n - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has\nfailed.\n - PROPOSAL_STATUS_VETOED: PROPOSAL_STATUS_VETOED defines a proposal status of a proposal that has\nbeen vetoed.","name":"proposal_status","in":"query"},{"type":"string","description":"voter defines the voter address for the proposals.","name":"voter","in":"query"},{"type":"string","description":"depositor defines the deposit addresses from the proposals.","name":"depositor","in":"query"},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1.QueryProposalsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1/proposals/{proposal_id}":{"get":{"tags":["Query"],"summary":"Proposal queries proposal details based on ProposalID.","operationId":"GithubComatomoneHubatomoneProposal","parameters":[{"type":"string","format":"uint64","description":"proposal_id defines the unique id of the proposal.","name":"proposal_id","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1.QueryProposalResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1/proposals/{proposal_id}/deposits":{"get":{"tags":["Query"],"summary":"Deposits queries all deposits of a single proposal.","operationId":"GithubComatomoneHubatomoneDeposits","parameters":[{"type":"string","format":"uint64","description":"proposal_id defines the unique id of the proposal.","name":"proposal_id","in":"path","required":true},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1.QueryDepositsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1/proposals/{proposal_id}/deposits/{depositor}":{"get":{"tags":["Query"],"summary":"Deposit queries single deposit information based proposalID, depositAddr.","operationId":"GithubComatomoneHubatomoneDeposit","parameters":[{"type":"string","format":"uint64","description":"proposal_id defines the unique id of the proposal.","name":"proposal_id","in":"path","required":true},{"type":"string","description":"depositor defines the deposit addresses from the proposals.","name":"depositor","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1.QueryDepositResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1/proposals/{proposal_id}/tally":{"get":{"tags":["Query"],"summary":"TallyResult queries the tally of a proposal vote.","operationId":"GithubComatomoneHubatomoneTallyResult","parameters":[{"type":"string","format":"uint64","description":"proposal_id defines the unique id of the proposal.","name":"proposal_id","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1.QueryTallyResultResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1/proposals/{proposal_id}/votes":{"get":{"tags":["Query"],"summary":"Votes queries votes of a given proposal.","operationId":"GithubComatomoneHubatomoneVotes","parameters":[{"type":"string","format":"uint64","description":"proposal_id defines the unique id of the proposal.","name":"proposal_id","in":"path","required":true},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1.QueryVotesResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1/proposals/{proposal_id}/votes/{voter}":{"get":{"tags":["Query"],"summary":"Vote queries voted information based on proposalID, voterAddr.","operationId":"GithubComatomoneHubatomoneVote","parameters":[{"type":"string","format":"uint64","description":"proposal_id defines the unique id of the proposal.","name":"proposal_id","in":"path","required":true},{"type":"string","description":"voter defines the voter address for the proposals.","name":"voter","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1.QueryVoteResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1/quorums":{"get":{"tags":["Query"],"summary":"Quorums queries the dynamically set quorums.","operationId":"GithubComatomoneHubatomoneQuorums","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1.QueryQuorumsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1beta1/params/{params_type}":{"get":{"tags":["Query"],"summary":"Params queries all parameters of the gov module.","operationId":"GithubComatomoneHubatomoneParamsMixin14","parameters":[{"type":"string","description":"params_type defines which parameters to query for, can be one of \"voting\",\n\"tallying\" or \"deposit\".","name":"params_type","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1beta1.QueryParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1beta1/proposals":{"get":{"tags":["Query"],"summary":"Proposals queries all proposals based on given status.","operationId":"GithubComatomoneHubatomoneProposalsMixin14","parameters":[{"enum":["PROPOSAL_STATUS_UNSPECIFIED","PROPOSAL_STATUS_DEPOSIT_PERIOD","PROPOSAL_STATUS_VOTING_PERIOD","PROPOSAL_STATUS_PASSED","PROPOSAL_STATUS_REJECTED","PROPOSAL_STATUS_FAILED","PROPOSAL_STATUS_VETOED"],"type":"string","default":"PROPOSAL_STATUS_UNSPECIFIED","description":"proposal_status defines the status of the proposals.\n\n - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status.\n - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit\nperiod.\n - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting\nperiod.\n - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has\npassed.\n - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has\nbeen rejected.\n - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has\nfailed.\n - PROPOSAL_STATUS_VETOED: PROPOSAL_STATUS_VETOED defines a proposal status of a proposal that has\nbeen vetoed.","name":"proposal_status","in":"query"},{"type":"string","description":"voter defines the voter address for the proposals.","name":"voter","in":"query"},{"type":"string","description":"depositor defines the deposit addresses from the proposals.","name":"depositor","in":"query"},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1beta1.QueryProposalsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1beta1/proposals/{proposal_id}":{"get":{"tags":["Query"],"summary":"Proposal queries proposal details based on ProposalID.","operationId":"GithubComatomoneHubatomoneProposalMixin14","parameters":[{"type":"string","format":"uint64","description":"proposal_id defines the unique id of the proposal.","name":"proposal_id","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1beta1.QueryProposalResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1beta1/proposals/{proposal_id}/deposits":{"get":{"tags":["Query"],"summary":"Deposits queries all deposits of a single proposal.","operationId":"GithubComatomoneHubatomoneDepositsMixin14","parameters":[{"type":"string","format":"uint64","description":"proposal_id defines the unique id of the proposal.","name":"proposal_id","in":"path","required":true},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1beta1.QueryDepositsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}":{"get":{"tags":["Query"],"summary":"Deposit queries single deposit information based proposalID, depositAddr.","operationId":"GithubComatomoneHubatomoneDepositMixin14","parameters":[{"type":"string","format":"uint64","description":"proposal_id defines the unique id of the proposal.","name":"proposal_id","in":"path","required":true},{"type":"string","description":"depositor defines the deposit addresses from the proposals.","name":"depositor","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1beta1.QueryDepositResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1beta1/proposals/{proposal_id}/tally":{"get":{"tags":["Query"],"summary":"TallyResult queries the tally of a proposal vote.","operationId":"GithubComatomoneHubatomoneTallyResultMixin14","parameters":[{"type":"string","format":"uint64","description":"proposal_id defines the unique id of the proposal.","name":"proposal_id","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1beta1.QueryTallyResultResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1beta1/proposals/{proposal_id}/votes":{"get":{"tags":["Query"],"summary":"Votes queries votes of a given proposal.","operationId":"GithubComatomoneHubatomoneVotesMixin14","parameters":[{"type":"string","format":"uint64","description":"proposal_id defines the unique id of the proposal.","name":"proposal_id","in":"path","required":true},{"type":"string","format":"byte","description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","name":"pagination.key","in":"query"},{"type":"string","format":"uint64","description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","name":"pagination.offset","in":"query"},{"type":"string","format":"uint64","description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","name":"pagination.limit","in":"query"},{"type":"boolean","description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","name":"pagination.count_total","in":"query"},{"type":"boolean","description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","name":"pagination.reverse","in":"query"}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1beta1.QueryVotesResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/gov/v1beta1/proposals/{proposal_id}/votes/{voter}":{"get":{"tags":["Query"],"summary":"Vote queries voted information based on proposalID, voterAddr.","operationId":"GithubComatomoneHubatomoneVoteMixin14","parameters":[{"type":"string","format":"uint64","description":"proposal_id defines the unique id of the proposal.","name":"proposal_id","in":"path","required":true},{"type":"string","description":"voter defines the voter address for the proposals.","name":"voter","in":"path","required":true}],"responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.gov.v1beta1.QueryVoteResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/photon/v1/conversion_rate":{"get":{"tags":["Query"],"summary":"ConversionRate queries the photon's conversion rate","operationId":"GithubComatomoneHubatomoneConversionRate","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.photon.v1.QueryConversionRateResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}},"/atomone/photon/v1/params":{"get":{"tags":["Query"],"summary":"Parameters queries the parameters of the module.","operationId":"GithubComatomoneHubatomoneParamsMixin18","responses":{"200":{"description":"A successful response.","schema":{"$ref":"#/definitions/atomone.photon.v1.QueryParamsResponse"}},"default":{"description":"An unexpected error response.","schema":{"$ref":"#/definitions/grpc.gateway.runtime.Error"}}}}}},"definitions":{"atomone.coredaos.v1.MsgAnnotateProposalResponse":{"description":"MsgAnnotateProposalResponse defines the response for MsgAnnotateProposal.","type":"object"},"atomone.coredaos.v1.MsgEndorseProposalResponse":{"description":"MsgEndorseProposalResponse defines the response for MsgEndorseProposal.","type":"object"},"atomone.coredaos.v1.MsgExtendVotingPeriodResponse":{"description":"MsgExtendVotingPeriodResponse defines the response for MsgExtendVotingPeriod.","type":"object"},"atomone.coredaos.v1.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.","type":"object"},"atomone.coredaos.v1.MsgVetoProposalResponse":{"description":"MsgVetoProposalResponse defines the response for MsgVetoProposal.","type":"object"},"atomone.coredaos.v1.Params":{"description":"Params defines the parameters for the x/coredaos module.","type":"object","properties":{"oversight_dao_address":{"description":"oversight_dao_address defines the address which has authority\nto execute messages as Oversight DAO.","type":"string"},"steering_dao_address":{"description":"steering_dao_address defines the address which has authority\nto execute messages as Steering DAO.","type":"string"},"voting_period_extension_duration":{"description":"voting_period_extension_duration defines the duration for which\na proposal's voting period can be extended.","type":"string"},"voting_period_extensions_limit":{"description":"voting_period_extensions_limit defines the maximum number of times\na proposal's voting period can be extended.","type":"integer","format":"int64"}}},"atomone.coredaos.v1.QueryParamsResponse":{"description":"QueryParamsResponse is response type for the Query/Params RPC method.","type":"object","properties":{"params":{"description":"params holds all the parameters of this module.","$ref":"#/definitions/atomone.coredaos.v1.Params"}}},"atomone.dynamicfee.v1.GasPriceResponse":{"description":"GasPriceResponse is the response type for the Query/GasPrice RPC method.\nReturns a gas price in specified denom.","type":"object","properties":{"price":{"$ref":"#/definitions/cosmos.base.v1beta1.DecCoin"}}},"atomone.dynamicfee.v1.GasPricesResponse":{"description":"GasPricesResponse is the response type for the Query/GasPrices RPC method.\nReturns a gas price in all available denoms.","type":"object","properties":{"prices":{"type":"array","items":{"$ref":"#/definitions/cosmos.base.v1beta1.DecCoin"}}}},"atomone.dynamicfee.v1.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.","type":"object"},"atomone.dynamicfee.v1.Params":{"description":"Params contains the required set of parameters for the EIP1559 dynamic fee\npricing implementation.","type":"object","properties":{"alpha":{"description":"Alpha is the amount we additively increase the learning rate\nwhen it is above or below the target +/- threshold.\n\nMust be \u003e 0.","type":"string"},"beta":{"description":"Beta is the amount we multiplicatively decrease the learning rate\nwhen it is within the target +/- threshold.\n\nMust be [0, 1].","type":"string"},"default_max_block_gas":{"description":"DefaultMaxBlockGas is the default max block gas.\nThis parameter is used by the dynamicfee module\nin the case consensus_params.block.max_gas returns 0 or -1.","type":"string","format":"uint64"},"enabled":{"description":"Enabled is a boolean that determines whether the EIP1559 dynamic fee\npricing is enabled.","type":"boolean"},"fee_denom":{"description":"FeeDenom is the denom that will be used for all fee payments.","type":"string"},"gamma":{"description":"Gamma is the threshold for the learning rate. If the learning rate is\nabove or below the target +/- threshold, we additively increase the\nlearning rate by Alpha. Otherwise, we multiplicatively decrease the\nlearning rate by Beta.\n\nMust be [0, 0.5].","type":"string"},"max_learning_rate":{"description":"MaxLearningRate is the upper bound for the learning rate.","type":"string"},"min_base_gas_price":{"description":"MinBaseGasPrice determines the initial gas price of the module and the\nglobal minimum for the network.","type":"string"},"min_learning_rate":{"description":"MinLearningRate is the lower bound for the learning rate.","type":"string"},"target_block_utilization":{"description":"TargetBlockUtilization is the target block utilization expressed as a\ndecimal value between 0 and 1. It is the target percentage utilization\nof the block in relation to the consensus_params.block.max_gas parameter.","type":"string"},"window":{"description":"Window defines the window size for calculating an adaptive learning rate\nover a moving window of blocks.","type":"string","format":"uint64"}}},"atomone.dynamicfee.v1.ParamsResponse":{"description":"ParamsResponse is the response type for the Query/Params RPC method.","type":"object","properties":{"params":{"$ref":"#/definitions/atomone.dynamicfee.v1.Params"}}},"atomone.dynamicfee.v1.State":{"description":"State is utilized to track the current state of the dynamic fee pricer.\nThis includes the current base fee, learning rate, and block gas within the\nspecified AIMD window.","type":"object","properties":{"base_gas_price":{"description":"BaseGasPrice is the current base fee. This is denominated in the fee per\ngas unit.","type":"string"},"index":{"description":"Index is the index of the current block in the block gas window.","type":"string","format":"uint64"},"learning_rate":{"description":"LearningRate is the current learning rate.","type":"string"},"window":{"description":"Window contains a list of the last blocks' gas values. This is used\nto calculate the next base fee. This stores the number of units of gas\nconsumed per block.","type":"array","items":{"type":"string","format":"uint64"}}}},"atomone.dynamicfee.v1.StateResponse":{"description":"StateResponse is the response type for the Query/State RPC method.","type":"object","properties":{"state":{"$ref":"#/definitions/atomone.dynamicfee.v1.State"}}},"atomone.gov.v1.Deposit":{"description":"Deposit defines an amount deposited by an account address to an active\nproposal.","type":"object","properties":{"amount":{"description":"amount to be deposited by depositor.","type":"array","items":{"$ref":"#/definitions/cosmos.base.v1beta1.Coin"}},"depositor":{"description":"depositor defines the deposit addresses from the proposals.","type":"string"},"proposal_id":{"description":"proposal_id defines the unique id of the proposal.","type":"string","format":"uint64"}}},"atomone.gov.v1.DepositParams":{"description":"DepositParams defines the params for deposits on governance proposals.","type":"object","properties":{"max_deposit_period":{"description":"Maximum period for Atom holders to deposit on a proposal. Initial value: 2\nmonths.","type":"string"},"min_deposit":{"description":"Minimum deposit for a proposal to enter voting period.","type":"array","items":{"$ref":"#/definitions/cosmos.base.v1beta1.Coin"}}}},"atomone.gov.v1.MinDepositThrottler":{"type":"object","properties":{"decrease_ratio":{"description":"The ratio of decrease for the minimum deposit when the number of active\nproposals is 1 less than the target.","type":"string"},"decrease_sensitivity_target_distance":{"description":"A positive integer representing the sensitivity of dynamic minimum deposit\ndecreases to the distance from the target number of active proposals.\nThe higher the number, the lower the sensitivity. A value of 1 represents\nthe highest sensitivity.","type":"string","format":"uint64"},"floor_value":{"description":"Floor value for the minimum deposit required for a proposal to enter the\nvoting period.","type":"array","items":{"$ref":"#/definitions/cosmos.base.v1beta1.Coin"}},"increase_ratio":{"description":"The ratio of increase for the minimum deposit when the number of active\nproposals is at or above the target.","type":"string"},"target_active_proposals":{"description":"The number of active proposals the dynamic minimum deposit should target.","type":"string","format":"uint64"},"update_period":{"description":"Duration that dictates after how long the dynamic minimum deposit should be\nrecalculated for time-based decreases.","type":"string"}}},"atomone.gov.v1.MinInitialDepositThrottler":{"type":"object","properties":{"decrease_ratio":{"description":"The ratio of decrease for the minimum initial deposit when the number of\nproposals in deposit period is 1 less than the target.","type":"string"},"decrease_sensitivity_target_distance":{"description":"A positive integer representing the sensitivity of dynamic minimum initial\ndeposit decreases to the distance from the target number of proposals\nin deposit period. The higher the number, the lower the sensitivity. A\nvalue of 1 represents the highest sensitivity.","type":"string","format":"uint64"},"floor_value":{"description":"Floor value for the minimum initial deposit required for a proposal to\nenter the deposit period.","type":"array","items":{"$ref":"#/definitions/cosmos.base.v1beta1.Coin"}},"increase_ratio":{"description":"The ratio of increase for the minimum initial deposit when the number of\nproposals in deposit period is at or above the target.","type":"string"},"target_proposals":{"description":"The number of proposals in deposit period the dynamic minimum initial\ndeposit should target.","type":"string","format":"uint64"},"update_period":{"description":"Duration that dictates after how long the dynamic minimum deposit should be\nrecalculated for time-based decreases.","type":"string"}}},"atomone.gov.v1.MsgDepositResponse":{"description":"MsgDepositResponse defines the Msg/Deposit response type.","type":"object"},"atomone.gov.v1.MsgExecLegacyContentResponse":{"description":"MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type.","type":"object"},"atomone.gov.v1.MsgProposeConstitutionAmendmentResponse":{"description":"MsgProposeConstitutionAmendmentResponse defines the response structure for\nexecuting a MsgProposeConstitutionAmendment message.","type":"object"},"atomone.gov.v1.MsgProposeLawResponse":{"description":"MsgProposeLawResponse defines the response structure for executing a\nMsgProposeLaw message.","type":"object"},"atomone.gov.v1.MsgSubmitProposalResponse":{"description":"MsgSubmitProposalResponse defines the Msg/SubmitProposal response type.","type":"object","properties":{"proposal_id":{"description":"proposal_id defines the unique id of the proposal.","type":"string","format":"uint64"}}},"atomone.gov.v1.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.\n\nSince: cosmos-sdk 0.47","type":"object"},"atomone.gov.v1.MsgVoteResponse":{"description":"MsgVoteResponse defines the Msg/Vote response type.","type":"object"},"atomone.gov.v1.MsgVoteWeightedResponse":{"description":"MsgVoteWeightedResponse defines the Msg/VoteWeighted response type.","type":"object"},"atomone.gov.v1.Params":{"description":"Params defines the parameters for the x/gov module.\n\nSince: cosmos-sdk 0.47","type":"object","properties":{"burn_deposit_no_threshold":{"description":"Minimum proportion of No Votes for a proposal deposit to be burnt.","type":"string"},"burn_proposal_deposit_prevote":{"type":"boolean","title":"burn deposits if the proposal does not enter voting period"},"burn_vote_quorum":{"type":"boolean","title":"burn deposits if a proposal does not meet quorum"},"constitution_amendment_quorum":{"type":"string","title":"quorum for constitution amendment proposals"},"constitution_amendment_quorum_range":{"title":"Achievable quorum for constitution amendment proposals","$ref":"#/definitions/atomone.gov.v1.QuorumRange"},"constitution_amendment_threshold":{"description":"Minimum proportion of Yes votes for a Constitution Amendment proposal to\npass. Default value: 0.9.","type":"string"},"law_quorum":{"type":"string","title":"quorum for law proposals"},"law_quorum_range":{"title":"Achievable quorum for law proposals","$ref":"#/definitions/atomone.gov.v1.QuorumRange"},"law_threshold":{"description":"Minimum proportion of Yes votes for a Law proposal to pass. Default value:\n0.9.","type":"string"},"max_deposit_period":{"description":"Maximum period for Atom holders to deposit on a proposal. Initial value: 2\nmonths.","type":"string"},"max_voting_period_extension":{"description":"Duration that expresses the maximum amount of time by which a proposal\nvoting period can be extended.","type":"string"},"min_deposit":{"description":"Minimum deposit for a proposal to enter voting period.\nDeprecated: a dynamic system now determines the minimum deposit,\nsee the other params inside the min_deposit_throttler field.\nWhile setting this value returns an error, when queried it is set to the\nvalue of the current minimum deposit value as determined by the dynamic\nsystem for backward compatibility.","type":"array","items":{"$ref":"#/definitions/cosmos.base.v1beta1.Coin"}},"min_deposit_ratio":{"description":"The ratio representing the proportion of the deposit value minimum that\nmust be met when making a deposit. Default value: 0.01. Meaning that for a\nchain with a min_deposit of 100stake, a deposit of 1stake would be\nrequired.\n\nSince: cosmos-sdk 0.50\nNOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/18146)","type":"string"},"min_deposit_throttler":{"$ref":"#/definitions/atomone.gov.v1.MinDepositThrottler"},"min_initial_deposit_ratio":{"description":"The ratio representing the proportion of the deposit value that must be\n paid at proposal submission.","type":"string"},"min_initial_deposit_throttler":{"$ref":"#/definitions/atomone.gov.v1.MinInitialDepositThrottler"},"quorum":{"description":"Minimum percentage of total stake needed to vote for a result to be\n considered valid. Default value: 0.25.","type":"string"},"quorum_check_count":{"description":"Number of times a proposal should be checked for quorum after the quorum\ntimeout has elapsed. Used to compute the amount of time in between quorum\nchecks.","type":"string","format":"uint64"},"quorum_range":{"title":"Achievable quorum","$ref":"#/definitions/atomone.gov.v1.QuorumRange"},"quorum_timeout":{"description":"Duration of time after a proposal enters the voting period, during which\nquorum must be achieved to not incur in a voting period extension.","type":"string"},"threshold":{"description":"Minimum proportion of Yes votes for proposal to pass. Default value: 2/3.","type":"string"},"voting_period":{"description":"Duration of the voting period.","type":"string"}}},"atomone.gov.v1.Proposal":{"description":"Proposal defines the core field members of a governance proposal.","type":"object","properties":{"annotation":{"description":"annotation is an optional field that contains annotations\nadded by the Steering DAO.","type":"string"},"deposit_end_time":{"description":"deposit_end_time is the end time for deposition.","type":"string","format":"date-time"},"endorsed":{"description":"endorsed is a boolean indicating whether the proposal has been endorsed\nby the Steering DAO.","type":"boolean"},"final_tally_result":{"description":"final_tally_result is the final tally result of the proposal. When\nquerying a proposal via gRPC, this field is not populated until the\nproposal's voting period has ended.","$ref":"#/definitions/atomone.gov.v1.TallyResult"},"id":{"description":"id defines the unique id of the proposal.","type":"string","format":"uint64"},"messages":{"description":"messages are the arbitrary messages to be executed if the proposal passes.","type":"array","items":{"$ref":"#/definitions/google.protobuf.Any"}},"metadata":{"description":"metadata is any arbitrary metadata attached to the proposal.","type":"string"},"proposer":{"description":"Since: cosmos-sdk 0.47","type":"string","title":"Proposer is the address of the proposal sumbitter"},"status":{"description":"status defines the proposal status.","$ref":"#/definitions/atomone.gov.v1.ProposalStatus"},"submit_time":{"description":"submit_time is the time of proposal submission.","type":"string","format":"date-time"},"summary":{"description":"Since: cosmos-sdk 0.47","type":"string","title":"summary is a short summary of the proposal"},"times_voting_period_extended":{"description":"times_voting_period_extended is the number of times the voting period\nhas been extended from one of the core DAOs.","type":"integer","format":"int64"},"title":{"description":"Since: cosmos-sdk 0.47","type":"string","title":"title is the title of the proposal"},"total_deposit":{"description":"total_deposit is the total deposit on the proposal.","type":"array","items":{"$ref":"#/definitions/cosmos.base.v1beta1.Coin"}},"voting_end_time":{"description":"voting_end_time is the end time of voting on a proposal.","type":"string","format":"date-time"},"voting_start_time":{"description":"voting_start_time is the starting time to vote on a proposal.","type":"string","format":"date-time"}}},"atomone.gov.v1.ProposalStatus":{"description":"ProposalStatus enumerates the valid statuses of a proposal.\n\n - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status.\n - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit\nperiod.\n - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting\nperiod.\n - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has\npassed.\n - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has\nbeen rejected.\n - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has\nfailed.\n - PROPOSAL_STATUS_VETOED: PROPOSAL_STATUS_VETOED defines a proposal status of a proposal that has\nbeen vetoed.","type":"string","default":"PROPOSAL_STATUS_UNSPECIFIED","enum":["PROPOSAL_STATUS_UNSPECIFIED","PROPOSAL_STATUS_DEPOSIT_PERIOD","PROPOSAL_STATUS_VOTING_PERIOD","PROPOSAL_STATUS_PASSED","PROPOSAL_STATUS_REJECTED","PROPOSAL_STATUS_FAILED","PROPOSAL_STATUS_VETOED"]},"atomone.gov.v1.QueryConstitutionResponse":{"type":"object","title":"QueryConstitutionResponse is the response type for the Query/Constitution RPC\nmethod","properties":{"constitution":{"type":"string"}}},"atomone.gov.v1.QueryDepositResponse":{"description":"QueryDepositResponse is the response type for the Query/Deposit RPC method.","type":"object","properties":{"deposit":{"description":"deposit defines the requested deposit.","$ref":"#/definitions/atomone.gov.v1.Deposit"}}},"atomone.gov.v1.QueryDepositsResponse":{"description":"QueryDepositsResponse is the response type for the Query/Deposits RPC method.","type":"object","properties":{"deposits":{"description":"deposits defines the requested deposits.","type":"array","items":{"$ref":"#/definitions/atomone.gov.v1.Deposit"}},"pagination":{"description":"pagination defines the pagination in the response.","$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"}}},"atomone.gov.v1.QueryMinDepositResponse":{"description":"QueryMinDepositResponse is the response type for the Query/MinDeposit RPC\nmethod.","type":"object","properties":{"min_deposit":{"description":"min_deposit defines the minimum deposit required for a proposal to enter\nvoting period.","type":"array","items":{"$ref":"#/definitions/cosmos.base.v1beta1.Coin"}}}},"atomone.gov.v1.QueryMinInitialDepositResponse":{"description":"QueryMinInitialDepositResponse is the response type for the\nQuery/MinInitialDeposit RPC method.","type":"object","properties":{"min_initial_deposit":{"description":"min_initial_deposit defines the minimum initial deposit required for a\nproposal to be submitted.","type":"array","items":{"$ref":"#/definitions/cosmos.base.v1beta1.Coin"}}}},"atomone.gov.v1.QueryParamsResponse":{"description":"QueryParamsResponse is the response type for the Query/Params RPC method.","type":"object","properties":{"deposit_params":{"description":"Deprecated: Prefer to use `params` instead.\ndeposit_params defines the parameters related to deposit.","$ref":"#/definitions/atomone.gov.v1.DepositParams"},"params":{"description":"params defines all the paramaters of x/gov module.\n\nSince: cosmos-sdk 0.47","$ref":"#/definitions/atomone.gov.v1.Params"},"tally_params":{"description":"Deprecated: Prefer to use `params` instead.\ntally_params defines the parameters related to tally.","$ref":"#/definitions/atomone.gov.v1.TallyParams"},"voting_params":{"description":"Deprecated: Prefer to use `params` instead.\nvoting_params defines the parameters related to voting.","$ref":"#/definitions/atomone.gov.v1.VotingParams"}}},"atomone.gov.v1.QueryParticipationEMAsResponse":{"description":"QueryParticipationEMAsResponse is the response type for the\nQuery/ParticipationEMAs RPC method.","type":"object","properties":{"constitution_amendment_participation_ema":{"description":"constitution_amendment_participation_ema defines the requested\nparticipation EMA for constitution amendment proposals.","type":"string"},"law_participation_ema":{"description":"law_participation_ema defines the requestedparticipation EMA for law\nproposals.","type":"string"},"participation_ema":{"description":"participation_ema defines the requested participation EMA for proposals.","type":"string"}}},"atomone.gov.v1.QueryProposalResponse":{"description":"QueryProposalResponse is the response type for the Query/Proposal RPC method.","type":"object","properties":{"proposal":{"description":"proposal is the requested governance proposal.","$ref":"#/definitions/atomone.gov.v1.Proposal"}}},"atomone.gov.v1.QueryProposalsResponse":{"description":"QueryProposalsResponse is the response type for the Query/Proposals RPC\nmethod.","type":"object","properties":{"pagination":{"description":"pagination defines the pagination in the response.","$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"},"proposals":{"description":"proposals defines all the requested governance proposals.","type":"array","items":{"$ref":"#/definitions/atomone.gov.v1.Proposal"}}}},"atomone.gov.v1.QueryQuorumsResponse":{"description":"QueryQuorumsResponse is the response type for the Query/Quorums RPC method.","type":"object","properties":{"constitution_amendment_quorum":{"description":"constitution_amendment_quorum defines the requested quorum for\nconstitution amendment proposals.","type":"string"},"law_quorum":{"description":"law_quorum defines the requested quorum for law proposals.","type":"string"},"quorum":{"description":"quorum defines the requested quorum.","type":"string"}}},"atomone.gov.v1.QueryTallyResultResponse":{"description":"QueryTallyResultResponse is the response type for the Query/Tally RPC method.","type":"object","properties":{"tally":{"description":"tally defines the requested tally.","$ref":"#/definitions/atomone.gov.v1.TallyResult"}}},"atomone.gov.v1.QueryVoteResponse":{"description":"QueryVoteResponse is the response type for the Query/Vote RPC method.","type":"object","properties":{"vote":{"description":"vote defines the queried vote.","$ref":"#/definitions/atomone.gov.v1.Vote"}}},"atomone.gov.v1.QueryVotesResponse":{"description":"QueryVotesResponse is the response type for the Query/Votes RPC method.","type":"object","properties":{"pagination":{"description":"pagination defines the pagination in the response.","$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"},"votes":{"description":"votes defines the queried votes.","type":"array","items":{"$ref":"#/definitions/atomone.gov.v1.Vote"}}}},"atomone.gov.v1.QuorumRange":{"type":"object","properties":{"max":{"type":"string","title":"Maximum achievable quorum"},"min":{"type":"string","title":"Minimum achievable quorum"}}},"atomone.gov.v1.TallyParams":{"description":"TallyParams defines the params for tallying votes on governance proposals.","type":"object","properties":{"constitution_amendment_quorum":{"type":"string","title":"quorum for constitution amendment proposals"},"constitution_amendment_threshold":{"description":"Minimum proportion of Yes votes for a Constitution Amendment proposal to\npass. Default value: 0.9.","type":"string"},"law_quorum":{"type":"string","title":"quorum for law proposals"},"law_threshold":{"description":"Minimum proportion of Yes votes for a Law proposal to pass. Default value:\n0.9.","type":"string"},"quorum":{"description":"Minimum percentage of total stake needed to vote for a result to be\nconsidered valid.","type":"string"},"threshold":{"description":"Minimum proportion of Yes votes for proposal to pass. Default value: 2/3.","type":"string"}}},"atomone.gov.v1.TallyResult":{"description":"TallyResult defines a standard tally for a governance proposal.","type":"object","properties":{"abstain_count":{"description":"abstain_count is the number of abstain votes on a proposal.","type":"string"},"no_count":{"description":"no_count is the number of no votes on a proposal.","type":"string"},"yes_count":{"description":"yes_count is the number of yes votes on a proposal.","type":"string"}}},"atomone.gov.v1.Vote":{"description":"Vote defines a vote on a governance proposal.\nA Vote consists of a proposal ID, the voter, and the vote option.","type":"object","properties":{"metadata":{"description":"metadata is any arbitrary metadata to attached to the vote.","type":"string"},"options":{"description":"options is the weighted vote options.","type":"array","items":{"$ref":"#/definitions/atomone.gov.v1.WeightedVoteOption"}},"proposal_id":{"description":"proposal_id defines the unique id of the proposal.","type":"string","format":"uint64"},"voter":{"description":"voter is the voter address of the proposal.","type":"string"}}},"atomone.gov.v1.VoteOption":{"description":"VoteOption enumerates the valid vote options for a given governance proposal.\n\n - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option.\n - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option.\n - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option.\n - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option.","type":"string","default":"VOTE_OPTION_UNSPECIFIED","enum":["VOTE_OPTION_UNSPECIFIED","VOTE_OPTION_YES","VOTE_OPTION_ABSTAIN","VOTE_OPTION_NO"]},"atomone.gov.v1.VotingParams":{"description":"VotingParams defines the params for voting on governance proposals.","type":"object","properties":{"voting_period":{"description":"Duration of the voting period.","type":"string"}}},"atomone.gov.v1.WeightedVoteOption":{"description":"WeightedVoteOption defines a unit of vote for vote split.","type":"object","properties":{"option":{"description":"option defines the valid vote options, it must not contain duplicate vote\noptions.","$ref":"#/definitions/atomone.gov.v1.VoteOption"},"weight":{"description":"weight is the vote weight associated with the vote option.","type":"string"}}},"atomone.gov.v1beta1.Deposit":{"description":"Deposit defines an amount deposited by an account address to an active\nproposal.","type":"object","properties":{"amount":{"description":"amount to be deposited by depositor.","type":"array","items":{"$ref":"#/definitions/cosmos.base.v1beta1.Coin"}},"depositor":{"description":"depositor defines the deposit addresses from the proposals.","type":"string"},"proposal_id":{"description":"proposal_id defines the unique id of the proposal.","type":"string","format":"uint64"}}},"atomone.gov.v1beta1.DepositParams":{"description":"DepositParams defines the params for deposits on governance proposals.","type":"object","properties":{"max_deposit_period":{"description":"Maximum period for Atom holders to deposit on a proposal. Initial value: 2\nmonths.","type":"string"},"min_deposit":{"description":"Minimum deposit for a proposal to enter voting period.","type":"array","items":{"$ref":"#/definitions/cosmos.base.v1beta1.Coin"}}}},"atomone.gov.v1beta1.MsgDepositResponse":{"description":"MsgDepositResponse defines the Msg/Deposit response type.","type":"object"},"atomone.gov.v1beta1.MsgSubmitProposalResponse":{"description":"MsgSubmitProposalResponse defines the Msg/SubmitProposal response type.","type":"object","properties":{"proposal_id":{"description":"proposal_id defines the unique id of the proposal.","type":"string","format":"uint64"}}},"atomone.gov.v1beta1.MsgVoteResponse":{"description":"MsgVoteResponse defines the Msg/Vote response type.","type":"object"},"atomone.gov.v1beta1.MsgVoteWeightedResponse":{"description":"MsgVoteWeightedResponse defines the Msg/VoteWeighted response type.\n\nSince: cosmos-sdk 0.43","type":"object"},"atomone.gov.v1beta1.Proposal":{"description":"Proposal defines the core field members of a governance proposal.","type":"object","properties":{"content":{"description":"content is the proposal's content.","$ref":"#/definitions/google.protobuf.Any"},"deposit_end_time":{"description":"deposit_end_time is the end time for deposition.","type":"string","format":"date-time"},"final_tally_result":{"description":"final_tally_result is the final tally result of the proposal. When\nquerying a proposal via gRPC, this field is not populated until the\nproposal's voting period has ended.","$ref":"#/definitions/atomone.gov.v1beta1.TallyResult"},"proposal_id":{"description":"proposal_id defines the unique id of the proposal.","type":"string","format":"uint64"},"status":{"description":"status defines the proposal status.","$ref":"#/definitions/atomone.gov.v1beta1.ProposalStatus"},"submit_time":{"description":"submit_time is the time of proposal submission.","type":"string","format":"date-time"},"total_deposit":{"description":"total_deposit is the total deposit on the proposal.","type":"array","items":{"$ref":"#/definitions/cosmos.base.v1beta1.Coin"}},"voting_end_time":{"description":"voting_end_time is the end time of voting on a proposal.","type":"string","format":"date-time"},"voting_start_time":{"description":"voting_start_time is the starting time to vote on a proposal.","type":"string","format":"date-time"}}},"atomone.gov.v1beta1.ProposalStatus":{"description":"ProposalStatus enumerates the valid statuses of a proposal.\n\n - PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status.\n - PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit\nperiod.\n - PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting\nperiod.\n - PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has\npassed.\n - PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has\nbeen rejected.\n - PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has\nfailed.\n - PROPOSAL_STATUS_VETOED: PROPOSAL_STATUS_VETOED defines a proposal status of a proposal that has\nbeen vetoed.","type":"string","default":"PROPOSAL_STATUS_UNSPECIFIED","enum":["PROPOSAL_STATUS_UNSPECIFIED","PROPOSAL_STATUS_DEPOSIT_PERIOD","PROPOSAL_STATUS_VOTING_PERIOD","PROPOSAL_STATUS_PASSED","PROPOSAL_STATUS_REJECTED","PROPOSAL_STATUS_FAILED","PROPOSAL_STATUS_VETOED"]},"atomone.gov.v1beta1.QueryDepositResponse":{"description":"QueryDepositResponse is the response type for the Query/Deposit RPC method.","type":"object","properties":{"deposit":{"description":"deposit defines the requested deposit.","$ref":"#/definitions/atomone.gov.v1beta1.Deposit"}}},"atomone.gov.v1beta1.QueryDepositsResponse":{"description":"QueryDepositsResponse is the response type for the Query/Deposits RPC method.","type":"object","properties":{"deposits":{"description":"deposits defines the requested deposits.","type":"array","items":{"$ref":"#/definitions/atomone.gov.v1beta1.Deposit"}},"pagination":{"description":"pagination defines the pagination in the response.","$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"}}},"atomone.gov.v1beta1.QueryParamsResponse":{"description":"QueryParamsResponse is the response type for the Query/Params RPC method.","type":"object","properties":{"deposit_params":{"description":"deposit_params defines the parameters related to deposit.","$ref":"#/definitions/atomone.gov.v1beta1.DepositParams"},"tally_params":{"description":"tally_params defines the parameters related to tally.","$ref":"#/definitions/atomone.gov.v1beta1.TallyParams"},"voting_params":{"description":"voting_params defines the parameters related to voting.","$ref":"#/definitions/atomone.gov.v1beta1.VotingParams"}}},"atomone.gov.v1beta1.QueryProposalResponse":{"description":"QueryProposalResponse is the response type for the Query/Proposal RPC method.","type":"object","properties":{"proposal":{"$ref":"#/definitions/atomone.gov.v1beta1.Proposal"}}},"atomone.gov.v1beta1.QueryProposalsResponse":{"description":"QueryProposalsResponse is the response type for the Query/Proposals RPC\nmethod.","type":"object","properties":{"pagination":{"description":"pagination defines the pagination in the response.","$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"},"proposals":{"description":"proposals defines all the requested governance proposals.","type":"array","items":{"$ref":"#/definitions/atomone.gov.v1beta1.Proposal"}}}},"atomone.gov.v1beta1.QueryTallyResultResponse":{"description":"QueryTallyResultResponse is the response type for the Query/Tally RPC method.","type":"object","properties":{"tally":{"description":"tally defines the requested tally.","$ref":"#/definitions/atomone.gov.v1beta1.TallyResult"}}},"atomone.gov.v1beta1.QueryVoteResponse":{"description":"QueryVoteResponse is the response type for the Query/Vote RPC method.","type":"object","properties":{"vote":{"description":"vote defines the queried vote.","$ref":"#/definitions/atomone.gov.v1beta1.Vote"}}},"atomone.gov.v1beta1.QueryVotesResponse":{"description":"QueryVotesResponse is the response type for the Query/Votes RPC method.","type":"object","properties":{"pagination":{"description":"pagination defines the pagination in the response.","$ref":"#/definitions/cosmos.base.query.v1beta1.PageResponse"},"votes":{"description":"votes defines the queried votes.","type":"array","items":{"$ref":"#/definitions/atomone.gov.v1beta1.Vote"}}}},"atomone.gov.v1beta1.TallyParams":{"description":"TallyParams defines the params for tallying votes on governance proposals.","type":"object","properties":{"quorum":{"description":"Minimum percentage of total stake needed to vote for a result to be\nconsidered valid.","type":"string","format":"byte"},"threshold":{"description":"Minimum proportion of Yes votes for proposal to pass. Default value: 2/3.","type":"string","format":"byte"},"veto_threshold":{"description":"Minimum value of Veto votes to Total votes ratio for proposal to be\nvetoed. Default value: 0 (disabled).","type":"string","format":"byte"}}},"atomone.gov.v1beta1.TallyResult":{"description":"TallyResult defines a standard tally for a governance proposal.","type":"object","properties":{"abstain":{"description":"abstain is the number of abstain votes on a proposal.","type":"string"},"no":{"description":"no is the number of no votes on a proposal.","type":"string"},"no_with_veto":{"description":"no_with_veto is the number of no with veto votes on a proposal.","type":"string"},"yes":{"description":"yes is the number of yes votes on a proposal.","type":"string"}}},"atomone.gov.v1beta1.Vote":{"description":"Vote defines a vote on a governance proposal.\nA Vote consists of a proposal ID, the voter, and the vote option.","type":"object","properties":{"option":{"description":"Deprecated: Prefer to use `options` instead. This field is set in queries\nif and only if `len(options) == 1` and that option has weight 1. In all\nother cases, this field will default to VOTE_OPTION_UNSPECIFIED.","$ref":"#/definitions/atomone.gov.v1beta1.VoteOption"},"options":{"description":"options is the weighted vote options.\n\nSince: cosmos-sdk 0.43","type":"array","items":{"$ref":"#/definitions/atomone.gov.v1beta1.WeightedVoteOption"}},"proposal_id":{"description":"proposal_id defines the unique id of the proposal.","type":"string","format":"uint64"},"voter":{"description":"voter is the voter address of the proposal.","type":"string"}}},"atomone.gov.v1beta1.VoteOption":{"description":"VoteOption enumerates the valid vote options for a given governance proposal.\n\n - VOTE_OPTION_UNSPECIFIED: VOTE_OPTION_UNSPECIFIED defines a no-op vote option.\n - VOTE_OPTION_YES: VOTE_OPTION_YES defines a yes vote option.\n - VOTE_OPTION_ABSTAIN: VOTE_OPTION_ABSTAIN defines an abstain vote option.\n - VOTE_OPTION_NO: VOTE_OPTION_NO defines a no vote option.\n - VOTE_OPTION_NO_WITH_VETO: VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option.","type":"string","default":"VOTE_OPTION_UNSPECIFIED","enum":["VOTE_OPTION_UNSPECIFIED","VOTE_OPTION_YES","VOTE_OPTION_ABSTAIN","VOTE_OPTION_NO","VOTE_OPTION_NO_WITH_VETO"]},"atomone.gov.v1beta1.VotingParams":{"description":"VotingParams defines the params for voting on governance proposals.","type":"object","properties":{"voting_period":{"description":"Duration of the voting period.","type":"string"}}},"atomone.gov.v1beta1.WeightedVoteOption":{"description":"WeightedVoteOption defines a unit of vote for vote split.\n\nSince: cosmos-sdk 0.43","type":"object","properties":{"option":{"description":"option defines the valid vote options, it must not contain duplicate vote\noptions.","$ref":"#/definitions/atomone.gov.v1beta1.VoteOption"},"weight":{"description":"weight is the vote weight associated with the vote option.","type":"string"}}},"atomone.photon.v1.MsgMintPhotonResponse":{"description":"MsgMintPhotonResponse defines the response structure for executing a\nMsgMintPhoton message.","type":"object","properties":{"conversion_rate":{"description":"conversion_rate represents the factor used to convert atone to photon.","type":"string"},"minted":{"$ref":"#/definitions/cosmos.base.v1beta1.Coin"}}},"atomone.photon.v1.MsgUpdateParamsResponse":{"description":"MsgUpdateParamsResponse defines the response structure for executing a\nMsgUpdateParams message.","type":"object"},"atomone.photon.v1.Params":{"description":"Params defines the parameters for the x/photon module.","type":"object","properties":{"mint_disabled":{"type":"boolean","title":"Allow to mint photon or not"},"tx_fee_exceptions":{"description":"tx_fee_exceptions holds the msg type urls that are allowed to use some\ndifferent tx fee coins than photon.\nA wildcard \"*\" can be used to allow all transactions to use any fee denom.","type":"array","items":{"type":"string"}}}},"atomone.photon.v1.QueryConversionRateResponse":{"description":"QueryConversionRateResponse is response type for the Query/ConversionRate RPC\nmethod.","type":"object","properties":{"conversion_rate":{"description":"conversion_rate represents the factor used to convert atone to photon.","type":"string"}}},"atomone.photon.v1.QueryParamsResponse":{"description":"QueryParamsResponse is response type for the Query/Params RPC method.","type":"object","properties":{"params":{"description":"params holds all the parameters of this module.","$ref":"#/definitions/atomone.photon.v1.Params"}}},"cosmos.base.query.v1beta1.PageRequest":{"description":"message SomeRequest {\n Foo some_parameter = 1;\n PageRequest pagination = 2;\n }","type":"object","title":"PageRequest is to be embedded in gRPC request messages for efficient\npagination. Ex:","properties":{"count_total":{"description":"count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.","type":"boolean"},"key":{"description":"key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.","type":"string","format":"byte"},"limit":{"description":"limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.","type":"string","format":"uint64"},"offset":{"description":"offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.","type":"string","format":"uint64"},"reverse":{"description":"reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43","type":"boolean"}}},"cosmos.base.query.v1beta1.PageResponse":{"description":"PageResponse is to be embedded in gRPC response messages where the\ncorresponding request message has used PageRequest.\n\n message SomeResponse {\n repeated Bar results = 1;\n PageResponse page = 2;\n }","type":"object","properties":{"next_key":{"description":"next_key is the key to be passed to PageRequest.key to\nquery the next page most efficiently. It will be empty if\nthere are no more results.","type":"string","format":"byte"},"total":{"type":"string","format":"uint64","title":"total is total number of results available if PageRequest.count_total\nwas set, its value is undefined otherwise"}}},"cosmos.base.v1beta1.Coin":{"description":"Coin defines a token with a denomination and an amount.\n\nNOTE: The amount field is an Int which implements the custom method\nsignatures required by gogoproto.","type":"object","properties":{"amount":{"type":"string"},"denom":{"type":"string"}}},"cosmos.base.v1beta1.DecCoin":{"description":"DecCoin defines a token with a denomination and a decimal amount.\n\nNOTE: The amount field is an Dec which implements the custom method\nsignatures required by gogoproto.","type":"object","properties":{"amount":{"type":"string"},"denom":{"type":"string"}}},"google.protobuf.Any":{"type":"object","properties":{"type_url":{"type":"string"},"value":{"type":"string","format":"byte"}}},"grpc.gateway.runtime.Error":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"details":{"type":"array","items":{"$ref":"#/definitions/google.protobuf.Any"}},"error":{"type":"string"},"message":{"type":"string"}}}}} \ No newline at end of file diff --git a/go.mod b/go.mod index 59b8d48de..5270b0381 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/cometbft/cometbft v0.38.17 github.com/cosmos/cosmos-db v1.1.1 github.com/cosmos/cosmos-proto v1.0.0-beta.5 - github.com/cosmos/cosmos-sdk v0.53.0 + github.com/cosmos/cosmos-sdk v0.53.4 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogoproto v1.7.0 github.com/cosmos/ibc-go/v10 v10.2.0 @@ -41,25 +41,222 @@ require ( github.com/manifoldco/promptui v0.9.0 github.com/ory/dockertest/v3 v3.10.0 github.com/spf13/cast v1.8.0 - github.com/spf13/cobra v1.9.1 - github.com/spf13/pflag v1.0.6 + github.com/spf13/cobra v1.10.1 + github.com/spf13/pflag v1.0.10 github.com/spf13/viper v1.20.1 - github.com/stretchr/testify v1.10.0 - golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 - golang.org/x/sync v0.14.0 - google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e - google.golang.org/grpc v1.72.0 - google.golang.org/protobuf v1.36.6 + github.com/stretchr/testify v1.11.1 + golang.org/x/exp v0.0.0-20251002181428-27f1f14c8bb9 + golang.org/x/sync v0.17.0 + google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 + google.golang.org/grpc v1.75.0 + google.golang.org/protobuf v1.36.10 gotest.tools/v3 v3.5.2 pgregory.net/rapid v1.2.0 ) require ( - cel.dev/expr v0.20.0 // indirect + 4d63.com/gocheckcompilerdirectives v1.3.0 // indirect + 4d63.com/gochecknoglobals v0.2.2 // indirect + buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.36.10-20250718181942-e35f9b667443.1 // indirect + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.10-20250717185734-6c6e0d3c608e.1 // indirect + buf.build/gen/go/bufbuild/registry/connectrpc/go v1.19.0-20250924144421-cb55f06efbd2.1 // indirect + buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.36.10-20250924144421-cb55f06efbd2.1 // indirect + buf.build/gen/go/pluginrpc/pluginrpc/protocolbuffers/go v1.36.9-20241007202033-cf42259fcbfc.1 // indirect + buf.build/go/app v0.1.0 // indirect + buf.build/go/bufplugin v0.9.0 // indirect + buf.build/go/interrupt v1.1.0 // indirect + buf.build/go/protovalidate v1.0.0 // indirect + buf.build/go/protoyaml v0.6.0 // indirect + buf.build/go/spdx v0.2.0 // indirect + buf.build/go/standard v0.1.0 // indirect + connectrpc.com/connect v1.19.1 // indirect + connectrpc.com/otelconnect v0.8.0 // indirect + dario.cat/mergo v1.0.1 // indirect + github.com/4meepo/tagalign v1.4.2 // indirect + github.com/Abirdcfly/dupword v0.1.3 // indirect + github.com/Antonboom/errname v1.0.0 // indirect + github.com/Antonboom/nilnil v1.0.1 // indirect + github.com/Antonboom/testifylint v1.5.2 // indirect + github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect + github.com/Crocmagnon/fatcontext v0.7.1 // indirect + github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect + github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 // indirect + github.com/Masterminds/semver/v3 v3.3.1 // indirect + github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect + github.com/alecthomas/go-check-sumtype v0.3.1 // indirect + github.com/alexkohler/nakedret/v2 v2.0.5 // indirect + github.com/alexkohler/prealloc v1.0.0 // indirect + github.com/alingse/asasalint v0.0.11 // indirect + github.com/alingse/nilnesserr v0.1.2 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/ashanbrown/forbidigo v1.6.0 // indirect + github.com/ashanbrown/makezero v1.2.0 // indirect + github.com/bkielbasa/cyclop v1.2.3 // indirect + github.com/blizzy78/varnamelen v0.8.0 // indirect + github.com/bombsimon/wsl/v4 v4.5.0 // indirect + github.com/breml/bidichk v0.3.2 // indirect + github.com/breml/errchkjson v0.4.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect + github.com/btcsuite/btcd/btcutil v1.1.6 // indirect + github.com/bufbuild/buf v1.58.0 // indirect + github.com/bufbuild/protocompile v0.14.1 // indirect + github.com/bufbuild/protoplugin v0.0.0-20250218205857-750e09ce93e1 // indirect + github.com/butuzov/ireturn v0.3.1 // indirect + github.com/butuzov/mirror v1.3.0 // indirect + github.com/catenacyber/perfsprint v0.8.2 // indirect + github.com/ccojocar/zxcvbn-go v1.0.2 // indirect + github.com/charithe/durationcheck v0.0.10 // indirect + github.com/chavacava/garif v0.1.0 // indirect + github.com/ckaznocha/intrange v0.3.0 // indirect + github.com/containerd/errdefs v1.0.0 // indirect + github.com/containerd/errdefs/pkg v0.3.0 // indirect + github.com/containerd/stargz-snapshotter/estargz v0.17.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect + github.com/curioswitch/go-reassign v0.3.0 // indirect + github.com/daixiang0/gci v0.13.5 // indirect + github.com/denis-tingaikin/go-header v0.5.0 // indirect + github.com/distribution/reference v0.6.0 // indirect + github.com/docker/distribution v2.8.3+incompatible // indirect + github.com/docker/docker-credential-helpers v0.9.4 // indirect + github.com/ettle/strcase v0.2.0 // indirect + github.com/fatih/structtag v1.2.0 // indirect + github.com/firefart/nonamedreturns v1.0.5 // indirect + github.com/fzipp/gocyclo v0.6.0 // indirect + github.com/ghodss/yaml v1.0.0 // indirect + github.com/ghostiam/protogetter v0.3.9 // indirect + github.com/go-chi/chi/v5 v5.2.3 // indirect + github.com/go-critic/go-critic v0.12.0 // indirect + github.com/go-toolsmith/astcast v1.1.0 // indirect + github.com/go-toolsmith/astcopy v1.1.0 // indirect + github.com/go-toolsmith/astequal v1.2.0 // indirect + github.com/go-toolsmith/astfmt v1.1.0 // indirect + github.com/go-toolsmith/astp v1.1.0 // indirect + github.com/go-toolsmith/strparse v1.1.0 // indirect + github.com/go-toolsmith/typep v1.1.0 // indirect + github.com/go-xmlfmt/xmlfmt v1.1.3 // indirect + github.com/gobwas/glob v0.2.3 // indirect + github.com/gofrs/flock v0.12.1 // indirect + github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect + github.com/golangci/go-printf-func-name v0.1.0 // indirect + github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d // indirect + github.com/golangci/golangci-lint v1.64.8 // indirect + github.com/golangci/misspell v0.6.0 // indirect + github.com/golangci/plugin-module-register v0.1.1 // indirect + github.com/golangci/revgrep v0.8.0 // indirect + github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect + github.com/google/cel-go v0.26.1 // indirect + github.com/google/go-containerregistry v0.20.6 // indirect + github.com/gordonklaus/ineffassign v0.1.0 // indirect + github.com/gostaticanalysis/analysisutil v0.7.1 // indirect + github.com/gostaticanalysis/comment v1.5.0 // indirect + github.com/gostaticanalysis/forcetypeassert v0.2.0 // indirect + github.com/gostaticanalysis/nilerr v0.1.1 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect + github.com/hashicorp/go-immutable-radix/v2 v2.1.0 // indirect + github.com/jdx/go-netrc v1.0.0 // indirect + github.com/jgautheron/goconst v1.7.1 // indirect + github.com/jingyugao/rowserrcheck v1.1.1 // indirect + github.com/jjti/go-spancheck v0.6.4 // indirect + github.com/julz/importas v0.2.0 // indirect + github.com/karamaru-alpha/copyloopvar v1.2.1 // indirect + github.com/kisielk/errcheck v1.9.0 // indirect + github.com/kkHAIKE/contextcheck v1.1.6 // indirect + github.com/klauspost/pgzip v1.2.6 // indirect + github.com/kulti/thelper v0.6.3 // indirect + github.com/kunwardeep/paralleltest v1.0.10 // indirect + github.com/lasiar/canonicalheader v1.1.2 // indirect + github.com/ldez/exptostd v0.4.2 // indirect + github.com/ldez/gomoddirectives v0.6.1 // indirect + github.com/ldez/grignotin v0.9.0 // indirect + github.com/ldez/tagliatelle v0.7.1 // indirect + github.com/ldez/usetesting v0.4.2 // indirect + github.com/leonklingele/grouper v1.1.2 // indirect + github.com/macabu/inamedparam v0.1.3 // indirect + github.com/maratori/testableexamples v1.0.0 // indirect + github.com/maratori/testpackage v1.1.1 // indirect + github.com/matoous/godox v1.1.0 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/mgechev/revive v1.7.0 // indirect + github.com/moby/docker-image-spec v1.3.1 // indirect + github.com/moricho/tparallel v0.3.2 // indirect + github.com/morikuni/aec v1.0.0 // indirect + github.com/nakabonne/nestif v0.3.1 // indirect + github.com/nishanths/exhaustive v0.12.0 // indirect + github.com/nishanths/predeclared v0.2.2 // indirect + github.com/nunnatsa/ginkgolinter v0.19.1 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect + github.com/polyfloyd/go-errorlint v1.7.1 // indirect + github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 // indirect + github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect + github.com/quasilyte/gogrep v0.5.0 // indirect + github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect + github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect + github.com/quic-go/qpack v0.5.1 // indirect + github.com/quic-go/quic-go v0.55.0 // indirect + github.com/raeperd/recvcheck v0.2.0 // indirect + github.com/rivo/uniseg v0.4.7 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/ryancurrah/gomodguard v1.3.5 // indirect + github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect + github.com/sanposhiho/wastedassign/v2 v2.1.0 // indirect + github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect + github.com/sashamelentyev/interfacebloat v1.1.0 // indirect + github.com/sashamelentyev/usestdlibvars v1.28.0 // indirect + github.com/securego/gosec/v2 v2.22.2 // indirect + github.com/segmentio/asm v1.2.1 // indirect + github.com/segmentio/encoding v0.5.3 // indirect + github.com/sivchari/containedctx v1.0.3 // indirect + github.com/sivchari/tenv v1.12.1 // indirect + github.com/sonatard/noctx v0.1.0 // indirect + github.com/sourcegraph/go-diff v0.7.0 // indirect + github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect + github.com/stbenjam/no-sprintf-host-port v0.2.0 // indirect + github.com/stoewer/go-strcase v1.3.1 // indirect + github.com/stretchr/objx v0.5.2 // indirect + github.com/tdakkota/asciicheck v0.4.1 // indirect + github.com/tetafro/godot v1.5.0 // indirect + github.com/tetratelabs/wazero v1.9.0 // indirect + github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3 // indirect + github.com/timonwong/loggercheck v0.10.1 // indirect + github.com/tomarrell/wrapcheck/v2 v2.10.0 // indirect + github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect + github.com/ultraware/funlen v0.2.0 // indirect + github.com/ultraware/whitespace v0.2.0 // indirect + github.com/uudashr/gocognit v1.2.0 // indirect + github.com/uudashr/iface v1.3.1 // indirect + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/vbatts/tar-split v0.12.1 // indirect + github.com/xen0n/gosmopolitan v1.2.2 // indirect + github.com/yagipy/maintidx v1.0.0 // indirect + github.com/yeya24/promlinter v0.3.0 // indirect + github.com/ykadowak/zerologlint v0.1.5 // indirect + gitlab.com/bosi/decorder v0.4.2 // indirect + go-simpler.org/musttag v0.13.0 // indirect + go-simpler.org/sloglint v0.9.0 // indirect + go.lsp.dev/jsonrpc2 v0.10.0 // indirect + go.lsp.dev/pkg v0.0.0-20210717090340-384b27a52fb2 // indirect + go.lsp.dev/protocol v0.12.0 // indirect + go.lsp.dev/uri v0.3.0 // indirect + go.uber.org/automaxprocs v1.6.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect + golang.org/x/mod v0.28.0 // indirect + golang.org/x/telemetry v0.0.0-20250908211612-aef8a434d053 // indirect + golang.org/x/tools v0.37.0 // indirect + google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 // indirect + honnef.co/go/tools v0.6.1 // indirect + mvdan.cc/gofumpt v0.7.0 // indirect + mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect + pluginrpc.com/pluginrpc v0.5.0 // indirect +) + +require ( + cel.dev/expr v0.24.0 // indirect cloud.google.com/go v0.116.0 // indirect - cloud.google.com/go/auth v0.14.1 // indirect + cloud.google.com/go/auth v0.15.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect - cloud.google.com/go/compute/metadata v0.6.0 // indirect + cloud.google.com/go/compute/metadata v0.7.0 // indirect cloud.google.com/go/iam v1.2.2 // indirect cloud.google.com/go/monitoring v1.21.2 // indirect cloud.google.com/go/storage v1.49.0 // indirect @@ -67,10 +264,10 @@ require ( filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect - github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect + github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/DataDog/datadog-go v4.8.3+incompatible // indirect github.com/DataDog/zstd v1.5.7 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.26.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect @@ -85,7 +282,7 @@ require ( github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cloudwego/base64x v0.1.5 // indirect - github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42 // indirect + github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 // indirect github.com/cockroachdb/errors v1.12.0 // indirect github.com/cockroachdb/fifo v0.0.0-20240616162244-4768e80dfb9a // indirect github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 // indirect @@ -97,19 +294,19 @@ require ( github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.2.2 // indirect - github.com/cosmos/ics23/go v0.11.0 // indirect + github.com/cosmos/ics23/go v0.11.0 github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/creachadair/atomicfile v0.3.1 // indirect github.com/creachadair/tomledit v0.0.24 // indirect - github.com/danieljoos/wincred v1.2.1 // indirect + github.com/danieljoos/wincred v1.2.3 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect github.com/desertbit/timer v1.0.1 // indirect github.com/dgraph-io/badger/v4 v4.2.0 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect - github.com/docker/cli v24.0.7+incompatible // indirect - github.com/docker/docker v20.10.19+incompatible // indirect - github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/cli v28.5.0+incompatible // indirect + github.com/docker/docker v28.5.0+incompatible // indirect + github.com/docker/go-connections v0.6.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect @@ -117,21 +314,22 @@ require ( github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect github.com/ethereum/go-ethereum v1.15.10 // indirect - github.com/fatih/color v1.17.0 // indirect + github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/getsentry/sentry-go v0.32.0 // indirect - github.com/go-jose/go-jose/v4 v4.0.5 // indirect + github.com/gnolang/gno v0.0.0-20251010155040-3f1cc0962a5f + github.com/go-jose/go-jose/v4 v4.1.1 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.2.4 // indirect + github.com/golang/glog v1.2.5 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.3 // indirect @@ -154,7 +352,7 @@ require ( github.com/hashicorp/go-metrics v0.5.4 // indirect github.com/hashicorp/go-plugin v1.6.3 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect - github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/yamux v0.1.2 // indirect @@ -162,7 +360,6 @@ require ( github.com/holiman/uint256 v1.3.2 // indirect github.com/huandu/skiplist v1.2.1 // indirect github.com/iancoleman/strcase v0.3.0 // indirect - github.com/imdario/mergo v0.3.12 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect @@ -178,14 +375,13 @@ require ( github.com/minio/highwayhash v1.0.3 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect + github.com/moby/term v0.5.2 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc2 // indirect + github.com/opencontainers/image-spec v1.1.1 // indirect github.com/opencontainers/runc v1.1.12 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect @@ -220,27 +416,27 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.4.0-alpha.1 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/contrib/detectors/gcp v1.34.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect - go.opentelemetry.io/otel v1.34.0 // indirect - go.opentelemetry.io/otel/metric v1.34.0 // indirect - go.opentelemetry.io/otel/sdk v1.34.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect - go.opentelemetry.io/otel/trace v1.34.0 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/contrib/detectors/gcp v1.36.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect + go.opentelemetry.io/otel v1.38.0 // indirect + go.opentelemetry.io/otel/metric v1.38.0 // indirect + go.opentelemetry.io/otel/sdk v1.38.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect + go.opentelemetry.io/otel/trace v1.38.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/arch v0.15.0 // indirect - golang.org/x/crypto v0.38.0 // indirect - golang.org/x/net v0.39.0 // indirect - golang.org/x/oauth2 v0.27.0 // indirect - golang.org/x/sys v0.33.0 // indirect - golang.org/x/term v0.32.0 // indirect - golang.org/x/text v0.25.0 // indirect + golang.org/x/crypto v0.42.0 // indirect + golang.org/x/net v0.45.0 // indirect + golang.org/x/oauth2 v0.30.0 // indirect + golang.org/x/sys v0.36.0 // indirect + golang.org/x/term v0.35.0 // indirect + golang.org/x/text v0.29.0 // indirect golang.org/x/time v0.10.0 // indirect - google.golang.org/api v0.222.0 // indirect + google.golang.org/api v0.223.0 // indirect google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250422160041-2d3770c4ea7f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.11 // indirect @@ -263,3 +459,16 @@ replace ( // replace broken cosmos-sdk dep nhooyr.io/websocket => github.com/coder/websocket v1.8.6 ) + +tool ( + github.com/bufbuild/buf/cmd/buf + github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar + github.com/cosmos/gogoproto/protoc-gen-gocosmos + github.com/cosmos/gogoproto/protoc-gen-gogo + github.com/golangci/golangci-lint/cmd/golangci-lint + github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway + github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 + golang.org/x/tools/cmd/goimports + google.golang.org/grpc/cmd/protoc-gen-go-grpc + google.golang.org/protobuf/cmd/protoc-gen-go +) diff --git a/go.sum b/go.sum index 3bdcb32f5..ec92cf218 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,33 @@ -cel.dev/expr v0.20.0 h1:OunBvVCfvpWlt4dN7zg3FM6TDkzOePe1+foGJ9AXeeI= -cel.dev/expr v0.20.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= +4d63.com/gocheckcompilerdirectives v1.3.0 h1:Ew5y5CtcAAQeTVKUVFrE7EwHMrTO6BggtEj8BZSjZ3A= +4d63.com/gocheckcompilerdirectives v1.3.0/go.mod h1:ofsJ4zx2QAuIP/NO/NAh1ig6R1Fb18/GI7RVMwz7kAY= +4d63.com/gochecknoglobals v0.2.2 h1:H1vdnwnMaZdQW/N+NrkT1SZMTBmcwHe9Vq8lJcYYTtU= +4d63.com/gochecknoglobals v0.2.2/go.mod h1:lLxwTQjL5eIesRbvnzIP3jZtG140FnTdz+AlMa+ogt0= +buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.36.10-20250718181942-e35f9b667443.1 h1:FzJGrb8r7vir+P3zJ5Ebey8p54LYTYtQsrM/U35YO9Q= +buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.36.10-20250718181942-e35f9b667443.1/go.mod h1:E6HwqUm4Ag7bXtg/tX7jHWO7CgpknbmeACgDax0icV0= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.10-20250717185734-6c6e0d3c608e.1 h1:N4XvWMoswHV6F6c8vmWw2BeR9hYuUX0wrr0NssttyUw= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.10-20250717185734-6c6e0d3c608e.1/go.mod h1:fUl8CEN/6ZAMk6bP8ahBJPUJw7rbp+j4x+wCcYi2IG4= +buf.build/gen/go/bufbuild/registry/connectrpc/go v1.19.0-20250924144421-cb55f06efbd2.1 h1:GPNjspvq4O2Cj1BJ5Z4c7Y+I9pDX5ixlbcGoqxyBDx0= +buf.build/gen/go/bufbuild/registry/connectrpc/go v1.19.0-20250924144421-cb55f06efbd2.1/go.mod h1:V7mUsvSd9Gw0ir8u7Jgh+IpSm631EqcdMEj29un7YOY= +buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.36.10-20250924144421-cb55f06efbd2.1 h1:4ZcqdlWZF5tQUyHBeLyOwFjRwZ/93X/W5GfOZX9dJZo= +buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.36.10-20250924144421-cb55f06efbd2.1/go.mod h1:AaYXXeRvnOc151wEuupAmn58Mh9bccKce2kk3QKMIrQ= +buf.build/gen/go/pluginrpc/pluginrpc/protocolbuffers/go v1.36.9-20241007202033-cf42259fcbfc.1 h1:XJTsGH7qNS0/Ty12KkmiYqx9ubBMXojVvCyuH1RQj58= +buf.build/gen/go/pluginrpc/pluginrpc/protocolbuffers/go v1.36.9-20241007202033-cf42259fcbfc.1/go.mod h1:5x0GIfbj38TyWYZO9qSAx79MW5YpTI4HigghTH/wJh8= +buf.build/go/app v0.1.0 h1:nlqD/h0rhIN73ZoiDElprrPiO2N6JV+RmNK34K29Ihg= +buf.build/go/app v0.1.0/go.mod h1:0XVOYemubVbxNXVY0DnsVgWeGkcbbAvjDa1fmhBC+Wo= +buf.build/go/bufplugin v0.9.0 h1:ktZJNP3If7ldcWVqh46XKeiYJVPxHQxCfjzVQDzZ/lo= +buf.build/go/bufplugin v0.9.0/go.mod h1:Z0CxA3sKQ6EPz/Os4kJJneeRO6CjPeidtP1ABh5jPPY= +buf.build/go/interrupt v1.1.0 h1:olBuhgv9Sav4/9pkSLoxgiOsZDgM5VhRhvRpn3DL0lE= +buf.build/go/interrupt v1.1.0/go.mod h1:ql56nXPG1oHlvZa6efNC7SKAQ/tUjS6z0mhJl0gyeRM= +buf.build/go/protovalidate v1.0.0 h1:IAG1etULddAy93fiBsFVhpj7es5zL53AfB/79CVGtyY= +buf.build/go/protovalidate v1.0.0/go.mod h1:KQmEUrcQuC99hAw+juzOEAmILScQiKBP1Oc36vvCLW8= +buf.build/go/protoyaml v0.6.0 h1:Nzz1lvcXF8YgNZXk+voPPwdU8FjDPTUV4ndNTXN0n2w= +buf.build/go/protoyaml v0.6.0/go.mod h1:RgUOsBu/GYKLDSIRgQXniXbNgFlGEZnQpRAUdLAFV2Q= +buf.build/go/spdx v0.2.0 h1:IItqM0/cMxvFJJumcBuP8NrsIzMs/UYjp/6WSpq8LTw= +buf.build/go/spdx v0.2.0/go.mod h1:bXdwQFem9Si3nsbNy8aJKGPoaPi5DKwdeEp5/ArZ6w8= +buf.build/go/standard v0.1.0 h1:g98T9IyvAl0vS3Pq8iVk6Cvj2ZiFvoUJRtfyGa0120U= +buf.build/go/standard v0.1.0/go.mod h1:PiqpHz/7ZFq+kqvYhc/SK3lxFIB9N/aiH2CFC2JHIQg= +cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY= +cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -101,8 +129,8 @@ cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVo cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= -cloud.google.com/go/auth v0.14.1 h1:AwoJbzUdxA/whv1qj3TLKwh3XX5sikny2fc40wUl+h0= -cloud.google.com/go/auth v0.14.1/go.mod h1:4JHUxlGXisL0AW8kXPtUF6ztuOksyfUQNFjfsOCXkPM= +cloud.google.com/go/auth v0.15.0 h1:Ly0u4aA5vG/fsSsxu98qCQBemXtAtJf+95z9HK+cxps= +cloud.google.com/go/auth v0.15.0/go.mod h1:WJDGqZ1o9E9wKIL+IwStfyn/+s59zl4Bi+1KQNVXLZ8= cloud.google.com/go/auth/oauth2adapt v0.2.7 h1:/Lc7xODdqcEw8IrZ9SvwnlLX6j9FHQM74z6cBk9Rw6M= cloud.google.com/go/auth/oauth2adapt v0.2.7/go.mod h1:NTbTTzfvPl1Y3V1nPpOgl2w6d/FjO7NNUQaWSox6ZMc= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= @@ -184,8 +212,8 @@ cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZ cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I= -cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= +cloud.google.com/go/compute/metadata v0.7.0 h1:PBWF+iiAerVNe8UCHxdOt6eHLVc3ydFeOCw78U8ytSU= +cloud.google.com/go/compute/metadata v0.7.0/go.mod h1:j5MvL9PprKL39t166CoB1uVHfQMs4tFQZZcKwksXUjo= cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= @@ -614,6 +642,10 @@ cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoIS cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= +connectrpc.com/connect v1.19.1 h1:R5M57z05+90EfEvCY1b7hBxDVOUl45PrtXtAV2fOC14= +connectrpc.com/connect v1.19.1/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w= +connectrpc.com/otelconnect v0.8.0 h1:a4qrN4H8aEE2jAoCxheZYYfEjXMgVPyL9OzPQLBEFXU= +connectrpc.com/otelconnect v0.8.0/go.mod h1:AEkVLjCPXra+ObGFCOClcJkNjS7zPaQSqvO0lCyjfZc= cosmossdk.io/api v0.9.2 h1:9i9ptOBdmoIEVEVWLtYYHjxZonlF/aOVODLFaxpmNtg= cosmossdk.io/api v0.9.2/go.mod h1:CWt31nVohvoPMTlPv+mMNCtC0a7BqRdESjCsstHcTkU= cosmossdk.io/client/v2 v2.0.0-beta.11 h1:iHbjDw/NuNz2OVaPmx0iE9eu2HrbX+WAv2u9guRcd6o= @@ -642,24 +674,44 @@ cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= cosmossdk.io/x/tx v0.14.0 h1:hB3O25kIcyDW/7kMTLMaO8Ripj3yqs5imceVd6c/heA= cosmossdk.io/x/tx v0.14.0/go.mod h1:Tn30rSRA1PRfdGB3Yz55W4Sn6EIutr9xtMKSHij+9PM= +dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= +dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= +github.com/4meepo/tagalign v1.4.2 h1:0hcLHPGMjDyM1gHG58cS73aQF8J4TdVR96TZViorO9E= +github.com/4meepo/tagalign v1.4.2/go.mod h1:+p4aMyFM+ra7nb41CnFG6aSDXqRxU/w1VQqScKqDARI= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= -github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Abirdcfly/dupword v0.1.3 h1:9Pa1NuAsZvpFPi9Pqkd93I7LIYRURj+A//dFd5tgBeE= +github.com/Abirdcfly/dupword v0.1.3/go.mod h1:8VbB2t7e10KRNdwTVoxdBaxla6avbhGzb8sCTygUMhw= +github.com/Antonboom/errname v1.0.0 h1:oJOOWR07vS1kRusl6YRSlat7HFnb3mSfMl6sDMRoTBA= +github.com/Antonboom/errname v1.0.0/go.mod h1:gMOBFzK/vrTiXN9Oh+HFs+e6Ndl0eTFbtsRTSRdXyGI= +github.com/Antonboom/nilnil v1.0.1 h1:C3Tkm0KUxgfO4Duk3PM+ztPncTFlOf0b2qadmS0s4xs= +github.com/Antonboom/nilnil v1.0.1/go.mod h1:CH7pW2JsRNFgEh8B2UaPZTEPhCMuFowP/e8Udp9Nnb0= +github.com/Antonboom/testifylint v1.5.2 h1:4s3Xhuv5AvdIgbd8wOOEeo0uZG7PbDKQyKY5lGoQazk= +github.com/Antonboom/testifylint v1.5.2/go.mod h1:vxy8VJ0bc6NavlYqjZfmp6EfqXMtBgQ4+mhCojwC1P8= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= +github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Crocmagnon/fatcontext v0.7.1 h1:SC/VIbRRZQeQWj/TcQBS6JmrXcfA+BU4OGSVUt54PjM= +github.com/Crocmagnon/fatcontext v0.7.1/go.mod h1:1wMvv3NXEBJucFGfwOJBxSVWcoIO6emV215SMkW9MFU= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q= github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.7 h1:ybO8RBeh29qrxIhCA9E8gKY6xfONU9T6G6aP9DTKfLE= github.com/DataDog/zstd v1.5.7/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.26.0 h1:f2Qw/Ehhimh5uO1fayV0QIW7DShEQqhtUfhYc+cBPlw= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.26.0/go.mod h1:2bIszWvQRlJVmJLiuLhukLImRjKPcYdzzsx6darK02A= +github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= +github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 h1:Sz1JIXEcSfhz7fUi7xHnhpIE0thVASYjvosApmHuD2k= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1/go.mod h1:n/LSCXNuIYqVfBlVXyHfMQkZDdp1/mmxfSjADd3z1Zg= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0 h1:UQUsRi8WTzhZntp5313l+CHIAT95ojUI2lpP/ExlZa4= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0/go.mod h1:Cz6ft6Dkn3Et6l2v2a9/RpN7epQ1GtDlO6lj8bEcOvw= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 h1:UQ0AhxogsIRZDkElkblfnwjc3IaltCm2HUMvezQaL7s= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1/go.mod h1:jyqM3eLpJ3IbIFDTKVz2rF9T/xWGW0rIriGwnz8l9Tk= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.48.1 h1:oTX4vsorBZo/Zdum6OKPA4o7544hm6smoRv1QjpTwGo= @@ -668,29 +720,50 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapp github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1/go.mod h1:viRWSEhtMZqz1rhwmOVKkWl6SwmVowfL9O2YR5gI2PE= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4= +github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/OpenPeeDeeP/depguard/v2 v2.2.1 h1:vckeWVESWp6Qog7UZSARNqfu/cZqvki8zsuj3piCMx4= +github.com/OpenPeeDeeP/depguard/v2 v2.2.1/go.mod h1:q4DKzC4UcVaAvcfd41CZh0PWpGgzrVxUYBlgKNGquUo= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= +github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= +github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= +github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= +github.com/alecthomas/go-check-sumtype v0.3.1 h1:u9aUvbGINJxLVXiFvHUlPEaD7VDULsrxJb4Aq31NLkU= +github.com/alecthomas/go-check-sumtype v0.3.1/go.mod h1:A8TSiN3UPRw3laIgWEUOHHLPa6/r9MtoigdlP5h3K/E= +github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= +github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alexkohler/nakedret/v2 v2.0.5 h1:fP5qLgtwbx9EJE8dGEERT02YwS8En4r9nnZ71RK+EVU= +github.com/alexkohler/nakedret/v2 v2.0.5/go.mod h1:bF5i0zF2Wo2o4X4USt9ntUWve6JbFv02Ff4vlkmS/VU= +github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= +github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= +github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= +github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= +github.com/alingse/nilnesserr v0.1.2 h1:Yf8Iwm3z2hUUrP4muWfW83DF4nE3r1xZ26fGWUKCZlo= +github.com/alingse/nilnesserr v0.1.2/go.mod h1:1xJPrXonEtX7wyTq8Dytns5P2hNzoWymVUIaKm4HNFg= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -701,6 +774,10 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8gerOIVIY= +github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= +github.com/ashanbrown/makezero v1.2.0 h1:/2Lp1bypdmK9wDIq7uWBlDF1iMUpIIS4A+pF6C9IEUU= +github.com/ashanbrown/makezero v1.2.0/go.mod h1:dxlPhHbDMC6N6xICzFBSK+4njQDdK8euNO0qjQMtGY4= github.com/atomone-hub/cosmos-sdk v0.50.14-atomone.1 h1:NTdlC3rYn398acMh4s9E5IEZFQmVK90CauQVaPSm/1w= github.com/atomone-hub/cosmos-sdk v0.50.14-atomone.1/go.mod h1:m6ZHPg764ojS01sa9VU17feUHN65mcRxCI/oe0d5RDY= github.com/atomone-hub/cosmos-sdk/x/upgrade v0.1.5-atomone.1 h1:W344uWbOkgqT1Am/Kpv4t3BoCfeH3C1NEAX/6Y2SNhQ= @@ -723,20 +800,65 @@ github.com/bgentry/speakeasy v0.2.0 h1:tgObeVOf8WAvtuAX6DhJ4xks4CFNwPDZiqzGqIHE5 github.com/bgentry/speakeasy v0.2.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.22.0 h1:Tquv9S8+SGaS3EhyA+up3FXzmkhxPGjQQCkcs2uw7w4= github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/bkielbasa/cyclop v1.2.3 h1:faIVMIGDIANuGPWH031CZJTi2ymOQBULs9H21HSMa5w= +github.com/bkielbasa/cyclop v1.2.3/go.mod h1:kHTwA9Q0uZqOADdupvcFJQtp/ksSnytRMe8ztxG8Fuo= +github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= +github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= +github.com/bombsimon/wsl/v4 v4.5.0 h1:iZRsEvDdyhd2La0FVi5k6tYehpOR/R7qIUjmKk7N74A= +github.com/bombsimon/wsl/v4 v4.5.0/go.mod h1:NOQ3aLF4nD7N5YPXMruR6ZXDOAqLoM0GEpLwTdvmOSc= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/breml/bidichk v0.3.2 h1:xV4flJ9V5xWTqxL+/PMFF6dtJPvZLPsyixAoPe8BGJs= +github.com/breml/bidichk v0.3.2/go.mod h1:VzFLBxuYtT23z5+iVkamXO386OB+/sVwZOpIj6zXGos= +github.com/breml/errchkjson v0.4.0 h1:gftf6uWZMtIa/Is3XJgibewBm2ksAQSY/kABDNFTAdk= +github.com/breml/errchkjson v0.4.0/go.mod h1:AuBOSTHyLSaaAFlWsRSuRBIroCh3eh7ZHh5YeelDIk8= +github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= +github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A= +github.com/btcsuite/btcd v0.24.2 h1:aLmxPguqxza+4ag8R1I2nnJjSu2iFn/kqtHTIImswcY= +github.com/btcsuite/btcd v0.24.2/go.mod h1:5C8ChTkl5ejr3WHj8tkQSCmydiMEPB0ZhQhehpq7Dgg= +github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= +github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= +github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= +github.com/btcsuite/btcd/btcutil v1.1.5/go.mod h1:PSZZ4UitpLBWzxGd5VGOrLnmOjtPP/a6HaFo12zMs00= github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= -github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= -github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ= +github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= +github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= +github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= +github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/bufbuild/buf v1.58.0 h1:TMgp0jmfPD5SixbUCB2iqGnK/X+2KQXTzsVc7F2LbLc= +github.com/bufbuild/buf v1.58.0/go.mod h1:guevy4hwwKlc9h69k4E9O/D23ecJHnP5LJ9QlDQoBtg= +github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= +github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= +github.com/bufbuild/protoplugin v0.0.0-20250218205857-750e09ce93e1 h1:V1xulAoqLqVg44rY97xOR+mQpD2N+GzhMHVwJ030WEU= +github.com/bufbuild/protoplugin v0.0.0-20250218205857-750e09ce93e1/go.mod h1:c5D8gWRIZ2HLWO3gXYTtUfw/hbJyD8xikv2ooPxnklQ= +github.com/butuzov/ireturn v0.3.1 h1:mFgbEI6m+9W8oP/oDdfA34dLisRFCj2G6o/yiI1yZrY= +github.com/butuzov/ireturn v0.3.1/go.mod h1:ZfRp+E7eJLC0NQmk1Nrm1LOrn/gQlOykv+cVPdiXH5M= +github.com/butuzov/mirror v1.3.0 h1:HdWCXzmwlQHdVhwvsfBb2Au0r3HyINry3bDWLYXiKoc= +github.com/butuzov/mirror v1.3.0/go.mod h1:AEij0Z8YMALaq4yQj9CPPVYOyJQyiexpQEQgihajRfI= github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ= github.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA= github.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/catenacyber/perfsprint v0.8.2 h1:+o9zVmCSVa7M4MvabsWvESEhpsMkhfE7k0sHNGL95yw= +github.com/catenacyber/perfsprint v0.8.2/go.mod h1:q//VWC2fWbcdSLEY1R3l8n0zQCDPdE4IjZwyY1HMunM= +github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= +github.com/ccojocar/zxcvbn-go v1.0.2/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -750,6 +872,10 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= +github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= +github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= +github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= @@ -762,6 +888,8 @@ github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/ckaznocha/intrange v0.3.0 h1:VqnxtK32pxgkhJgYQEeOArVidIPg+ahLP7WBOXZd5ZY= +github.com/ckaznocha/intrange v0.3.0/go.mod h1:+I/o2d2A1FBHgGELbGxzIcyd3/9l9DuwjM8FsbSS3Lo= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4= @@ -780,8 +908,8 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42 h1:Om6kYQYDUk5wWbT0t0q6pvyM49i9XZAv9dDrkDA7gjk= -github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= +github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 h1:aQ3y1lwWyqYPiWZThqv1aFbZMiM9vblcSArJRf2Irls= +github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= @@ -806,6 +934,14 @@ github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= +github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= +github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= +github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= +github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= +github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= +github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= +github.com/containerd/stargz-snapshotter/estargz v0.17.0 h1:+TyQIsR/zSFI1Rm31EQBwpAA1ovYgIKHy7kctL3sLcE= +github.com/containerd/stargz-snapshotter/estargz v0.17.0/go.mod h1:s06tWAiJcXQo9/8AReBCIo/QxcXFZ2n4qfsRnpl71SM= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= @@ -835,6 +971,8 @@ github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9E github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= +github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= +github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= @@ -843,16 +981,26 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= -github.com/danieljoos/wincred v1.2.1 h1:dl9cBrupW8+r5250DYkYxocLeZ1Y4vB1kxgtjxw8GQs= -github.com/danieljoos/wincred v1.2.1/go.mod h1:uGaFL9fDn3OLTvzCGulzE+SzjEe5NGlh5FdCcyfPwps= +github.com/curioswitch/go-reassign v0.3.0 h1:dh3kpQHuADL3cobV/sSGETA8DOv457dwl+fbBAhrQPs= +github.com/curioswitch/go-reassign v0.3.0/go.mod h1:nApPCCTtqLJN/s8HfItCcKV0jIPwluBOvZP+dsJGA88= +github.com/daixiang0/gci v0.13.5 h1:kThgmH1yBmZSBCh1EJVxQ7JsHpm5Oms0AMed/0LaH4c= +github.com/daixiang0/gci v0.13.5/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk= +github.com/danieljoos/wincred v1.2.3 h1:v7dZC2x32Ut3nEfRH+vhoZGvN72+dQ/snVXo/vMFLdQ= +github.com/danieljoos/wincred v1.2.3/go.mod h1:6qqX0WNrS4RzPZ1tnroDzq9kY3fu1KwE7MRLQK4X0bs= +github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= +github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/denis-tingaikin/go-header v0.5.0 h1:SRdnP5ZKvcO9KKRP1KJrhFR3RrlGuD+42t4429eC9k8= +github.com/denis-tingaikin/go-header v0.5.0/go.mod h1:mMenU5bWrok6Wl2UsZjy+1okegmwQ3UgWl4V1D8gjlY= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/desertbit/timer v1.0.1 h1:yRpYNn5Vaaj6QXecdLMPMJsW81JLiI1eokUft5nBmeo= github.com/desertbit/timer v1.0.1/go.mod h1:htRrYeY5V/t4iu1xCJ5XsQvp4xve8QulXXctAzxqcwE= @@ -863,12 +1011,20 @@ github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkz github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/docker/cli v24.0.7+incompatible h1:wa/nIwYFW7BVTGa7SWPVyyXU9lgORqUb1xfI36MSkFg= -github.com/docker/cli v24.0.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/docker v20.10.19+incompatible h1:lzEmjivyNHFHMNAFLXORMBXyGIhw/UP4DvJwvyKYq64= -github.com/docker/docker v20.10.19+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/dlclark/regexp2 v1.11.4 h1:rPYF9/LECdNymJufQKmri9gV604RvvABwgOA8un7yAo= +github.com/dlclark/regexp2 v1.11.4/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/docker/cli v28.5.0+incompatible h1:crVqLrtKsrhC9c00ythRx435H8LiQnUKRtJLRR+Auxk= +github.com/docker/cli v28.5.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= +github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v28.5.0+incompatible h1:ZdSQoRUE9XxhFI/B8YLvhnEFMmYN9Pp8Egd2qcaFk1E= +github.com/docker/docker v28.5.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.9.4 h1:76ItO69/AP/V4yT9V4uuuItG0B1N8hvt0T0c0NN/DzI= +github.com/docker/docker-credential-helpers v0.9.4/go.mod h1:v1S+hepowrQXITkEfw6o4+BMbGot02wiKpzWhGUZK6c= +github.com/docker/go-connections v0.6.0 h1:LlMG9azAe1TqfR7sO+NJttz1gy6KO7VJBh+pMmjSD94= +github.com/docker/go-connections v0.6.0/go.mod h1:AahvXYshr6JgfUJGdDCs2b5EZG/vmaMAntpSFH5BFKE= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= @@ -910,12 +1066,18 @@ github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfU github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= github.com/ethereum/go-ethereum v1.15.10 h1:UxqBhpsF2TNF1f7Z/k3RUUHEuLvDGAlHuh/lQ99ZA0w= github.com/ethereum/go-ethereum v1.15.10/go.mod h1:+S9k+jFzlyVTNcYGvqFhzN/SFhI6vA+aOY4T5tLSPL0= +github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= +github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= -github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= +github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/firefart/nonamedreturns v1.0.5 h1:tM+Me2ZaXs8tfdDw3X6DOX++wMCOqzYUho6tUTYIdRA= +github.com/firefart/nonamedreturns v1.0.5/go.mod h1:gHJjDqhGM4WyPt639SOZs+G89Ko7QKH5R5BhnO6xJhw= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= @@ -928,13 +1090,24 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= +github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/getsentry/sentry-go v0.32.0 h1:YKs+//QmwE3DcYtfKRH8/KyOOF/I6Qnx7qYGNHCGmCY= github.com/getsentry/sentry-go v0.32.0/go.mod h1:CYNcMMz73YigoHljQRG+qPF+eMq8gG72XcGN/p71BAY= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghostiam/protogetter v0.3.9 h1:j+zlLLWzqLay22Cz/aYwTHKQ88GE2DQ6GkWSYFOI4lQ= +github.com/ghostiam/protogetter v0.3.9/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= +github.com/gnolang/gno v0.0.0-20251010155040-3f1cc0962a5f h1:5lf//p9OafnjpYArec9dOsisFy7SwQSEAitzIuiAIIA= +github.com/gnolang/gno v0.0.0-20251010155040-3f1cc0962a5f/go.mod h1:HFxg7s2sqFtjTP5F7BjewpWKMS8RSe1JwZe19jLwme0= +github.com/go-chi/chi/v5 v5.2.3 h1:WQIt9uxdsAbgIYgid+BpYc+liqQZGMHRaUwp0JUcvdE= +github.com/go-chi/chi/v5 v5.2.3/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= +github.com/go-critic/go-critic v0.12.0 h1:iLosHZuye812wnkEz1Xu3aBwn5ocCPfc9yqmFG9pa6w= +github.com/go-critic/go-critic v0.12.0/go.mod h1:DpE0P6OVc6JzVYzmM5gq5jMU31zLr4am5mB/VfFK64w= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= @@ -945,8 +1118,8 @@ github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmn github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-jose/go-jose/v4 v4.0.5 h1:M6T8+mKZl/+fNNuFHvGIzDz7BTLQPIounk/b9dw3AaE= -github.com/go-jose/go-jose/v4 v4.0.5/go.mod h1:s3P1lRrkT8igV8D9OjyL4WRyHvjB6a4JSllnOrmmBOA= +github.com/go-jose/go-jose/v4 v4.1.1 h1:JYhSgy4mXXzAdF3nUx3ygx347LRXJRrpgyU3adRmkAI= +github.com/go-jose/go-jose/v4 v4.1.1/go.mod h1:BdsZGqgdO3b6tTc6LSE56wcDbMMLuPsw5d4ZD5f94kA= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= @@ -963,8 +1136,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= @@ -976,12 +1149,39 @@ github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/j github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= +github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= +github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= -github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= +github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= +github.com/go-toolsmith/astcast v1.1.0/go.mod h1:qdcuFWeGGS2xX5bLM/c3U9lewg7+Zu4mr+xPwZIB4ZU= +github.com/go-toolsmith/astcopy v1.1.0 h1:YGwBN0WM+ekI/6SS6+52zLDEf8Yvp3n2seZITCUBt5s= +github.com/go-toolsmith/astcopy v1.1.0/go.mod h1:hXM6gan18VA1T/daUEHCFcYiW8Ai1tIwIzHY6srfEAw= +github.com/go-toolsmith/astequal v1.0.3/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= +github.com/go-toolsmith/astequal v1.1.0/go.mod h1:sedf7VIdCL22LD8qIvv7Nn9MuWJruQA/ysswh64lffQ= +github.com/go-toolsmith/astequal v1.2.0 h1:3Fs3CYZ1k9Vo4FzFhwwewC3CHISHDnVUPC4x0bI2+Cw= +github.com/go-toolsmith/astequal v1.2.0/go.mod h1:c8NZ3+kSFtFY/8lPso4v8LuJjdJiUFVnSuU3s0qrrDY= +github.com/go-toolsmith/astfmt v1.1.0 h1:iJVPDPp6/7AaeLJEruMsBUlOYCmvg0MoCfJprsOmcco= +github.com/go-toolsmith/astfmt v1.1.0/go.mod h1:OrcLlRwu0CuiIBp/8b5PYF9ktGVZUjlNMV634mhwuQ4= +github.com/go-toolsmith/astp v1.1.0 h1:dXPuCl6u2llURjdPLLDxJeZInAeZ0/eZwFJmqZMnpQA= +github.com/go-toolsmith/astp v1.1.0/go.mod h1:0T1xFGz9hicKs8Z5MfAqSUitoUYS30pDMsRVIDHs8CA= +github.com/go-toolsmith/pkgload v1.2.2 h1:0CtmHq/02QhxcF7E9N5LIFcYFsMR5rdovfqTtRKkgIk= +github.com/go-toolsmith/pkgload v1.2.2/go.mod h1:R2hxLNRKuAsiXCo2i5J6ZQPhnPMOVtU+f0arbFPWCus= +github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= +github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQiyP2Bvw= +github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= +github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUNHus= +github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig= github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-xmlfmt/xmlfmt v1.1.3 h1:t8Ey3Uy7jDSEisW2K3somuMKIpzktkWptA0iFCnRUWY= +github.com/go-xmlfmt/xmlfmt v1.1.3/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= +github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= @@ -995,6 +1195,8 @@ github.com/goccy/go-json v0.10.4/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PU github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= +github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= @@ -1010,8 +1212,8 @@ github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGw github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= -github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= -github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.5 h1:DrW6hGnjIhtvhOIiAKT6Psh/Kd/ldepEa81DKeiRJ5I= +github.com/golang/glog v1.2.5/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -1054,10 +1256,28 @@ github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 h1:WUvBfQL6EW/40l6OmeSBYQJNSif4O11+bmWEz+C7FYw= +github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32/go.mod h1:NUw9Zr2Sy7+HxzdjIULge71wI6yEg1lWQr7Evcu8K0E= +github.com/golangci/go-printf-func-name v0.1.0 h1:dVokQP+NMTO7jwO4bwsRwLWeudOVUPPyAKJuzv8pEJU= +github.com/golangci/go-printf-func-name v0.1.0/go.mod h1:wqhWFH5mUdJQhweRnldEywnR5021wTdZSNgwYceV14s= +github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d h1:viFft9sS/dxoYY0aiOTsLKO2aZQAPT4nlQCsimGcSGE= +github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d/go.mod h1:ivJ9QDg0XucIkmwhzCDsqcnxxlDStoTl89jDMIoNxKY= +github.com/golangci/golangci-lint v1.64.8 h1:y5TdeVidMtBGG32zgSC7ZXTFNHrsJkDnpO4ItB3Am+I= +github.com/golangci/golangci-lint v1.64.8/go.mod h1:5cEsUQBSr6zi8XI8OjmcY2Xmliqc4iYL7YoPrL+zLJ4= +github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= +github.com/golangci/misspell v0.6.0/go.mod h1:keMNyY6R9isGaSAu+4Q8NMBwMPkh15Gtc8UCVoDtAWo= +github.com/golangci/plugin-module-register v0.1.1 h1:TCmesur25LnyJkpsVrupv1Cdzo+2f7zX0H6Jkw1Ol6c= +github.com/golangci/plugin-module-register v0.1.1/go.mod h1:TTpqoB6KkwOJMV8u7+NyXMrkwwESJLOkfl9TxR1DGFc= +github.com/golangci/revgrep v0.8.0 h1:EZBctwbVd0aMeRnNUsFogoyayvKHyxlV3CdUA46FX2s= +github.com/golangci/revgrep v0.8.0/go.mod h1:U4R/s9dlXZsg8uJmaR1GrloUr14D7qDl8gi2iPXJH8k= +github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed h1:IURFTjxeTfNFP0hTEi1YKjB/ub8zkpaOqFFMApi2EAs= +github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed/go.mod h1:XLXN8bNw4CGRPaqgl3bv/lhz7bsGPh4/xSaMTbo2vkQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/cel-go v0.26.1 h1:iPbVVEdkhTX++hpe3lzSk7D3G3QSYqLGoHOcEio+UXQ= +github.com/google/cel-go v0.26.1/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM= github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/flatbuffers v24.3.25+incompatible h1:CX395cjN9Kke9mmalRoL3d81AtFUxJM+yDthflgJGkI= github.com/google/flatbuffers v24.3.25+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= @@ -1079,6 +1299,8 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/go-containerregistry v0.20.6 h1:cvWX87UxxLgaH76b4hIvya6Dzz9qHB31qAwjAohdSTU= +github.com/google/go-containerregistry v0.20.6/go.mod h1:T0x8MuoAoKX/873bkeSfLD2FAkwCDf9/HZgsFJ02E2Y= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= @@ -1108,6 +1330,8 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg= +github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= @@ -1141,6 +1365,8 @@ github.com/googleapis/gax-go/v2 v2.14.1/go.mod h1:Hb/NubMaVM88SrNkvl8X/o8XWwDJEP github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gordonklaus/ineffassign v0.1.0 h1:y2Gd/9I7MdY1oEIt+n+rowjBNDcLQq3RsH5hwJd0f9s= +github.com/gordonklaus/ineffassign v0.1.0/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= @@ -1150,8 +1376,22 @@ github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= +github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= +github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= +github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= +github.com/gostaticanalysis/comment v1.5.0 h1:X82FLl+TswsUMpMh17srGRuKaaXprTaytmEpgnKIDu8= +github.com/gostaticanalysis/comment v1.5.0/go.mod h1:V6eb3gpCv9GNVqb6amXzEUX3jXLVK/AdA+IrAMSqvEc= +github.com/gostaticanalysis/forcetypeassert v0.2.0 h1:uSnWrrUEYDr86OCxWa4/Tp2jeYDlogZiZHzGkWFefTk= +github.com/gostaticanalysis/forcetypeassert v0.2.0/go.mod h1:M5iPavzE9pPqWyeiVXSFghQjljW1+l/Uke3PXHS6ILY= +github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= +github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= +github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= +github.com/gostaticanalysis/testutil v0.5.0 h1:Dq4wT1DdTwTGCQQv3rl3IvD5Ld0E6HiY+3Zh0sUGqw8= +github.com/gostaticanalysis/testutil v0.5.0/go.mod h1:OLQSbuM6zw2EvCcXTz1lVq5unyoNft372msDY0nY5Hs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -1162,6 +1402,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4 github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= @@ -1178,6 +1420,8 @@ github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix/v2 v2.1.0 h1:CUW5RYIcysz+D3B+l1mDeXrQ7fUvGGCwJfdASSzbrfo= +github.com/hashicorp/go-immutable-radix/v2 v2.1.0/go.mod h1:hgdqLXA4f6NIjRVisM1TJ9aOJVNRqKZj+xDGF6m7PBw= github.com/hashicorp/go-metrics v0.5.4 h1:8mmPiIJkTPPEbAiV97IxdAGNdRdaWwVap1BU6elejKY= github.com/hashicorp/go-metrics v0.5.4/go.mod h1:CG5yz4NZ/AI/aQt9Ucm/vdBnbh7fvmv4lxZ350i+QQI= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= @@ -1192,11 +1436,13 @@ github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerX github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -1227,16 +1473,26 @@ github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSAS github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jdx/go-netrc v1.0.0 h1:QbLMLyCZGj0NA8glAhxUpf1zDg6cxnWgMBbjq40W0gQ= +github.com/jdx/go-netrc v1.0.0/go.mod h1:Gh9eFQJnoTNIRHXl2j5bJXA1u84hQWJWgGh569zF3v8= +github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5Jkk= +github.com/jgautheron/goconst v1.7.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= +github.com/jhump/protoreflect/v2 v2.0.0-beta.2 h1:qZU+rEZUOYTz1Bnhi3xbwn+VxdXkLVeEpAeZzVXLY88= +github.com/jhump/protoreflect/v2 v2.0.0-beta.2/go.mod h1:4tnOYkB/mq7QTyS3YKtVtNrJv4Psqout8HA1U+hZtgM= +github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= +github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= +github.com/jjti/go-spancheck v0.6.4 h1:Tl7gQpYf4/TMU7AT84MN83/6PutY21Nb9fuQjFTpRRc= +github.com/jjti/go-spancheck v0.6.4/go.mod h1:yAEYdKJ2lRkDA8g7X+oKUHXOWVAXSBJRv04OhF+QUjk= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -1246,6 +1502,7 @@ github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -1259,13 +1516,22 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/julz/importas v0.2.0 h1:y+MJN/UdL63QbFJHws9BVC5RpA2iq0kpjrFajTGivjQ= +github.com/julz/importas v0.2.0/go.mod h1:pThlt589EnCYtMnmhmRYY/qn9lCf/frPOK+WMx3xiJY= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/karamaru-alpha/copyloopvar v1.2.1 h1:wmZaZYIjnJ0b5UoKDjUHrikcV0zuPyyxI4SVplLd2CI= +github.com/karamaru-alpha/copyloopvar v1.2.1/go.mod h1:nFmMlFNlClC2BPvNaHMdkirmTJxVCY0lhxBtlfOypMM= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/errcheck v1.9.0 h1:9xt1zI9EBfcYBvdU1nVrzMzzUPUtPKs9bVSIM3TAb3M= +github.com/kisielk/errcheck v1.9.0/go.mod h1:kQxWMMVZgIkDq7U8xtG/n2juOjbLgZtedi0D+/VL/i8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kkHAIKE/contextcheck v1.1.6 h1:7HIyRcnyzxL9Lz06NGhiKvenXq7Zw6Q0UQu/ttjfJCE= +github.com/kkHAIKE/contextcheck v1.1.6/go.mod h1:3dDbMRNBFaq8HFXWC1JyvDSPm43CmE6IuHam8Wr0rkg= +github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= @@ -1276,6 +1542,8 @@ github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYW github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= +github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1290,10 +1558,28 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= +github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= +github.com/kunwardeep/paralleltest v1.0.10 h1:wrodoaKYzS2mdNVnc4/w31YaXFtsc21PCTdvWJ/lDDs= +github.com/kunwardeep/paralleltest v1.0.10/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/lasiar/canonicalheader v1.1.2 h1:vZ5uqwvDbyJCnMhmFYimgMZnJMjwljN5VGY0VKbMXb4= +github.com/lasiar/canonicalheader v1.1.2/go.mod h1:qJCeLFS0G/QlLQ506T+Fk/fWMa2VmBUiEI2cuMK4djI= +github.com/ldez/exptostd v0.4.2 h1:l5pOzHBz8mFOlbcifTxzfyYbgEmoUqjxLFHZkjlbHXs= +github.com/ldez/exptostd v0.4.2/go.mod h1:iZBRYaUmcW5jwCR3KROEZ1KivQQp6PHXbDPk9hqJKCQ= +github.com/ldez/gomoddirectives v0.6.1 h1:Z+PxGAY+217f/bSGjNZr/b2KTXcyYLgiWI6geMBN2Qc= +github.com/ldez/gomoddirectives v0.6.1/go.mod h1:cVBiu3AHR9V31em9u2kwfMKD43ayN5/XDgr+cdaFaKs= +github.com/ldez/grignotin v0.9.0 h1:MgOEmjZIVNn6p5wPaGp/0OKWyvq42KnzAt/DAb8O4Ow= +github.com/ldez/grignotin v0.9.0/go.mod h1:uaVTr0SoZ1KBii33c47O1M8Jp3OP3YDwhZCmzT9GHEk= +github.com/ldez/tagliatelle v0.7.1 h1:bTgKjjc2sQcsgPiT902+aadvMjCeMHrY7ly2XKFORIk= +github.com/ldez/tagliatelle v0.7.1/go.mod h1:3zjxUpsNB2aEZScWiZTHrAXOl1x25t3cRmzfK1mlo2I= +github.com/ldez/usetesting v0.4.2 h1:J2WwbrFGk3wx4cZwSMiCQQ00kjGR0+tuuyW0Lqm4lwA= +github.com/ldez/usetesting v0.4.2/go.mod h1:eEs46T3PpQ+9RgN9VjpY6qWdiw2/QmfiDeWmdZdrjIQ= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY= +github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= @@ -1304,10 +1590,20 @@ github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuz github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star/v2 v2.0.1/go.mod h1:RcCdONR2ScXaYnQC5tUzxzlpA3WVYF7/opLeUgcQs/o= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= +github.com/macabu/inamedparam v0.1.3/go.mod h1:93FLICAIk/quk7eaPPQvbzihUdn/QkGDwIZEoLtpH6I= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= +github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= +github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= +github.com/maratori/testpackage v1.1.1 h1:S58XVV5AD7HADMmD0fNnziNHqKvSdDuEKdPD1rNTU04= +github.com/maratori/testpackage v1.1.1/go.mod h1:s4gRK/ym6AMrqpOa/kEbQTV4Q4jb7WeLZzVhVVVOQMc= +github.com/matoous/godox v1.1.0 h1:W5mqwbyWrwZv6OQ5Z1a/DHGMOvXYCBP3+Ht7KMoJhq4= +github.com/matoous/godox v1.1.0/go.mod h1:jgE/3fUXiTurkdHOLT5WEkThTSuE7yxHv5iWPa80afs= +github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= +github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= @@ -1324,8 +1620,13 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mgechev/revive v1.7.0 h1:JyeQ4yO5K8aZhIKf5rec56u0376h8AlKNQEmjfkjKlY= +github.com/mgechev/revive v1.7.0/go.mod h1:qZnwcNhoguE58dfi96IJeSTPeZQejNeoMQLUZGi4SW4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= @@ -1342,10 +1643,14 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA= -github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= +github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw= +github.com/moby/sys/atomicwriter v0.1.0/go.mod h1:Ul8oqv2ZMNHOceF643P6FKPXeCmYtlQMvpizfsSoaWs= +github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU= +github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko= +github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= +github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1353,6 +1658,10 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/moricho/tparallel v0.3.2 h1:odr8aZVFA3NZrNybggMkYO3rgPRcqjeQUlBBFVxKHTI= +github.com/moricho/tparallel v0.3.2/go.mod h1:OQ+K3b4Ln3l2TZveGCywybl68glfLEwFGqvnjok8b+U= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= @@ -1361,6 +1670,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= +github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= +github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= @@ -1369,6 +1680,12 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhKRf3Swg= +github.com/nishanths/exhaustive v0.12.0/go.mod h1:mEZ95wPIZW+x8kC4TgC+9YCUgiST7ecevsVDTgc2obs= +github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= +github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= +github.com/nunnatsa/ginkgolinter v0.19.1 h1:mjwbOlDQxZi9Cal+KfbEJTCz327OLNfwNvoZ70NJ+c4= +github.com/nunnatsa/ginkgolinter v0.19.1/go.mod h1:jkQ3naZDmxaZMXPWaS9rblH+i+GWXQCaS/JFIWcOH2s= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -1379,22 +1696,27 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU= +github.com/onsi/ginkgo/v2 v2.22.2/go.mod h1:oeMosUL+8LtarXBHu/c0bx2D/K9zyQ6uX3cTyztHwsk= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= -github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= +github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= +github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= +github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= @@ -1409,6 +1731,13 @@ github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4 github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4= github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg= +github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= +github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= +github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -1428,6 +1757,8 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1441,7 +1772,11 @@ github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/polyfloyd/go-errorlint v1.7.1 h1:RyLVXIbosq1gBdk/pChWA8zWYLsq9UEw7a1L5TVMCnA= +github.com/polyfloyd/go-errorlint v1.7.1/go.mod h1:aXjNb1x2TNhoLsk26iv1yl7a+zTnXPhwEMtEXukiLR8= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -1478,10 +1813,29 @@ github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 h1:+Wl/0aFp0hpuHM3H//KMft64WQ1yX9LdJY64Qm/gFCo= +github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= +github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= +github.com/quasilyte/go-ruleguard/dsl v0.3.22/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= +github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo= +github.com/quasilyte/gogrep v0.5.0/go.mod h1:Cm9lpz9NZjEoL1tgZ2OgeUKPIxL1meE7eo60Z6Sk+Ng= +github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl980XxGFEZSS6KlBGIV0diGdySzxATTWoqaU= +github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= +github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= +github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= +github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI= +github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg= +github.com/quic-go/quic-go v0.55.0 h1:zccPQIqYCXDt5NmcEabyYvOnomjs8Tlwl7tISjJh9Mk= +github.com/quic-go/quic-go v0.55.0/go.mod h1:DR51ilwU1uE164KuWXhinFcKWGlEjzys2l8zUl5Ss1U= +github.com/raeperd/recvcheck v0.2.0 h1:GnU+NsbiCqdC2XX5+vMZzP+jAJC5fht7rcVTAhX74UI= +github.com/raeperd/recvcheck v0.2.0/go.mod h1:n04eYkwIR0JbgD73wT8wL4JjPC3wm0nFtzBnWNocnYU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -1497,16 +1851,37 @@ github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY= github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= +github.com/ryancurrah/gomodguard v1.3.5 h1:cShyguSwUEeC0jS7ylOiG/idnd1TpJ1LfHGpV3oJmPU= +github.com/ryancurrah/gomodguard v1.3.5/go.mod h1:MXlEPQRxgfPQa62O8wzK3Ozbkv9Rkqr+wKjSxTdsNJE= +github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= +github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sanposhiho/wastedassign/v2 v2.1.0 h1:crurBF7fJKIORrV85u9UUpePDYGWnwvv3+A96WvwXT0= +github.com/sanposhiho/wastedassign/v2 v2.1.0/go.mod h1:+oSmSC+9bQ+VUAxA66nBb0Z7N8CK7mscKTDYC6aIek4= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 h1:PKK9DyHxif4LZo+uQSgXNqs0jj5+xZwwfKHgph2lxBw= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.1/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= +github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= +github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= +github.com/sashamelentyev/usestdlibvars v1.28.0 h1:jZnudE2zKCtYlGzLVreNp5pmCdOxXUzwsMDBkR21cyQ= +github.com/sashamelentyev/usestdlibvars v1.28.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/securego/gosec/v2 v2.22.2 h1:IXbuI7cJninj0nRpZSLCUlotsj8jGusohfONMrHoF6g= +github.com/securego/gosec/v2 v2.22.2/go.mod h1:UEBGA+dSKb+VqM6TdehR7lnQtIIMorYJ4/9CW1KVQBE= +github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0= +github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= +github.com/segmentio/encoding v0.5.3 h1:OjMgICtcSFuNvQCdwqMCv9Tg7lEOXGwm1J5RPQccx6w= +github.com/segmentio/encoding v0.5.3/go.mod h1:HS1ZKa3kSN32ZHVZ7ZLPLXWvOVIiZtyJnO1gPH1sKt0= +github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -1514,12 +1889,20 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE= +github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= +github.com/sivchari/tenv v1.12.1 h1:+E0QzjktdnExv/wwsnnyk4oqZBUfuh89YMQT1cyuvSY= +github.com/sivchari/tenv v1.12.1/go.mod h1:1LjSOUCc25snIr5n3DtGGrENhX3LuWefcplwVGC24mw= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sonatard/noctx v0.1.0 h1:JjqOc2WN16ISWAjAk8M5ej0RfExEXtkEyExl2hLW+OM= +github.com/sonatard/noctx v0.1.0/go.mod h1:0RvBxqY8D4j9cTTTWE8ylt2vqj2EPI8fHmrxHdsaZ2c= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0= +github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= @@ -1529,16 +1912,23 @@ github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4 github.com/spf13/cast v1.8.0 h1:gEN9K4b8Xws4EX0+a0reLmhq8moKn7ntRlQYgjPeCDk= github.com/spf13/cast v1.8.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= -github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= +github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s= +github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= -github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/spiffe/go-spiffe/v2 v2.5.0 h1:N2I01KCUkv1FAjZXJMwh95KK1ZIQLYbPfhaxw8WS0hE= github.com/spiffe/go-spiffe/v2 v2.5.0/go.mod h1:P+NxobPc6wXhVtINNtFjNWGBTreew1GBUCwT2wPmb7g= +github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= +github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= +github.com/stbenjam/no-sprintf-host-port v0.2.0 h1:i8pxvGrt1+4G0czLr/WnmyH7zbZ8Bg8etvARQ1rpyl4= +github.com/stbenjam/no-sprintf-host-port v0.2.0/go.mod h1:eL0bQ9PasS0hsyTyfTjjG+E80QIyPnBVQbYZyv20Jfk= +github.com/stoewer/go-strcase v1.3.1 h1:iS0MdW+kVTxgMoE1LAZyMiYJFKlOzLooE4MxjirtkAs= +github.com/stoewer/go-strcase v1.3.1/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -1559,17 +1949,36 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/tdakkota/asciicheck v0.4.1 h1:bm0tbcmi0jezRA2b5kg4ozmMuGAFotKI3RZfrhfovg8= +github.com/tdakkota/asciicheck v0.4.1/go.mod h1:0k7M3rCfRXb0Z6bwgvkEIMleKH3kXNz9UqJ9Xuqopr8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= +github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA= +github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= +github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= +github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= +github.com/tetafro/godot v1.5.0 h1:aNwfVI4I3+gdxjMgYPus9eHmoBeJIbnajOyqZYStzuw= +github.com/tetafro/godot v1.5.0/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= +github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I= +github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3 h1:y4mJRFlM6fUyPhoXuFg/Yu02fg/nIPFMOY8tOqppoFg= +github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460= +github.com/timonwong/loggercheck v0.10.1 h1:uVZYClxQFpw55eh+PIoqM7uAOHMrhVcDoWDery9R8Lg= +github.com/timonwong/loggercheck v0.10.1/go.mod h1:HEAWU8djynujaAVX7QI65Myb8qgfcZ1uKbdpg3ZzKl8= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tomarrell/wrapcheck/v2 v2.10.0 h1:SzRCryzy4IrAH7bVGG4cK40tNUhmVmMDuJujy4XwYDg= +github.com/tomarrell/wrapcheck/v2 v2.10.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= +github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= +github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= @@ -1580,15 +1989,35 @@ github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95 github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ultraware/funlen v0.2.0 h1:gCHmCn+d2/1SemTdYMiKLAHFYxTYz7z9VIDRaTGyLkI= +github.com/ultraware/funlen v0.2.0/go.mod h1:ZE0q4TsJ8T1SQcjmkhN/w+MceuatI6pBFSxxyteHIJA= +github.com/ultraware/whitespace v0.2.0 h1:TYowo2m9Nfj1baEQBjuHzvMRbp19i+RCcRYrSWoFa+g= +github.com/ultraware/whitespace v0.2.0/go.mod h1:XcP1RLD81eV4BW8UhQlpaR+SDc2givTvyI8a586WjW8= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/uudashr/gocognit v1.2.0 h1:3BU9aMr1xbhPlvJLSydKwdLN3tEUUrzPSSM8S4hDYRA= +github.com/uudashr/gocognit v1.2.0/go.mod h1:k/DdKPI6XBZO1q7HgoV2juESI2/Ofj9AcHPZhBBdrTU= +github.com/uudashr/iface v1.3.1 h1:bA51vmVx1UIhiIsQFSNq6GZ6VPTk3WNMZgRiCe9R29U= +github.com/uudashr/iface v1.3.1/go.mod h1:4QvspiRd3JLPAEXBQ9AiZpLbJlrWWgRChOKDJEuQTdg= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/vbatts/tar-split v0.12.1 h1:CqKoORW7BUWBe7UL/iqTVvkTBOF8UvOMKOIZykxnnbo= +github.com/vbatts/tar-split v0.12.1/go.mod h1:eF6B6i6ftWQcDqEn3/iGFRFRo8cBIMSJVOpnNdfTMFA= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= +github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= +github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= +github.com/yeya24/promlinter v0.3.0 h1:JVDbMp08lVCP7Y6NP3qHroGAO6z2yGKQtS5JsjqtoFs= +github.com/yeya24/promlinter v0.3.0/go.mod h1:cDfJQQYv9uYciW60QT0eeHlFodotkYZlL+YcPQN+mW4= +github.com/ykadowak/zerologlint v0.1.5 h1:Gy/fMz1dFQN9JZTPjv1hxEk+sRWm05row04Yoolgdiw= +github.com/ykadowak/zerologlint v0.1.5/go.mod h1:KaUskqF3e/v59oPmdq1U1DnKcuHokl2/K1U4pmIELKg= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1604,10 +2033,26 @@ github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= +gitlab.com/bosi/decorder v0.4.2 h1:qbQaV3zgwnBZ4zPMhGLW4KZe7A7NwxEhJx39R3shffo= +gitlab.com/bosi/decorder v0.4.2/go.mod h1:muuhHoaJkA9QLcYHq4Mj8FJUwDZ+EirSHRiaTcTf6T8= +go-simpler.org/assert v0.9.0 h1:PfpmcSvL7yAnWyChSjOz6Sp6m9j5lyK8Ok9pEL31YkQ= +go-simpler.org/assert v0.9.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28= +go-simpler.org/musttag v0.13.0 h1:Q/YAW0AHvaoaIbsPj3bvEI5/QFP7w696IMUpnKXQfCE= +go-simpler.org/musttag v0.13.0/go.mod h1:FTzIGeK6OkKlUDVpj0iQUXZLUO1Js9+mvykDQy9C5yM= +go-simpler.org/sloglint v0.9.0 h1:/40NQtjRx9txvsB/RN022KsUJU+zaaSb/9q9BSefSrE= +go-simpler.org/sloglint v0.9.0/go.mod h1:G/OrAF6uxj48sHahCzrbarVMptL2kjWTaUeC8+fOGww= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.4.0-alpha.1 h1:3yrqQzbRRPFPdOMWS/QQIVxVnzSkAZQYeWlZFv1kbj4= go.etcd.io/bbolt v1.4.0-alpha.1/go.mod h1:S/Z/Nm3iuOnyO1W4XuFfPci51Gj6F1Hv0z8hisyYYOw= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.lsp.dev/jsonrpc2 v0.10.0 h1:Pr/YcXJoEOTMc/b6OTmcR1DPJ3mSWl/SWiU1Cct6VmI= +go.lsp.dev/jsonrpc2 v0.10.0/go.mod h1:fmEzIdXPi/rf6d4uFcayi8HpFP1nBF99ERP1htC72Ac= +go.lsp.dev/pkg v0.0.0-20210717090340-384b27a52fb2 h1:hCzQgh6UcwbKgNSRurYWSqh8MufqRRPODRBblutn4TE= +go.lsp.dev/pkg v0.0.0-20210717090340-384b27a52fb2/go.mod h1:gtSHRuYfbCT0qnbLnovpie/WEmqyJ7T4n6VXiFMBtcw= +go.lsp.dev/protocol v0.12.0 h1:tNprUI9klQW5FAFVM4Sa+AbPFuVQByWhP1ttNUAjIWg= +go.lsp.dev/protocol v0.12.0/go.mod h1:Qb11/HgZQ72qQbeyPfJbu3hZBH23s1sr4st8czGeDMQ= +go.lsp.dev/uri v0.3.0 h1:KcZJmh6nFIBeJzTugn5JTU6OOyG0lDOo3R9KwTxTYbo= +go.lsp.dev/uri v0.3.0/go.mod h1:P5sbO1IQR+qySTWOCnhnK7phBx+W3zbLqSMDJNTw88I= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -1619,33 +2064,41 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= -go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/contrib/detectors/gcp v1.34.0 h1:JRxssobiPg23otYU5SbWtQC//snGVIM3Tx6QRzlQBao= -go.opentelemetry.io/contrib/detectors/gcp v1.34.0/go.mod h1:cV4BMFcscUR/ckqLkbfQmF0PRsq8w/lMGzdbCSveBHo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 h1:PS8wXpbyaDJQ2VDHHncMe9Vct0Zn1fEjpsjrLxGJoSc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0/go.mod h1:HDBUsEjOuRC0EzKZ1bSaRGZWUBAzo+MhAcUUORSr4D0= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= -go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= -go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/contrib/detectors/gcp v1.36.0 h1:F7q2tNlCaHY9nMKHR6XH9/qkp8FktLnIcy6jJNyOCQw= +go.opentelemetry.io/contrib/detectors/gcp v1.36.0/go.mod h1:IbBN8uAIIx734PTonTPxAxnjc2pQTxWNkwfstZ+6H2k= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 h1:rgMkmiGfix9vFJDcDi1PK8WEQP4FLQwLDfhp5ZLpFeE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0/go.mod h1:ijPqXp5P6IRRByFVVg9DY8P5HkxkHE5ARIa+86aXPf4= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= +go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= +go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 h1:GqRJVj7UmLjCVyVJ3ZFLdPRmhDUp2zFmQe3RHIOsw24= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0/go.mod h1:ri3aaHSmCTVYu2AWv44YMauwAQc0aqI9gHKIcSbI1pU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0 h1:wpMfgF8E1rkrT1Z6meFh1NDtownE9Ii3n3X2GJYjsaU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0/go.mod h1:wAy0T/dUbs468uOlkT31xjvqQgEVXv58BRFWEgn5v/0= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= -go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= -go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= -go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= -go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= -go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= -go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= -go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= -go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= +go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= +go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= +go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= +go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= +go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= +go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= +go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= +go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.opentelemetry.io/proto/otlp v1.8.0 h1:fRAZQDcAFHySxpJ1TwlA1cJ4tvcrw7nXl9xWWC8N5CE= +go.opentelemetry.io/proto/otlp v1.8.0/go.mod h1:tIeYOeNBU4cvmPqpaji1P+KbB4Oloai8wN4rWzRrFF0= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= +go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= @@ -1660,8 +2113,11 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/arch v0.15.0 h1:QtOrQd0bTUnhNVNndMpLHNWrDmYzZ2KDqSrEymqInZw= golang.org/x/arch v0.15.0/go.mod h1:JmwW7aLIoRUKgaTzhkiEFxvcEiQGyOg9BMonBJUS7EE= +golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -1677,11 +2133,12 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= -golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= -golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= +golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI= +golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1698,8 +2155,12 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw= -golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM= +golang.org/x/exp v0.0.0-20251002181428-27f1f14c8bb9 h1:TQwNpfvNkxAVlItJf6Cr5JTsVZoC/Sj7K3OZv2Pc14A= +golang.org/x/exp v0.0.0-20251002181428-27f1f14c8bb9/go.mod h1:TwQYMMnGpvZyc+JpB/UAuTNIsVJifOlSkrZkhcvpVUk= +golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac h1:TSSpLIG4v+p0rPv1pNOQtl1I8knsO4S9trOxNMOLVP4= +golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1738,13 +2199,18 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U= +golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1817,11 +2283,12 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= -golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= -golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= +golang.org/x/net v0.45.0 h1:RLBg5JKixCy82FtLJpeNlVM0nrSqpCRYzVU1n8kj0tM= +golang.org/x/net v0.45.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1851,8 +2318,8 @@ golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= -golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M= -golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= +golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1870,11 +2337,12 @@ golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= -golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= +golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1953,6 +2421,7 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1984,13 +2453,16 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= -golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k= +golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= +golang.org/x/telemetry v0.0.0-20250908211612-aef8a434d053 h1:dHQOQddU4YHS5gY33/6klKjq7Gp3WwMyOXGNp5nzRj8= +golang.org/x/telemetry v0.0.0-20250908211612-aef8a434d053/go.mod h1:+nZKN+XVh4LCiA9DV3ywrzN4gumyCnKjau3NGb9SGoE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -2002,11 +2474,12 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= -golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg= -golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= +golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ= +golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2027,8 +2500,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= -golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= +golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk= +golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2081,16 +2554,21 @@ golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -2099,18 +2577,28 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= +golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE= +golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w= +golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= +golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= +golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= +golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated/go.mod h1:RVAQXBGNv1ib0J382/DPCRS/BPnsGebyM1Gj5VSDpG8= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2123,6 +2611,8 @@ gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJ gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= +gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= @@ -2185,8 +2675,8 @@ google.golang.org/api v0.108.0/go.mod h1:2Ts0XTHNVWxypznxWOYUeI4g3WdP9Pk2Qk58+a/ google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= google.golang.org/api v0.111.0/go.mod h1:qtFHvU9mhgTJegR31csQ+rwxyUTHOKFqCKWp1J0fdw0= google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= -google.golang.org/api v0.222.0 h1:Aiewy7BKLCuq6cUCeOUrsAlzjXPqBkEeQ/iwGHVQa/4= -google.golang.org/api v0.222.0/go.mod h1:efZia3nXpWELrwMlN5vyQrD4GmJN1Vw0x68Et3r+a9c= +google.golang.org/api v0.223.0 h1:JUTaWEriXmEy5AhvdMgksGGPEFsYfUKaPEYXd4c3Wvc= +google.golang.org/api v0.223.0/go.mod h1:C+RS7Z+dDwds2b+zoAk5hN/eSfsiCn0UDrYof/M4d2M= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2334,10 +2824,10 @@ google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOl google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= -google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e h1:UdXH7Kzbj+Vzastr5nVfccbmFsmYNygVLSPk1pEfDoY= -google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e/go.mod h1:085qFyf2+XaZlRdCgKNCIZ3afY2p4HHZdoIRpId8F4A= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250422160041-2d3770c4ea7f h1:N/PrbTw4kdkqNRzVfWPrBekzLuarFREcbFOiOLkXon4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250422160041-2d3770c4ea7f/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 h1:BIRfGDEjiHRrk0QKZe3Xv2ieMhtgRGeLcZQ0mIVn4EY= +google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5/go.mod h1:j3QtIyytwqGr1JUDtYXwtMXWPKsEa5LtzIFN1Wn5WvE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 h1:eaY8u2EuxbRv7c3NiGK0/NedzVsCcV6hDuU5qPX5EGE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5/go.mod h1:M4/wBTSeyLxupu3W3tJtOgB14jILAS/XWPSSa3TAlJc= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -2385,8 +2875,9 @@ google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5v google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= -google.golang.org/grpc v1.72.0 h1:S7UkcVa60b5AAQTaO6ZKamFp1zMZSU0fGDK2WZLbBnM= -google.golang.org/grpc v1.72.0/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= +google.golang.org/grpc v1.75.0 h1:+TW+dqTd2Biwe6KKfhE5JpiYIBWq865PhKGSXiivqt4= +google.golang.org/grpc v1.75.0/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -2406,8 +2897,8 @@ google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= -google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= +google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= +google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -2449,6 +2940,8 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +honnef.co/go/tools v0.6.1 h1:R094WgE8K4JirYjBaOpz/AvTyUu/3wbmAoskKN/pxTI= +honnef.co/go/tools v0.6.1/go.mod h1:3puzxxljPCe8RGJX7BIy1plGbxEOZni5mR2aXe3/uk4= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= @@ -2483,9 +2976,15 @@ modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= +mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= +mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= +mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= +mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk= pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +pluginrpc.com/pluginrpc v0.5.0 h1:tOQj2D35hOmvHyPu8e7ohW2/QvAnEtKscy2IJYWQ2yo= +pluginrpc.com/pluginrpc v0.5.0/go.mod h1:UNWZ941hcVAoOZUn8YZsMmOZBzbUjQa3XMns8RQLp9o= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/modules/10-gno/client_state.go b/modules/10-gno/client_state.go new file mode 100644 index 000000000..e8c61b365 --- /dev/null +++ b/modules/10-gno/client_state.go @@ -0,0 +1,326 @@ +package gno + +import ( + "strings" + "time" + + bfttypes "github.com/gnolang/gno/tm2/pkg/bft/types" + + "github.com/cometbft/cometbft/light" + + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v10/modules/core/23-commitment/types" + commitmenttypesv2 "github.com/cosmos/ibc-go/v10/modules/core/23-commitment/types/v2" + ibcerrors "github.com/cosmos/ibc-go/v10/modules/core/errors" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + ics23 "github.com/cosmos/ics23/go" + + errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ exported.ClientState = (*ClientState)(nil) + +// NewClientState creates a new ClientState instance +func NewClientState( + chainID string, trustLevel Fraction, + trustingPeriod, ubdPeriod, maxClockDrift time.Duration, + latestHeight clienttypes.Height, specs []*ics23.ProofSpec, + upgradePath []string, +) *ClientState { + return &ClientState{ + ChainId: chainID, + TrustLevel: trustLevel, + TrustingPeriod: trustingPeriod, + UnbondingPeriod: ubdPeriod, + MaxClockDrift: maxClockDrift, + LatestHeight: latestHeight, + FrozenHeight: clienttypes.ZeroHeight(), + ProofSpecs: specs, + UpgradePath: upgradePath, + } +} + +// GetChainID returns the chain-id +func (cs ClientState) GetChainID() string { + return cs.ChainId +} + +// ClientType is gno. +func (ClientState) ClientType() string { + return Gno +} + +// getTimestampAtHeight returns the timestamp in nanoseconds of the consensus state at the given height. +func (ClientState) getTimestampAtHeight( + clientStore storetypes.KVStore, + cdc codec.BinaryCodec, + height exported.Height, +) (uint64, error) { + // get consensus state at height from clientStore to check for expiry + consState, found := GetConsensusState(clientStore, cdc, height) + if !found { + return 0, errorsmod.Wrapf(clienttypes.ErrConsensusStateNotFound, "height (%s)", height) + } + return consState.GetTimestamp(), nil +} + +// status returns the status of the gno client. +// The client may be: +// - Active: FrozenHeight is zero and client is not expired +// - Frozen: Frozen Height is not zero +// - Expired: the latest consensus state timestamp + trusting period <= current time +// +// A frozen client will become expired, so the Frozen status +// has higher precedence. +func (cs ClientState) status( + ctx sdk.Context, + clientStore storetypes.KVStore, + cdc codec.BinaryCodec, +) exported.Status { + if !cs.FrozenHeight.IsZero() { + return exported.Frozen + } + + // get latest consensus state from clientStore to check for expiry + consState, found := GetConsensusState(clientStore, cdc, cs.LatestHeight) + if !found { + // if the client state does not have an associated consensus state for its latest height + // then it must be expired + return exported.Expired + } + + if cs.IsExpired(consState.Timestamp, ctx.BlockTime()) { + return exported.Expired + } + + return exported.Active +} + +// IsExpired returns whether or not the client has passed the trusting period since the last +// update (in which case no headers are considered valid). +func (cs ClientState) IsExpired(latestTimestamp, now time.Time) bool { + expirationTime := latestTimestamp.Add(cs.TrustingPeriod) + return !expirationTime.After(now) +} + +// Validate performs a basic validation of the client state fields. +func (cs ClientState) Validate() error { + if strings.TrimSpace(cs.ChainId) == "" { + return errorsmod.Wrap(ErrInvalidChainID, "chain id cannot be empty string") + } + + // NOTE: the value of bfttypes.MaxChainIDLen may change in the future. + // If this occurs, the code here must account for potential difference + // between the gno/tm2 version being run by the counterparty chain + // and the gno/tm2 version used by this light client. + // https://github.com/cosmos/ibc-go/issues/177 + if len(cs.ChainId) > bfttypes.MaxChainIDLen { + return errorsmod.Wrapf(ErrInvalidChainID, "chainID is too long; got: %d, max: %d", len(cs.ChainId), bfttypes.MaxChainIDLen) + } + + if err := light.ValidateTrustLevel(cs.TrustLevel.ToTendermint()); err != nil { + return errorsmod.Wrap(ErrInvalidTrustLevel, err.Error()) + } + if cs.TrustingPeriod <= 0 { + return errorsmod.Wrap(ErrInvalidTrustingPeriod, "trusting period must be greater than zero") + } + if cs.UnbondingPeriod <= 0 { + return errorsmod.Wrap(ErrInvalidUnbondingPeriod, "unbonding period must be greater than zero") + } + if cs.MaxClockDrift <= 0 { + return errorsmod.Wrap(ErrInvalidMaxClockDrift, "max clock drift must be greater than zero") + } + + // the latest height revision number must match the chain id revision number + if cs.LatestHeight.RevisionNumber != clienttypes.ParseChainID(cs.ChainId) { + return errorsmod.Wrapf(ErrInvalidHeaderHeight, + "latest height revision number must match chain id revision number (%d != %d)", cs.LatestHeight.RevisionNumber, clienttypes.ParseChainID(cs.ChainId)) + } + if cs.LatestHeight.RevisionHeight == 0 { + return errorsmod.Wrap(ErrInvalidHeaderHeight, "gno client's latest height revision height cannot be zero") + } + if cs.TrustingPeriod >= cs.UnbondingPeriod { + return errorsmod.Wrapf( + ErrInvalidTrustingPeriod, + "trusting period (%s) should be < unbonding period (%s)", cs.TrustingPeriod, cs.UnbondingPeriod, + ) + } + + if cs.ProofSpecs == nil { + return errorsmod.Wrap(ErrInvalidProofSpecs, "proof specs cannot be nil for gno client") + } + for i, spec := range cs.ProofSpecs { + if spec == nil { + return errorsmod.Wrapf(ErrInvalidProofSpecs, "proof spec cannot be nil at index: %d", i) + } + } + // UpgradePath may be empty, but if it isn't, each key must be non-empty + for i, k := range cs.UpgradePath { + if strings.TrimSpace(k) == "" { + return errorsmod.Wrapf(clienttypes.ErrInvalidClient, "key in upgrade path at index %d cannot be empty", i) + } + } + + return nil +} + +// ZeroCustomFields returns a ClientState that is a copy of the current ClientState +// with all client customizable fields zeroed out. All chain specific fields must +// remain unchanged. This client state will be used to verify chain upgrades when a +// chain breaks a light client verification parameter such as chainID. +func (cs ClientState) ZeroCustomFields() *ClientState { + // copy over all chain-specified fields + // and leave custom fields empty + return &ClientState{ + ChainId: cs.ChainId, + UnbondingPeriod: cs.UnbondingPeriod, + LatestHeight: cs.LatestHeight, + ProofSpecs: cs.ProofSpecs, + UpgradePath: cs.UpgradePath, + } +} + +// initialize checks that the initial consensus state is an 10-gno consensus state and +// sets the client state, consensus state and associated metadata in the provided client store. +func (cs ClientState) initialize(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, consState exported.ConsensusState) error { + consensusState, ok := consState.(*ConsensusState) + if !ok { + return errorsmod.Wrapf(clienttypes.ErrInvalidConsensus, "invalid initial consensus state. expected type: %T, got: %T", + &ConsensusState{}, consState) + } + + setClientState(clientStore, cdc, &cs) + setConsensusState(clientStore, cdc, consensusState, cs.LatestHeight) + setConsensusMetadata(ctx, clientStore, cs.LatestHeight) + + return nil +} + +// verifyMembership is a generic proof verification method which verifies a proof of the existence of a value at a given CommitmentPath at the specified height. +// The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24). +// If a zero proof height is passed in, it will fail to retrieve the associated consensus state. +func (cs ClientState) verifyMembership( + ctx sdk.Context, + clientStore storetypes.KVStore, + cdc codec.BinaryCodec, + height exported.Height, + delayTimePeriod uint64, + delayBlockPeriod uint64, + proof []byte, + path exported.Path, + value []byte, +) error { + if cs.LatestHeight.LT(height) { + return errorsmod.Wrapf( + ibcerrors.ErrInvalidHeight, + "client state height < proof height (%d < %d), please ensure the client has been updated", cs.LatestHeight, height, + ) + } + + if err := verifyDelayPeriodPassed(ctx, clientStore, height, delayTimePeriod, delayBlockPeriod); err != nil { + return err + } + + var merkleProof commitmenttypes.MerkleProof + if err := cdc.Unmarshal(proof, &merkleProof); err != nil { + return errorsmod.Wrap(commitmenttypes.ErrInvalidProof, "failed to unmarshal proof into ICS 23 commitment merkle proof") + } + + merklePath, ok := path.(commitmenttypesv2.MerklePath) + if !ok { + return errorsmod.Wrapf(ibcerrors.ErrInvalidType, "expected %T, got %T", commitmenttypesv2.MerklePath{}, path) + } + + consensusState, found := GetConsensusState(clientStore, cdc, height) + if !found { + return errorsmod.Wrap(clienttypes.ErrConsensusStateNotFound, "please ensure the proof was constructed against a height that exists on the client") + } + + return merkleProof.VerifyMembership(cs.ProofSpecs, consensusState.GetRoot(), merklePath, value) +} + +// verifyNonMembership is a generic proof verification method which verifies the absence of a given CommitmentPath at a specified height. +// The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24). +// If a zero proof height is passed in, it will fail to retrieve the associated consensus state. +func (cs ClientState) verifyNonMembership( + ctx sdk.Context, + clientStore storetypes.KVStore, + cdc codec.BinaryCodec, + height exported.Height, + delayTimePeriod uint64, + delayBlockPeriod uint64, + proof []byte, + path exported.Path, +) error { + if cs.LatestHeight.LT(height) { + return errorsmod.Wrapf( + ibcerrors.ErrInvalidHeight, + "client state height < proof height (%d < %d), please ensure the client has been updated", cs.LatestHeight, height, + ) + } + + if err := verifyDelayPeriodPassed(ctx, clientStore, height, delayTimePeriod, delayBlockPeriod); err != nil { + return err + } + + var merkleProof commitmenttypes.MerkleProof + if err := cdc.Unmarshal(proof, &merkleProof); err != nil { + return errorsmod.Wrap(commitmenttypes.ErrInvalidProof, "failed to unmarshal proof into ICS 23 commitment merkle proof") + } + + merklePath, ok := path.(commitmenttypesv2.MerklePath) + if !ok { + return errorsmod.Wrapf(ibcerrors.ErrInvalidType, "expected %T, got %T", commitmenttypesv2.MerklePath{}, path) + } + + consensusState, found := GetConsensusState(clientStore, cdc, height) + if !found { + return errorsmod.Wrap(clienttypes.ErrConsensusStateNotFound, "please ensure the proof was constructed against a height that exists on the client") + } + + return merkleProof.VerifyNonMembership(cs.ProofSpecs, consensusState.GetRoot(), merklePath) +} + +// verifyDelayPeriodPassed will ensure that at least delayTimePeriod amount of time and delayBlockPeriod number of blocks have passed +// since consensus state was submitted before allowing verification to continue. +func verifyDelayPeriodPassed(ctx sdk.Context, store storetypes.KVStore, proofHeight exported.Height, delayTimePeriod, delayBlockPeriod uint64) error { + if delayTimePeriod != 0 { + // check that executing chain's timestamp has passed consensusState's processed time + delay time period + processedTime, ok := GetProcessedTime(store, proofHeight) + if !ok { + return errorsmod.Wrapf(ErrProcessedTimeNotFound, "processed time not found for height: %s", proofHeight) + } + + currentTimestamp := uint64(ctx.BlockTime().UnixNano()) + validTime := processedTime + delayTimePeriod + + // NOTE: delay time period is inclusive, so if currentTimestamp is validTime, then we return no error + if currentTimestamp < validTime { + return errorsmod.Wrapf(ErrDelayPeriodNotPassed, "cannot verify packet until time: %d, current time: %d", + validTime, currentTimestamp) + } + } + + if delayBlockPeriod != 0 { + // check that executing chain's height has passed consensusState's processed height + delay block period + processedHeight, ok := GetProcessedHeight(store, proofHeight) + if !ok { + return errorsmod.Wrapf(ErrProcessedHeightNotFound, "processed height not found for height: %s", proofHeight) + } + + currentHeight := clienttypes.GetSelfHeight(ctx) + validHeight := clienttypes.NewHeight(processedHeight.GetRevisionNumber(), processedHeight.GetRevisionHeight()+delayBlockPeriod) + + // NOTE: delay block period is inclusive, so if currentHeight is validHeight, then we return no error + if currentHeight.LT(validHeight) { + return errorsmod.Wrapf(ErrDelayPeriodNotPassed, "cannot verify packet until height: %s, current height: %s", + validHeight, currentHeight) + } + } + + return nil +} diff --git a/modules/10-gno/client_state_test.go b/modules/10-gno/client_state_test.go new file mode 100644 index 000000000..9b327a6d9 --- /dev/null +++ b/modules/10-gno/client_state_test.go @@ -0,0 +1,134 @@ +package gno_test + +import ( + ics23 "github.com/cosmos/ics23/go" + + ibcgno "github.com/atomone-hub/atomone/modules/10-gno" + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v10/modules/core/23-commitment/types" +) + +const ( + // Do not change the length of these variables + fiftyCharChainID = "12345678901234567890123456789012345678901234567890" + fiftyOneCharChainID = "123456789012345678901234567890123456789012345678901" +) + +var invalidProof = []byte("invalid proof") + +func (suite *GnoTestSuite) TestValidate() { + testCases := []struct { + name string + clientState *ibcgno.ClientState + expErr error + }{ + { + name: "valid client", + clientState: ibcgno.NewClientState(chainID, ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, commitmenttypes.GetSDKSpecs(), upgradePath), + expErr: nil, + }, + { + name: "valid client with nil upgrade path", + clientState: ibcgno.NewClientState(chainID, ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, commitmenttypes.GetSDKSpecs(), nil), + expErr: nil, + }, + { + name: "invalid chainID", + clientState: ibcgno.NewClientState(" ", ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, commitmenttypes.GetSDKSpecs(), upgradePath), + expErr: ibcgno.ErrInvalidChainID, + }, + { + // NOTE: if this test fails, the code must account for the change in chainID length across tendermint versions! + // Do not only fix the test, fix the code! + // https://github.com/cosmos/ibc-go/issues/177 + name: "valid chainID - chainID validation did not fail for chainID of length 50! ", + clientState: ibcgno.NewClientState(fiftyCharChainID, ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, commitmenttypes.GetSDKSpecs(), upgradePath), + expErr: nil, + }, + { + // NOTE: if this test fails, the code must account for the change in chainID length across tendermint versions! + // Do not only fix the test, fix the code! + // https://github.com/cosmos/ibc-go/issues/177 + name: "invalid chainID - chainID validation failed for chainID of length 51! ", + clientState: ibcgno.NewClientState(fiftyOneCharChainID, ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, commitmenttypes.GetSDKSpecs(), upgradePath), + expErr: ibcgno.ErrInvalidChainID, + }, + { + name: "invalid trust level", + clientState: ibcgno.NewClientState(chainID, ibcgno.Fraction{Numerator: 0, Denominator: 1}, trustingPeriod, ubdPeriod, maxClockDrift, height, commitmenttypes.GetSDKSpecs(), upgradePath), + expErr: ibcgno.ErrInvalidTrustLevel, + }, + { + name: "invalid zero trusting period", + clientState: ibcgno.NewClientState(chainID, ibcgno.DefaultTrustLevel, 0, ubdPeriod, maxClockDrift, height, commitmenttypes.GetSDKSpecs(), upgradePath), + expErr: ibcgno.ErrInvalidTrustingPeriod, + }, + { + name: "invalid negative trusting period", + clientState: ibcgno.NewClientState(chainID, ibcgno.DefaultTrustLevel, -1, ubdPeriod, maxClockDrift, height, commitmenttypes.GetSDKSpecs(), upgradePath), + expErr: ibcgno.ErrInvalidTrustingPeriod, + }, + { + name: "invalid zero unbonding period", + clientState: ibcgno.NewClientState(chainID, ibcgno.DefaultTrustLevel, trustingPeriod, 0, maxClockDrift, height, commitmenttypes.GetSDKSpecs(), upgradePath), + expErr: ibcgno.ErrInvalidUnbondingPeriod, + }, + { + name: "invalid negative unbonding period", + clientState: ibcgno.NewClientState(chainID, ibcgno.DefaultTrustLevel, trustingPeriod, -1, maxClockDrift, height, commitmenttypes.GetSDKSpecs(), upgradePath), + expErr: ibcgno.ErrInvalidUnbondingPeriod, + }, + { + name: "invalid zero max clock drift", + clientState: ibcgno.NewClientState(chainID, ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod, 0, height, commitmenttypes.GetSDKSpecs(), upgradePath), + expErr: ibcgno.ErrInvalidMaxClockDrift, + }, + { + name: "invalid negative max clock drift", + clientState: ibcgno.NewClientState(chainID, ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod, -1, height, commitmenttypes.GetSDKSpecs(), upgradePath), + expErr: ibcgno.ErrInvalidMaxClockDrift, + }, + { + name: "invalid revision number", + clientState: ibcgno.NewClientState(chainID, ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, clienttypes.NewHeight(1, 1), commitmenttypes.GetSDKSpecs(), upgradePath), + expErr: ibcgno.ErrInvalidHeaderHeight, + }, + { + name: "invalid revision height", + clientState: ibcgno.NewClientState(chainID, ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, clienttypes.ZeroHeight(), commitmenttypes.GetSDKSpecs(), upgradePath), + expErr: ibcgno.ErrInvalidHeaderHeight, + }, + { + name: "trusting period not less than unbonding period", + clientState: ibcgno.NewClientState(chainID, ibcgno.DefaultTrustLevel, ubdPeriod, ubdPeriod, maxClockDrift, height, commitmenttypes.GetSDKSpecs(), upgradePath), + expErr: ibcgno.ErrInvalidTrustingPeriod, + }, + { + name: "proof specs is nil", + clientState: ibcgno.NewClientState(chainID, ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, nil, upgradePath), + expErr: ibcgno.ErrInvalidProofSpecs, + }, + { + name: "proof specs contains nil", + clientState: ibcgno.NewClientState(chainID, ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, []*ics23.ProofSpec{ics23.TendermintSpec, nil}, upgradePath), + expErr: ibcgno.ErrInvalidProofSpecs, + }, + { + name: "invalid upgrade path", + clientState: ibcgno.NewClientState(chainID, ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, height, commitmenttypes.GetSDKSpecs(), invalidUpgradePath), + expErr: clienttypes.ErrInvalidClient, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + err := tc.clientState.Validate() + + if tc.expErr == nil { + suite.Require().NoError(err, tc.name) + } else { + suite.Require().ErrorContains(err, tc.expErr.Error()) + } + }) + } +} diff --git a/modules/10-gno/codec.go b/modules/10-gno/codec.go new file mode 100644 index 000000000..0367d9b85 --- /dev/null +++ b/modules/10-gno/codec.go @@ -0,0 +1,28 @@ +package gno + +import ( + "github.com/cosmos/ibc-go/v10/modules/core/exported" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" +) + +// RegisterInterfaces registers the gno concrete client-related +// implementations and interfaces. +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations( + (*exported.ClientState)(nil), + &ClientState{}, + ) + registry.RegisterImplementations( + (*exported.ConsensusState)(nil), + &ConsensusState{}, + ) + registry.RegisterImplementations( + (*exported.ClientMessage)(nil), + &Header{}, + ) + registry.RegisterImplementations( + (*exported.ClientMessage)(nil), + &Misbehaviour{}, + ) +} diff --git a/modules/10-gno/codec_test.go b/modules/10-gno/codec_test.go new file mode 100644 index 000000000..07b424ff6 --- /dev/null +++ b/modules/10-gno/codec_test.go @@ -0,0 +1,62 @@ +package gno_test + +import ( + "errors" + "testing" + + "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + + gno "github.com/atomone-hub/atomone/modules/10-gno" +) + +func TestCodecTypeRegistration(t *testing.T) { + testCases := []struct { + name string + typeURL string + expError error + }{ + { + "success: ClientState", + sdk.MsgTypeURL(&gno.ClientState{}), + nil, + }, + { + "success: ConsensusState", + sdk.MsgTypeURL(&gno.ConsensusState{}), + nil, + }, + { + "success: Header", + sdk.MsgTypeURL(&gno.Header{}), + nil, + }, + { + "success: Misbehaviour", + sdk.MsgTypeURL(&gno.Misbehaviour{}), + nil, + }, + { + "type not registered on codec", + "ibc.invalid.MsgTypeURL", + errors.New("unable to resolve type URL ibc.invalid.MsgTypeURL"), + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + encodingCfg := moduletestutil.MakeTestEncodingConfig(gno.AppModuleBasic{}) + msg, err := encodingCfg.Codec.InterfaceRegistry().Resolve(tc.typeURL) + + if tc.expError == nil { + require.NotNil(t, msg) + require.NoError(t, err) + } else { + require.Nil(t, msg) + require.ErrorContains(t, err, tc.expError.Error()) + } + }) + } +} diff --git a/modules/10-gno/config_test.go b/modules/10-gno/config_test.go new file mode 100644 index 000000000..15efc66c3 --- /dev/null +++ b/modules/10-gno/config_test.go @@ -0,0 +1,33 @@ +package gno_test + +import ( + "time" + + ibcgno "github.com/atomone-hub/atomone/modules/10-gno" +) + +type GnoConfig struct { + TrustLevel ibcgno.Fraction + TrustingPeriod time.Duration + UnbondingPeriod time.Duration + MaxClockDrift time.Duration +} + +const ( + TrustingPeriod time.Duration = time.Hour * 24 + UnbondingPeriod time.Duration = time.Hour * 24 * 2 + MaxClockDrift time.Duration = time.Second * 10 +) + +func NewGnoConfig() *GnoConfig { + return &GnoConfig{ + TrustLevel: ibcgno.DefaultTrustLevel, + TrustingPeriod: TrustingPeriod, + UnbondingPeriod: UnbondingPeriod, + MaxClockDrift: MaxClockDrift, + } +} + +func (*GnoConfig) GetClientType() string { + return ibcgno.Gno +} diff --git a/modules/10-gno/consensus_state.go b/modules/10-gno/consensus_state.go new file mode 100644 index 000000000..040a2e61e --- /dev/null +++ b/modules/10-gno/consensus_state.go @@ -0,0 +1,62 @@ +package gno + +import ( + "time" + + cmtbytes "github.com/cometbft/cometbft/libs/bytes" + cmttypes "github.com/cometbft/cometbft/types" + + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v10/modules/core/23-commitment/types" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + + errorsmod "cosmossdk.io/errors" +) + +var _ exported.ConsensusState = (*ConsensusState)(nil) + +// SentinelRoot is used as a stand-in root value for the consensus state set at the upgrade height +const SentinelRoot = "sentinel_root" + +// NewConsensusState creates a new ConsensusState instance. +func NewConsensusState( + timestamp time.Time, root commitmenttypes.MerkleRoot, nextValsHash cmtbytes.HexBytes, +) *ConsensusState { + return &ConsensusState{ + Timestamp: timestamp, + Root: root, + NextValidatorsHash: nextValsHash, + LcType: Gno, + } +} + +// ClientType returns Gno +func (ConsensusState) ClientType() string { + return Gno +} + +// GetRoot returns the commitment Root for the specific +func (cs ConsensusState) GetRoot() exported.Root { + return cs.Root +} + +// GetTimestamp returns block time in nanoseconds of the header that created consensus state +func (cs ConsensusState) GetTimestamp() uint64 { + return uint64(cs.Timestamp.UnixNano()) +} + +// ValidateBasic defines a basic validation for the gno consensus state. +// NOTE: ProcessedTimestamp may be zero if this is an initial consensus state passed in by relayer +// as opposed to a consensus state constructed by the chain. +func (cs ConsensusState) ValidateBasic() error { + if cs.Root.Empty() { + return errorsmod.Wrap(clienttypes.ErrInvalidConsensus, "root cannot be empty") + } + if err := cmttypes.ValidateHash(cs.NextValidatorsHash); err != nil { + return errorsmod.Wrap(err, "next validators hash is invalid") + } + if cs.Timestamp.Unix() <= 0 { + return errorsmod.Wrap(clienttypes.ErrInvalidConsensus, "timestamp must be a positive Unix time") + } + return nil +} diff --git a/modules/10-gno/consensus_state_test.go b/modules/10-gno/consensus_state_test.go new file mode 100644 index 000000000..ef7d17c20 --- /dev/null +++ b/modules/10-gno/consensus_state_test.go @@ -0,0 +1,87 @@ +package gno_test + +import ( + "time" + + ibcgno "github.com/atomone-hub/atomone/modules/10-gno" + commitmenttypes "github.com/cosmos/ibc-go/v10/modules/core/23-commitment/types" +) + +func (suite *GnoTestSuite) TestConsensusStateValidateBasic() { + testCases := []struct { + msg string + consensusState *ibcgno.ConsensusState + expectPass bool + }{ + { + "success", + &ibcgno.ConsensusState{ + Timestamp: suite.now, + Root: commitmenttypes.NewMerkleRoot([]byte("app_hash")), + NextValidatorsHash: suite.valsHash, + }, + true, + }, + { + "success with sentinel", + &ibcgno.ConsensusState{ + Timestamp: suite.now, + Root: commitmenttypes.NewMerkleRoot([]byte(ibcgno.SentinelRoot)), + NextValidatorsHash: suite.valsHash, + }, + true, + }, + { + "root is nil", + &ibcgno.ConsensusState{ + Timestamp: suite.now, + Root: commitmenttypes.MerkleRoot{}, + NextValidatorsHash: suite.valsHash, + }, + false, + }, + { + "root is empty", + &ibcgno.ConsensusState{ + Timestamp: suite.now, + Root: commitmenttypes.MerkleRoot{}, + NextValidatorsHash: suite.valsHash, + }, + false, + }, + { + "nextvalshash is invalid", + &ibcgno.ConsensusState{ + Timestamp: suite.now, + Root: commitmenttypes.NewMerkleRoot([]byte("app_hash")), + NextValidatorsHash: []byte("hi"), + }, + false, + }, + + { + "timestamp is zero", + &ibcgno.ConsensusState{ + Timestamp: time.Time{}, + Root: commitmenttypes.NewMerkleRoot([]byte("app_hash")), + NextValidatorsHash: suite.valsHash, + }, + false, + }, + } + + for i, tc := range testCases { + suite.Run(tc.msg, func() { + // check just to increase coverage + suite.Require().Equal(ibcgno.Gno, tc.consensusState.ClientType()) + suite.Require().Equal(tc.consensusState.GetRoot(), tc.consensusState.Root) + + err := tc.consensusState.ValidateBasic() + if tc.expectPass { + suite.Require().NoError(err, "valid test case %d failed: %s", i, tc.msg) + } else { + suite.Require().Error(err, "invalid test case %d passed: %s", i, tc.msg) + } + }) + } +} diff --git a/modules/10-gno/doc.go b/modules/10-gno/doc.go new file mode 100644 index 000000000..9ecd24107 --- /dev/null +++ b/modules/10-gno/doc.go @@ -0,0 +1,11 @@ +/* +DONE +package gno implements a concrete LightClientModule, ClientState, ConsensusState, +Header, Misbehaviour and types for the Tendermint 2 / GNO consensus light client. +This implementation is based off the ICS 07 specification for Tendermint consensus +(https://github.com/cosmos/ibc/tree/main/spec/client/ics-007-tendermint-client) + +Note that client identifiers are expected to be in the form: 10-gno-{N}. +Client identifiers are generated and validated by core IBC, unexpected client identifiers will result in errors. +*/ +package gno diff --git a/modules/10-gno/errors.go b/modules/10-gno/errors.go new file mode 100644 index 000000000..9024c0b9b --- /dev/null +++ b/modules/10-gno/errors.go @@ -0,0 +1,25 @@ +package gno + +import ( + errorsmod "cosmossdk.io/errors" +) + +// IBC gno client sentinel errors +var ( + ErrInvalidChainID = errorsmod.Register(ModuleName, 2, "invalid chain-id") + ErrInvalidTrustingPeriod = errorsmod.Register(ModuleName, 3, "invalid trusting period") + ErrInvalidUnbondingPeriod = errorsmod.Register(ModuleName, 4, "invalid unbonding period") + ErrInvalidHeaderHeight = errorsmod.Register(ModuleName, 5, "invalid header height") + ErrInvalidHeader = errorsmod.Register(ModuleName, 6, "invalid header") + ErrInvalidMaxClockDrift = errorsmod.Register(ModuleName, 7, "invalid max clock drift") + ErrProcessedTimeNotFound = errorsmod.Register(ModuleName, 8, "processed time not found") + ErrProcessedHeightNotFound = errorsmod.Register(ModuleName, 9, "processed height not found") + ErrDelayPeriodNotPassed = errorsmod.Register(ModuleName, 10, "packet-specified delay period has not been reached") + ErrTrustingPeriodExpired = errorsmod.Register(ModuleName, 11, "time since latest trusted state has passed the trusting period") + ErrUnbondingPeriodExpired = errorsmod.Register(ModuleName, 12, "time since latest trusted state has passed the unbonding period") + ErrInvalidProofSpecs = errorsmod.Register(ModuleName, 13, "invalid proof specs") + ErrInvalidValidatorSet = errorsmod.Register(ModuleName, 14, "invalid validator set") + ErrInvalidTrustLevel = errorsmod.Register(ModuleName, 15, "invalid trust level") + ErrOldHeaderExpired = errorsmod.Register(ModuleName, 16, "old header has expired") + ErrNewValSetCantBeTrusted = errorsmod.Register(ModuleName, 17, "new val set cannot be trusted") +) diff --git a/modules/10-gno/fraction.go b/modules/10-gno/fraction.go new file mode 100644 index 000000000..e9c3c7601 --- /dev/null +++ b/modules/10-gno/fraction.go @@ -0,0 +1,24 @@ +package gno + +import ( + cmtmath "github.com/cometbft/cometbft/libs/math" +) + +// DefaultTrustLevel is the Gno light client default trust level +var DefaultTrustLevel = NewFractionFromTm(LCDefaultTrustLevel) + +// NewFractionFromTm returns a new Fraction instance from a tmmath.Fraction +func NewFractionFromTm(f cmtmath.Fraction) Fraction { + return Fraction{ + Numerator: f.Numerator, + Denominator: f.Denominator, + } +} + +// ToTendermint converts Fraction to tmmath.Fraction +func (f Fraction) ToTendermint() cmtmath.Fraction { + return cmtmath.Fraction{ + Numerator: f.Numerator, + Denominator: f.Denominator, + } +} diff --git a/modules/10-gno/gno.pb.go b/modules/10-gno/gno.pb.go new file mode 100644 index 000000000..1d47a3878 --- /dev/null +++ b/modules/10-gno/gno.pb.go @@ -0,0 +1,6223 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/lightclients/gno/v1/gno.proto + +package gno + +import ( + fmt "fmt" + crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + _ "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + types "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + types1 "github.com/cosmos/ibc-go/v10/modules/core/23-commitment/types" + _go "github.com/cosmos/ics23/go" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// ClientState from Gno tracks the current validator set, latest height, +// and a possible frozen height. +type ClientState struct { + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + TrustLevel Fraction `protobuf:"bytes,2,opt,name=trust_level,json=trustLevel,proto3" json:"trust_level"` + // duration of the period since the LatestTimestamp during which the + // submitted headers are valid for upgrade + TrustingPeriod time.Duration `protobuf:"bytes,3,opt,name=trusting_period,json=trustingPeriod,proto3,stdduration" json:"trusting_period"` + // duration of the staking unbonding period + UnbondingPeriod time.Duration `protobuf:"bytes,4,opt,name=unbonding_period,json=unbondingPeriod,proto3,stdduration" json:"unbonding_period"` + // defines how much new (untrusted) header's Time can drift into the future. + MaxClockDrift time.Duration `protobuf:"bytes,5,opt,name=max_clock_drift,json=maxClockDrift,proto3,stdduration" json:"max_clock_drift"` + // Block height when the client was frozen due to a misbehaviour + FrozenHeight types.Height `protobuf:"bytes,6,opt,name=frozen_height,json=frozenHeight,proto3" json:"frozen_height"` + // Latest height the client was updated to + LatestHeight types.Height `protobuf:"bytes,7,opt,name=latest_height,json=latestHeight,proto3" json:"latest_height"` + // Proof specifications used in verifying counterparty state + ProofSpecs []*_go.ProofSpec `protobuf:"bytes,8,rep,name=proof_specs,json=proofSpecs,proto3" json:"proof_specs,omitempty"` + // Path at which next upgraded client will be committed. + // Each element corresponds to the key for a single CommitmentProof in the + // chained proof. NOTE: ClientState must stored under + // `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored + // under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using + // the default upgrade module, upgrade_path should be []string{"upgrade", + // "upgradedIBCState"}` + UpgradePath []string `protobuf:"bytes,9,rep,name=upgrade_path,json=upgradePath,proto3" json:"upgrade_path,omitempty"` + // allow_update_after_expiry is deprecated + AllowUpdateAfterExpiry bool `protobuf:"varint,10,opt,name=allow_update_after_expiry,json=allowUpdateAfterExpiry,proto3" json:"allow_update_after_expiry,omitempty"` // Deprecated: Do not use. + // allow_update_after_misbehaviour is deprecated + AllowUpdateAfterMisbehaviour bool `protobuf:"varint,11,opt,name=allow_update_after_misbehaviour,json=allowUpdateAfterMisbehaviour,proto3" json:"allow_update_after_misbehaviour,omitempty"` // Deprecated: Do not use. + // In order to distinguisgh between Gno and Tendermint light clients + // we add a client type field. This is useful for clients that + // may support multiple light client types. + LcType string `protobuf:"bytes,12,opt,name=lc_type,json=lcType,proto3" json:"lc_type,omitempty"` +} + +func (m *ClientState) Reset() { *m = ClientState{} } +func (m *ClientState) String() string { return proto.CompactTextString(m) } +func (*ClientState) ProtoMessage() {} +func (*ClientState) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{0} +} +func (m *ClientState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClientState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClientState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ClientState) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientState.Merge(m, src) +} +func (m *ClientState) XXX_Size() int { + return m.Size() +} +func (m *ClientState) XXX_DiscardUnknown() { + xxx_messageInfo_ClientState.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientState proto.InternalMessageInfo + +// ConsensusState defines the consensus state from Gno. +type ConsensusState struct { + // timestamp that corresponds to the block height in which the ConsensusState + // was stored. + Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"` + // commitment root (i.e app hash) + Root types1.MerkleRoot `protobuf:"bytes,2,opt,name=root,proto3" json:"root"` + NextValidatorsHash []byte `protobuf:"bytes,3,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` + // In order to distinguisgh between Gno and Tendermint light clients + // we add a client type field. This is useful for clients that + // may support multiple light client types. + LcType string `protobuf:"bytes,4,opt,name=lc_type,json=lcType,proto3" json:"lc_type,omitempty"` +} + +func (m *ConsensusState) Reset() { *m = ConsensusState{} } +func (m *ConsensusState) String() string { return proto.CompactTextString(m) } +func (*ConsensusState) ProtoMessage() {} +func (*ConsensusState) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{1} +} +func (m *ConsensusState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsensusState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsensusState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConsensusState) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusState.Merge(m, src) +} +func (m *ConsensusState) XXX_Size() int { + return m.Size() +} +func (m *ConsensusState) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusState.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusState proto.InternalMessageInfo + +// Misbehaviour is a wrapper over two conflicting Headers +// that implements Misbehaviour interface expected by ICS-02 +type Misbehaviour struct { + // ClientID is deprecated + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` // Deprecated: Do not use. + Header1 *Header `protobuf:"bytes,2,opt,name=header_1,json=header1,proto3" json:"header_1,omitempty"` + Header2 *Header `protobuf:"bytes,3,opt,name=header_2,json=header2,proto3" json:"header_2,omitempty"` +} + +func (m *Misbehaviour) Reset() { *m = Misbehaviour{} } +func (m *Misbehaviour) String() string { return proto.CompactTextString(m) } +func (*Misbehaviour) ProtoMessage() {} +func (*Misbehaviour) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{2} +} +func (m *Misbehaviour) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Misbehaviour) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Misbehaviour.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Misbehaviour) XXX_Merge(src proto.Message) { + xxx_messageInfo_Misbehaviour.Merge(m, src) +} +func (m *Misbehaviour) XXX_Size() int { + return m.Size() +} +func (m *Misbehaviour) XXX_DiscardUnknown() { + xxx_messageInfo_Misbehaviour.DiscardUnknown(m) +} + +var xxx_messageInfo_Misbehaviour proto.InternalMessageInfo + +// Header defines the Tendermint client consensus Header. +// It encapsulates all the information necessary to update from a trusted +// Tendermint ConsensusState. The inclusion of TrustedHeight and +// TrustedValidators allows this update to process correctly, so long as the +// ConsensusState for the TrustedHeight exists, this removes race conditions +// among relayers The SignedHeader and ValidatorSet are the new untrusted update +// fields for the client. The TrustedHeight is the height of a stored +// ConsensusState on the client that will be used to verify the new untrusted +// header. The Trusted ConsensusState must be within the unbonding period of +// current time in order to correctly verify, and the TrustedValidators must +// hash to TrustedConsensusState.NextValidatorsHash since that is the last +// trusted validator set at the TrustedHeight. +type Header struct { + SignedHeader *SignedHeader `protobuf:"bytes,1,opt,name=signed_header,json=signedHeader,proto3" json:"signed_header,omitempty"` + ValidatorSet *ValidatorSet `protobuf:"bytes,2,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` + TrustedHeight types.Height `protobuf:"bytes,3,opt,name=trusted_height,json=trustedHeight,proto3" json:"trusted_height"` + TrustedValidators *ValidatorSet `protobuf:"bytes,4,opt,name=trusted_validators,json=trustedValidators,proto3" json:"trusted_validators,omitempty"` +} + +func (m *Header) Reset() { *m = Header{} } +func (m *Header) String() string { return proto.CompactTextString(m) } +func (*Header) ProtoMessage() {} +func (*Header) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{3} +} +func (m *Header) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Header.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Header) XXX_Merge(src proto.Message) { + xxx_messageInfo_Header.Merge(m, src) +} +func (m *Header) XXX_Size() int { + return m.Size() +} +func (m *Header) XXX_DiscardUnknown() { + xxx_messageInfo_Header.DiscardUnknown(m) +} + +var xxx_messageInfo_Header proto.InternalMessageInfo + +func (m *Header) GetSignedHeader() *SignedHeader { + if m != nil { + return m.SignedHeader + } + return nil +} + +func (m *Header) GetValidatorSet() *ValidatorSet { + if m != nil { + return m.ValidatorSet + } + return nil +} + +func (m *Header) GetTrustedHeight() types.Height { + if m != nil { + return m.TrustedHeight + } + return types.Height{} +} + +func (m *Header) GetTrustedValidators() *ValidatorSet { + if m != nil { + return m.TrustedValidators + } + return nil +} + +type Block struct { + Header *GnoHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + LastCommit *Commit `protobuf:"bytes,3,opt,name=last_commit,json=lastCommit,proto3" json:"last_commit,omitempty"` +} + +func (m *Block) Reset() { *m = Block{} } +func (m *Block) String() string { return proto.CompactTextString(m) } +func (*Block) ProtoMessage() {} +func (*Block) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{4} +} +func (m *Block) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Block.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Block) XXX_Merge(src proto.Message) { + xxx_messageInfo_Block.Merge(m, src) +} +func (m *Block) XXX_Size() int { + return m.Size() +} +func (m *Block) XXX_DiscardUnknown() { + xxx_messageInfo_Block.DiscardUnknown(m) +} + +var xxx_messageInfo_Block proto.InternalMessageInfo + +func (m *Block) GetHeader() *GnoHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *Block) GetData() *Data { + if m != nil { + return m.Data + } + return nil +} + +func (m *Block) GetLastCommit() *Commit { + if m != nil { + return m.LastCommit + } + return nil +} + +type GnoHeader struct { + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Height int64 `protobuf:"zigzag64,3,opt,name=height,proto3" json:"height,omitempty"` + Time time.Time `protobuf:"bytes,4,opt,name=time,proto3,stdtime" json:"time"` + NumTxs int64 `protobuf:"zigzag64,5,opt,name=num_txs,json=numTxs,proto3" json:"num_txs,omitempty"` + TotalTxs int64 `protobuf:"zigzag64,6,opt,name=total_txs,json=totalTxs,proto3" json:"total_txs,omitempty"` + AppVersion string `protobuf:"bytes,7,opt,name=app_version,json=appVersion,proto3" json:"app_version,omitempty"` + LastBlockId *BlockID `protobuf:"bytes,8,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id,omitempty"` + LastCommitHash []byte `protobuf:"bytes,9,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` + DataHash []byte `protobuf:"bytes,10,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` + ValidatorsHash []byte `protobuf:"bytes,11,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` + NextValidatorsHash []byte `protobuf:"bytes,12,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` + ConsensusHash []byte `protobuf:"bytes,13,opt,name=consensus_hash,json=consensusHash,proto3" json:"consensus_hash,omitempty"` + AppHash []byte `protobuf:"bytes,14,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + LastResultsHash []byte `protobuf:"bytes,15,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` + ProposerAddress string `protobuf:"bytes,16,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` +} + +func (m *GnoHeader) Reset() { *m = GnoHeader{} } +func (m *GnoHeader) String() string { return proto.CompactTextString(m) } +func (*GnoHeader) ProtoMessage() {} +func (*GnoHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{5} +} +func (m *GnoHeader) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GnoHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GnoHeader.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GnoHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_GnoHeader.Merge(m, src) +} +func (m *GnoHeader) XXX_Size() int { + return m.Size() +} +func (m *GnoHeader) XXX_DiscardUnknown() { + xxx_messageInfo_GnoHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_GnoHeader proto.InternalMessageInfo + +func (m *GnoHeader) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *GnoHeader) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *GnoHeader) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *GnoHeader) GetTime() time.Time { + if m != nil { + return m.Time + } + return time.Time{} +} + +func (m *GnoHeader) GetNumTxs() int64 { + if m != nil { + return m.NumTxs + } + return 0 +} + +func (m *GnoHeader) GetTotalTxs() int64 { + if m != nil { + return m.TotalTxs + } + return 0 +} + +func (m *GnoHeader) GetAppVersion() string { + if m != nil { + return m.AppVersion + } + return "" +} + +func (m *GnoHeader) GetLastBlockId() *BlockID { + if m != nil { + return m.LastBlockId + } + return nil +} + +func (m *GnoHeader) GetLastCommitHash() []byte { + if m != nil { + return m.LastCommitHash + } + return nil +} + +func (m *GnoHeader) GetDataHash() []byte { + if m != nil { + return m.DataHash + } + return nil +} + +func (m *GnoHeader) GetValidatorsHash() []byte { + if m != nil { + return m.ValidatorsHash + } + return nil +} + +func (m *GnoHeader) GetNextValidatorsHash() []byte { + if m != nil { + return m.NextValidatorsHash + } + return nil +} + +func (m *GnoHeader) GetConsensusHash() []byte { + if m != nil { + return m.ConsensusHash + } + return nil +} + +func (m *GnoHeader) GetAppHash() []byte { + if m != nil { + return m.AppHash + } + return nil +} + +func (m *GnoHeader) GetLastResultsHash() []byte { + if m != nil { + return m.LastResultsHash + } + return nil +} + +func (m *GnoHeader) GetProposerAddress() string { + if m != nil { + return m.ProposerAddress + } + return "" +} + +type Data struct { + Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` +} + +func (m *Data) Reset() { *m = Data{} } +func (m *Data) String() string { return proto.CompactTextString(m) } +func (*Data) ProtoMessage() {} +func (*Data) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{6} +} +func (m *Data) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Data.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Data) XXX_Merge(src proto.Message) { + xxx_messageInfo_Data.Merge(m, src) +} +func (m *Data) XXX_Size() int { + return m.Size() +} +func (m *Data) XXX_DiscardUnknown() { + xxx_messageInfo_Data.DiscardUnknown(m) +} + +var xxx_messageInfo_Data proto.InternalMessageInfo + +func (m *Data) GetTxs() [][]byte { + if m != nil { + return m.Txs + } + return nil +} + +type Commit struct { + BlockId *BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` + Precommits []*CommitSig `protobuf:"bytes,2,rep,name=precommits,proto3" json:"precommits,omitempty"` +} + +func (m *Commit) Reset() { *m = Commit{} } +func (m *Commit) String() string { return proto.CompactTextString(m) } +func (*Commit) ProtoMessage() {} +func (*Commit) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{7} +} +func (m *Commit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Commit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Commit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Commit) XXX_Merge(src proto.Message) { + xxx_messageInfo_Commit.Merge(m, src) +} +func (m *Commit) XXX_Size() int { + return m.Size() +} +func (m *Commit) XXX_DiscardUnknown() { + xxx_messageInfo_Commit.DiscardUnknown(m) +} + +var xxx_messageInfo_Commit proto.InternalMessageInfo + +func (m *Commit) GetBlockId() *BlockID { + if m != nil { + return m.BlockId + } + return nil +} + +func (m *Commit) GetPrecommits() []*CommitSig { + if m != nil { + return m.Precommits + } + return nil +} + +type BlockID struct { + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + PartsHeader *PartSetHeader `protobuf:"bytes,2,opt,name=parts_header,json=parts,proto3" json:"parts_header,omitempty"` +} + +func (m *BlockID) Reset() { *m = BlockID{} } +func (m *BlockID) String() string { return proto.CompactTextString(m) } +func (*BlockID) ProtoMessage() {} +func (*BlockID) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{8} +} +func (m *BlockID) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockID.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockID) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockID.Merge(m, src) +} +func (m *BlockID) XXX_Size() int { + return m.Size() +} +func (m *BlockID) XXX_DiscardUnknown() { + xxx_messageInfo_BlockID.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockID proto.InternalMessageInfo + +func (m *BlockID) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +func (m *BlockID) GetPartsHeader() *PartSetHeader { + if m != nil { + return m.PartsHeader + } + return nil +} + +type SignedHeader struct { + Header *GnoHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Commit *Commit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` +} + +func (m *SignedHeader) Reset() { *m = SignedHeader{} } +func (m *SignedHeader) String() string { return proto.CompactTextString(m) } +func (*SignedHeader) ProtoMessage() {} +func (*SignedHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{9} +} +func (m *SignedHeader) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SignedHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SignedHeader.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SignedHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignedHeader.Merge(m, src) +} +func (m *SignedHeader) XXX_Size() int { + return m.Size() +} +func (m *SignedHeader) XXX_DiscardUnknown() { + xxx_messageInfo_SignedHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_SignedHeader proto.InternalMessageInfo + +func (m *SignedHeader) GetHeader() *GnoHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *SignedHeader) GetCommit() *Commit { + if m != nil { + return m.Commit + } + return nil +} + +type LightBlock struct { + SignedHeader *SignedHeader `protobuf:"bytes,1,opt,name=signed_header,json=signedHeader,proto3" json:"signed_header,omitempty"` + ValidatorSet *ValidatorSet `protobuf:"bytes,2,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` +} + +func (m *LightBlock) Reset() { *m = LightBlock{} } +func (m *LightBlock) String() string { return proto.CompactTextString(m) } +func (*LightBlock) ProtoMessage() {} +func (*LightBlock) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{10} +} +func (m *LightBlock) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LightBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LightBlock.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LightBlock) XXX_Merge(src proto.Message) { + xxx_messageInfo_LightBlock.Merge(m, src) +} +func (m *LightBlock) XXX_Size() int { + return m.Size() +} +func (m *LightBlock) XXX_DiscardUnknown() { + xxx_messageInfo_LightBlock.DiscardUnknown(m) +} + +var xxx_messageInfo_LightBlock proto.InternalMessageInfo + +func (m *LightBlock) GetSignedHeader() *SignedHeader { + if m != nil { + return m.SignedHeader + } + return nil +} + +func (m *LightBlock) GetValidatorSet() *ValidatorSet { + if m != nil { + return m.ValidatorSet + } + return nil +} + +type CommitSig struct { + Type uint32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` + Height int64 `protobuf:"zigzag64,2,opt,name=height,proto3" json:"height,omitempty"` + Round int64 `protobuf:"zigzag64,3,opt,name=round,proto3" json:"round,omitempty"` + BlockId *BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` + Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"` + ValidatorAddress string `protobuf:"bytes,6,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorIndex int64 `protobuf:"zigzag64,7,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty"` + Signature []byte `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *CommitSig) Reset() { *m = CommitSig{} } +func (m *CommitSig) String() string { return proto.CompactTextString(m) } +func (*CommitSig) ProtoMessage() {} +func (*CommitSig) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{11} +} +func (m *CommitSig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CommitSig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CommitSig.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CommitSig) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommitSig.Merge(m, src) +} +func (m *CommitSig) XXX_Size() int { + return m.Size() +} +func (m *CommitSig) XXX_DiscardUnknown() { + xxx_messageInfo_CommitSig.DiscardUnknown(m) +} + +var xxx_messageInfo_CommitSig proto.InternalMessageInfo + +func (m *CommitSig) GetType() uint32 { + if m != nil { + return m.Type + } + return 0 +} + +func (m *CommitSig) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *CommitSig) GetRound() int64 { + if m != nil { + return m.Round + } + return 0 +} + +func (m *CommitSig) GetBlockId() *BlockID { + if m != nil { + return m.BlockId + } + return nil +} + +func (m *CommitSig) GetTimestamp() time.Time { + if m != nil { + return m.Timestamp + } + return time.Time{} +} + +func (m *CommitSig) GetValidatorAddress() string { + if m != nil { + return m.ValidatorAddress + } + return "" +} + +func (m *CommitSig) GetValidatorIndex() int64 { + if m != nil { + return m.ValidatorIndex + } + return 0 +} + +func (m *CommitSig) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +type Vote struct { + Type uint32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` + Height int64 `protobuf:"zigzag64,2,opt,name=height,proto3" json:"height,omitempty"` + Round int64 `protobuf:"zigzag64,3,opt,name=round,proto3" json:"round,omitempty"` + BlockId *BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` + Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"` + ValidatorAddress string `protobuf:"bytes,6,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorIndex int64 `protobuf:"zigzag64,7,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty"` + Signature []byte `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *Vote) Reset() { *m = Vote{} } +func (m *Vote) String() string { return proto.CompactTextString(m) } +func (*Vote) ProtoMessage() {} +func (*Vote) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{12} +} +func (m *Vote) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Vote.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Vote) XXX_Merge(src proto.Message) { + xxx_messageInfo_Vote.Merge(m, src) +} +func (m *Vote) XXX_Size() int { + return m.Size() +} +func (m *Vote) XXX_DiscardUnknown() { + xxx_messageInfo_Vote.DiscardUnknown(m) +} + +var xxx_messageInfo_Vote proto.InternalMessageInfo + +func (m *Vote) GetType() uint32 { + if m != nil { + return m.Type + } + return 0 +} + +func (m *Vote) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *Vote) GetRound() int64 { + if m != nil { + return m.Round + } + return 0 +} + +func (m *Vote) GetBlockId() *BlockID { + if m != nil { + return m.BlockId + } + return nil +} + +func (m *Vote) GetTimestamp() time.Time { + if m != nil { + return m.Timestamp + } + return time.Time{} +} + +func (m *Vote) GetValidatorAddress() string { + if m != nil { + return m.ValidatorAddress + } + return "" +} + +func (m *Vote) GetValidatorIndex() int64 { + if m != nil { + return m.ValidatorIndex + } + return 0 +} + +func (m *Vote) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +type PartSet struct { +} + +func (m *PartSet) Reset() { *m = PartSet{} } +func (m *PartSet) String() string { return proto.CompactTextString(m) } +func (*PartSet) ProtoMessage() {} +func (*PartSet) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{13} +} +func (m *PartSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PartSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PartSet.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PartSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_PartSet.Merge(m, src) +} +func (m *PartSet) XXX_Size() int { + return m.Size() +} +func (m *PartSet) XXX_DiscardUnknown() { + xxx_messageInfo_PartSet.DiscardUnknown(m) +} + +var xxx_messageInfo_PartSet proto.InternalMessageInfo + +type PartSetHeader struct { + Total int64 `protobuf:"zigzag64,1,opt,name=total,proto3" json:"total,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } +func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } +func (*PartSetHeader) ProtoMessage() {} +func (*PartSetHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{14} +} +func (m *PartSetHeader) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PartSetHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PartSetHeader.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PartSetHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_PartSetHeader.Merge(m, src) +} +func (m *PartSetHeader) XXX_Size() int { + return m.Size() +} +func (m *PartSetHeader) XXX_DiscardUnknown() { + xxx_messageInfo_PartSetHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_PartSetHeader proto.InternalMessageInfo + +func (m *PartSetHeader) GetTotal() int64 { + if m != nil { + return m.Total + } + return 0 +} + +func (m *PartSetHeader) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +type Validator struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + PubKey *crypto.PublicKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + VotingPower int64 `protobuf:"zigzag64,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` + ProposerPriority int64 `protobuf:"zigzag64,4,opt,name=proposer_priority,json=proposerPriority,proto3" json:"proposer_priority,omitempty"` +} + +func (m *Validator) Reset() { *m = Validator{} } +func (m *Validator) String() string { return proto.CompactTextString(m) } +func (*Validator) ProtoMessage() {} +func (*Validator) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{15} +} +func (m *Validator) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Validator.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Validator) XXX_Merge(src proto.Message) { + xxx_messageInfo_Validator.Merge(m, src) +} +func (m *Validator) XXX_Size() int { + return m.Size() +} +func (m *Validator) XXX_DiscardUnknown() { + xxx_messageInfo_Validator.DiscardUnknown(m) +} + +var xxx_messageInfo_Validator proto.InternalMessageInfo + +func (m *Validator) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Validator) GetPubKey() *crypto.PublicKey { + if m != nil { + return m.PubKey + } + return nil +} + +func (m *Validator) GetVotingPower() int64 { + if m != nil { + return m.VotingPower + } + return 0 +} + +func (m *Validator) GetProposerPriority() int64 { + if m != nil { + return m.ProposerPriority + } + return 0 +} + +type ValidatorSet struct { + Validators []*Validator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators,omitempty"` + Proposer *Validator `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` +} + +func (m *ValidatorSet) Reset() { *m = ValidatorSet{} } +func (m *ValidatorSet) String() string { return proto.CompactTextString(m) } +func (*ValidatorSet) ProtoMessage() {} +func (*ValidatorSet) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{16} +} +func (m *ValidatorSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorSet.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ValidatorSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorSet.Merge(m, src) +} +func (m *ValidatorSet) XXX_Size() int { + return m.Size() +} +func (m *ValidatorSet) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorSet.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorSet proto.InternalMessageInfo + +func (m *ValidatorSet) GetValidators() []*Validator { + if m != nil { + return m.Validators + } + return nil +} + +func (m *ValidatorSet) GetProposer() *Validator { + if m != nil { + return m.Proposer + } + return nil +} + +// Fraction defines the protobuf message type for tmmath.Fraction that only +// supports positive values. +type Fraction struct { + Numerator uint64 `protobuf:"varint,1,opt,name=numerator,proto3" json:"numerator,omitempty"` + Denominator uint64 `protobuf:"varint,2,opt,name=denominator,proto3" json:"denominator,omitempty"` +} + +func (m *Fraction) Reset() { *m = Fraction{} } +func (m *Fraction) String() string { return proto.CompactTextString(m) } +func (*Fraction) ProtoMessage() {} +func (*Fraction) Descriptor() ([]byte, []int) { + return fileDescriptor_30a4bac44dcc3529, []int{17} +} +func (m *Fraction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Fraction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Fraction.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Fraction) XXX_Merge(src proto.Message) { + xxx_messageInfo_Fraction.Merge(m, src) +} +func (m *Fraction) XXX_Size() int { + return m.Size() +} +func (m *Fraction) XXX_DiscardUnknown() { + xxx_messageInfo_Fraction.DiscardUnknown(m) +} + +var xxx_messageInfo_Fraction proto.InternalMessageInfo + +func (m *Fraction) GetNumerator() uint64 { + if m != nil { + return m.Numerator + } + return 0 +} + +func (m *Fraction) GetDenominator() uint64 { + if m != nil { + return m.Denominator + } + return 0 +} + +func init() { + proto.RegisterType((*ClientState)(nil), "ibc.lightclients.gno.v1.ClientState") + proto.RegisterType((*ConsensusState)(nil), "ibc.lightclients.gno.v1.ConsensusState") + proto.RegisterType((*Misbehaviour)(nil), "ibc.lightclients.gno.v1.Misbehaviour") + proto.RegisterType((*Header)(nil), "ibc.lightclients.gno.v1.Header") + proto.RegisterType((*Block)(nil), "ibc.lightclients.gno.v1.Block") + proto.RegisterType((*GnoHeader)(nil), "ibc.lightclients.gno.v1.GnoHeader") + proto.RegisterType((*Data)(nil), "ibc.lightclients.gno.v1.Data") + proto.RegisterType((*Commit)(nil), "ibc.lightclients.gno.v1.Commit") + proto.RegisterType((*BlockID)(nil), "ibc.lightclients.gno.v1.BlockID") + proto.RegisterType((*SignedHeader)(nil), "ibc.lightclients.gno.v1.SignedHeader") + proto.RegisterType((*LightBlock)(nil), "ibc.lightclients.gno.v1.LightBlock") + proto.RegisterType((*CommitSig)(nil), "ibc.lightclients.gno.v1.CommitSig") + proto.RegisterType((*Vote)(nil), "ibc.lightclients.gno.v1.Vote") + proto.RegisterType((*PartSet)(nil), "ibc.lightclients.gno.v1.PartSet") + proto.RegisterType((*PartSetHeader)(nil), "ibc.lightclients.gno.v1.PartSetHeader") + proto.RegisterType((*Validator)(nil), "ibc.lightclients.gno.v1.Validator") + proto.RegisterType((*ValidatorSet)(nil), "ibc.lightclients.gno.v1.ValidatorSet") + proto.RegisterType((*Fraction)(nil), "ibc.lightclients.gno.v1.Fraction") +} + +func init() { proto.RegisterFile("ibc/lightclients/gno/v1/gno.proto", fileDescriptor_30a4bac44dcc3529) } + +var fileDescriptor_30a4bac44dcc3529 = []byte{ + // 1612 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0xcf, 0x73, 0x23, 0x47, + 0x15, 0xf6, 0xc8, 0xb2, 0x7e, 0x3c, 0xc9, 0x3f, 0xb6, 0x6b, 0x2b, 0x91, 0x37, 0xc6, 0xf2, 0x4e, + 0x55, 0x88, 0x81, 0x8a, 0x14, 0x39, 0x45, 0x01, 0x59, 0xa0, 0x88, 0xed, 0xb0, 0xeb, 0xec, 0x86, + 0x72, 0x8d, 0x97, 0x3d, 0x70, 0x99, 0x6a, 0xcd, 0xb4, 0xa5, 0xa9, 0x9d, 0x99, 0x9e, 0xea, 0xee, + 0x51, 0x2c, 0xae, 0x5c, 0xe0, 0x96, 0xe2, 0xc4, 0x91, 0x03, 0x47, 0xfe, 0x00, 0x2e, 0x14, 0x55, + 0x5c, 0xc8, 0x31, 0x47, 0x4e, 0x81, 0xda, 0xbd, 0x71, 0xe6, 0x0f, 0xa0, 0xfa, 0x75, 0xcf, 0x68, + 0xe4, 0x8a, 0x58, 0x25, 0x5c, 0x38, 0xe4, 0xe4, 0xee, 0xf7, 0xbe, 0xf7, 0xdc, 0xfd, 0xbd, 0xf7, + 0xbe, 0xd6, 0xc0, 0xfd, 0x68, 0x1c, 0x0c, 0xe3, 0x68, 0x32, 0x55, 0x41, 0x1c, 0xb1, 0x54, 0xc9, + 0xe1, 0x24, 0xe5, 0xc3, 0xd9, 0x48, 0xff, 0x19, 0x64, 0x82, 0x2b, 0x4e, 0x5e, 0x8f, 0xc6, 0xc1, + 0xa0, 0x0a, 0x19, 0x68, 0xdf, 0x6c, 0x74, 0xef, 0x20, 0xe0, 0x32, 0xe1, 0x72, 0x18, 0x05, 0xf2, + 0xe4, 0x5d, 0x1d, 0x93, 0x09, 0xce, 0xaf, 0xa5, 0x09, 0xbb, 0x77, 0x77, 0xc2, 0x27, 0x1c, 0x97, + 0x43, 0xbd, 0xb2, 0xd6, 0xfd, 0x09, 0xe7, 0x93, 0x98, 0x0d, 0x71, 0x37, 0xce, 0xaf, 0x87, 0x34, + 0x9d, 0x5b, 0xd7, 0xe1, 0x6d, 0x57, 0x98, 0x0b, 0xaa, 0x22, 0x9e, 0x5a, 0x7f, 0xff, 0xb6, 0x5f, + 0x45, 0x09, 0x93, 0x8a, 0x26, 0x59, 0x01, 0xd0, 0x77, 0x09, 0xb8, 0x60, 0x43, 0x73, 0x50, 0x7d, + 0x24, 0xb3, 0xb2, 0x80, 0xb7, 0x16, 0x00, 0x9e, 0x24, 0x91, 0x4a, 0x0a, 0x50, 0xb9, 0xb3, 0xc0, + 0x03, 0xc5, 0xd2, 0x90, 0x89, 0x24, 0x4a, 0xd5, 0x30, 0x10, 0xf3, 0x4c, 0xf1, 0xe1, 0x73, 0x36, + 0xb7, 0x37, 0x73, 0xff, 0xbd, 0x05, 0x9d, 0x33, 0xcc, 0x7b, 0xa5, 0xa8, 0x62, 0x64, 0x1f, 0x5a, + 0xc1, 0x94, 0x46, 0xa9, 0x1f, 0x85, 0x3d, 0xe7, 0xc8, 0x39, 0x6e, 0x7b, 0x4d, 0xdc, 0x5f, 0x84, + 0xe4, 0x11, 0x74, 0x94, 0xc8, 0xa5, 0xf2, 0x63, 0x36, 0x63, 0x71, 0xaf, 0x76, 0xe4, 0x1c, 0x77, + 0x4e, 0xee, 0x0f, 0x56, 0x30, 0x3a, 0xf8, 0xa9, 0xa0, 0x81, 0xbe, 0xf1, 0x69, 0xfd, 0xd3, 0xcf, + 0xfb, 0x1b, 0x1e, 0x60, 0xec, 0x13, 0x1d, 0x4a, 0x9e, 0xc0, 0x2e, 0xee, 0xa2, 0x74, 0xe2, 0x67, + 0x4c, 0x44, 0x3c, 0xec, 0x6d, 0x62, 0xb6, 0xfd, 0x81, 0xe1, 0x65, 0x50, 0xf0, 0x32, 0x38, 0xb7, + 0xbc, 0x9d, 0xb6, 0x74, 0x96, 0xdf, 0xfd, 0xa3, 0xef, 0x78, 0x3b, 0x45, 0xec, 0x25, 0x86, 0x92, + 0x9f, 0xc1, 0x5e, 0x9e, 0x8e, 0x79, 0x1a, 0x56, 0xd2, 0xd5, 0xd7, 0x4f, 0xb7, 0x5b, 0x06, 0xdb, + 0x7c, 0x8f, 0x61, 0x37, 0xa1, 0x37, 0x7e, 0x10, 0xf3, 0xe0, 0xb9, 0x1f, 0x8a, 0xe8, 0x5a, 0xf5, + 0xb6, 0xd6, 0x4f, 0xb7, 0x9d, 0xd0, 0x9b, 0x33, 0x1d, 0x7a, 0xae, 0x23, 0xc9, 0x07, 0xb0, 0x7d, + 0x2d, 0xf8, 0x2f, 0x59, 0xea, 0x4f, 0x99, 0x26, 0xa9, 0xd7, 0xc0, 0x54, 0xf7, 0x90, 0x36, 0x5d, + 0xbe, 0x81, 0xad, 0xea, 0x6c, 0x34, 0x78, 0x84, 0x08, 0xcb, 0x57, 0xd7, 0x84, 0x19, 0x9b, 0x4e, + 0x13, 0x53, 0xc5, 0xa4, 0x2a, 0xd2, 0x34, 0xd7, 0x4d, 0x63, 0xc2, 0x6c, 0x9a, 0x07, 0xd0, 0xc1, + 0xbe, 0xf6, 0x65, 0xc6, 0x02, 0xd9, 0x6b, 0x1d, 0x6d, 0x62, 0x12, 0xd3, 0xfb, 0x03, 0xec, 0x7d, + 0x9d, 0xe1, 0x52, 0x63, 0xae, 0x32, 0x16, 0x78, 0x90, 0x15, 0x4b, 0x49, 0xee, 0x43, 0x37, 0xcf, + 0x26, 0x82, 0x86, 0xcc, 0xcf, 0xa8, 0x9a, 0xf6, 0xda, 0x47, 0x9b, 0xc7, 0x6d, 0xaf, 0x63, 0x6d, + 0x97, 0x54, 0x4d, 0xc9, 0x8f, 0x60, 0x9f, 0xc6, 0x31, 0xff, 0xd8, 0xcf, 0xb3, 0x90, 0x2a, 0xe6, + 0xd3, 0x6b, 0xc5, 0x84, 0xcf, 0x6e, 0xb2, 0x48, 0xcc, 0x7b, 0x70, 0xe4, 0x1c, 0xb7, 0x4e, 0x6b, + 0x3d, 0xc7, 0x7b, 0x0d, 0x41, 0x3f, 0x47, 0xcc, 0xfb, 0x1a, 0xf2, 0x01, 0x22, 0xc8, 0x05, 0xf4, + 0xbf, 0x20, 0x3c, 0x89, 0xe4, 0x98, 0x4d, 0xe9, 0x2c, 0xe2, 0xb9, 0xe8, 0x75, 0xca, 0x24, 0x07, + 0xb7, 0x93, 0x7c, 0x54, 0xc1, 0x91, 0xd7, 0xa1, 0x19, 0x07, 0xbe, 0x9a, 0x67, 0xac, 0xd7, 0xc5, + 0x36, 0x6e, 0xc4, 0xc1, 0xd3, 0x79, 0xc6, 0xde, 0xab, 0xff, 0xfa, 0xf7, 0xfd, 0x0d, 0xf7, 0xa5, + 0x03, 0x3b, 0x67, 0x3c, 0x95, 0x2c, 0x95, 0xb9, 0x34, 0x9d, 0x7f, 0x0a, 0xed, 0x72, 0x08, 0xb1, + 0xf5, 0x35, 0x33, 0xb7, 0x0b, 0xfe, 0xb4, 0x40, 0x98, 0x8a, 0x7f, 0xa2, 0x2b, 0xbe, 0x08, 0x23, + 0x3f, 0x84, 0xba, 0xe0, 0x5c, 0xd9, 0xd9, 0x70, 0x2b, 0xd5, 0x59, 0x4c, 0xe5, 0x6c, 0x34, 0xf8, + 0x88, 0x89, 0xe7, 0x31, 0xf3, 0x38, 0x2f, 0xaa, 0x84, 0x51, 0xe4, 0x1d, 0xb8, 0x9b, 0xb2, 0x1b, + 0xe5, 0xcf, 0x68, 0x1c, 0x85, 0x54, 0x71, 0x21, 0xfd, 0x29, 0x95, 0x53, 0x9c, 0x8d, 0xae, 0x47, + 0xb4, 0xef, 0x59, 0xe9, 0x7a, 0x44, 0xe5, 0xb4, 0x7a, 0xcb, 0xfa, 0x17, 0xdc, 0xf2, 0x6f, 0x0e, + 0x74, 0x97, 0x58, 0xe9, 0x43, 0xdb, 0xf4, 0x49, 0x39, 0xde, 0x48, 0x65, 0xcb, 0x18, 0x2f, 0x42, + 0xf2, 0x10, 0x5a, 0x53, 0x46, 0x43, 0x26, 0xfc, 0x91, 0xbd, 0x44, 0x7f, 0xe5, 0x80, 0x3f, 0x42, + 0xe0, 0x69, 0xe7, 0xc5, 0xe7, 0xfd, 0xa6, 0x59, 0x8f, 0xbc, 0xa6, 0x89, 0x1e, 0x55, 0x12, 0x9d, + 0xd8, 0xd9, 0xfe, 0x32, 0x89, 0x4e, 0x8a, 0x44, 0x27, 0xf6, 0x26, 0x7f, 0xa9, 0x41, 0xc3, 0xb8, + 0xc8, 0x87, 0xb0, 0x2d, 0xa3, 0x49, 0xca, 0x42, 0xdf, 0x40, 0x6c, 0xad, 0xde, 0x5c, 0x99, 0xfe, + 0x0a, 0xd1, 0x26, 0xda, 0xeb, 0xca, 0xca, 0x4e, 0xe7, 0x2a, 0xc9, 0xf6, 0x25, 0x2b, 0x0a, 0xb7, + 0x3a, 0x57, 0xc9, 0xff, 0x15, 0x53, 0x5e, 0x77, 0x56, 0xd9, 0x91, 0x87, 0x60, 0x84, 0x09, 0x0f, + 0x86, 0x33, 0xba, 0xb9, 0xe6, 0x8c, 0x6e, 0xdb, 0x38, 0x3b, 0xa4, 0x4f, 0x81, 0x14, 0x89, 0x16, + 0x9d, 0x60, 0x15, 0x6d, 0xcd, 0x93, 0xdd, 0xb1, 0x09, 0x16, 0xed, 0xe2, 0xfe, 0xc9, 0x81, 0xad, + 0x53, 0xad, 0x4b, 0xe4, 0x3d, 0x68, 0x2c, 0x31, 0xe7, 0xae, 0xcc, 0xf9, 0x30, 0xe5, 0x96, 0x36, + 0x1b, 0x41, 0x46, 0x50, 0x0f, 0xa9, 0xa2, 0x96, 0xa7, 0x6f, 0xac, 0x8c, 0x3c, 0xa7, 0x8a, 0x7a, + 0x08, 0x25, 0x3f, 0x81, 0x4e, 0x4c, 0xa5, 0xf2, 0xcd, 0x08, 0xbc, 0xb2, 0x19, 0xce, 0x10, 0xe6, + 0x81, 0x8e, 0x31, 0x6b, 0xf7, 0x5f, 0x75, 0x68, 0x97, 0x47, 0x21, 0x3d, 0x68, 0xce, 0x98, 0x90, + 0x11, 0x4f, 0x8b, 0x07, 0xca, 0x6e, 0x97, 0xde, 0xae, 0xda, 0xf2, 0xdb, 0xf5, 0x9a, 0xbe, 0x73, + 0x59, 0x14, 0xe2, 0xd9, 0x1d, 0xf9, 0x3e, 0xd4, 0xf5, 0xf4, 0x5a, 0x76, 0xd7, 0x9b, 0x77, 0x8c, + 0xd0, 0xa3, 0x97, 0xe6, 0x89, 0xaf, 0x6e, 0x24, 0xbe, 0x0e, 0xc4, 0x6b, 0xa4, 0x79, 0xf2, 0xf4, + 0x46, 0x92, 0x37, 0xa0, 0xad, 0xb8, 0xa2, 0x31, 0xba, 0x1a, 0xe8, 0x6a, 0xa1, 0x41, 0x3b, 0xfb, + 0xd0, 0xa1, 0x59, 0xe6, 0x17, 0x17, 0x68, 0xe2, 0x29, 0x81, 0x66, 0xd9, 0x33, 0x7b, 0x87, 0x73, + 0x2d, 0xf4, 0x52, 0xf9, 0x63, 0x7c, 0x7d, 0xa2, 0xb0, 0xd7, 0xc2, 0x93, 0x1d, 0xad, 0xe4, 0x0b, + 0x6b, 0x7a, 0x71, 0xee, 0x21, 0xc9, 0x66, 0x13, 0x92, 0x63, 0xd8, 0xab, 0x70, 0x6e, 0x54, 0xa4, + 0x8d, 0x2a, 0xb2, 0xb3, 0xe0, 0x15, 0x15, 0xe4, 0x0d, 0x68, 0xeb, 0x2a, 0x19, 0x08, 0x20, 0xa4, + 0xa5, 0x0d, 0xe8, 0x7c, 0x0b, 0x76, 0x6f, 0x6b, 0x51, 0xc7, 0x64, 0x99, 0x2d, 0xeb, 0xd0, 0x2a, + 0xe5, 0xea, 0xae, 0x54, 0xae, 0x37, 0x61, 0x27, 0x28, 0xf4, 0xd7, 0x60, 0xb7, 0x11, 0xbb, 0x5d, + 0x5a, 0x11, 0xb6, 0x0f, 0x2d, 0xcd, 0x17, 0x02, 0x76, 0x10, 0xd0, 0xa4, 0x59, 0x86, 0xae, 0x6f, + 0xc3, 0x1d, 0xbc, 0xa3, 0x60, 0x32, 0x8f, 0x95, 0x4d, 0xb2, 0x8b, 0x98, 0x5d, 0xed, 0xf0, 0x8c, + 0x1d, 0xb1, 0xdf, 0x82, 0xbd, 0x4c, 0xf0, 0x8c, 0x4b, 0x26, 0x7c, 0x1a, 0x86, 0x82, 0x49, 0xd9, + 0xdb, 0x43, 0xee, 0x77, 0x0b, 0xfb, 0xfb, 0xc6, 0xec, 0xf6, 0xa0, 0xae, 0x9b, 0x97, 0xec, 0xc1, + 0xa6, 0x2e, 0xa0, 0x73, 0xb4, 0x79, 0xdc, 0xf5, 0xf4, 0xd2, 0xfd, 0x8d, 0x03, 0x0d, 0xc3, 0x1c, + 0x79, 0x00, 0xad, 0xb2, 0x40, 0xce, 0x9a, 0x05, 0x6a, 0x8e, 0x6d, 0x71, 0x4e, 0x01, 0x32, 0xc1, + 0x4c, 0x69, 0x64, 0xaf, 0x86, 0x6f, 0xb0, 0xfb, 0x8a, 0x79, 0xb8, 0x8a, 0x26, 0x5e, 0x25, 0xca, + 0x1d, 0x43, 0xd3, 0xe6, 0x25, 0x04, 0xea, 0x78, 0x75, 0x07, 0xaf, 0x8e, 0x6b, 0x72, 0x06, 0xdd, + 0x8c, 0x0a, 0x4d, 0x8a, 0x19, 0x74, 0x33, 0xae, 0xdf, 0x5c, 0xf9, 0x4f, 0x2e, 0xa9, 0x50, 0x57, + 0x4c, 0xd9, 0x61, 0xdf, 0xc2, 0x58, 0xf7, 0x57, 0x0e, 0x74, 0xab, 0xda, 0xf9, 0x3f, 0x09, 0xc7, + 0xf7, 0xa0, 0x61, 0x05, 0xa0, 0xb6, 0x9e, 0x00, 0x58, 0xb8, 0xfb, 0x07, 0x07, 0xe0, 0x09, 0x8a, + 0x25, 0x8a, 0xd7, 0xff, 0xa9, 0xfa, 0xbb, 0x7f, 0xad, 0x41, 0xbb, 0x2c, 0x95, 0xae, 0x09, 0x3e, + 0xca, 0xfa, 0x70, 0xdb, 0x1e, 0xae, 0x2b, 0x12, 0x54, 0x5b, 0x92, 0xa0, 0xbb, 0xb0, 0x25, 0x78, + 0x9e, 0x86, 0x56, 0x99, 0xcc, 0x66, 0xa9, 0xc3, 0xea, 0x5f, 0xbe, 0xc3, 0x2a, 0x3f, 0x65, 0xb6, + 0xbe, 0xda, 0x4f, 0x99, 0xef, 0xc0, 0x9d, 0x05, 0x39, 0xc5, 0xcc, 0x34, 0x70, 0x66, 0xf6, 0x4a, + 0x87, 0x1d, 0x9a, 0x25, 0xa1, 0xf0, 0xa3, 0x34, 0x64, 0x37, 0x28, 0x6d, 0xa4, 0x22, 0x14, 0x17, + 0xda, 0x4a, 0x0e, 0xa0, 0xad, 0x4b, 0x40, 0x55, 0x2e, 0x18, 0x4a, 0x5b, 0xd7, 0x5b, 0x18, 0xdc, + 0x3f, 0xd7, 0xa0, 0xfe, 0x8c, 0x2b, 0xf6, 0x35, 0x7f, 0x5f, 0x8d, 0xbf, 0x36, 0x34, 0xed, 0x24, + 0xbb, 0x3f, 0x80, 0xed, 0xa5, 0xa1, 0xd6, 0x34, 0xe1, 0x2b, 0x84, 0x9c, 0x12, 0xcf, 0x6c, 0x4a, + 0xf1, 0xa8, 0x2d, 0xc4, 0xc3, 0xfd, 0xa3, 0x03, 0xed, 0xb2, 0xd3, 0xf5, 0x73, 0x5b, 0x9c, 0xde, + 0x3e, 0xb7, 0x76, 0x4b, 0xbe, 0x0b, 0xcd, 0x2c, 0x1f, 0xfb, 0xcf, 0xd9, 0xdc, 0x0e, 0xce, 0xc1, + 0x60, 0xf1, 0xa9, 0x39, 0x30, 0x9f, 0x9a, 0x83, 0xcb, 0x7c, 0x1c, 0x47, 0xc1, 0x63, 0x36, 0xf7, + 0x1a, 0x59, 0x3e, 0x7e, 0xcc, 0xe6, 0xfa, 0x33, 0x62, 0xc6, 0xcd, 0xa7, 0x1f, 0xff, 0x98, 0x09, + 0x5b, 0xb6, 0x8e, 0xb1, 0x5d, 0x6a, 0x93, 0xe6, 0xae, 0x94, 0xeb, 0x4c, 0x44, 0x5c, 0x44, 0x6a, + 0x8e, 0x55, 0x24, 0x5e, 0xa9, 0xe3, 0x97, 0xd6, 0xee, 0xfe, 0xd6, 0x81, 0x6e, 0x75, 0x30, 0xb5, + 0xbe, 0x56, 0x7e, 0x37, 0x39, 0xaf, 0xd0, 0xd7, 0x32, 0xd4, 0xab, 0x44, 0x91, 0x1f, 0x43, 0xab, + 0xf8, 0x47, 0x4b, 0x3f, 0xe6, 0xff, 0x7b, 0x86, 0x32, 0xc6, 0xfd, 0x10, 0x5a, 0xc5, 0xf7, 0xaf, + 0xae, 0x59, 0x9a, 0x27, 0x4c, 0x68, 0x08, 0x72, 0x58, 0xf7, 0x16, 0x06, 0x72, 0x04, 0x9d, 0x90, + 0xa5, 0x3c, 0x89, 0x52, 0xf4, 0xd7, 0xd0, 0x5f, 0x35, 0x9d, 0x3e, 0xfe, 0xf4, 0xc5, 0xa1, 0xf3, + 0xd9, 0x8b, 0x43, 0xe7, 0x9f, 0x2f, 0x0e, 0x9d, 0x4f, 0x5e, 0x1e, 0x6e, 0x7c, 0xf6, 0xf2, 0x70, + 0xe3, 0xef, 0x2f, 0x0f, 0x37, 0x7e, 0x31, 0x9a, 0x44, 0x6a, 0x9a, 0x8f, 0xf5, 0xd7, 0xc5, 0x90, + 0x2a, 0x9e, 0xf0, 0x94, 0xbd, 0x3d, 0xcd, 0xc7, 0xc5, 0x7a, 0x98, 0xf0, 0x30, 0x8f, 0x99, 0x1c, + 0x8e, 0xde, 0x79, 0x7b, 0x92, 0xf2, 0x07, 0x93, 0x94, 0x8f, 0x1b, 0xd8, 0xbf, 0xef, 0xfe, 0x27, + 0x00, 0x00, 0xff, 0xff, 0x3a, 0x9b, 0xbf, 0x08, 0x2c, 0x11, 0x00, 0x00, +} + +func (m *ClientState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClientState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClientState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.LcType) > 0 { + i -= len(m.LcType) + copy(dAtA[i:], m.LcType) + i = encodeVarintGno(dAtA, i, uint64(len(m.LcType))) + i-- + dAtA[i] = 0x62 + } + if m.AllowUpdateAfterMisbehaviour { + i-- + if m.AllowUpdateAfterMisbehaviour { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if m.AllowUpdateAfterExpiry { + i-- + if m.AllowUpdateAfterExpiry { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if len(m.UpgradePath) > 0 { + for iNdEx := len(m.UpgradePath) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.UpgradePath[iNdEx]) + copy(dAtA[i:], m.UpgradePath[iNdEx]) + i = encodeVarintGno(dAtA, i, uint64(len(m.UpgradePath[iNdEx]))) + i-- + dAtA[i] = 0x4a + } + } + if len(m.ProofSpecs) > 0 { + for iNdEx := len(m.ProofSpecs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ProofSpecs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + { + size, err := m.LatestHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size, err := m.FrozenHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + n3, err3 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.MaxClockDrift, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MaxClockDrift):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintGno(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x2a + n4, err4 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintGno(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x22 + n5, err5 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TrustingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TrustingPeriod):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintGno(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x1a + { + size, err := m.TrustLevel.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintGno(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConsensusState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConsensusState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsensusState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.LcType) > 0 { + i -= len(m.LcType) + copy(dAtA[i:], m.LcType) + i = encodeVarintGno(dAtA, i, uint64(len(m.LcType))) + i-- + dAtA[i] = 0x22 + } + if len(m.NextValidatorsHash) > 0 { + i -= len(m.NextValidatorsHash) + copy(dAtA[i:], m.NextValidatorsHash) + i = encodeVarintGno(dAtA, i, uint64(len(m.NextValidatorsHash))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.Root.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + n8, err8 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintGno(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Misbehaviour) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Misbehaviour) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Misbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Header2 != nil { + { + size, err := m.Header2.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Header1 != nil { + { + size, err := m.Header1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintGno(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Header) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Header) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TrustedValidators != nil { + { + size, err := m.TrustedValidators.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + { + size, err := m.TrustedHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.ValidatorSet != nil { + { + size, err := m.ValidatorSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.SignedHeader != nil { + { + size, err := m.SignedHeader.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Block) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Block) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Block) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.LastCommit != nil { + { + size, err := m.LastCommit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Data != nil { + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GnoHeader) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GnoHeader) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GnoHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ProposerAddress) > 0 { + i -= len(m.ProposerAddress) + copy(dAtA[i:], m.ProposerAddress) + i = encodeVarintGno(dAtA, i, uint64(len(m.ProposerAddress))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.LastResultsHash) > 0 { + i -= len(m.LastResultsHash) + copy(dAtA[i:], m.LastResultsHash) + i = encodeVarintGno(dAtA, i, uint64(len(m.LastResultsHash))) + i-- + dAtA[i] = 0x7a + } + if len(m.AppHash) > 0 { + i -= len(m.AppHash) + copy(dAtA[i:], m.AppHash) + i = encodeVarintGno(dAtA, i, uint64(len(m.AppHash))) + i-- + dAtA[i] = 0x72 + } + if len(m.ConsensusHash) > 0 { + i -= len(m.ConsensusHash) + copy(dAtA[i:], m.ConsensusHash) + i = encodeVarintGno(dAtA, i, uint64(len(m.ConsensusHash))) + i-- + dAtA[i] = 0x6a + } + if len(m.NextValidatorsHash) > 0 { + i -= len(m.NextValidatorsHash) + copy(dAtA[i:], m.NextValidatorsHash) + i = encodeVarintGno(dAtA, i, uint64(len(m.NextValidatorsHash))) + i-- + dAtA[i] = 0x62 + } + if len(m.ValidatorsHash) > 0 { + i -= len(m.ValidatorsHash) + copy(dAtA[i:], m.ValidatorsHash) + i = encodeVarintGno(dAtA, i, uint64(len(m.ValidatorsHash))) + i-- + dAtA[i] = 0x5a + } + if len(m.DataHash) > 0 { + i -= len(m.DataHash) + copy(dAtA[i:], m.DataHash) + i = encodeVarintGno(dAtA, i, uint64(len(m.DataHash))) + i-- + dAtA[i] = 0x52 + } + if len(m.LastCommitHash) > 0 { + i -= len(m.LastCommitHash) + copy(dAtA[i:], m.LastCommitHash) + i = encodeVarintGno(dAtA, i, uint64(len(m.LastCommitHash))) + i-- + dAtA[i] = 0x4a + } + if m.LastBlockId != nil { + { + size, err := m.LastBlockId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.AppVersion) > 0 { + i -= len(m.AppVersion) + copy(dAtA[i:], m.AppVersion) + i = encodeVarintGno(dAtA, i, uint64(len(m.AppVersion))) + i-- + dAtA[i] = 0x3a + } + if m.TotalTxs != 0 { + i = encodeVarintGno(dAtA, i, uint64((uint64(m.TotalTxs)<<1)^uint64((m.TotalTxs>>63)))) + i-- + dAtA[i] = 0x30 + } + if m.NumTxs != 0 { + i = encodeVarintGno(dAtA, i, uint64((uint64(m.NumTxs)<<1)^uint64((m.NumTxs>>63)))) + i-- + dAtA[i] = 0x28 + } + n19, err19 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) + if err19 != nil { + return 0, err19 + } + i -= n19 + i = encodeVarintGno(dAtA, i, uint64(n19)) + i-- + dAtA[i] = 0x22 + if m.Height != 0 { + i = encodeVarintGno(dAtA, i, uint64((uint64(m.Height)<<1)^uint64((m.Height>>63)))) + i-- + dAtA[i] = 0x18 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintGno(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGno(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Data) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Data) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Data) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Txs) > 0 { + for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Txs[iNdEx]) + copy(dAtA[i:], m.Txs[iNdEx]) + i = encodeVarintGno(dAtA, i, uint64(len(m.Txs[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Commit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Commit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Precommits) > 0 { + for iNdEx := len(m.Precommits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Precommits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.BlockId != nil { + { + size, err := m.BlockId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockID) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockID) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockID) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PartsHeader != nil { + { + size, err := m.PartsHeader.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintGno(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SignedHeader) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SignedHeader) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SignedHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Commit != nil { + { + size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Header != nil { + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LightBlock) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LightBlock) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LightBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ValidatorSet != nil { + { + size, err := m.ValidatorSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.SignedHeader != nil { + { + size, err := m.SignedHeader.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CommitSig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CommitSig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CommitSig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintGno(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x42 + } + if m.ValidatorIndex != 0 { + i = encodeVarintGno(dAtA, i, uint64((uint64(m.ValidatorIndex)<<1)^uint64((m.ValidatorIndex>>63)))) + i-- + dAtA[i] = 0x38 + } + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintGno(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0x32 + } + n26, err26 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp):]) + if err26 != nil { + return 0, err26 + } + i -= n26 + i = encodeVarintGno(dAtA, i, uint64(n26)) + i-- + dAtA[i] = 0x2a + if m.BlockId != nil { + { + size, err := m.BlockId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Round != 0 { + i = encodeVarintGno(dAtA, i, uint64((uint64(m.Round)<<1)^uint64((m.Round>>63)))) + i-- + dAtA[i] = 0x18 + } + if m.Height != 0 { + i = encodeVarintGno(dAtA, i, uint64((uint64(m.Height)<<1)^uint64((m.Height>>63)))) + i-- + dAtA[i] = 0x10 + } + if m.Type != 0 { + i = encodeVarintGno(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Vote) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Vote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintGno(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x42 + } + if m.ValidatorIndex != 0 { + i = encodeVarintGno(dAtA, i, uint64((uint64(m.ValidatorIndex)<<1)^uint64((m.ValidatorIndex>>63)))) + i-- + dAtA[i] = 0x38 + } + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintGno(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0x32 + } + n28, err28 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp):]) + if err28 != nil { + return 0, err28 + } + i -= n28 + i = encodeVarintGno(dAtA, i, uint64(n28)) + i-- + dAtA[i] = 0x2a + if m.BlockId != nil { + { + size, err := m.BlockId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Round != 0 { + i = encodeVarintGno(dAtA, i, uint64((uint64(m.Round)<<1)^uint64((m.Round>>63)))) + i-- + dAtA[i] = 0x18 + } + if m.Height != 0 { + i = encodeVarintGno(dAtA, i, uint64((uint64(m.Height)<<1)^uint64((m.Height>>63)))) + i-- + dAtA[i] = 0x10 + } + if m.Type != 0 { + i = encodeVarintGno(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PartSet) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PartSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PartSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *PartSetHeader) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PartSetHeader) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PartSetHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintGno(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x12 + } + if m.Total != 0 { + i = encodeVarintGno(dAtA, i, uint64((uint64(m.Total)<<1)^uint64((m.Total>>63)))) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Validator) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Validator) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposerPriority != 0 { + i = encodeVarintGno(dAtA, i, uint64((uint64(m.ProposerPriority)<<1)^uint64((m.ProposerPriority>>63)))) + i-- + dAtA[i] = 0x20 + } + if m.VotingPower != 0 { + i = encodeVarintGno(dAtA, i, uint64((uint64(m.VotingPower)<<1)^uint64((m.VotingPower>>63)))) + i-- + dAtA[i] = 0x18 + } + if m.PubKey != nil { + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintGno(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorSet) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatorSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Proposer != nil { + { + size, err := m.Proposer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGno(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Fraction) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Fraction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Fraction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Denominator != 0 { + i = encodeVarintGno(dAtA, i, uint64(m.Denominator)) + i-- + dAtA[i] = 0x10 + } + if m.Numerator != 0 { + i = encodeVarintGno(dAtA, i, uint64(m.Numerator)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintGno(dAtA []byte, offset int, v uint64) int { + offset -= sovGno(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ClientState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + l = m.TrustLevel.Size() + n += 1 + l + sovGno(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TrustingPeriod) + n += 1 + l + sovGno(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod) + n += 1 + l + sovGno(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MaxClockDrift) + n += 1 + l + sovGno(uint64(l)) + l = m.FrozenHeight.Size() + n += 1 + l + sovGno(uint64(l)) + l = m.LatestHeight.Size() + n += 1 + l + sovGno(uint64(l)) + if len(m.ProofSpecs) > 0 { + for _, e := range m.ProofSpecs { + l = e.Size() + n += 1 + l + sovGno(uint64(l)) + } + } + if len(m.UpgradePath) > 0 { + for _, s := range m.UpgradePath { + l = len(s) + n += 1 + l + sovGno(uint64(l)) + } + } + if m.AllowUpdateAfterExpiry { + n += 2 + } + if m.AllowUpdateAfterMisbehaviour { + n += 2 + } + l = len(m.LcType) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + return n +} + +func (m *ConsensusState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp) + n += 1 + l + sovGno(uint64(l)) + l = m.Root.Size() + n += 1 + l + sovGno(uint64(l)) + l = len(m.NextValidatorsHash) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + l = len(m.LcType) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + return n +} + +func (m *Misbehaviour) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + if m.Header1 != nil { + l = m.Header1.Size() + n += 1 + l + sovGno(uint64(l)) + } + if m.Header2 != nil { + l = m.Header2.Size() + n += 1 + l + sovGno(uint64(l)) + } + return n +} + +func (m *Header) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SignedHeader != nil { + l = m.SignedHeader.Size() + n += 1 + l + sovGno(uint64(l)) + } + if m.ValidatorSet != nil { + l = m.ValidatorSet.Size() + n += 1 + l + sovGno(uint64(l)) + } + l = m.TrustedHeight.Size() + n += 1 + l + sovGno(uint64(l)) + if m.TrustedValidators != nil { + l = m.TrustedValidators.Size() + n += 1 + l + sovGno(uint64(l)) + } + return n +} + +func (m *Block) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovGno(uint64(l)) + } + if m.Data != nil { + l = m.Data.Size() + n += 1 + l + sovGno(uint64(l)) + } + if m.LastCommit != nil { + l = m.LastCommit.Size() + n += 1 + l + sovGno(uint64(l)) + } + return n +} + +func (m *GnoHeader) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Version) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + if m.Height != 0 { + n += 1 + sozGno(uint64(m.Height)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) + n += 1 + l + sovGno(uint64(l)) + if m.NumTxs != 0 { + n += 1 + sozGno(uint64(m.NumTxs)) + } + if m.TotalTxs != 0 { + n += 1 + sozGno(uint64(m.TotalTxs)) + } + l = len(m.AppVersion) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + if m.LastBlockId != nil { + l = m.LastBlockId.Size() + n += 1 + l + sovGno(uint64(l)) + } + l = len(m.LastCommitHash) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + l = len(m.DataHash) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + l = len(m.ValidatorsHash) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + l = len(m.NextValidatorsHash) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + l = len(m.ConsensusHash) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + l = len(m.AppHash) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + l = len(m.LastResultsHash) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + l = len(m.ProposerAddress) + if l > 0 { + n += 2 + l + sovGno(uint64(l)) + } + return n +} + +func (m *Data) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Txs) > 0 { + for _, b := range m.Txs { + l = len(b) + n += 1 + l + sovGno(uint64(l)) + } + } + return n +} + +func (m *Commit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockId != nil { + l = m.BlockId.Size() + n += 1 + l + sovGno(uint64(l)) + } + if len(m.Precommits) > 0 { + for _, e := range m.Precommits { + l = e.Size() + n += 1 + l + sovGno(uint64(l)) + } + } + return n +} + +func (m *BlockID) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + if m.PartsHeader != nil { + l = m.PartsHeader.Size() + n += 1 + l + sovGno(uint64(l)) + } + return n +} + +func (m *SignedHeader) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovGno(uint64(l)) + } + if m.Commit != nil { + l = m.Commit.Size() + n += 1 + l + sovGno(uint64(l)) + } + return n +} + +func (m *LightBlock) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SignedHeader != nil { + l = m.SignedHeader.Size() + n += 1 + l + sovGno(uint64(l)) + } + if m.ValidatorSet != nil { + l = m.ValidatorSet.Size() + n += 1 + l + sovGno(uint64(l)) + } + return n +} + +func (m *CommitSig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovGno(uint64(m.Type)) + } + if m.Height != 0 { + n += 1 + sozGno(uint64(m.Height)) + } + if m.Round != 0 { + n += 1 + sozGno(uint64(m.Round)) + } + if m.BlockId != nil { + l = m.BlockId.Size() + n += 1 + l + sovGno(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp) + n += 1 + l + sovGno(uint64(l)) + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + if m.ValidatorIndex != 0 { + n += 1 + sozGno(uint64(m.ValidatorIndex)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + return n +} + +func (m *Vote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovGno(uint64(m.Type)) + } + if m.Height != 0 { + n += 1 + sozGno(uint64(m.Height)) + } + if m.Round != 0 { + n += 1 + sozGno(uint64(m.Round)) + } + if m.BlockId != nil { + l = m.BlockId.Size() + n += 1 + l + sovGno(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp) + n += 1 + l + sovGno(uint64(l)) + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + if m.ValidatorIndex != 0 { + n += 1 + sozGno(uint64(m.ValidatorIndex)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + return n +} + +func (m *PartSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *PartSetHeader) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Total != 0 { + n += 1 + sozGno(uint64(m.Total)) + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + return n +} + +func (m *Validator) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovGno(uint64(l)) + } + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovGno(uint64(l)) + } + if m.VotingPower != 0 { + n += 1 + sozGno(uint64(m.VotingPower)) + } + if m.ProposerPriority != 0 { + n += 1 + sozGno(uint64(m.ProposerPriority)) + } + return n +} + +func (m *ValidatorSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Validators) > 0 { + for _, e := range m.Validators { + l = e.Size() + n += 1 + l + sovGno(uint64(l)) + } + } + if m.Proposer != nil { + l = m.Proposer.Size() + n += 1 + l + sovGno(uint64(l)) + } + return n +} + +func (m *Fraction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Numerator != 0 { + n += 1 + sovGno(uint64(m.Numerator)) + } + if m.Denominator != 0 { + n += 1 + sovGno(uint64(m.Denominator)) + } + return n +} + +func sovGno(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGno(x uint64) (n int) { + return sovGno(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ClientState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClientState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClientState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TrustLevel", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TrustLevel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TrustingPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.TrustingPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.UnbondingPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxClockDrift", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.MaxClockDrift, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FrozenHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FrozenHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LatestHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofSpecs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofSpecs = append(m.ProofSpecs, &_go.ProofSpec{}) + if err := m.ProofSpecs[len(m.ProofSpecs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UpgradePath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UpgradePath = append(m.UpgradePath, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowUpdateAfterExpiry", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowUpdateAfterExpiry = bool(v != 0) + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowUpdateAfterMisbehaviour", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowUpdateAfterMisbehaviour = bool(v != 0) + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LcType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LcType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConsensusState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConsensusState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsensusState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Root", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Root.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) + if m.NextValidatorsHash == nil { + m.NextValidatorsHash = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LcType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LcType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Misbehaviour) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Misbehaviour: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Misbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header1 == nil { + m.Header1 = &Header{} + } + if err := m.Header1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header2", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header2 == nil { + m.Header2 = &Header{} + } + if err := m.Header2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Header) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Header: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SignedHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SignedHeader == nil { + m.SignedHeader = &SignedHeader{} + } + if err := m.SignedHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorSet == nil { + m.ValidatorSet = &ValidatorSet{} + } + if err := m.ValidatorSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TrustedHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TrustedHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TrustedValidators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TrustedValidators == nil { + m.TrustedValidators = &ValidatorSet{} + } + if err := m.TrustedValidators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Block) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Block: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Block: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &GnoHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Data == nil { + m.Data = &Data{} + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastCommit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LastCommit == nil { + m.LastCommit = &Commit{} + } + if err := m.LastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GnoHeader) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GnoHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GnoHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.Height = int64(v) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumTxs", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.NumTxs = int64(v) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalTxs", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.TotalTxs = int64(v) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastBlockId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LastBlockId == nil { + m.LastBlockId = &BlockID{} + } + if err := m.LastBlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastCommitHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LastCommitHash = append(m.LastCommitHash[:0], dAtA[iNdEx:postIndex]...) + if m.LastCommitHash == nil { + m.LastCommitHash = []byte{} + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataHash = append(m.DataHash[:0], dAtA[iNdEx:postIndex]...) + if m.DataHash == nil { + m.DataHash = []byte{} + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorsHash = append(m.ValidatorsHash[:0], dAtA[iNdEx:postIndex]...) + if m.ValidatorsHash == nil { + m.ValidatorsHash = []byte{} + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) + if m.NextValidatorsHash == nil { + m.NextValidatorsHash = []byte{} + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsensusHash = append(m.ConsensusHash[:0], dAtA[iNdEx:postIndex]...) + if m.ConsensusHash == nil { + m.ConsensusHash = []byte{} + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) + if m.AppHash == nil { + m.AppHash = []byte{} + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastResultsHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LastResultsHash = append(m.LastResultsHash[:0], dAtA[iNdEx:postIndex]...) + if m.LastResultsHash == nil { + m.LastResultsHash = []byte{} + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Data) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Data: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Data: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) + copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Commit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Commit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Commit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockId == nil { + m.BlockId = &BlockID{} + } + if err := m.BlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Precommits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Precommits = append(m.Precommits, &CommitSig{}) + if err := m.Precommits[len(m.Precommits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockID) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockID: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockID: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PartsHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PartsHeader == nil { + m.PartsHeader = &PartSetHeader{} + } + if err := m.PartsHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SignedHeader) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SignedHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SignedHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &GnoHeader{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Commit == nil { + m.Commit = &Commit{} + } + if err := m.Commit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LightBlock) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LightBlock: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LightBlock: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SignedHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SignedHeader == nil { + m.SignedHeader = &SignedHeader{} + } + if err := m.SignedHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ValidatorSet == nil { + m.ValidatorSet = &ValidatorSet{} + } + if err := m.ValidatorSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CommitSig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CommitSig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CommitSig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.Height = int64(v) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.Round = int64(v) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockId == nil { + m.BlockId = &BlockID{} + } + if err := m.BlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorIndex", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.ValidatorIndex = int64(v) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Vote) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Vote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.Height = int64(v) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.Round = int64(v) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockId == nil { + m.BlockId = &BlockID{} + } + if err := m.BlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorIndex", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.ValidatorIndex = int64(v) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PartSet) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PartSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PartSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PartSetHeader) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PartSetHeader: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PartSetHeader: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.Total = int64(v) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Validator) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Validator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Validator: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PubKey == nil { + m.PubKey = &crypto.PublicKey{} + } + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.VotingPower = int64(v) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerPriority", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + v = (v >> 1) ^ uint64((int64(v&1)<<63)>>63) + m.ProposerPriority = int64(v) + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorSet) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidatorSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validators = append(m.Validators, &Validator{}) + if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGno + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGno + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proposer == nil { + m.Proposer = &Validator{} + } + if err := m.Proposer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Fraction) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Fraction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Fraction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Numerator", wireType) + } + m.Numerator = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Numerator |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Denominator", wireType) + } + m.Denominator = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGno + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Denominator |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGno(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGno + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGno(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGno + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGno + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGno + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGno + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGno + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGno + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGno = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGno = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGno = fmt.Errorf("proto: unexpected end of group") +) diff --git a/modules/10-gno/gno_test.go b/modules/10-gno/gno_test.go new file mode 100644 index 000000000..719a48fbe --- /dev/null +++ b/modules/10-gno/gno_test.go @@ -0,0 +1,115 @@ +package gno_test + +import ( + "testing" + "time" + + testifysuite "github.com/stretchr/testify/suite" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + cmtbytes "github.com/cometbft/cometbft/libs/bytes" + cmttypes "github.com/cometbft/cometbft/types" + + ibcgno "github.com/atomone-hub/atomone/modules/10-gno" + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + ibctesting "github.com/cosmos/ibc-go/v10/testing" + "github.com/cosmos/ibc-go/v10/testing/simapp" +) + +const ( + chainID = "gaia" + chainIDRevision0 = "gaia-revision-0" + chainIDRevision1 = "gaia-revision-1" + clientID = "gaiamainnet" + trustingPeriod time.Duration = time.Hour * 24 * 7 * 2 + ubdPeriod time.Duration = time.Hour * 24 * 7 * 3 + maxClockDrift time.Duration = time.Second * 10 +) + +var ( + height = clienttypes.NewHeight(0, 4) + newClientHeight = clienttypes.NewHeight(1, 1) + upgradePath = []string{"upgrade", "upgradedIBCState"} + invalidUpgradePath = []string{"upgrade", ""} +) + +type GnoTestSuite struct { + testifysuite.Suite + + coordinator *ibctesting.Coordinator + + // testing chains used for convenience and readability + chainA *ibctesting.TestChain + chainB *ibctesting.TestChain + + // TODO: deprecate usage in favor of testing package + ctx sdk.Context + cdc codec.Codec + privVal cmttypes.PrivValidator + valSet *cmttypes.ValidatorSet + signers map[string]cmttypes.PrivValidator + valsHash cmtbytes.HexBytes + header *ibcgno.Header + now time.Time + headerTime time.Time + clientTime time.Time +} + +func TestGnoTestSuite(t *testing.T) { + testifysuite.Run(t, new(GnoTestSuite)) +} + +func (s *GnoTestSuite) SetupTest() { + s.coordinator = ibctesting.NewCoordinator(s.T(), 2) + s.chainA = s.coordinator.GetChain(ibctesting.GetChainID(1)) + s.chainB = s.coordinator.GetChain(ibctesting.GetChainID(2)) + // commit some blocks so that QueryProof returns valid proof (cannot return valid query if height <= 1) + s.coordinator.CommitNBlocks(s.chainA, 2) + s.coordinator.CommitNBlocks(s.chainB, 2) + + // TODO: deprecate usage in favor of testing package + checkTx := false + app := simapp.Setup(s.T(), checkTx) + + s.cdc = app.AppCodec() + + // now is the time of the current chain, must be after the updating header + // mocks ctx.BlockTime() + s.now = time.Date(2020, 1, 2, 0, 0, 0, 0, time.UTC) + s.clientTime = time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC) + // Header time is intended to be time for any new header used for updates + s.headerTime = time.Date(2020, 1, 2, 0, 0, 0, 0, time.UTC) + + s.privVal = cmttypes.NewMockPV() + + pubKey, err := s.privVal.GetPubKey() + s.Require().NoError(err) + + heightMinus1 := clienttypes.NewHeight(0, height.RevisionHeight-1) + + val := cmttypes.NewValidator(pubKey, 10) + s.signers = make(map[string]cmttypes.PrivValidator) + s.signers[val.Address.String()] = s.privVal + s.valSet = cmttypes.NewValidatorSet([]*cmttypes.Validator{val}) + s.valsHash = s.valSet.Hash() + s.header = s.chainA.CreateTMClientHeader(chainID, int64(height.RevisionHeight), heightMinus1, s.now, s.valSet, s.valSet, s.valSet, s.signers) + s.ctx = app.NewContext(checkTx) +} + +func getAltSigners(altVal *cmttypes.Validator, altPrivVal cmttypes.PrivValidator) map[string]cmttypes.PrivValidator { + return map[string]cmttypes.PrivValidator{altVal.Address.String(): altPrivVal} +} + +func getBothSigners(s *GnoTestSuite, altVal *cmttypes.Validator, altPrivVal cmttypes.PrivValidator) (*cmttypes.ValidatorSet, map[string]cmttypes.PrivValidator) { + // Create bothValSet with both suite validator and altVal. Would be valid update + bothValSet := cmttypes.NewValidatorSet(append(s.valSet.Validators, altVal)) + // Create signer array and ensure it is in same order as bothValSet + _, suiteVal := s.valSet.GetByIndex(0) + bothSigners := map[string]cmttypes.PrivValidator{ + suiteVal.Address.String(): s.privVal, + altVal.Address.String(): altPrivVal, + } + return bothValSet, bothSigners +} diff --git a/modules/10-gno/header.go b/modules/10-gno/header.go new file mode 100644 index 000000000..4805626b0 --- /dev/null +++ b/modules/10-gno/header.go @@ -0,0 +1,150 @@ +package gno + +import ( + "bytes" + "encoding/hex" + "errors" + "time" + + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v10/modules/core/23-commitment/types" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + bfttypes "github.com/gnolang/gno/tm2/pkg/bft/types" + "github.com/gnolang/gno/tm2/pkg/crypto" + "github.com/gnolang/gno/tm2/pkg/crypto/ed25519" + + errorsmod "cosmossdk.io/errors" +) + +var _ exported.ClientMessage = (*Header)(nil) + +func hexDec(s string) []byte { + b, err := hex.DecodeString(s) + if err != nil { + panic(err) + } + return b +} + +// ConsensusState returns the updated consensus state associated with the header +func (h Header) ConsensusState() *ConsensusState { + return &ConsensusState{ + Timestamp: h.GetTime(), + Root: commitmenttypes.NewMerkleRoot(h.SignedHeader.Header.AppHash), + NextValidatorsHash: h.SignedHeader.Header.NextValidatorsHash, + } +} + +// ClientType defines that the Header is a Gno consensus algorithm +func (Header) ClientType() string { + return Gno +} + +// GetHeight returns the current height. It returns 0 if the gno +// header is nil. +// NOTE: the header.Header is checked to be non nil in ValidateBasic. +func (h Header) GetHeight() exported.Height { + revision := clienttypes.ParseChainID(h.SignedHeader.Header.ChainId) + return clienttypes.NewHeight(revision, uint64(h.SignedHeader.Header.Height)) +} + +// GetTime returns the current block timestamp. It returns a zero time if +// the gno header is nil. +// NOTE: the header.Header is checked to be non nil in ValidateBasic. +func (h Header) GetTime() time.Time { + return h.SignedHeader.Header.Time +} + +// ValidateBasic calls the SignedHeader ValidateBasic function and checks +// that validatorsets are not nil. +// NOTE: TrustedHeight and TrustedValidators may be empty when creating client +// with MsgCreateClient +func (h Header) ValidateBasic() error { + if h.SignedHeader == nil { + return errorsmod.Wrap(clienttypes.ErrInvalidHeader, "gno signed header cannot be nil") + } + // SignedHeader ValidateBasic() checks that Header and Commit are not nil + if h.SignedHeader.Header == nil { + return errorsmod.Wrap(clienttypes.ErrInvalidHeader, "gno header cannot be nil") + } + if h.SignedHeader.Commit == nil { + return errorsmod.Wrap(errors.New("missing commit"), "gno commit cannot be nil") + } + // GnoHeader ValidateBasic() + gnoHeader := bfttypes.Header{ + Version: h.SignedHeader.Header.Version, + ChainID: h.SignedHeader.Header.ChainId, + Height: h.SignedHeader.Header.Height, + Time: h.SignedHeader.Header.Time, + NumTxs: h.SignedHeader.Header.NumTxs, + TotalTxs: h.SignedHeader.Header.TotalTxs, + LastBlockID: bfttypes.BlockID{Hash: h.SignedHeader.Header.LastBlockId.Hash, PartsHeader: bfttypes.PartSetHeader{Total: int(h.SignedHeader.Header.LastBlockId.PartsHeader.Total), Hash: h.SignedHeader.Header.LastBlockId.PartsHeader.Hash}}, + LastCommitHash: h.SignedHeader.Header.LastCommitHash, + DataHash: h.SignedHeader.Header.DataHash, + ValidatorsHash: h.SignedHeader.Header.ValidatorsHash, + NextValidatorsHash: h.SignedHeader.Header.NextValidatorsHash, + ConsensusHash: h.SignedHeader.Header.ConsensusHash, + AppHash: h.SignedHeader.Header.AppHash, + LastResultsHash: h.SignedHeader.Header.LastResultsHash, + ProposerAddress: crypto.MustAddressFromString(h.SignedHeader.Header.ProposerAddress), + } + gnoCommit := bfttypes.Commit{ + BlockID: bfttypes.BlockID{Hash: h.SignedHeader.Commit.BlockId.Hash, PartsHeader: bfttypes.PartSetHeader{Total: int(h.SignedHeader.Commit.BlockId.PartsHeader.Total), Hash: h.SignedHeader.Commit.BlockId.PartsHeader.Hash}}, + Precommits: make([]*bfttypes.CommitSig, len(h.SignedHeader.Commit.Precommits)), + } + for i, sig := range h.SignedHeader.Commit.Precommits { + if sig == nil { + continue + } + gnoCommit.Precommits[i] = &bfttypes.CommitSig{ + ValidatorIndex: int(sig.ValidatorIndex), + Signature: sig.Signature, + BlockID: bfttypes.BlockID{Hash: sig.BlockId.Hash, PartsHeader: bfttypes.PartSetHeader{Total: int(sig.BlockId.PartsHeader.Total), Hash: sig.BlockId.PartsHeader.Hash}}, + Type: bfttypes.SignedMsgType(sig.Type), + Height: sig.Height, + Round: int(sig.Round), + Timestamp: sig.Timestamp, + ValidatorAddress: crypto.MustAddressFromString(sig.ValidatorAddress), + } + } + gnoSignedHeader := bfttypes.SignedHeader{ + Header: &gnoHeader, + Commit: &gnoCommit, + } + // NOTE: SignedHeader ValidateBasic checks + if err := gnoSignedHeader.ValidateBasic(h.SignedHeader.Header.ChainId); err != nil { + return errorsmod.Wrap(err, "header failed basic validation") + } + + // TrustedHeight is less than Header for updates and misbehaviour + if h.TrustedHeight.GTE(h.GetHeight()) { + return errorsmod.Wrapf(ErrInvalidHeaderHeight, "TrustedHeight %d must be less than header height %d", + h.TrustedHeight, h.GetHeight()) + } + + if h.ValidatorSet == nil { + return errorsmod.Wrap(clienttypes.ErrInvalidHeader, "validator set is nil") + } + gnoValset := bfttypes.ValidatorSet{ + Validators: make([]*bfttypes.Validator, len(h.ValidatorSet.Validators)), + Proposer: nil, + } + for i, val := range h.ValidatorSet.Validators { + key := val.PubKey + if (key.GetEd25519()) == nil { + return errorsmod.Wrap(clienttypes.ErrInvalidHeader, "validator pubkey is not ed25519") + } + gnoValset.Validators[i] = &bfttypes.Validator{ + Address: crypto.MustAddressFromString(val.Address), + PubKey: ed25519.PubKeyEd25519(key.GetEd25519()), + VotingPower: val.VotingPower, + ProposerPriority: val.ProposerPriority, + } + } + gnoValset.TotalVotingPower() // ensure TotalVotingPower is set + + if !bytes.Equal(h.SignedHeader.Header.ValidatorsHash, gnoValset.Hash()) { + return errorsmod.Wrap(clienttypes.ErrInvalidHeader, "validator set does not match hash") + } + return nil +} diff --git a/modules/10-gno/header_test.go b/modules/10-gno/header_test.go new file mode 100644 index 000000000..ce5099b99 --- /dev/null +++ b/modules/10-gno/header_test.go @@ -0,0 +1,75 @@ +package gno_test + +import ( + "time" +) + +func (suite *GnoTestSuite) TestGetHeight() { + header := suite.chainA.LatestCommittedHeader + suite.Require().NotEqual(uint64(0), header.GetHeight()) +} + +func (suite *GnoTestSuite) TestGetTime() { + header := suite.chainA.LatestCommittedHeader + suite.Require().NotEqual(time.Time{}, header.GetTime()) +} + +/* +TODO: Fix gno specific tests +func (suite *GnoTestSuite) TestHeaderValidateBasic() { + var header *ibcgno.Header + testCases := []struct { + name string + malleate func() + expErr error + }{ + {"valid header", func() {}, nil}, + {"header is nil", func() { + header.SignedHeader.Header = nil + }, errors.New("gno header cannot be nil")}, + {"signed header is nil", func() { + header.SignedHeader = nil + }, errors.New("gno signed header cannot be nil")}, + {"signed header failed gno ValidateBasic", func() { + header = suite.chainA.LatestCommittedHeader + header.SignedHeader.Commit = nil + }, errors.New("header failed basic validation")}, + {"trusted height is equal to header height", func() { + var ok bool + header.TrustedHeight, ok = header.GetHeight().(clienttypes.Height) + suite.Require().True(ok) + }, errors.New("invalid header height")}, + {"validator set nil", func() { + header.ValidatorSet = nil + }, errors.New("invalid client header")}, + {"ValidatorSetFromProto failed", func() { + header.ValidatorSet.Validators[0].PubKey = cmtprotocrypto.PublicKey{} + }, errors.New("validator set is not tendermint validator set")}, + {"header validator hash does not equal hash of validator set", func() { + // use chainB's randomly generated validator set + header.ValidatorSet = suite.chainB.LatestCommittedHeader.ValidatorSet + }, errors.New("validator set does not match hash")}, + } + + suite.Require().Equal(exported.Tendermint, suite.header.ClientType()) + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() + + header = suite.chainA.LatestCommittedHeader // must be explicitly changed in malleate + + tc.malleate() + + err := header.ValidateBasic() + + if tc.expErr == nil { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.expErr.Error()) + } + }) + } +} +*/ diff --git a/modules/10-gno/keys.go b/modules/10-gno/keys.go new file mode 100644 index 000000000..9c752d202 --- /dev/null +++ b/modules/10-gno/keys.go @@ -0,0 +1,6 @@ +/* DONE */ +package gno + +const ( + ModuleName = "10-gno" +) diff --git a/modules/10-gno/light_client_module.go b/modules/10-gno/light_client_module.go new file mode 100644 index 000000000..ca9b37a74 --- /dev/null +++ b/modules/10-gno/light_client_module.go @@ -0,0 +1,240 @@ +package gno + +import ( + "fmt" + + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + ibcerrors "github.com/cosmos/ibc-go/v10/modules/core/errors" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + + errorsmod "cosmossdk.io/errors" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ exported.LightClientModule = (*LightClientModule)(nil) + +// LightClientModule implements the core IBC api.LightClientModule interface. +type LightClientModule struct { + cdc codec.BinaryCodec + storeProvider clienttypes.StoreProvider +} + +// NewLightClientModule creates and returns a new 10-gno LightClientModule. +func NewLightClientModule(cdc codec.BinaryCodec, storeProvider clienttypes.StoreProvider) LightClientModule { + return LightClientModule{ + cdc: cdc, + storeProvider: storeProvider, + } +} + +// Initialize unmarshals the provided client and consensus states and performs basic validation. It calls into the +// clientState.initialize method. +func (l LightClientModule) Initialize(ctx sdk.Context, clientID string, clientStateBz, consensusStateBz []byte) error { + var clientState ClientState + if err := l.cdc.Unmarshal(clientStateBz, &clientState); err != nil { + return fmt.Errorf("failed to unmarshal client state bytes into client state: %w", err) + } + + if err := clientState.Validate(); err != nil { + return err + } + + var consensusState ConsensusState + if err := l.cdc.Unmarshal(consensusStateBz, &consensusState); err != nil { + return fmt.Errorf("failed to unmarshal consensus state bytes into consensus state: %w", err) + } + + if err := consensusState.ValidateBasic(); err != nil { + return err + } + + clientStore := l.storeProvider.ClientStore(ctx, clientID) + + return clientState.initialize(ctx, l.cdc, clientStore, &consensusState) +} + +// VerifyClientMessage obtains the client state associated with the client identifier and calls into the clientState.VerifyClientMessage method. +func (l LightClientModule) VerifyClientMessage(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) error { + clientStore := l.storeProvider.ClientStore(ctx, clientID) + clientState, found := getClientState(clientStore, l.cdc) + if !found { + return errorsmod.Wrap(clienttypes.ErrClientNotFound, clientID) + } + + return clientState.VerifyClientMessage(ctx, l.cdc, clientStore, clientMsg) +} + +// CheckForMisbehaviour obtains the client state associated with the client identifier and calls into the clientState.CheckForMisbehaviour method. +func (l LightClientModule) CheckForMisbehaviour(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) bool { + clientStore := l.storeProvider.ClientStore(ctx, clientID) + clientState, found := getClientState(clientStore, l.cdc) + if !found { + panic(errorsmod.Wrap(clienttypes.ErrClientNotFound, clientID)) + } + + return clientState.CheckForMisbehaviour(ctx, l.cdc, clientStore, clientMsg) +} + +// UpdateStateOnMisbehaviour obtains the client state associated with the client identifier and calls into the clientState.UpdateStateOnMisbehaviour method. +func (l LightClientModule) UpdateStateOnMisbehaviour(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) { + clientStore := l.storeProvider.ClientStore(ctx, clientID) + clientState, found := getClientState(clientStore, l.cdc) + if !found { + panic(errorsmod.Wrap(clienttypes.ErrClientNotFound, clientID)) + } + + clientState.UpdateStateOnMisbehaviour(ctx, l.cdc, clientStore, clientMsg) +} + +// UpdateState obtains the client state associated with the client identifier and calls into the clientState.UpdateState method. +func (l LightClientModule) UpdateState(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) []exported.Height { + clientStore := l.storeProvider.ClientStore(ctx, clientID) + clientState, found := getClientState(clientStore, l.cdc) + if !found { + panic(errorsmod.Wrap(clienttypes.ErrClientNotFound, clientID)) + } + + return clientState.UpdateState(ctx, l.cdc, clientStore, clientMsg) +} + +// VerifyMembership obtains the client state associated with the client identifier and calls into the clientState.verifyMembership method. +func (l LightClientModule) VerifyMembership( + ctx sdk.Context, + clientID string, + height exported.Height, + delayTimePeriod uint64, + delayBlockPeriod uint64, + proof []byte, + path exported.Path, + value []byte, +) error { + clientStore := l.storeProvider.ClientStore(ctx, clientID) + clientState, found := getClientState(clientStore, l.cdc) + if !found { + return errorsmod.Wrap(clienttypes.ErrClientNotFound, clientID) + } + + return clientState.verifyMembership(ctx, clientStore, l.cdc, height, delayTimePeriod, delayBlockPeriod, proof, path, value) +} + +// VerifyNonMembership obtains the client state associated with the client identifier and calls into the clientState.verifyNonMembership method. +func (l LightClientModule) VerifyNonMembership( + ctx sdk.Context, + clientID string, + height exported.Height, + delayTimePeriod uint64, + delayBlockPeriod uint64, + proof []byte, + path exported.Path, +) error { + clientStore := l.storeProvider.ClientStore(ctx, clientID) + clientState, found := getClientState(clientStore, l.cdc) + if !found { + return errorsmod.Wrap(clienttypes.ErrClientNotFound, clientID) + } + + return clientState.verifyNonMembership(ctx, clientStore, l.cdc, height, delayTimePeriod, delayBlockPeriod, proof, path) +} + +// Status obtains the client state associated with the client identifier and calls into the clientState.status method. +func (l LightClientModule) Status(ctx sdk.Context, clientID string) exported.Status { + clientStore := l.storeProvider.ClientStore(ctx, clientID) + clientState, found := getClientState(clientStore, l.cdc) + if !found { + return exported.Unknown + } + + return clientState.status(ctx, clientStore, l.cdc) +} + +// LatestHeight returns the latest height for the client state for the given client identifier. +// If no client is present for the provided client identifier a zero value height is returned. +func (l LightClientModule) LatestHeight(ctx sdk.Context, clientID string) exported.Height { + clientStore := l.storeProvider.ClientStore(ctx, clientID) + clientState, found := getClientState(clientStore, l.cdc) + if !found { + return clienttypes.ZeroHeight() + } + + return clientState.LatestHeight +} + +// TimestampAtHeight obtains the client state associated with the client identifier and calls into the clientState.getTimestampAtHeight method. +func (l LightClientModule) TimestampAtHeight( + ctx sdk.Context, + clientID string, + height exported.Height, +) (uint64, error) { + clientStore := l.storeProvider.ClientStore(ctx, clientID) + clientState, found := getClientState(clientStore, l.cdc) + if !found { + return 0, errorsmod.Wrap(clienttypes.ErrClientNotFound, clientID) + } + + return clientState.getTimestampAtHeight(clientStore, l.cdc, height) +} + +// RecoverClient asserts that the substitute client is a gno client. It obtains the client state associated with the +// subject client and calls into the subjectClientState.CheckSubstituteAndUpdateState method. +func (l LightClientModule) RecoverClient(ctx sdk.Context, clientID, substituteClientID string) error { + substituteClientType, _, err := clienttypes.ParseClientIdentifier(substituteClientID) + if err != nil { + return err + } + + if substituteClientType != Gno { + return errorsmod.Wrapf(clienttypes.ErrInvalidClientType, "expected: %s, got: %s", Gno, substituteClientType) + } + + clientStore := l.storeProvider.ClientStore(ctx, clientID) + clientState, found := getClientState(clientStore, l.cdc) + if !found { + return errorsmod.Wrap(clienttypes.ErrClientNotFound, clientID) + } + + substituteClientStore := l.storeProvider.ClientStore(ctx, substituteClientID) + substituteClient, found := getClientState(substituteClientStore, l.cdc) + if !found { + return errorsmod.Wrap(clienttypes.ErrClientNotFound, substituteClientID) + } + + return clientState.CheckSubstituteAndUpdateState(ctx, l.cdc, clientStore, substituteClientStore, substituteClient) +} + +// VerifyUpgradeAndUpdateState obtains the client state associated with the client identifier and calls into the clientState.VerifyUpgradeAndUpdateState method. +// The new client and consensus states will be unmarshaled and an error is returned if the new client state is not at a height greater +// than the existing client. +func (l LightClientModule) VerifyUpgradeAndUpdateState( + ctx sdk.Context, + clientID string, + newClient []byte, + newConsState []byte, + upgradeClientProof, + upgradeConsensusStateProof []byte, +) error { + var newClientState ClientState + if err := l.cdc.Unmarshal(newClient, &newClientState); err != nil { + return errorsmod.Wrap(clienttypes.ErrInvalidClient, err.Error()) + } + + var newConsensusState ConsensusState + if err := l.cdc.Unmarshal(newConsState, &newConsensusState); err != nil { + return errorsmod.Wrap(clienttypes.ErrInvalidConsensus, err.Error()) + } + + clientStore := l.storeProvider.ClientStore(ctx, clientID) + clientState, found := getClientState(clientStore, l.cdc) + if !found { + return errorsmod.Wrap(clienttypes.ErrClientNotFound, clientID) + } + + // last height of current counterparty chain must be client's latest height + lastHeight := clientState.LatestHeight + if !newClientState.LatestHeight.GT(lastHeight) { + return errorsmod.Wrapf(ibcerrors.ErrInvalidHeight, "upgraded client height %s must be at greater than current client height %s", newClientState.LatestHeight, lastHeight) + } + + return clientState.VerifyUpgradeAndUpdateState(ctx, l.cdc, clientStore, &newClientState, &newConsensusState, upgradeClientProof, upgradeConsensusStateProof) +} diff --git a/modules/10-gno/light_client_module_test.go b/modules/10-gno/light_client_module_test.go new file mode 100644 index 000000000..d441f39a7 --- /dev/null +++ b/modules/10-gno/light_client_module_test.go @@ -0,0 +1,1187 @@ +package gno_test + +import ( + "crypto/sha256" + "errors" + "time" + + errorsmod "cosmossdk.io/errors" + upgradetypes "cosmossdk.io/x/upgrade/types" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + + ibcgno "github.com/atomone-hub/atomone/modules/10-gno" + transfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v10/modules/core/04-channel/types" + commitmenttypes "github.com/cosmos/ibc-go/v10/modules/core/23-commitment/types" + host "github.com/cosmos/ibc-go/v10/modules/core/24-host" + ibcerrors "github.com/cosmos/ibc-go/v10/modules/core/errors" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + ibctesting "github.com/cosmos/ibc-go/v10/testing" + ibcmock "github.com/cosmos/ibc-go/v10/testing/mock" +) + +var ( + tmClientID = clienttypes.FormatClientIdentifier(ibcgno.Gno, 100) + solomachineClientID = clienttypes.FormatClientIdentifier(exported.Solomachine, 0) +) + +func (suite *GnoTestSuite) TestInitialize() { + var consensusState exported.ConsensusState + var clientState exported.ClientState + + testCases := []struct { + name string + malleate func() + expErr error + }{ + { + "valid consensus & client states", + func() {}, + nil, + }, + { + "invalid client state", + func() { + clientState.(*ibcgno.ClientState).ChainId = "" + }, + ibcgno.ErrInvalidChainID, + }, + { + "invalid client state: solomachine client state", + func() { + clientState = ibctesting.NewSolomachine(suite.T(), suite.chainA.Codec, "solomachine", "", 2).ClientState() + }, + errors.New("failed to unmarshal client state bytes into client state"), + }, + { + "invalid consensus: consensus state is solomachine consensus", + func() { + consensusState = ibctesting.NewSolomachine(suite.T(), suite.chainA.Codec, "solomachine", "", 2).ConsensusState() + }, + errors.New("failed to unmarshal consensus state bytes into consensus state"), + }, + { + "invalid consensus state", + func() { + consensusState = ibcgno.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte(ibcgno.SentinelRoot)), []byte("invalidNextValsHash")) + }, + errors.New("next validators hash is invalid"), + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() + path := ibctesting.NewPath(suite.chainA, suite.chainB) + + gnoConfig, ok := path.EndpointA.ClientConfig.(*GnoConfig) + suite.Require().True(ok) + + clientState = ibcgno.NewClientState( + path.EndpointA.Chain.ChainID, + gnoConfig.TrustLevel, gnoConfig.TrustingPeriod, gnoConfig.UnbondingPeriod, gnoConfig.MaxClockDrift, + suite.chainA.LatestCommittedHeader.GetHeight().(clienttypes.Height), commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, + ) + + consensusState = ibcgno.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte(ibcgno.SentinelRoot)), suite.chainA.ProposedHeader.ValidatorsHash) + + clientID := suite.chainA.App.GetIBCKeeper().ClientKeeper.GenerateClientIdentifier(suite.chainA.GetContext(), clientState.ClientType()) + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), clientID) + suite.Require().NoError(err) + + tc.malleate() + + clientStateBz := suite.chainA.Codec.MustMarshal(clientState) + consStateBz := suite.chainA.Codec.MustMarshal(consensusState) + + err = lightClientModule.Initialize(suite.chainA.GetContext(), path.EndpointA.ClientID, clientStateBz, consStateBz) + + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + + if tc.expErr == nil { + suite.Require().NoError(err, "valid case returned an error") + suite.Require().True(store.Has(host.ClientStateKey())) + suite.Require().True(store.Has(host.ConsensusStateKey(suite.chainB.LatestCommittedHeader.GetHeight()))) + } else { + suite.Require().ErrorContains(err, tc.expErr.Error()) + suite.Require().False(store.Has(host.ClientStateKey())) + suite.Require().False(store.Has(host.ConsensusStateKey(suite.chainB.LatestCommittedHeader.GetHeight()))) + } + }) + } +} + +func (suite *GnoTestSuite) TestVerifyClientMessage() { + var path *ibctesting.Path + + testCases := []struct { + name string + malleate func() + expErr error + }{ + { + "success", + func() {}, + nil, + }, + { + "failure: client state not found", + func() { + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + store.Delete(host.ClientStateKey()) + }, + clienttypes.ErrClientNotFound, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() + + path = ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupClients() + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().NoError(err) + + // ensure counterparty state is committed + suite.coordinator.CommitBlock(suite.chainB) + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + header, err := path.EndpointA.Counterparty.Chain.IBCClientHeader(path.EndpointA.Counterparty.Chain.LatestCommittedHeader, trustedHeight) + suite.Require().NoError(err) + + tc.malleate() + + err = lightClientModule.VerifyClientMessage(suite.chainA.GetContext(), path.EndpointA.ClientID, header) + + if tc.expErr == nil { + suite.Require().NoError(err) + } else { + suite.Require().ErrorIs(err, tc.expErr) + } + }) + } +} + +func (suite *GnoTestSuite) TestCheckForMisbehaviourPanicsOnClientStateNotFound() { + suite.SetupTest() + + path := ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupClients() + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().NoError(err) + + // ensure counterparty state is committed + suite.coordinator.CommitBlock(suite.chainB) + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + header, err := path.EndpointA.Counterparty.Chain.IBCClientHeader(path.EndpointA.Counterparty.Chain.LatestCommittedHeader, trustedHeight) + suite.Require().NoError(err) + + // delete client state + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + store.Delete(host.ClientStateKey()) + + suite.Require().PanicsWithError(errorsmod.Wrap(clienttypes.ErrClientNotFound, path.EndpointA.ClientID).Error(), + func() { + lightClientModule.CheckForMisbehaviour(suite.chainA.GetContext(), path.EndpointA.ClientID, header) + }, + ) +} + +func (suite *GnoTestSuite) TestUpdateStateOnMisbehaviourPanicsOnClientStateNotFound() { + suite.SetupTest() + + path := ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupClients() + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().NoError(err) + + // ensure counterparty state is committed + suite.coordinator.CommitBlock(suite.chainB) + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + header, err := path.EndpointA.Counterparty.Chain.IBCClientHeader(path.EndpointA.Counterparty.Chain.LatestCommittedHeader, trustedHeight) + suite.Require().NoError(err) + + // delete client state + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + store.Delete(host.ClientStateKey()) + + suite.Require().PanicsWithError( + errorsmod.Wrap(clienttypes.ErrClientNotFound, path.EndpointA.ClientID).Error(), + func() { + lightClientModule.UpdateStateOnMisbehaviour(suite.chainA.GetContext(), path.EndpointA.ClientID, header) + }, + ) +} + +func (suite *GnoTestSuite) TestUpdateStatePanicsOnClientStateNotFound() { + suite.SetupTest() + + path := ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupClients() + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().NoError(err) + + // ensure counterparty state is committed + suite.coordinator.CommitBlock(suite.chainB) + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + header, err := path.EndpointA.Counterparty.Chain.IBCClientHeader(path.EndpointA.Counterparty.Chain.LatestCommittedHeader, trustedHeight) + suite.Require().NoError(err) + + // delete client state + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + store.Delete(host.ClientStateKey()) + + suite.Require().PanicsWithError( + errorsmod.Wrap(clienttypes.ErrClientNotFound, path.EndpointA.ClientID).Error(), + func() { + lightClientModule.UpdateState(suite.chainA.GetContext(), path.EndpointA.ClientID, header) + }, + ) +} + +func (suite *GnoTestSuite) TestVerifyMembership() { + var ( + testingpath *ibctesting.Path + delayTimePeriod uint64 + delayBlockPeriod uint64 + err error + proofHeight exported.Height + proof []byte + path exported.Path + value []byte + ) + + testCases := []struct { + name string + malleate func() + expErr error + }{ + { + "successful ClientState verification", + func() { + // default proof construction uses ClientState + }, + nil, + }, + { + "successful ConsensusState verification", func() { + latestHeight := testingpath.EndpointB.GetClientLatestHeight() + + key := host.FullConsensusStateKey(testingpath.EndpointB.ClientID, latestHeight) + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = suite.chainB.QueryProof(key) + + consensusState, ok := testingpath.EndpointB.GetConsensusState(latestHeight).(*ibcgno.ConsensusState) + suite.Require().True(ok) + value, err = suite.chainB.Codec.MarshalInterface(consensusState) + suite.Require().NoError(err) + }, + nil, + }, + { + "successful Connection verification", func() { + key := host.ConnectionKey(testingpath.EndpointB.ConnectionID) + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = suite.chainB.QueryProof(key) + + connection := testingpath.EndpointB.GetConnection() + value, err = suite.chainB.Codec.Marshal(&connection) + suite.Require().NoError(err) + }, + nil, + }, + { + "successful Channel verification", func() { + key := host.ChannelKey(testingpath.EndpointB.ChannelConfig.PortID, testingpath.EndpointB.ChannelID) + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = suite.chainB.QueryProof(key) + + channel := testingpath.EndpointB.GetChannel() + value, err = suite.chainB.Codec.Marshal(&channel) + suite.Require().NoError(err) + }, + nil, + }, + { + "successful PacketCommitment verification", func() { + // send from chainB to chainA since we are proving chainB sent a packet + sequence, err := testingpath.EndpointB.SendPacket(clienttypes.NewHeight(1, 100), 0, ibctesting.MockPacketData) + suite.Require().NoError(err) + + // make packet commitment proof + packet := channeltypes.NewPacket(ibctesting.MockPacketData, sequence, testingpath.EndpointB.ChannelConfig.PortID, testingpath.EndpointB.ChannelID, testingpath.EndpointA.ChannelConfig.PortID, testingpath.EndpointA.ChannelID, clienttypes.NewHeight(1, 100), 0) + key := host.PacketCommitmentKey(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = testingpath.EndpointB.QueryProof(key) + + value = channeltypes.CommitPacket(packet) + }, nil, + }, + { + "successful Acknowledgement verification", func() { + // send from chainA to chainB since we are proving chainB wrote an acknowledgement + sequence, err := testingpath.EndpointA.SendPacket(clienttypes.NewHeight(1, 100), 0, ibctesting.MockPacketData) + suite.Require().NoError(err) + + // write receipt and ack + packet := channeltypes.NewPacket(ibctesting.MockPacketData, sequence, testingpath.EndpointA.ChannelConfig.PortID, testingpath.EndpointA.ChannelID, testingpath.EndpointB.ChannelConfig.PortID, testingpath.EndpointB.ChannelID, clienttypes.NewHeight(1, 100), 0) + err = testingpath.EndpointB.RecvPacket(packet) + suite.Require().NoError(err) + + key := host.PacketAcknowledgementKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence()) + merklePath := commitmenttypes.NewMerklePath(key) + + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = testingpath.EndpointB.QueryProof(key) + + value = channeltypes.CommitAcknowledgement(ibcmock.MockAcknowledgement.Acknowledgement()) + }, + nil, + }, + { + "successful NextSequenceRecv verification", func() { + // send from chainA to chainB since we are proving chainB incremented the sequence recv + + // send packet + sequence, err := testingpath.EndpointA.SendPacket(clienttypes.NewHeight(1, 100), 0, ibctesting.MockPacketData) + suite.Require().NoError(err) + + // next seq recv incremented + packet := channeltypes.NewPacket(ibctesting.MockPacketData, sequence, testingpath.EndpointA.ChannelConfig.PortID, testingpath.EndpointA.ChannelID, testingpath.EndpointB.ChannelConfig.PortID, testingpath.EndpointB.ChannelID, clienttypes.NewHeight(1, 100), 0) + err = testingpath.EndpointB.RecvPacket(packet) + suite.Require().NoError(err) + key := host.NextSequenceRecvKey(packet.GetDestPort(), packet.GetDestChannel()) + merklePath := commitmenttypes.NewMerklePath(key) + + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = testingpath.EndpointB.QueryProof(key) + + value = sdk.Uint64ToBigEndian(packet.GetSequence() + 1) + }, + nil, + }, + { + "successful verification outside IBC store", func() { + key := transfertypes.PortKey + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(commitmenttypes.NewMerklePrefix([]byte(transfertypes.StoreKey)), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = suite.chainB.QueryProofForStore(transfertypes.StoreKey, key, int64(testingpath.EndpointA.GetClientLatestHeight().GetRevisionHeight())) + + value = []byte(suite.chainB.GetSimApp().TransferKeeper.GetPort(suite.chainB.GetContext())) + suite.Require().NoError(err) + }, + nil, + }, + { + "delay time period has passed", func() { + delayTimePeriod = uint64(time.Second.Nanoseconds()) + }, + nil, + }, + { + "delay time period has not passed", func() { + delayTimePeriod = uint64(time.Hour.Nanoseconds()) + }, + ibcgno.ErrDelayPeriodNotPassed, + }, + { + "delay block period has passed", func() { + delayBlockPeriod = 1 + }, + nil, + }, + { + "delay block period has not passed", func() { + delayBlockPeriod = 1000 + }, + ibcgno.ErrDelayPeriodNotPassed, + }, + { + "latest client height < height", func() { + proofHeight = testingpath.EndpointA.GetClientLatestHeight().Increment() + }, + ibcerrors.ErrInvalidHeight, + }, + { + "invalid path type", + func() { + path = ibcmock.KeyPath{} + }, + ibcerrors.ErrInvalidType, + }, + { + "failed to unmarshal merkle proof", func() { + proof = invalidProof + }, + commitmenttypes.ErrInvalidProof, + }, + { + "consensus state not found", func() { + proofHeight = clienttypes.ZeroHeight() + }, + clienttypes.ErrConsensusStateNotFound, + }, + { + "proof verification failed", func() { + // change the value being proved + value = []byte("invalid value") + }, + commitmenttypes.ErrInvalidProof, + }, + { + "proof is empty", func() { + // change the inserted proof + proof = []byte{} + }, + commitmenttypes.ErrInvalidMerkleProof, + }, + { + "client state not found", + func() { + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), testingpath.EndpointA.ClientID) + store.Delete(host.ClientStateKey()) + }, + clienttypes.ErrClientNotFound, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + testingpath = ibctesting.NewPath(suite.chainA, suite.chainB) + testingpath.SetChannelOrdered() + testingpath.Setup() + + // reset time and block delays to 0, malleate may change to a specific non-zero value. + delayTimePeriod = 0 + delayBlockPeriod = 0 + + // create default proof, merklePath, and value which passes + // may be overwritten by malleate() + key := host.FullClientStateKey(testingpath.EndpointB.ClientID) + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = suite.chainB.QueryProof(key) + + clientState, ok := testingpath.EndpointB.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + value, err = suite.chainB.Codec.MarshalInterface(clientState) + suite.Require().NoError(err) + + tc.malleate() // make changes as necessary + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), testingpath.EndpointA.ClientID) + suite.Require().NoError(err) + + err = lightClientModule.VerifyMembership( + suite.chainA.GetContext(), testingpath.EndpointA.ClientID, proofHeight, delayTimePeriod, delayBlockPeriod, + proof, path, value, + ) + if tc.expErr == nil { + suite.Require().NoError(err) + } else { + suite.Require().ErrorContains(err, tc.expErr.Error()) + } + }) + } +} + +func (suite *GnoTestSuite) TestVerifyNonMembership() { + var ( + testingpath *ibctesting.Path + delayTimePeriod uint64 + delayBlockPeriod uint64 + err error + proofHeight exported.Height + path exported.Path + proof []byte + invalidClientID = "09-tendermint" + invalidConnectionID = "connection-100" + invalidChannelID = "channel-800" + invalidPortID = "invalid-port" + ) + + testCases := []struct { + name string + malleate func() + expErr error + }{ + { + "successful ClientState verification of non membership", + func() { + // default proof construction uses ClientState + }, + nil, + }, + { + "successful ConsensusState verification of non membership", func() { + key := host.FullConsensusStateKey(invalidClientID, testingpath.EndpointB.GetClientLatestHeight()) + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = suite.chainB.QueryProof(key) + }, + nil, + }, + { + "successful Connection verification of non membership", func() { + key := host.ConnectionKey(invalidConnectionID) + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = suite.chainB.QueryProof(key) + }, + nil, + }, + { + "successful Channel verification of non membership", func() { + key := host.ChannelKey(testingpath.EndpointB.ChannelConfig.PortID, invalidChannelID) + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = suite.chainB.QueryProof(key) + }, + nil, + }, + { + "successful PacketCommitment verification of non membership", func() { + // make packet commitment proof + key := host.PacketCommitmentKey(invalidPortID, invalidChannelID, 1) + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = testingpath.EndpointB.QueryProof(key) + }, + nil, + }, + { + "successful Acknowledgement verification of non membership", func() { + key := host.PacketAcknowledgementKey(invalidPortID, invalidChannelID, 1) + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = testingpath.EndpointB.QueryProof(key) + }, + nil, + }, + { + "successful NextSequenceRecv verification of non membership", func() { + key := host.NextSequenceRecvKey(invalidPortID, invalidChannelID) + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = testingpath.EndpointB.QueryProof(key) + }, + nil, + }, + { + "successful verification of non membership outside IBC store", func() { + key := []byte{0x08} + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(commitmenttypes.NewMerklePrefix([]byte(transfertypes.StoreKey)), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = suite.chainB.QueryProofForStore(transfertypes.StoreKey, key, int64(testingpath.EndpointA.GetClientLatestHeight().GetRevisionHeight())) + }, + nil, + }, + { + "delay time period has passed", func() { + delayTimePeriod = uint64(time.Second.Nanoseconds()) + }, + nil, + }, + { + "delay time period has not passed", func() { + delayTimePeriod = uint64(time.Hour.Nanoseconds()) + }, + ibcgno.ErrDelayPeriodNotPassed, + }, + { + "delay block period has passed", func() { + delayBlockPeriod = 1 + }, + nil, + }, + { + "delay block period has not passed", func() { + delayBlockPeriod = 1000 + }, + ibcgno.ErrDelayPeriodNotPassed, + }, + { + "latest client height < height", func() { + proofHeight = testingpath.EndpointA.GetClientLatestHeight().Increment() + }, + ibcerrors.ErrInvalidHeight, + }, + { + "invalid path type", + func() { + path = ibcmock.KeyPath{} + }, + ibcerrors.ErrInvalidType, + }, + { + "failed to unmarshal merkle proof", func() { + proof = invalidProof + }, + commitmenttypes.ErrInvalidProof, + }, + { + "consensus state not found", func() { + proofHeight = clienttypes.ZeroHeight() + }, + clienttypes.ErrConsensusStateNotFound, + }, + { + "verify non membership fails as path exists", func() { + // change the value being proved + key := host.FullClientStateKey(testingpath.EndpointB.ClientID) + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = suite.chainB.QueryProof(key) + }, + commitmenttypes.ErrInvalidProof, + }, + { + "proof is empty", func() { + // change the inserted proof + proof = []byte{} + }, + commitmenttypes.ErrInvalidMerkleProof, + }, + { + "client state not found", + func() { + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), testingpath.EndpointA.ClientID) + store.Delete(host.ClientStateKey()) + }, + clienttypes.ErrClientNotFound, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + testingpath = ibctesting.NewPath(suite.chainA, suite.chainB) + testingpath.SetChannelOrdered() + testingpath.Setup() + + // reset time and block delays to 0, malleate may change to a specific non-zero value. + delayTimePeriod = 0 + delayBlockPeriod = 0 + + // create default proof, merklePath, and value which passes + // may be overwritten by malleate() + key := host.FullClientStateKey("invalid-client-id") + + merklePath := commitmenttypes.NewMerklePath(key) + path, err = commitmenttypes.ApplyPrefix(suite.chainB.GetPrefix(), merklePath) + suite.Require().NoError(err) + + proof, proofHeight = suite.chainB.QueryProof(key) + + tc.malleate() // make changes as necessary + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), testingpath.EndpointA.ClientID) + suite.Require().NoError(err) + + err = lightClientModule.VerifyNonMembership( + suite.chainA.GetContext(), testingpath.EndpointA.ClientID, proofHeight, delayTimePeriod, delayBlockPeriod, + proof, path, + ) + + if tc.expErr == nil { + suite.Require().NoError(err) + } else { + suite.Require().ErrorContains(err, tc.expErr.Error()) + } + }) + } +} + +func (suite *GnoTestSuite) TestStatus() { + var ( + path *ibctesting.Path + clientState *ibcgno.ClientState + ) + + testCases := []struct { + name string + malleate func() + expStatus exported.Status + }{ + { + "client is active", + func() {}, + exported.Active, + }, + { + "client is frozen", + func() { + clientState.FrozenHeight = clienttypes.NewHeight(0, 1) + path.EndpointA.SetClientState(clientState) + }, + exported.Frozen, + }, + { + "client status without consensus state", + func() { + newLatestHeight, ok := clientState.LatestHeight.Increment().(clienttypes.Height) + suite.Require().True(ok) + clientState.LatestHeight = newLatestHeight + path.EndpointA.SetClientState(clientState) + }, + exported.Expired, + }, + { + "client status is expired", + func() { + suite.coordinator.IncrementTimeBy(clientState.TrustingPeriod) + }, + exported.Expired, + }, + { + "client state not found", + func() { + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + store.Delete(host.ClientStateKey()) + }, + exported.Unknown, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() + + path = ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupClients() + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().NoError(err) + + var ok bool + clientState, ok = path.EndpointA.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + + tc.malleate() + + status := lightClientModule.Status(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().Equal(tc.expStatus, status) + }) + } +} + +func (suite *GnoTestSuite) TestLatestHeight() { + var ( + path *ibctesting.Path + height exported.Height + ) + + testCases := []struct { + name string + malleate func() + expHeight exported.Height + }{ + { + "success", + func() {}, + clienttypes.Height{RevisionNumber: 0x1, RevisionHeight: 0x4}, + }, + { + "client state not found", + func() { + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + store.Delete(host.ClientStateKey()) + }, + clienttypes.ZeroHeight(), + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() + + path = ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupClients() + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().NoError(err) + + tc.malleate() + + height = lightClientModule.LatestHeight(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().Equal(tc.expHeight, height) + }) + } +} + +func (suite *GnoTestSuite) TestGetTimestampAtHeight() { + var ( + path *ibctesting.Path + height exported.Height + ) + expectedTimestamp := time.Unix(1, 0) + + testCases := []struct { + name string + malleate func() + expErr error + }{ + { + "success", + func() {}, + nil, + }, + { + "failure: client state not found", + func() { + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + store.Delete(host.ClientStateKey()) + }, + clienttypes.ErrClientNotFound, + }, + { + "failure: consensus state not found for height", + func() { + clientState, ok := path.EndpointA.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + height = clientState.LatestHeight.Increment() + }, + clienttypes.ErrConsensusStateNotFound, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() + + path = ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupClients() + + clientState, ok := path.EndpointA.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + height = clientState.LatestHeight + + // grab consensusState from store and update with a predefined timestamp + consensusState := path.EndpointA.GetConsensusState(height) + tmConsensusState, ok := consensusState.(*ibcgno.ConsensusState) + suite.Require().True(ok) + + tmConsensusState.Timestamp = expectedTimestamp + path.EndpointA.SetConsensusState(tmConsensusState, height) + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().NoError(err) + + tc.malleate() + + timestamp, err := lightClientModule.TimestampAtHeight(suite.chainA.GetContext(), path.EndpointA.ClientID, height) + + if tc.expErr == nil { + suite.Require().NoError(err) + + expectedTimestamp := uint64(expectedTimestamp.UnixNano()) + suite.Require().Equal(expectedTimestamp, timestamp) + } else { + suite.Require().ErrorIs(err, tc.expErr) + } + }) + } +} + +func (suite *GnoTestSuite) TestRecoverClient() { + var ( + subjectClientID, substituteClientID string + subjectClientState exported.ClientState + ) + + testCases := []struct { + name string + malleate func() + expErr error + }{ + { + "success", + func() { + }, + nil, + }, + { + "cannot parse malformed substitute client ID", + func() { + substituteClientID = ibctesting.InvalidID + }, + host.ErrInvalidID, + }, + { + "substitute client ID does not contain 07-tendermint prefix", + func() { + substituteClientID = solomachineClientID + }, + clienttypes.ErrInvalidClientType, + }, + { + "cannot find subject client state", + func() { + subjectClientID = tmClientID + }, + clienttypes.ErrClientNotFound, + }, + { + "cannot find substitute client state", + func() { + substituteClientID = tmClientID + }, + clienttypes.ErrClientNotFound, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + ctx := suite.chainA.GetContext() + + subjectPath := ibctesting.NewPath(suite.chainA, suite.chainB) + subjectPath.SetupClients() + subjectClientID = subjectPath.EndpointA.ClientID + subjectClientState = suite.chainA.GetClientState(subjectClientID) + + substitutePath := ibctesting.NewPath(suite.chainA, suite.chainB) + substitutePath.SetupClients() + substituteClientID = substitutePath.EndpointA.ClientID + + tmClientState, ok := subjectClientState.(*ibcgno.ClientState) + suite.Require().True(ok) + tmClientState.FrozenHeight = tmClientState.LatestHeight + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientState(ctx, subjectPath.EndpointA.ClientID, tmClientState) + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), subjectClientID) + suite.Require().NoError(err) + + tc.malleate() + + err = lightClientModule.RecoverClient(ctx, subjectClientID, substituteClientID) + + if tc.expErr == nil { + suite.Require().NoError(err) + + // assert that status of subject client is now Active + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), subjectClientID) + suite.Require().NoError(err) + suite.Require().Equal(lightClientModule.Status(suite.chainA.GetContext(), subjectClientID), exported.Active) + } else { + suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) + } + }) + } +} + +func (suite *GnoTestSuite) TestVerifyUpgradeAndUpdateState() { + var ( + clientID string + path *ibctesting.Path + upgradedClientState exported.ClientState + upgradedClientStateAny, upgradedConsensusStateAny *codectypes.Any + upgradedClientStateProof, upgradedConsensusStateProof []byte + ) + + testCases := []struct { + name string + malleate func() + expErr error + }{ + { + "success", + func() { + // upgrade height is at next block + upgradeHeight := clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + zeroedUpgradedClient := upgradedClientState.(*ibcgno.ClientState).ZeroCustomFields() + zeroedUpgradedClientAny, err := codectypes.NewAnyWithValue(zeroedUpgradedClient) + suite.Require().NoError(err) + + err = suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetRevisionHeight()), suite.chainB.Codec.MustMarshal(zeroedUpgradedClientAny)) + suite.Require().NoError(err) + + err = suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedConsensusState(suite.chainB.GetContext(), int64(upgradeHeight.GetRevisionHeight()), suite.chainB.Codec.MustMarshal(upgradedConsensusStateAny)) + suite.Require().NoError(err) + + // commit upgrade store changes and update clients + suite.coordinator.CommitBlock(suite.chainB) + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + upgradedClientStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetRevisionHeight())), path.EndpointA.GetClientLatestHeight().GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(upgradeHeight.GetRevisionHeight())), path.EndpointA.GetClientLatestHeight().GetRevisionHeight()) + }, + nil, + }, + { + "cannot find client state", + func() { + clientID = tmClientID + }, + clienttypes.ErrClientNotFound, + }, + { + "upgraded client state is not for tendermint client state", + func() { + upgradedClientStateAny = &codectypes.Any{ + Value: []byte("invalid client state bytes"), + } + }, + clienttypes.ErrInvalidClient, + }, + { + "upgraded consensus state is not tendermint consensus state", + func() { + upgradedConsensusStateAny = &codectypes.Any{ + Value: []byte("invalid consensus state bytes"), + } + }, + clienttypes.ErrInvalidConsensus, + }, + { + "upgraded client state height is not greater than current height", + func() { + // upgrade height is at next block + upgradeHeight := clienttypes.NewHeight(1, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + zeroedUpgradedClient := upgradedClientState.(*ibcgno.ClientState).ZeroCustomFields() + zeroedUpgradedClientAny, err := codectypes.NewAnyWithValue(zeroedUpgradedClient) + suite.Require().NoError(err) + + err = suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetRevisionHeight()), suite.chainB.Codec.MustMarshal(zeroedUpgradedClientAny)) + suite.Require().NoError(err) + + err = suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedConsensusState(suite.chainB.GetContext(), int64(upgradeHeight.GetRevisionHeight()), suite.chainB.Codec.MustMarshal(upgradedConsensusStateAny)) + suite.Require().NoError(err) + + // change upgraded client state height to be lower than current client state height + tmClient, ok := upgradedClientState.(*ibcgno.ClientState) + suite.Require().True(ok) + + newLatestheight, ok := path.EndpointA.GetClientLatestHeight().Decrement() + suite.Require().True(ok) + + tmClient.LatestHeight, ok = newLatestheight.(clienttypes.Height) + suite.Require().True(ok) + upgradedClientStateAny, err = codectypes.NewAnyWithValue(tmClient) + suite.Require().NoError(err) + + suite.coordinator.CommitBlock(suite.chainB) + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + upgradedClientStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetRevisionHeight())), path.EndpointA.GetClientLatestHeight().GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(upgradeHeight.GetRevisionHeight())), path.EndpointA.GetClientLatestHeight().GetRevisionHeight()) + }, + ibcerrors.ErrInvalidHeight, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + path = ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupClients() + + clientID = path.EndpointA.ClientID + clientState, ok := path.EndpointA.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + revisionNumber := clienttypes.ParseChainID(clientState.ChainId) + + newUnbondindPeriod := ubdPeriod + trustingPeriod + newChainID, err := clienttypes.SetRevisionNumber(clientState.ChainId, revisionNumber+1) + suite.Require().NoError(err) + + upgradedClientState = ibcgno.NewClientState(newChainID, ibcgno.DefaultTrustLevel, trustingPeriod, newUnbondindPeriod, maxClockDrift, clienttypes.NewHeight(revisionNumber+1, clientState.LatestHeight.GetRevisionHeight()+1), commitmenttypes.GetSDKSpecs(), upgradePath) + upgradedClientStateAny, err = codectypes.NewAnyWithValue(upgradedClientState) + suite.Require().NoError(err) + + nextValsHash := sha256.Sum256([]byte("new-nextValsHash")) + upgradedConsensusState := ibcgno.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("new-hash")), nextValsHash[:]) + + upgradedConsensusStateAny, err = codectypes.NewAnyWithValue(upgradedConsensusState) + suite.Require().NoError(err) + + tc.malleate() + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), clientID) + suite.Require().NoError(err) + + err = lightClientModule.VerifyUpgradeAndUpdateState( + suite.chainA.GetContext(), + clientID, + upgradedClientStateAny.Value, + upgradedConsensusStateAny.Value, + upgradedClientStateProof, + upgradedConsensusStateProof, + ) + + if tc.expErr == nil { + suite.Require().NoError(err) + + expClientState := path.EndpointA.GetClientState() + expClientStateBz := suite.chainA.Codec.MustMarshal(expClientState) + suite.Require().Equal(upgradedClientStateAny.Value, expClientStateBz) + + expConsensusState := ibcgno.NewConsensusState(upgradedConsensusState.Timestamp, commitmenttypes.NewMerkleRoot([]byte(ibcgno.SentinelRoot)), upgradedConsensusState.NextValidatorsHash) + expConsensusStateBz := suite.chainA.Codec.MustMarshal(expConsensusState) + + consensusStateBz := suite.chainA.Codec.MustMarshal(path.EndpointA.GetConsensusState(path.EndpointA.GetClientLatestHeight())) + suite.Require().Equal(expConsensusStateBz, consensusStateBz) + } else { + suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) + } + }) + } +} diff --git a/modules/10-gno/migrations/expected_keepers.go b/modules/10-gno/migrations/expected_keepers.go new file mode 100644 index 000000000..a0cddbcc8 --- /dev/null +++ b/modules/10-gno/migrations/expected_keepers.go @@ -0,0 +1,18 @@ +package migrations + +import ( + "github.com/cosmos/ibc-go/v10/modules/core/exported" + + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// ClientKeeper expected account IBC client keeper +type ClientKeeper interface { + GetClientState(ctx sdk.Context, clientID string) (exported.ClientState, bool) + IterateClientStates(ctx sdk.Context, prefix []byte, cb func(string, exported.ClientState) bool) + ClientStore(ctx sdk.Context, clientID string) storetypes.KVStore + Logger(ctx sdk.Context) log.Logger +} diff --git a/modules/10-gno/migrations/migrations.go b/modules/10-gno/migrations/migrations.go new file mode 100644 index 000000000..1ff2b7cf2 --- /dev/null +++ b/modules/10-gno/migrations/migrations.go @@ -0,0 +1,47 @@ +package migrations + +import ( + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + + errorsmod "cosmossdk.io/errors" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + ibcgno "github.com/atomone-hub/atomone/modules/10-gno" +) + +// PruneExpiredConsensusStates prunes all expired GNO consensus states. This function +// may optionally be called during in-place store migrations. The ibc store key must be provided. +func PruneExpiredConsensusStates(ctx sdk.Context, cdc codec.BinaryCodec, clientKeeper ClientKeeper) (int, error) { + var clientIDs []string + clientKeeper.IterateClientStates(ctx, []byte(ibcgno.Gno), func(clientID string, _ exported.ClientState) bool { + clientIDs = append(clientIDs, clientID) + return false + }) + + // keep track of the total consensus states pruned so chains can + // understand how much space is saved when the migration is run + var totalPruned int + + for _, clientID := range clientIDs { + clientStore := clientKeeper.ClientStore(ctx, clientID) + + clientState, ok := clientKeeper.GetClientState(ctx, clientID) + if !ok { + return 0, errorsmod.Wrapf(clienttypes.ErrClientNotFound, "clientID %s", clientID) + } + + gnoClientState, ok := clientState.(*ibcgno.ClientState) + if !ok { + return 0, errorsmod.Wrap(clienttypes.ErrInvalidClient, "client state is not GNO even though client id contains 10-gno") + } + + totalPruned += ibcgno.PruneAllExpiredConsensusStates(ctx, clientStore, cdc, gnoClientState) + } + + clientKeeper.Logger(ctx).Info("pruned expired gno consensus states", "total", totalPruned) + + return totalPruned, nil +} diff --git a/modules/10-gno/migrations/migrations_test.go b/modules/10-gno/migrations/migrations_test.go new file mode 100644 index 000000000..544c9cfc4 --- /dev/null +++ b/modules/10-gno/migrations/migrations_test.go @@ -0,0 +1,178 @@ +package migrations_test + +import ( + "testing" + "time" + + testifysuite "github.com/stretchr/testify/suite" + + ibcgno "github.com/atomone-hub/atomone/modules/10-gno" + ibcgnomigrations "github.com/atomone-hub/atomone/modules/10-gno/migrations" + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + host "github.com/cosmos/ibc-go/v10/modules/core/24-host" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + ibctesting "github.com/cosmos/ibc-go/v10/testing" +) + +type MigrationsTestSuite struct { + testifysuite.Suite + + coordinator *ibctesting.Coordinator + + // testing chains used for convenience and readability + chainA *ibctesting.TestChain + chainB *ibctesting.TestChain +} + +func (suite *MigrationsTestSuite) SetupTest() { + suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) + suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(1)) + suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(2)) +} + +func TestGnoTestSuite(t *testing.T) { + testifysuite.Run(t, new(MigrationsTestSuite)) +} + +// test pruning of multiple expired gno consensus states +func (suite *MigrationsTestSuite) TestPruneExpiredConsensusStates() { + // create multiple gno clients and a solo machine client + // the solo machine is used to verify this pruning function only modifies + // the gno store. + + numTMClients := 3 + paths := make([]*ibctesting.Path, numTMClients) + + for i := range numTMClients { + path := ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupClients() + + paths[i] = path + } + + solomachine := ibctesting.NewSolomachine(suite.T(), suite.chainA.Codec, ibctesting.DefaultSolomachineClientID, "testing", 1) + smClientStore := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), solomachine.ClientID) + + // set client state + bz, err := suite.chainA.App.AppCodec().MarshalInterface(solomachine.ClientState()) + suite.Require().NoError(err) + smClientStore.Set(host.ClientStateKey(), bz) + + bz, err = suite.chainA.App.AppCodec().MarshalInterface(solomachine.ConsensusState()) + suite.Require().NoError(err) + smHeight := clienttypes.NewHeight(0, 1) + smClientStore.Set(host.ConsensusStateKey(smHeight), bz) + + pruneHeightMap := make(map[*ibctesting.Path][]exported.Height) + unexpiredHeightMap := make(map[*ibctesting.Path][]exported.Height) + + for _, path := range paths { + // collect all heights expected to be pruned + var pruneHeights []exported.Height + pruneHeights = append(pruneHeights, path.EndpointA.GetClientLatestHeight()) + + // these heights will be expired and also pruned + for range 3 { + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + pruneHeights = append(pruneHeights, path.EndpointA.GetClientLatestHeight()) + } + + // double chedck all information is currently stored + for _, pruneHeight := range pruneHeights { + consState, ok := suite.chainA.GetConsensusState(path.EndpointA.ClientID, pruneHeight) + suite.Require().True(ok) + suite.Require().NotNil(consState) + + ctx := suite.chainA.GetContext() + clientStore := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(ctx, path.EndpointA.ClientID) + + processedTime, ok := ibcgno.GetProcessedTime(clientStore, pruneHeight) + suite.Require().True(ok) + suite.Require().NotNil(processedTime) + + processedHeight, ok := ibcgno.GetProcessedHeight(clientStore, pruneHeight) + suite.Require().True(ok) + suite.Require().NotNil(processedHeight) + + expectedConsKey := ibcgno.GetIterationKey(clientStore, pruneHeight) + suite.Require().NotNil(expectedConsKey) + } + pruneHeightMap[path] = pruneHeights + } + + // Increment the time by a week + suite.coordinator.IncrementTimeBy(7 * 24 * time.Hour) + + for _, path := range paths { + // create the consensus state that can be used as trusted height for next update + var unexpiredHeights []exported.Height + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + unexpiredHeights = append(unexpiredHeights, path.EndpointA.GetClientLatestHeight()) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + unexpiredHeights = append(unexpiredHeights, path.EndpointA.GetClientLatestHeight()) + + unexpiredHeightMap[path] = unexpiredHeights + } + + // Increment the time by another week, then update the client. + // This will cause the consensus states created before the first time increment + // to be expired + suite.coordinator.IncrementTimeBy(7 * 24 * time.Hour) + totalPruned, err := ibcgnomigrations.PruneExpiredConsensusStates(suite.chainA.GetContext(), suite.chainA.App.AppCodec(), suite.chainA.GetSimApp().IBCKeeper.ClientKeeper) + suite.Require().NoError(err) + suite.Require().NotZero(totalPruned) + + for _, path := range paths { + ctx := suite.chainA.GetContext() + clientStore := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(ctx, path.EndpointA.ClientID) + + // ensure everything has been pruned + for i, pruneHeight := range pruneHeightMap[path] { + consState, ok := suite.chainA.GetConsensusState(path.EndpointA.ClientID, pruneHeight) + suite.Require().False(ok, i) + suite.Require().Nil(consState, i) + + processedTime, ok := ibcgno.GetProcessedTime(clientStore, pruneHeight) + suite.Require().False(ok, i) + suite.Require().Equal(uint64(0), processedTime, i) + + processedHeight, ok := ibcgno.GetProcessedHeight(clientStore, pruneHeight) + suite.Require().False(ok, i) + suite.Require().Nil(processedHeight, i) + + expectedConsKey := ibcgno.GetIterationKey(clientStore, pruneHeight) + suite.Require().Nil(expectedConsKey, i) + } + + // ensure metadata is set for unexpired consensus state + for _, height := range unexpiredHeightMap[path] { + consState, ok := suite.chainA.GetConsensusState(path.EndpointA.ClientID, height) + suite.Require().True(ok) + suite.Require().NotNil(consState) + + processedTime, ok := ibcgno.GetProcessedTime(clientStore, height) + suite.Require().True(ok) + suite.Require().NotEqual(uint64(0), processedTime) + + processedHeight, ok := ibcgno.GetProcessedHeight(clientStore, height) + suite.Require().True(ok) + suite.Require().NotEqual(clienttypes.ZeroHeight(), processedHeight) + + consKey := ibcgno.GetIterationKey(clientStore, height) + suite.Require().Equal(host.ConsensusStateKey(height), consKey) + } + } + + // verify that solomachine client and consensus state were not removed + smClientStore = suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), solomachine.ClientID) + bz = smClientStore.Get(host.ClientStateKey()) + suite.Require().NotEmpty(bz) + + bz = smClientStore.Get(host.ConsensusStateKey(smHeight)) + suite.Require().NotEmpty(bz) +} diff --git a/modules/10-gno/misbehaviour.go b/modules/10-gno/misbehaviour.go new file mode 100644 index 000000000..bef308417 --- /dev/null +++ b/modules/10-gno/misbehaviour.go @@ -0,0 +1,175 @@ +package gno + +import ( + "time" + + bfttypes "github.com/gnolang/gno/tm2/pkg/bft/types" + "github.com/gnolang/gno/tm2/pkg/crypto" + "github.com/gnolang/gno/tm2/pkg/crypto/ed25519" + + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + host "github.com/cosmos/ibc-go/v10/modules/core/24-host" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + + errorsmod "cosmossdk.io/errors" +) + +var _ exported.ClientMessage = (*Misbehaviour)(nil) + +// FrozenHeight is same for all misbehaviour +var FrozenHeight = clienttypes.NewHeight(0, 1) + +// NewMisbehaviour creates a new Misbehaviour instance. +func NewMisbehaviour(clientID string, header1, header2 *Header) *Misbehaviour { + return &Misbehaviour{ + ClientId: clientID, + Header1: header1, + Header2: header2, + } +} + +// ClientType is Gno light client +func (Misbehaviour) ClientType() string { + return Gno +} + +// GetTime returns the timestamp at which misbehaviour occurred. It uses the +// maximum value from both headers to prevent producing an invalid header outside +// of the misbehaviour age range. +func (misbehaviour Misbehaviour) GetTime() time.Time { + t1, t2 := misbehaviour.Header1.GetTime(), misbehaviour.Header2.GetTime() + if t1.After(t2) { + return t1 + } + return t2 +} + +// ValidateBasic implements Misbehaviour interface +func (misbehaviour Misbehaviour) ValidateBasic() error { + if misbehaviour.Header1 == nil { + return errorsmod.Wrap(ErrInvalidHeader, "misbehaviour Header1 cannot be nil") + } + if misbehaviour.Header2 == nil { + return errorsmod.Wrap(ErrInvalidHeader, "misbehaviour Header2 cannot be nil") + } + if misbehaviour.Header1.TrustedHeight.RevisionHeight == 0 { + return errorsmod.Wrapf(ErrInvalidHeaderHeight, "misbehaviour Header1 cannot have zero revision height") + } + if misbehaviour.Header2.TrustedHeight.RevisionHeight == 0 { + return errorsmod.Wrapf(ErrInvalidHeaderHeight, "misbehaviour Header2 cannot have zero revision height") + } + if misbehaviour.Header1.TrustedValidators == nil { + return errorsmod.Wrap(ErrInvalidValidatorSet, "trusted validator set in Header1 cannot be empty") + } + if misbehaviour.Header2.TrustedValidators == nil { + return errorsmod.Wrap(ErrInvalidValidatorSet, "trusted validator set in Header2 cannot be empty") + } + if misbehaviour.Header1.SignedHeader.Header.ChainId != misbehaviour.Header2.SignedHeader.Header.ChainId { + return errorsmod.Wrap(clienttypes.ErrInvalidMisbehaviour, "headers must have identical chainIDs") + } + + if err := host.ClientIdentifierValidator(misbehaviour.ClientId); err != nil { + return errorsmod.Wrap(err, "misbehaviour client ID is invalid") + } + + // ValidateBasic on both validators + if err := misbehaviour.Header1.ValidateBasic(); err != nil { + return errorsmod.Wrap( + clienttypes.ErrInvalidMisbehaviour, + errorsmod.Wrap(err, "header 1 failed validation").Error(), + ) + } + if err := misbehaviour.Header2.ValidateBasic(); err != nil { + return errorsmod.Wrap( + clienttypes.ErrInvalidMisbehaviour, + errorsmod.Wrap(err, "header 2 failed validation").Error(), + ) + } + // Ensure that Height1 is greater than or equal to Height2 + if misbehaviour.Header1.GetHeight().LT(misbehaviour.Header2.GetHeight()) { + return errorsmod.Wrapf(clienttypes.ErrInvalidMisbehaviour, "Header1 height is less than Header2 height (%s < %s)", misbehaviour.Header1.GetHeight(), misbehaviour.Header2.GetHeight()) + } + + blockId1 := bfttypes.BlockID{ + Hash: misbehaviour.Header1.SignedHeader.Header.LastBlockId.Hash, + PartsHeader: bfttypes.PartSetHeader{Total: int(misbehaviour.Header1.SignedHeader.Header.LastBlockId.PartsHeader.Total), Hash: misbehaviour.Header1.SignedHeader.Header.LastBlockId.PartsHeader.Hash}, + } + err := blockId1.ValidateBasic() + if err != nil { + return errorsmod.Wrap(err, "invalid block ID from header 1 in misbehaviour") + } + blockId2 := bfttypes.BlockID{ + Hash: misbehaviour.Header2.SignedHeader.Header.LastBlockId.Hash, + PartsHeader: bfttypes.PartSetHeader{Total: int(misbehaviour.Header2.SignedHeader.Header.LastBlockId.PartsHeader.Total), Hash: misbehaviour.Header2.SignedHeader.Header.LastBlockId.PartsHeader.Hash}, + } + err = blockId2.ValidateBasic() + if err != nil { + return errorsmod.Wrap(err, "invalid block ID from header 2 in misbehaviour") + } + + if err := validCommit(misbehaviour.Header1.SignedHeader.Header.ChainId, blockId1, + *misbehaviour.Header1.SignedHeader.Commit, misbehaviour.Header1.ValidatorSet); err != nil { + return err + } + return validCommit(misbehaviour.Header2.SignedHeader.Header.ChainId, blockId2, + *misbehaviour.Header2.SignedHeader.Commit, misbehaviour.Header2.ValidatorSet) +} + +// validCommit checks if the given commit is a valid commit from the passed-in validatorset +func validCommit(chainID string, blockID bfttypes.BlockID, commit Commit, valSet *ValidatorSet) (err error) { + err = blockID.ValidateBasic() + if err != nil { + return errorsmod.Wrap(err, "block ID is not gno block ID type") + } + gnoCommit := bfttypes.Commit{ + BlockID: bfttypes.BlockID{Hash: commit.BlockId.Hash, PartsHeader: bfttypes.PartSetHeader{Total: int(commit.BlockId.PartsHeader.Total), Hash: commit.BlockId.PartsHeader.Hash}}, + Precommits: make([]*bfttypes.CommitSig, len(commit.Precommits)), + } + for i, sig := range commit.Precommits { + if sig == nil { + continue + } + gnoCommit.Precommits[i] = &bfttypes.CommitSig{ + ValidatorIndex: int(sig.ValidatorIndex), + Signature: sig.Signature, + BlockID: bfttypes.BlockID{Hash: sig.BlockId.Hash, PartsHeader: bfttypes.PartSetHeader{Total: int(sig.BlockId.PartsHeader.Total), Hash: sig.BlockId.PartsHeader.Hash}}, + Type: bfttypes.SignedMsgType(sig.Type), + Height: sig.Height, + Round: int(sig.Round), + Timestamp: sig.Timestamp, + ValidatorAddress: crypto.MustAddressFromString(sig.ValidatorAddress), + } + } + err = gnoCommit.ValidateBasic() + if err != nil { + return errorsmod.Wrap(err, "commit is not gno commit type") + } + + gnoValset := bfttypes.ValidatorSet{ + Validators: make([]*bfttypes.Validator, len(valSet.Validators)), + Proposer: nil, + } + for i, val := range valSet.Validators { + key := val.PubKey + if (key.GetEd25519()) == nil { + return errorsmod.Wrap(clienttypes.ErrInvalidHeader, "validator pubkey is not ed25519") + } + gnoValset.Validators[i] = &bfttypes.Validator{ + Address: crypto.MustAddressFromString(val.Address), + PubKey: ed25519.PubKeyEd25519(key.GetEd25519()), + VotingPower: val.VotingPower, + ProposerPriority: val.ProposerPriority, + } + } + gnoValset.TotalVotingPower() // ensure TotalVotingPower is set + empty := gnoValset.IsNilOrEmpty() + if empty { + return errorsmod.Wrap(err, "validator set is not gno validator set type") + } + + if err := gnoValset.VerifyCommit(chainID, blockID, gnoCommit.Height(), &gnoCommit); err != nil { + return errorsmod.Wrap(clienttypes.ErrInvalidMisbehaviour, "validator set did not commit to header") + } + + return nil +} diff --git a/modules/10-gno/misbehaviour_handle.go b/modules/10-gno/misbehaviour_handle.go new file mode 100644 index 000000000..283fc4a29 --- /dev/null +++ b/modules/10-gno/misbehaviour_handle.go @@ -0,0 +1,215 @@ +package gno + +import ( + "bytes" + "errors" + "reflect" + "time" + + bfttypes "github.com/gnolang/gno/tm2/pkg/bft/types" + "github.com/gnolang/gno/tm2/pkg/crypto" + "github.com/gnolang/gno/tm2/pkg/crypto/ed25519" + + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + + errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// CheckForMisbehaviour detects duplicate height misbehaviour and BFT time violation misbehaviour +// in a submitted Header message and verifies the correctness of a submitted Misbehaviour ClientMessage +func (ClientState) CheckForMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, msg exported.ClientMessage) bool { + switch msg := msg.(type) { + case *Header: + header := msg + consState := header.ConsensusState() + + // Check if the Client store already has a consensus state for the header's height + // If the consensus state exists, and it matches the header then we return early + // since header has already been submitted in a previous UpdateClient. + if existingConsState, found := GetConsensusState(clientStore, cdc, header.GetHeight()); found { + // This header has already been submitted and the necessary state is already stored + // in client store, thus we can return early without further validation. + if reflect.DeepEqual(existingConsState, header.ConsensusState()) { + return false + } + + // A consensus state already exists for this height, but it does not match the provided header. + // The assumption is that Header has already been validated. Thus we can return true as misbehaviour is present + return true + } + + // Check that consensus state timestamps are monotonic + prevCons, prevOk := GetPreviousConsensusState(clientStore, cdc, header.GetHeight()) + nextCons, nextOk := GetNextConsensusState(clientStore, cdc, header.GetHeight()) + // if previous consensus state exists, check consensus state time is greater than previous consensus state time + // if previous consensus state is not before current consensus state return true + if prevOk && !prevCons.Timestamp.Before(consState.Timestamp) { + return true + } + // if next consensus state exists, check consensus state time is less than next consensus state time + // if next consensus state is not after current consensus state return true + if nextOk && !nextCons.Timestamp.After(consState.Timestamp) { + return true + } + case *Misbehaviour: + // if heights are equal check that this is valid misbehaviour of a fork + // otherwise if heights are unequal check that this is valid misbehavior of BFT time violation + if msg.Header1.GetHeight().EQ(msg.Header2.GetHeight()) { + + blockID1 := bfttypes.BlockID{ + Hash: msg.Header1.SignedHeader.Header.LastBlockId.Hash, + PartsHeader: bfttypes.PartSetHeader{Total: int(msg.Header1.SignedHeader.Header.LastBlockId.PartsHeader.Total), Hash: msg.Header1.SignedHeader.Header.LastBlockId.PartsHeader.Hash}, + } + if blockID1.ValidateBasic() != nil { + return false + } + blockID2 := bfttypes.BlockID{ + Hash: msg.Header2.SignedHeader.Header.LastBlockId.Hash, + PartsHeader: bfttypes.PartSetHeader{Total: int(msg.Header2.SignedHeader.Header.LastBlockId.PartsHeader.Total), Hash: msg.Header2.SignedHeader.Header.LastBlockId.PartsHeader.Hash}, + } + if blockID2.ValidateBasic() != nil { + return false + } + + // Ensure that Commit Hashes are different + if !bytes.Equal(blockID1.Hash, blockID2.Hash) { + return true + } + + } else if !msg.Header1.SignedHeader.Header.Time.After(msg.Header2.SignedHeader.Header.Time) { + // Header1 is at greater height than Header2, therefore Header1 time must be less than or equal to + // Header2 time in order to be valid misbehaviour (violation of monotonic time). + return true + } + } + + return false +} + +// verifyMisbehaviour determines whether or not two conflicting +// headers at the same height would have convinced the light client. +// +// NOTE: consensusState1 is the trusted consensus state that corresponds to the TrustedHeight +// of misbehaviour.Header1 +// Similarly, consensusState2 is the trusted consensus state that corresponds +// to misbehaviour.Header2 +// Misbehaviour sets frozen height to {0, 1} since it is only used as a boolean value (zero or non-zero). +func (cs *ClientState) verifyMisbehaviour(ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, misbehaviour *Misbehaviour) error { + // Regardless of the type of misbehaviour, ensure that both headers are valid and would have been accepted by light-client + + // Retrieve trusted consensus states for each Header in misbehaviour + tmConsensusState1, found := GetConsensusState(clientStore, cdc, misbehaviour.Header1.TrustedHeight) + if !found { + return errorsmod.Wrapf(clienttypes.ErrConsensusStateNotFound, "could not get trusted consensus state from clientStore for Header1 at TrustedHeight: %s", misbehaviour.Header1.TrustedHeight) + } + + tmConsensusState2, found := GetConsensusState(clientStore, cdc, misbehaviour.Header2.TrustedHeight) + if !found { + return errorsmod.Wrapf(clienttypes.ErrConsensusStateNotFound, "could not get trusted consensus state from clientStore for Header2 at TrustedHeight: %s", misbehaviour.Header2.TrustedHeight) + } + + // Check the validity of the two conflicting headers against their respective + // trusted consensus states + // NOTE: header height and commitment root assertions are checked in + // misbehaviour.ValidateBasic by the client keeper and msg.ValidateBasic + // by the base application. + if err := checkMisbehaviourHeader( + cs, tmConsensusState1, misbehaviour.Header1, ctx.BlockTime(), + ); err != nil { + return errorsmod.Wrap(err, "verifying Header1 in Misbehaviour failed") + } + if err := checkMisbehaviourHeader( + cs, tmConsensusState2, misbehaviour.Header2, ctx.BlockTime(), + ); err != nil { + return errorsmod.Wrap(err, "verifying Header2 in Misbehaviour failed") + } + + return nil +} + +// checkMisbehaviourHeader checks that a Header in Misbehaviour is valid misbehaviour given +// a trusted ConsensusState +func checkMisbehaviourHeader( + clientState *ClientState, consState *ConsensusState, header *Header, currentTimestamp time.Time, +) error { + gnoTrustedValset := bfttypes.ValidatorSet{ + Validators: make([]*bfttypes.Validator, len(header.TrustedValidators.Validators)), + Proposer: nil, + } + for i, val := range header.TrustedValidators.Validators { + key := val.PubKey + if (key.GetEd25519()) == nil { + return errorsmod.Wrap(clienttypes.ErrInvalidHeader, "validator pubkey is not ed25519") + } + gnoTrustedValset.Validators[i] = &bfttypes.Validator{ + Address: crypto.MustAddressFromString(val.Address), + PubKey: ed25519.PubKeyEd25519(key.GetEd25519()), + VotingPower: val.VotingPower, + ProposerPriority: val.ProposerPriority, + } + } + gnoTrustedValset.TotalVotingPower() // ensure TotalVotingPower is set + if gnoTrustedValset.IsNilOrEmpty() { + return errorsmod.Wrap(errors.New("empty trusted validator set"), "trusted validator set is not gno validator set type") + } + + gnoCommit := bfttypes.Commit{ + BlockID: bfttypes.BlockID{Hash: header.SignedHeader.Commit.BlockId.Hash, PartsHeader: bfttypes.PartSetHeader{Total: int(header.SignedHeader.Commit.BlockId.PartsHeader.Total), Hash: header.SignedHeader.Commit.BlockId.PartsHeader.Hash}}, + Precommits: make([]*bfttypes.CommitSig, len(header.SignedHeader.Commit.Precommits)), + } + for i, sig := range header.SignedHeader.Commit.Precommits { + if sig == nil { + continue + } + gnoCommit.Precommits[i] = &bfttypes.CommitSig{ + ValidatorIndex: int(sig.ValidatorIndex), + Signature: sig.Signature, + BlockID: bfttypes.BlockID{Hash: sig.BlockId.Hash, PartsHeader: bfttypes.PartSetHeader{Total: int(sig.BlockId.PartsHeader.Total), Hash: sig.BlockId.PartsHeader.Hash}}, + Type: bfttypes.SignedMsgType(sig.Type), + Height: sig.Height, + Round: int(sig.Round), + Timestamp: sig.Timestamp, + ValidatorAddress: crypto.MustAddressFromString(sig.ValidatorAddress), + } + } + err := gnoCommit.ValidateBasic() + if err != nil { + return errorsmod.Wrap(err, "commit is not gno commit type") + } + + // check the trusted fields for the header against ConsensusState + if err := checkTrustedHeader(header, consState); err != nil { + return err + } + + // assert that the age of the trusted consensus state is not older than the trusting period + if currentTimestamp.Sub(consState.Timestamp) >= clientState.TrustingPeriod { + return errorsmod.Wrapf( + ErrTrustingPeriodExpired, + "current timestamp minus the latest consensus state timestamp is greater than or equal to the trusting period (%d >= %d)", + currentTimestamp.Sub(consState.Timestamp), clientState.TrustingPeriod, + ) + } + + chainID := clientState.GetChainID() + // If chainID is in revision format, then set revision number of chainID with the revision number + // of the misbehaviour header + // NOTE: misbehaviour verification is not supported for chains which upgrade to a new chainID without + // strictly following the chainID revision format + if clienttypes.IsRevisionFormat(chainID) { + chainID, _ = clienttypes.SetRevisionNumber(chainID, header.GetHeight().GetRevisionNumber()) + } + + // - ValidatorSet must have TrustLevel similarity with trusted ValidatorSet + // - TODO: re-check + err = VerifyLightCommit(&gnoTrustedValset, chainID, gnoCommit.BlockID, header.SignedHeader.Header.Height, &gnoCommit, LCDefaultTrustLevel) + if err != nil { + return errorsmod.Wrapf(clienttypes.ErrInvalidMisbehaviour, "validator set in header has too much change from trusted validator set: %v", err) + } + return nil +} diff --git a/modules/10-gno/misbehaviour_handle_test.go b/modules/10-gno/misbehaviour_handle_test.go new file mode 100644 index 000000000..81eca1981 --- /dev/null +++ b/modules/10-gno/misbehaviour_handle_test.go @@ -0,0 +1,695 @@ +package gno_test + +import ( + "errors" + "fmt" + "strings" + "time" + + ibcgno "github.com/atomone-hub/atomone/modules/10-gno" + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + solomachine "github.com/cosmos/ibc-go/v10/modules/light-clients/06-solomachine" + ibctesting "github.com/cosmos/ibc-go/v10/testing" + bfttypes "github.com/gnolang/gno/tm2/pkg/bft/types" +) + +func (suite *GnoTestSuite) TestVerifyMisbehaviour() { + // Setup different validators and signers for testing different types of updates + altPrivVal := bfttypes.NewMockPV() + altPubKey := altPrivVal.PubKey() + suite.Require().NotNil(altPubKey) + + // create modified heights to use for test-cases + altVal := bfttypes.NewValidator(altPubKey, 100) + + // Create alternative validator set with only altVal, invalid update (too much change in valSet) + altValSet := bfttypes.NewValidatorSet([]*bfttypes.Validator{altVal}) + altSigners := getAltSigners(altVal, altPrivVal) + + var ( + path *ibctesting.Path + misbehaviour exported.ClientMessage + ) + + testCases := []struct { + name string + malleate func() + expErr error + }{ + { + "valid fork misbehaviour", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, + nil, + }, + { + "valid time misbehaviour", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+3, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, + nil, + }, + { + "valid time misbehaviour, header 1 time strictly less than header 2 time", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+3, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Hour), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, + nil, + }, + { + "valid misbehavior at height greater than last consensusState", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+1, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+1, trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, nil, + }, + { + "valid misbehaviour with different trusted heights", func() { + trustedHeight1, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals1, ok := suite.chainB.TrustedValidators[trustedHeight1.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + trustedHeight2, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals2, ok := suite.chainB.TrustedValidators[trustedHeight2.RevisionHeight] + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight1, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals1, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight2, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals2, suite.chainB.Signers), + } + }, + nil, + }, + { + "valid misbehaviour at a previous revision", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + + // increment revision number + err = path.EndpointB.UpgradeChain() + suite.Require().NoError(err) + }, + nil, + }, + { + "valid misbehaviour at a future revision", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + futureRevision := fmt.Sprintf("%s-%d", strings.TrimSuffix(suite.chainB.ChainID, fmt.Sprintf("-%d", clienttypes.ParseChainID(suite.chainB.ChainID))), height.GetRevisionNumber()+1) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(futureRevision, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(futureRevision, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, + nil, + }, + { + "valid misbehaviour with trusted heights at a previous revision", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + // increment revision of chainID + err = path.EndpointB.UpgradeChain() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, + nil, + }, + { + "consensus state's valset hash different from misbehaviour should still pass", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + // Create bothValSet with both suite validator and altVal + bothValSet := bfttypes.NewValidatorSet(append(suite.chainB.Vals.Validators, altValSet.Proposer)) + bothSigners := suite.chainB.Signers + bothSigners[altValSet.Proposer.Address.String()] = altPrivVal + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), bothValSet, suite.chainB.NextVals, trustedVals, bothSigners), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, bothValSet, suite.chainB.NextVals, trustedVals, bothSigners), + } + }, nil, + }, + { + "invalid misbehaviour: misbehaviour from different chain", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader("evmos", int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader("evmos", int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, errors.New("invalid light client misbehaviour"), + }, + { + "misbehaviour trusted validators does not match validator hash in trusted consensus state", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, altValSet, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, altValSet, suite.chainB.Signers), + } + }, errors.New("invalid validator set"), + }, + { + "trusted consensus state does not exist", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight.Increment().(clienttypes.Height), suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, errors.New("consensus state not found"), + }, + { + "invalid tendermint misbehaviour", func() { + misbehaviour = &solomachine.Misbehaviour{} + }, errors.New("invalid client type"), + }, + { + "trusting period expired", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + suite.chainA.ExpireClient(path.EndpointA.ClientConfig.(*ibctesting.TendermintConfig).TrustingPeriod) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, errors.New("time since latest trusted state has passed the trusting period"), + }, + { + "header 1 valset has too much change", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), altValSet, suite.chainB.NextVals, trustedVals, altSigners), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, errors.New("validator set in header has too much change from trusted validator set"), + }, + { + "header 2 valset has too much change", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, altValSet, suite.chainB.NextVals, trustedVals, altSigners), + } + }, errors.New("validator set in header has too much change from trusted validator set"), + }, + { + "both header 1 and header 2 valsets have too much change", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), altValSet, suite.chainB.NextVals, trustedVals, altSigners), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, altValSet, suite.chainB.NextVals, trustedVals, altSigners), + } + }, errors.New("validator set in header has too much change from trusted validator set"), + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() + path = ibctesting.NewPath(suite.chainA, suite.chainB) + + err := path.EndpointA.CreateClient() + suite.Require().NoError(err) + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().NoError(err) + + tc.malleate() + + err = lightClientModule.VerifyClientMessage(suite.chainA.GetContext(), path.EndpointA.ClientID, misbehaviour) + + if tc.expErr == nil { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.expErr.Error()) + } + }) + } +} + +// test both fork and time misbehaviour for chainIDs not in the revision format +// this function is separate as it must use a global variable in the testing package +// to initialize chains not in the revision format +func (suite *GnoTestSuite) TestVerifyMisbehaviourNonRevisionChainID() { + // NOTE: chains set to non revision format + ibctesting.ChainIDSuffix = "" + + // Setup different validators and signers for testing different types of updates + altPrivVal := bfttypes.NewMockPV() + altPubKey := altPrivVal.PubKey() + suite.Require().NotNil(altPubKey) + + // create modified heights to use for test-cases + altVal := bfttypes.NewValidator(altPubKey, 100) + + // Create alternative validator set with only altVal, invalid update (too much change in valSet) + altValSet := bfttypes.NewValidatorSet([]*bfttypes.Validator{altVal}) + altSigners := getAltSigners(altVal, altPrivVal) + + var ( + path *ibctesting.Path + misbehaviour exported.ClientMessage + ) + + testCases := []struct { + name string + malleate func() + expErr error + }{ + { + "valid fork misbehaviour", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, + nil, + }, + { + "valid time misbehaviour", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+3, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, + nil, + }, + { + "valid time misbehaviour, header 1 time strictly less than header 2 time", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+3, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Hour), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, + nil, + }, + { + "valid misbehavior at height greater than last consensusState", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+1, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+1, trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, nil, + }, + { + "valid misbehaviour with different trusted heights", func() { + trustedHeight1, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals1, ok := suite.chainB.TrustedValidators[trustedHeight1.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + trustedHeight2, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals2, ok := suite.chainB.TrustedValidators[trustedHeight2.RevisionHeight] + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight1, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals1, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight2, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals2, suite.chainB.Signers), + } + }, + nil, + }, + { + "consensus state's valset hash different from misbehaviour should still pass", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + // Create bothValSet with both suite validator and altVal + bothValSet := bfttypes.NewValidatorSet(append(suite.chainB.Vals.Validators, altValSet.Proposer)) + bothSigners := suite.chainB.Signers + bothSigners[altValSet.Proposer.Address.String()] = altPrivVal + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), bothValSet, suite.chainB.NextVals, trustedVals, bothSigners), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, bothValSet, suite.chainB.NextVals, trustedVals, bothSigners), + } + }, nil, + }, + { + "invalid misbehaviour: misbehaviour from different chain", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader("evmos", int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader("evmos", int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, errors.New("validator set in header has too much change from trusted validator set"), + }, + { + "misbehaviour trusted validators does not match validator hash in trusted consensus state", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, altValSet, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, altValSet, suite.chainB.Signers), + } + }, errors.New("invalid validator set"), + }, + { + "trusted consensus state does not exist", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight.Increment().(clienttypes.Height), suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, errors.New("consensus state not found"), + }, + { + "invalid tendermint misbehaviour", func() { + misbehaviour = &solomachine.Misbehaviour{} + }, errors.New("nvalid client type"), + }, + { + "trusting period expired", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + suite.chainA.ExpireClient(path.EndpointA.ClientConfig.(*ibctesting.TendermintConfig).TrustingPeriod) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, errors.New("time since latest trusted state has passed the trusting period"), + }, + { + "header 1 valset has too much change", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), altValSet, suite.chainB.NextVals, trustedVals, altSigners), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, errors.New("validator set in header has too much change from trusted validator set"), + }, + { + "header 2 valset has too much change", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, altValSet, suite.chainB.NextVals, trustedVals, altSigners), + } + }, errors.New("validator set in header has too much change from trusted validator set"), + }, + { + "both header 1 and header 2 valsets have too much change", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviour = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), altValSet, suite.chainB.NextVals, trustedVals, altSigners), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, altValSet, suite.chainB.NextVals, trustedVals, altSigners), + } + }, errors.New("validator set in header has too much change from trusted validator set"), + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() + path = ibctesting.NewPath(suite.chainA, suite.chainB) + + err := path.EndpointA.CreateClient() + suite.Require().NoError(err) + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().NoError(err) + + tc.malleate() + + err = lightClientModule.VerifyClientMessage(suite.chainA.GetContext(), path.EndpointA.ClientID, misbehaviour) + + if tc.expErr == nil { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.expErr.Error()) + } + }) + } + + // NOTE: reset chain creation to revision format + ibctesting.ChainIDSuffix = "-1" +} diff --git a/modules/10-gno/misbehaviour_test.go b/modules/10-gno/misbehaviour_test.go new file mode 100644 index 000000000..c49539b2d --- /dev/null +++ b/modules/10-gno/misbehaviour_test.go @@ -0,0 +1,240 @@ +package gno_test + +import ( + "errors" + "time" + + errorsmod "cosmossdk.io/errors" + + "github.com/cometbft/cometbft/crypto/tmhash" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" + + ibcgno "github.com/atomone-hub/atomone/modules/10-gno" + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + ibctesting "github.com/cosmos/ibc-go/v10/testing" +) + +func (suite *GnoTestSuite) TestMisbehaviour() { + heightMinus1 := clienttypes.NewHeight(0, height.RevisionHeight-1) + + misbehaviour := &ibcgno.Misbehaviour{ + Header1: suite.header, + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.RevisionHeight), heightMinus1, suite.now, suite.valSet, suite.valSet, suite.valSet, suite.signers), + ClientId: clientID, + } + + suite.Require().Equal(exported.Tendermint, misbehaviour.ClientType()) +} + +func (suite *GnoTestSuite) TestMisbehaviourValidateBasic() { + altPrivVal := cmttypes.NewMockPV() + altPubKey, err := altPrivVal.GetPubKey() + suite.Require().NoError(err) + + revisionHeight := int64(height.RevisionHeight) + + altVal := cmttypes.NewValidator(altPubKey, revisionHeight) + + // Create alternative validator set with only altVal + altValSet := cmttypes.NewValidatorSet([]*cmttypes.Validator{altVal}) + + // Create signer array and ensure it is in same order as bothValSet + bothValSet, bothSigners := getBothSigners(suite, altVal, altPrivVal) + + altSignerArr := []cmttypes.PrivValidator{altPrivVal} + + heightMinus1 := clienttypes.NewHeight(0, height.RevisionHeight-1) + + testCases := []struct { + name string + misbehaviour *ibcgno.Misbehaviour + malleateMisbehaviour func(misbehaviour *ibcgno.Misbehaviour) error + expErr error + }{ + { + "valid fork misbehaviour, two headers at same height have different time", + &ibcgno.Misbehaviour{ + Header1: suite.header, + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.RevisionHeight), heightMinus1, suite.now.Add(time.Minute), suite.valSet, suite.valSet, suite.valSet, suite.signers), + ClientId: clientID, + }, + func(misbehaviour *ibcgno.Misbehaviour) error { return nil }, + nil, + }, + { + "valid time misbehaviour, both headers at different heights are at same time", + &ibcgno.Misbehaviour{ + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.RevisionHeight+5), heightMinus1, suite.now, suite.valSet, suite.valSet, suite.valSet, suite.signers), + Header2: suite.header, + ClientId: clientID, + }, + func(misbehaviour *ibcgno.Misbehaviour) error { return nil }, + nil, + }, + { + "misbehaviour Header1 is nil", + ibcgno.NewMisbehaviour(clientID, nil, suite.header), + func(m *ibcgno.Misbehaviour) error { return nil }, + errorsmod.Wrap(ibcgno.ErrInvalidHeader, "misbehaviour Header1 cannot be nil"), + }, + { + "misbehaviour Header2 is nil", + ibcgno.NewMisbehaviour(clientID, suite.header, nil), + func(m *ibcgno.Misbehaviour) error { return nil }, + errorsmod.Wrap(ibcgno.ErrInvalidHeader, "misbehaviour Header2 cannot be nil"), + }, + { + "valid misbehaviour with different trusted headers", + &ibcgno.Misbehaviour{ + Header1: suite.header, + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.RevisionHeight), clienttypes.NewHeight(0, height.RevisionHeight-3), suite.now.Add(time.Minute), suite.valSet, suite.valSet, bothValSet, suite.signers), + ClientId: clientID, + }, + func(misbehaviour *ibcgno.Misbehaviour) error { return nil }, + nil, + }, + { + "trusted height is 0 in Header1", + &ibcgno.Misbehaviour{ + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.RevisionHeight), clienttypes.ZeroHeight(), suite.now.Add(time.Minute), suite.valSet, suite.valSet, suite.valSet, suite.signers), + Header2: suite.header, + ClientId: clientID, + }, + func(misbehaviour *ibcgno.Misbehaviour) error { return nil }, + errorsmod.Wrap(ibcgno.ErrInvalidHeaderHeight, "misbehaviour Header1 cannot have zero revision height"), + }, + { + "trusted height is 0 in Header2", + &ibcgno.Misbehaviour{ + Header1: suite.header, + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.RevisionHeight), clienttypes.ZeroHeight(), suite.now.Add(time.Minute), suite.valSet, suite.valSet, suite.valSet, suite.signers), + ClientId: clientID, + }, + func(misbehaviour *ibcgno.Misbehaviour) error { return nil }, + errorsmod.Wrap(ibcgno.ErrInvalidHeaderHeight, "misbehaviour Header2 cannot have zero revision height"), + }, + { + "trusted valset is nil in Header1", + &ibcgno.Misbehaviour{ + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.RevisionHeight), heightMinus1, suite.now.Add(time.Minute), suite.valSet, suite.valSet, nil, suite.signers), + Header2: suite.header, + ClientId: clientID, + }, + func(misbehaviour *ibcgno.Misbehaviour) error { return nil }, + errorsmod.Wrap(ibcgno.ErrInvalidValidatorSet, "trusted validator set in Header1 cannot be empty"), + }, + { + "trusted valset is nil in Header2", + &ibcgno.Misbehaviour{ + Header1: suite.header, + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.RevisionHeight), heightMinus1, suite.now.Add(time.Minute), suite.valSet, suite.valSet, nil, suite.signers), + ClientId: clientID, + }, + func(misbehaviour *ibcgno.Misbehaviour) error { return nil }, + errorsmod.Wrap(ibcgno.ErrInvalidValidatorSet, "trusted validator set in Header2 cannot be empty"), + }, + { + "invalid client ID ", + &ibcgno.Misbehaviour{ + Header1: suite.header, + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.RevisionHeight), heightMinus1, suite.now, suite.valSet, suite.valSet, suite.valSet, suite.signers), + ClientId: "GAI", + }, + func(misbehaviour *ibcgno.Misbehaviour) error { return nil }, + errors.New("identifier GAI has invalid length"), + }, + { + "chainIDs do not match", + &ibcgno.Misbehaviour{ + Header1: suite.header, + Header2: suite.chainA.CreateTMClientHeader("ethermint", int64(height.RevisionHeight), heightMinus1, suite.now, suite.valSet, suite.valSet, suite.valSet, suite.signers), + ClientId: clientID, + }, + func(misbehaviour *ibcgno.Misbehaviour) error { return nil }, + errorsmod.Wrap(clienttypes.ErrInvalidMisbehaviour, "headers must have identical chainIDs"), + }, + { + "header2 height is greater", + &ibcgno.Misbehaviour{ + Header1: suite.header, + Header2: suite.chainA.CreateTMClientHeader(chainID, 6, clienttypes.NewHeight(0, height.RevisionHeight+1), suite.now, suite.valSet, suite.valSet, suite.valSet, suite.signers), + ClientId: clientID, + }, + func(misbehaviour *ibcgno.Misbehaviour) error { return nil }, + errors.New("Header1 height is less than Header2 height"), + }, + { + "header 1 doesn't have 2/3 majority", + &ibcgno.Misbehaviour{ + Header1: suite.chainA.CreateTMClientHeader(chainID, int64(height.RevisionHeight), heightMinus1, suite.now, bothValSet, bothValSet, suite.valSet, bothSigners), + Header2: suite.header, + ClientId: clientID, + }, + func(misbehaviour *ibcgno.Misbehaviour) error { + // voteSet contains only altVal which is less than 2/3 of total power (height/1height) + wrongVoteSet := cmttypes.NewVoteSet(chainID, int64(misbehaviour.Header1.GetHeight().GetRevisionHeight()), 1, cmtproto.PrecommitType, altValSet) + blockID, err := cmttypes.BlockIDFromProto(&misbehaviour.Header1.Commit.BlockID) + if err != nil { + return err + } + + extCommit, err := cmttypes.MakeExtCommit(*blockID, int64(misbehaviour.Header2.GetHeight().GetRevisionHeight()), misbehaviour.Header1.Commit.Round, wrongVoteSet, altSignerArr, suite.now, false) + misbehaviour.Header1.Commit = extCommit.ToCommit().ToProto() + return err + }, + errors.New("validator set did not commit to header"), + }, + { + "header 2 doesn't have 2/3 majority", + &ibcgno.Misbehaviour{ + Header1: suite.header, + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.RevisionHeight), heightMinus1, suite.now, bothValSet, bothValSet, suite.valSet, bothSigners), + ClientId: clientID, + }, + func(misbehaviour *ibcgno.Misbehaviour) error { + // voteSet contains only altVal which is less than 2/3 of total power (height/1height) + wrongVoteSet := cmttypes.NewVoteSet(chainID, int64(misbehaviour.Header2.GetHeight().GetRevisionHeight()), 1, cmtproto.PrecommitType, altValSet) + blockID, err := cmttypes.BlockIDFromProto(&misbehaviour.Header2.Commit.BlockID) + if err != nil { + return err + } + + extCommit, err := cmttypes.MakeExtCommit(*blockID, int64(misbehaviour.Header2.GetHeight().GetRevisionHeight()), misbehaviour.Header2.Commit.Round, wrongVoteSet, altSignerArr, suite.now, false) + misbehaviour.Header2.Commit = extCommit.ToCommit().ToProto() + return err + }, + errors.New("validator set did not commit to header"), + }, + { + "validators sign off on wrong commit", + &ibcgno.Misbehaviour{ + Header1: suite.header, + Header2: suite.chainA.CreateTMClientHeader(chainID, int64(height.RevisionHeight), heightMinus1, suite.now, bothValSet, bothValSet, suite.valSet, bothSigners), + ClientId: clientID, + }, + func(misbehaviour *ibcgno.Misbehaviour) error { + tmBlockID := ibctesting.MakeBlockID(tmhash.Sum([]byte("other_hash")), 3, tmhash.Sum([]byte("other_partset"))) + misbehaviour.Header2.Commit.BlockID = tmBlockID.ToProto() + return nil + }, + errors.New("header 2 failed validation"), + }, + } + + for i, tc := range testCases { + suite.Run(tc.name, func() { + err := tc.malleateMisbehaviour(tc.misbehaviour) + suite.Require().NoError(err) + err = tc.misbehaviour.ValidateBasic() + + if tc.expErr == nil { + suite.Require().NoError(err, "valid test case %d failed: %s", i, tc.name) + } else { + suite.Require().Error(err, "invalid test case %d passed: %s", i, tc.name) + suite.Require().ErrorContains(err, tc.expErr.Error()) + } + }) + } +} diff --git a/modules/10-gno/module.go b/modules/10-gno/module.go new file mode 100644 index 000000000..33db45aee --- /dev/null +++ b/modules/10-gno/module.go @@ -0,0 +1,89 @@ +package gno + +import ( + "encoding/json" + + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + "cosmossdk.io/core/appmodule" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/types/module" +) + +var ( + _ module.AppModuleBasic = (*AppModuleBasic)(nil) + _ appmodule.AppModule = (*AppModule)(nil) +) + +// AppModuleBasic defines the basic application module used by the GNO light client. +// Only the RegisterInterfaces function needs to be implemented. All other function perform +// a no-op. +type AppModuleBasic struct{} + +const Gno string = "10-gno" + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (AppModuleBasic) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (AppModuleBasic) IsAppModule() {} + +// Name returns the gno module name. +func (AppModuleBasic) Name() string { + return ModuleName +} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (AppModule) IsAppModule() {} + +// RegisterLegacyAminoCodec performs a no-op. The gno client does not support amino. +func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino) {} + +// RegisterInterfaces registers module concrete types into protobuf Any. This allows core IBC +// to unmarshal gno light client types. +func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + RegisterInterfaces(registry) +} + +// DefaultGenesis performs a no-op. Genesis is not supported for the gno light client. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return nil +} + +// ValidateGenesis performs a no-op. Genesis is not supported for the gno light client. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + return nil +} + +// RegisterGRPCGatewayRoutes performs a no-op. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {} + +// GetTxCmd performs a no-op. Please see the 02-client cli commands. +func (AppModuleBasic) GetTxCmd() *cobra.Command { + return nil +} + +// GetQueryCmd performs a no-op. Please see the 02-client cli commands. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return nil +} + +// AppModule is the application module for the GNO client module +type AppModule struct { + AppModuleBasic + lightClientModule LightClientModule +} + +// NewAppModule creates a new GNO client module +func NewAppModule(lightClientModule LightClientModule) AppModule { + return AppModule{ + lightClientModule: lightClientModule, + } +} diff --git a/modules/10-gno/proposal_handle.go b/modules/10-gno/proposal_handle.go new file mode 100644 index 000000000..f655d1955 --- /dev/null +++ b/modules/10-gno/proposal_handle.go @@ -0,0 +1,103 @@ +package gno + +import ( + "reflect" + "time" + + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + + errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// CheckSubstituteAndUpdateState will try to update the client with the state of the +// substitute. +// +// AllowUpdateAfterMisbehaviour and AllowUpdateAfterExpiry have been deprecated. +// Please see ADR 026 for more information. +// +// The following must always be true: +// - The substitute client is the same type as the subject client +// - The subject and substitute client states match in all parameters (expect frozen height, latest height, and chain-id) +// +// In case 1) before updating the client, the client will be unfrozen by resetting +// the FrozenHeight to the zero Height. +func (cs ClientState) CheckSubstituteAndUpdateState( + ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore, + substituteClientStore storetypes.KVStore, substituteClient exported.ClientState, +) error { + substituteClientState, ok := substituteClient.(*ClientState) + if !ok { + return errorsmod.Wrapf(clienttypes.ErrInvalidClient, "expected type %T, got %T", &ClientState{}, substituteClient) + } + + if !IsMatchingClientState(cs, *substituteClientState) { + return errorsmod.Wrap(clienttypes.ErrInvalidSubstitute, "subject client state does not match substitute client state") + } + + if cs.status(ctx, subjectClientStore, cdc) == exported.Frozen { + // unfreeze the client + cs.FrozenHeight = clienttypes.ZeroHeight() + } + + // copy consensus states and processed time from substitute to subject + // starting from initial height and ending on the latest height (inclusive) + height := substituteClientState.LatestHeight + + consensusState, found := GetConsensusState(substituteClientStore, cdc, height) + if !found { + return errorsmod.Wrap(clienttypes.ErrConsensusStateNotFound, "unable to retrieve latest consensus state for substitute client") + } + + setConsensusState(subjectClientStore, cdc, consensusState, height) + + // set metadata stored for the substitute consensus state + processedHeight, found := GetProcessedHeight(substituteClientStore, height) + if !found { + return errorsmod.Wrap(clienttypes.ErrUpdateClientFailed, "unable to retrieve processed height for substitute client latest height") + } + + processedTime, found := GetProcessedTime(substituteClientStore, height) + if !found { + return errorsmod.Wrap(clienttypes.ErrUpdateClientFailed, "unable to retrieve processed time for substitute client latest height") + } + + setConsensusMetadataWithValues(subjectClientStore, height, processedHeight, processedTime) + + cs.LatestHeight = substituteClientState.LatestHeight + cs.ChainId = substituteClientState.ChainId + + // set new trusting period based on the substitute client state + cs.TrustingPeriod = substituteClientState.TrustingPeriod + + // no validation is necessary since the substitute is verified to be Active + // in 02-client. + setClientState(subjectClientStore, cdc, &cs) + + return nil +} + +// IsMatchingClientState returns true if all the client state parameters match +// except for frozen height, latest height, trusting period, chain-id. +func IsMatchingClientState(subject, substitute ClientState) bool { + // zero out parameters which do not need to match + subject.LatestHeight = clienttypes.ZeroHeight() + subject.FrozenHeight = clienttypes.ZeroHeight() + subject.TrustingPeriod = time.Duration(0) + substitute.LatestHeight = clienttypes.ZeroHeight() + substitute.FrozenHeight = clienttypes.ZeroHeight() + substitute.TrustingPeriod = time.Duration(0) + subject.ChainId = "" + substitute.ChainId = "" + // sets both sets of flags to true as these flags have been DEPRECATED, see ADR-026 for more information + subject.AllowUpdateAfterExpiry = true + substitute.AllowUpdateAfterExpiry = true + subject.AllowUpdateAfterMisbehaviour = true + substitute.AllowUpdateAfterMisbehaviour = true + + return reflect.DeepEqual(subject, substitute) +} diff --git a/modules/10-gno/proposal_handle_test.go b/modules/10-gno/proposal_handle_test.go new file mode 100644 index 000000000..48b82b7a8 --- /dev/null +++ b/modules/10-gno/proposal_handle_test.go @@ -0,0 +1,236 @@ +package gno_test + +import ( + "time" + + ibcgno "github.com/atomone-hub/atomone/modules/10-gno" + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + ibctesting "github.com/cosmos/ibc-go/v10/testing" +) + +var frozenHeight = clienttypes.NewHeight(0, 1) + +func (suite *GnoTestSuite) TestCheckSubstituteUpdateStateBasic() { + var ( + substituteClientState exported.ClientState + substitutePath *ibctesting.Path + ) + testCases := []struct { + name string + malleate func() + }{ + { + "solo machine used for substitute", func() { + substituteClientState = ibctesting.NewSolomachine(suite.T(), suite.cdc, "solo machine", "", 1).ClientState() + }, + }, + { + "non-matching substitute", func() { + substitutePath.SetupClients() + substituteClientState, ok := suite.chainA.GetClientState(substitutePath.EndpointA.ClientID).(*ibcgno.ClientState) + suite.Require().True(ok) + // change trusting period so that test should fail + substituteClientState.TrustingPeriod = time.Hour * 24 * 7 + + tmClientState := substituteClientState + tmClientState.ChainId += "different chain" + }, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + subjectPath := ibctesting.NewPath(suite.chainA, suite.chainB) + substitutePath = ibctesting.NewPath(suite.chainA, suite.chainB) + + subjectPath.SetupClients() + subjectClientState, ok := suite.chainA.GetClientState(subjectPath.EndpointA.ClientID).(*ibcgno.ClientState) + suite.Require().True(ok) + + // expire subject client + suite.coordinator.IncrementTimeBy(subjectClientState.TrustingPeriod) + suite.coordinator.CommitBlock(suite.chainA, suite.chainB) + + tc.malleate() + + subjectClientStore := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), subjectPath.EndpointA.ClientID) + substituteClientStore := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), substitutePath.EndpointA.ClientID) + + err := subjectClientState.CheckSubstituteAndUpdateState(suite.chainA.GetContext(), suite.chainA.App.AppCodec(), subjectClientStore, substituteClientStore, substituteClientState) + suite.Require().Error(err) + }) + } +} + +func (suite *GnoTestSuite) TestCheckSubstituteAndUpdateState() { + testCases := []struct { + name string + FreezeClient bool + expError error + }{ + { + name: "PASS: update checks are deprecated, client is not frozen", + FreezeClient: false, + expError: nil, + }, + { + name: "PASS: update checks are deprecated, client is frozen", + FreezeClient: true, + expError: nil, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + // construct subject using test case parameters + subjectPath := ibctesting.NewPath(suite.chainA, suite.chainB) + subjectPath.SetupClients() + subjectClientState, ok := suite.chainA.GetClientState(subjectPath.EndpointA.ClientID).(*ibcgno.ClientState) + suite.Require().True(ok) + + if tc.FreezeClient { + subjectClientState.FrozenHeight = frozenHeight + } + + // construct the substitute to match the subject client + + substitutePath := ibctesting.NewPath(suite.chainA, suite.chainB) + substitutePath.SetupClients() + substituteClientState, ok := suite.chainA.GetClientState(substitutePath.EndpointA.ClientID).(*ibcgno.ClientState) + suite.Require().True(ok) + // update trusting period of substitute client state + substituteClientState.TrustingPeriod = time.Hour * 24 * 7 + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientState(suite.chainA.GetContext(), substitutePath.EndpointA.ClientID, substituteClientState) + + // update substitute a few times + for range 3 { + err := substitutePath.EndpointA.UpdateClient() + suite.Require().NoError(err) + // skip a block + suite.coordinator.CommitBlock(suite.chainA, suite.chainB) + } + + // get updated substitute + substituteClientState, ok = suite.chainA.GetClientState(substitutePath.EndpointA.ClientID).(*ibcgno.ClientState) + suite.Require().True(ok) + + // test that subject gets updated chain-id + newChainID := "new-chain-id" + substituteClientState.ChainId = newChainID + + subjectClientStore := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), subjectPath.EndpointA.ClientID) + substituteClientStore := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), substitutePath.EndpointA.ClientID) + + expectedConsState := substitutePath.EndpointA.GetConsensusState(substituteClientState.LatestHeight) + expectedProcessedTime, found := ibcgno.GetProcessedTime(substituteClientStore, substituteClientState.LatestHeight) + suite.Require().True(found) + expectedProcessedHeight, found := ibcgno.GetProcessedTime(substituteClientStore, substituteClientState.LatestHeight) + suite.Require().True(found) + expectedIterationKey := ibcgno.GetIterationKey(substituteClientStore, substituteClientState.LatestHeight) + + err := subjectClientState.CheckSubstituteAndUpdateState(suite.chainA.GetContext(), suite.chainA.App.AppCodec(), subjectClientStore, substituteClientStore, substituteClientState) + + if tc.expError == nil { + suite.Require().NoError(err) + + updatedClient, ok := subjectPath.EndpointA.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + suite.Require().Equal(clienttypes.ZeroHeight(), updatedClient.FrozenHeight) + + subjectClientStore := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), subjectPath.EndpointA.ClientID) + + // check that the correct consensus state was copied over + suite.Require().Equal(substituteClientState.LatestHeight, updatedClient.LatestHeight) + subjectConsState := subjectPath.EndpointA.GetConsensusState(updatedClient.LatestHeight) + subjectProcessedTime, found := ibcgno.GetProcessedTime(subjectClientStore, updatedClient.LatestHeight) + suite.Require().True(found) + subjectProcessedHeight, found := ibcgno.GetProcessedTime(substituteClientStore, updatedClient.LatestHeight) + suite.Require().True(found) + subjectIterationKey := ibcgno.GetIterationKey(substituteClientStore, updatedClient.LatestHeight) + + suite.Require().Equal(expectedConsState, subjectConsState) + suite.Require().Equal(expectedProcessedTime, subjectProcessedTime) + suite.Require().Equal(expectedProcessedHeight, subjectProcessedHeight) + suite.Require().Equal(expectedIterationKey, subjectIterationKey) + + suite.Require().Equal(newChainID, updatedClient.ChainId) + suite.Require().Equal(time.Hour*24*7, updatedClient.TrustingPeriod) + } else { + suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.expError.Error()) + } + }) + } +} + +func (suite *GnoTestSuite) TestIsMatchingClientState() { + var ( + subjectPath, substitutePath *ibctesting.Path + subjectClientState, substituteClientState *ibcgno.ClientState + ) + + testCases := []struct { + name string + malleate func() + isMatch bool + }{ + { + "matching clients", func() { + var ok bool + subjectClientState, ok = suite.chainA.GetClientState(subjectPath.EndpointA.ClientID).(*ibcgno.ClientState) + suite.Require().True(ok) + substituteClientState, ok = suite.chainA.GetClientState(substitutePath.EndpointA.ClientID).(*ibcgno.ClientState) + suite.Require().True(ok) + }, true, + }, + { + "matching, frozen height is not used in check for equality", func() { + subjectClientState.FrozenHeight = frozenHeight + substituteClientState.FrozenHeight = clienttypes.ZeroHeight() + }, true, + }, + { + "matching, latest height is not used in check for equality", func() { + subjectClientState.LatestHeight = clienttypes.NewHeight(0, 10) + substituteClientState.FrozenHeight = clienttypes.ZeroHeight() + }, true, + }, + { + "matching, chain id is different", func() { + subjectClientState.ChainId = "bitcoin" + substituteClientState.ChainId = "ethereum" + }, true, + }, + { + "matching, trusting period is different", func() { + subjectClientState.TrustingPeriod = time.Hour * 10 + substituteClientState.TrustingPeriod = time.Hour * 1 + }, true, + }, + { + "not matching, trust level is different", func() { + subjectClientState.TrustLevel = ibcgno.Fraction{2, 3} + substituteClientState.TrustLevel = ibcgno.Fraction{1, 3} + }, false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + subjectPath = ibctesting.NewPath(suite.chainA, suite.chainB) + substitutePath = ibctesting.NewPath(suite.chainA, suite.chainB) + subjectPath.SetupClients() + substitutePath.SetupClients() + + tc.malleate() + + suite.Require().Equal(tc.isMatch, ibcgno.IsMatchingClientState(*subjectClientState, *substituteClientState)) + }) + } +} diff --git a/modules/10-gno/store.go b/modules/10-gno/store.go new file mode 100644 index 000000000..b98288b0d --- /dev/null +++ b/modules/10-gno/store.go @@ -0,0 +1,344 @@ +package gno + +import ( + "bytes" + "encoding/binary" + "fmt" + + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + host "github.com/cosmos/ibc-go/v10/modules/core/24-host" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +/* +This file contains the logic for storage and iteration over `IterationKey` metadata that is stored +for each consensus state. The consensus state key specified in ICS-24 and expected by counterparty chains +stores the consensus state under the key: `consensusStates/{revision_number}-{revision_height}`, with each number +represented as a string. +While this works fine for IBC proof verification, it makes efficient iteration difficult since the lexicographic order +of the consensus state keys do not match the height order of consensus states. This makes consensus state pruning and +monotonic time enforcement difficult since it is inefficient to find the earliest consensus state or to find the neighboring +consensus states given a consensus state height. +Changing the ICS-24 representation will be a major breaking change that requires counterparty chains to accept a new key format. +Thus to avoid breaking IBC, we can store a lookup from a more efficiently formatted key: `iterationKey` to the consensus state key which +stores the underlying consensus state. This efficient iteration key will be formatted like so: `iterateConsensusStates{BigEndianRevisionBytes}{BigEndianHeightBytes}`. +This ensures that the lexicographic order of iteration keys match the height order of the consensus states. Thus, we can use the SDK store's +Iterators to iterate over the consensus states in ascending/descending order by providing a mapping from `iterationKey -> consensusStateKey -> ConsensusState`. +A future version of IBC may choose to replace the ICS24 ConsensusState path with the more efficient format and make this indirection unnecessary. +*/ + +const KeyIterateConsensusStatePrefix = "iterateConsensusStates" + +var ( + // KeyProcessedTime is appended to consensus state key to store the processed time + KeyProcessedTime = []byte("/processedTime") + // KeyProcessedHeight is appended to consensus state key to store the processed height + KeyProcessedHeight = []byte("/processedHeight") + // KeyIteration stores the key mapping to consensus state key for efficient iteration + KeyIteration = []byte("/iterationKey") +) + +// setClientState stores the client state +func setClientState(clientStore storetypes.KVStore, cdc codec.BinaryCodec, clientState *ClientState) { + key := host.ClientStateKey() + val := clienttypes.MustMarshalClientState(cdc, clientState) + clientStore.Set(key, val) +} + +// getClientState retrieves the client state from the store using the provided KVStore and codec. +// It returns the unmarshaled ClientState and a boolean indicating if the state was found. +func getClientState(store storetypes.KVStore, cdc codec.BinaryCodec) (*ClientState, bool) { + bz := store.Get(host.ClientStateKey()) + if len(bz) == 0 { + return nil, false + } + + clientStateI := clienttypes.MustUnmarshalClientState(cdc, bz) + var clientState *ClientState + clientState, ok := clientStateI.(*ClientState) + if !ok { + panic(fmt.Errorf("cannot convert %T into %T", clientStateI, clientState)) + } + return clientState, true +} + +// setConsensusState stores the consensus state at the given height. +func setConsensusState(clientStore storetypes.KVStore, cdc codec.BinaryCodec, consensusState *ConsensusState, height exported.Height) { + key := host.ConsensusStateKey(height) + val := clienttypes.MustMarshalConsensusState(cdc, consensusState) + clientStore.Set(key, val) +} + +// GetConsensusState retrieves the consensus state from the client prefixed store. +// If the ConsensusState does not exist in state for the provided height a nil value and false boolean flag is returned +func GetConsensusState(store storetypes.KVStore, cdc codec.BinaryCodec, height exported.Height) (*ConsensusState, bool) { + bz := store.Get(host.ConsensusStateKey(height)) + if len(bz) == 0 { + return nil, false + } + + consensusStateI := clienttypes.MustUnmarshalConsensusState(cdc, bz) + var consensusState *ConsensusState + consensusState, ok := consensusStateI.(*ConsensusState) + if !ok { + panic(fmt.Errorf("cannot convert %T into %T", consensusStateI, consensusState)) + } + + return consensusState, true +} + +// deleteConsensusState deletes the consensus state at the given height +func deleteConsensusState(clientStore storetypes.KVStore, height exported.Height) { + key := host.ConsensusStateKey(height) + clientStore.Delete(key) +} + +// ProcessedTimeKey returns the key under which the processed time will be stored in the client store. +func ProcessedTimeKey(height exported.Height) []byte { + return append(host.ConsensusStateKey(height), KeyProcessedTime...) +} + +// SetProcessedTime stores the time at which a header was processed and the corresponding consensus state was created. +// This is useful when validating whether a packet has reached the time specified delay period in the gno client's +// verification functions +func SetProcessedTime(clientStore storetypes.KVStore, height exported.Height, timeNs uint64) { + key := ProcessedTimeKey(height) + val := sdk.Uint64ToBigEndian(timeNs) + clientStore.Set(key, val) +} + +// GetProcessedTime gets the time (in nanoseconds) at which this chain received and processed a gno header. +// This is used to validate that a received packet has passed the time delay period. +func GetProcessedTime(clientStore storetypes.KVStore, height exported.Height) (uint64, bool) { + key := ProcessedTimeKey(height) + bz := clientStore.Get(key) + if len(bz) == 0 { + return 0, false + } + return sdk.BigEndianToUint64(bz), true +} + +// deleteProcessedTime deletes the processedTime for a given height +func deleteProcessedTime(clientStore storetypes.KVStore, height exported.Height) { + key := ProcessedTimeKey(height) + clientStore.Delete(key) +} + +// ProcessedHeightKey returns the key under which the processed height will be stored in the client store. +func ProcessedHeightKey(height exported.Height) []byte { + return append(host.ConsensusStateKey(height), KeyProcessedHeight...) +} + +// SetProcessedHeight stores the height at which a header was processed and the corresponding consensus state was created. +// This is useful when validating whether a packet has reached the specified block delay period in the gno client's +// verification functions +func SetProcessedHeight(clientStore storetypes.KVStore, consHeight, processedHeight exported.Height) { + key := ProcessedHeightKey(consHeight) + val := []byte(processedHeight.String()) + clientStore.Set(key, val) +} + +// GetProcessedHeight gets the height at which this chain received and processed a gno header. +// This is used to validate that a received packet has passed the block delay period. +func GetProcessedHeight(clientStore storetypes.KVStore, height exported.Height) (exported.Height, bool) { + key := ProcessedHeightKey(height) + bz := clientStore.Get(key) + if len(bz) == 0 { + return nil, false + } + processedHeight, err := clienttypes.ParseHeight(string(bz)) + if err != nil { + return nil, false + } + return processedHeight, true +} + +// deleteProcessedHeight deletes the processedHeight for a given height +func deleteProcessedHeight(clientStore storetypes.KVStore, height exported.Height) { + key := ProcessedHeightKey(height) + clientStore.Delete(key) +} + +// IterationKey returns the key under which the consensus state key will be stored. +// The iteration key is a BigEndian representation of the consensus state key to support efficient iteration. +func IterationKey(height exported.Height) []byte { + heightBytes := bigEndianHeightBytes(height) + return append([]byte(KeyIterateConsensusStatePrefix), heightBytes...) +} + +// SetIterationKey stores the consensus state key under a key that is more efficient for ordered iteration +func SetIterationKey(clientStore storetypes.KVStore, height exported.Height) { + key := IterationKey(height) + val := host.ConsensusStateKey(height) + clientStore.Set(key, val) +} + +// GetIterationKey returns the consensus state key stored under the efficient iteration key. +// NOTE: This function is currently only used for testing purposes +func GetIterationKey(clientStore storetypes.KVStore, height exported.Height) []byte { + key := IterationKey(height) + return clientStore.Get(key) +} + +// deleteIterationKey deletes the iteration key for a given height +func deleteIterationKey(clientStore storetypes.KVStore, height exported.Height) { + key := IterationKey(height) + clientStore.Delete(key) +} + +// GetHeightFromIterationKey takes an iteration key and returns the height that it references +func GetHeightFromIterationKey(iterKey []byte) exported.Height { + bigEndianBytes := iterKey[len([]byte(KeyIterateConsensusStatePrefix)):] + revisionBytes := bigEndianBytes[0:8] + heightBytes := bigEndianBytes[8:] + revision := binary.BigEndian.Uint64(revisionBytes) + height := binary.BigEndian.Uint64(heightBytes) + return clienttypes.NewHeight(revision, height) +} + +// IterateConsensusStateAscending iterates through the consensus states in ascending order. It calls the provided +// callback on each height, until stop=true is returned. +func IterateConsensusStateAscending(clientStore storetypes.KVStore, cb func(height exported.Height) (stop bool)) { + iterator := storetypes.KVStorePrefixIterator(clientStore, []byte(KeyIterateConsensusStatePrefix)) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + iterKey := iterator.Key() + height := GetHeightFromIterationKey(iterKey) + if cb(height) { + break + } + } +} + +// GetNextConsensusState returns the lowest consensus state that is larger than the given height. +// The Iterator returns a storetypes.Iterator which iterates from start (inclusive) to end (exclusive). +// If the starting height exists in store, we need to call iterator.Next() to get the next consensus state. +// Otherwise, the iterator is already at the next consensus state so we can call iterator.Value() immediately. +func GetNextConsensusState(clientStore storetypes.KVStore, cdc codec.BinaryCodec, height exported.Height) (*ConsensusState, bool) { + iterateStore := prefix.NewStore(clientStore, []byte(KeyIterateConsensusStatePrefix)) + iterator := iterateStore.Iterator(bigEndianHeightBytes(height), nil) + defer iterator.Close() + if !iterator.Valid() { + return nil, false + } + + // if iterator is at current height, ignore the consensus state at current height and get next height + // if iterator value is not at current height, it is already at next height. + if bytes.Equal(iterator.Value(), host.ConsensusStateKey(height)) { + iterator.Next() + if !iterator.Valid() { + return nil, false + } + } + + csKey := iterator.Value() + + return getTmConsensusState(clientStore, cdc, csKey) +} + +// GetPreviousConsensusState returns the highest consensus state that is lower than the given height. +// The Iterator returns a storetypes.Iterator which iterates from the end (exclusive) to start (inclusive). +// Thus to get previous consensus state we call iterator.Value() immediately. +func GetPreviousConsensusState(clientStore storetypes.KVStore, cdc codec.BinaryCodec, height exported.Height) (*ConsensusState, bool) { + iterateStore := prefix.NewStore(clientStore, []byte(KeyIterateConsensusStatePrefix)) + iterator := iterateStore.ReverseIterator(nil, bigEndianHeightBytes(height)) + defer iterator.Close() + + if !iterator.Valid() { + return nil, false + } + + csKey := iterator.Value() + + return getTmConsensusState(clientStore, cdc, csKey) +} + +// PruneAllExpiredConsensusStates iterates over all consensus states for a given +// client store. If a consensus state is expired, it is deleted and its metadata +// is deleted. The number of consensus states pruned is returned. +func PruneAllExpiredConsensusStates( + ctx sdk.Context, clientStore storetypes.KVStore, + cdc codec.BinaryCodec, clientState *ClientState, +) int { + var heights []exported.Height + + pruneCb := func(height exported.Height) bool { + consState, found := GetConsensusState(clientStore, cdc, height) + if !found { // consensus state should always be found + return true + } + if clientState.IsExpired(consState.Timestamp, ctx.BlockTime()) { + heights = append(heights, height) + } + + return false + } + + IterateConsensusStateAscending(clientStore, pruneCb) + + for _, height := range heights { + deleteConsensusState(clientStore, height) + deleteConsensusMetadata(clientStore, height) + } + + return len(heights) +} + +// Helper function for GetNextConsensusState and GetPreviousConsensusState +func getTmConsensusState(clientStore storetypes.KVStore, cdc codec.BinaryCodec, key []byte) (*ConsensusState, bool) { + bz := clientStore.Get(key) + if len(bz) == 0 { + return nil, false + } + + consensusStateI, err := clienttypes.UnmarshalConsensusState(cdc, bz) + if err != nil { + return nil, false + } + + consensusState, ok := consensusStateI.(*ConsensusState) + if !ok { + return nil, false + } + return consensusState, true +} + +func bigEndianHeightBytes(height exported.Height) []byte { + heightBytes := make([]byte, 16) + binary.BigEndian.PutUint64(heightBytes, height.GetRevisionNumber()) + binary.BigEndian.PutUint64(heightBytes[8:], height.GetRevisionHeight()) + return heightBytes +} + +// setConsensusMetadata sets context time as processed time and set context height as processed height +// as this is internal gno light client logic. +// client state and consensus state will be set by client keeper +// set iteration key to provide ability for efficient ordered iteration of consensus states. +func setConsensusMetadata(ctx sdk.Context, clientStore storetypes.KVStore, height exported.Height) { + setConsensusMetadataWithValues(clientStore, height, clienttypes.GetSelfHeight(ctx), uint64(ctx.BlockTime().UnixNano())) +} + +// setConsensusMetadataWithValues sets the consensus metadata with the provided values +func setConsensusMetadataWithValues( + clientStore storetypes.KVStore, height, + processedHeight exported.Height, + processedTime uint64, +) { + SetProcessedTime(clientStore, height, processedTime) + SetProcessedHeight(clientStore, height, processedHeight) + SetIterationKey(clientStore, height) +} + +// deleteConsensusMetadata deletes the metadata stored for a particular consensus state. +func deleteConsensusMetadata(clientStore storetypes.KVStore, height exported.Height) { + deleteProcessedTime(clientStore, height) + deleteProcessedHeight(clientStore, height) + deleteIterationKey(clientStore, height) +} diff --git a/modules/10-gno/store_test.go b/modules/10-gno/store_test.go new file mode 100644 index 000000000..c4a24c95c --- /dev/null +++ b/modules/10-gno/store_test.go @@ -0,0 +1,199 @@ +package gno_test + +import ( + "math" + "time" + + gno "github.com/atomone-hub/atomone/modules/10-gno" + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v10/modules/core/23-commitment/types" + host "github.com/cosmos/ibc-go/v10/modules/core/24-host" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + solomachine "github.com/cosmos/ibc-go/v10/modules/light-clients/06-solomachine" + ibctesting "github.com/cosmos/ibc-go/v10/testing" +) + +func (suite *GnoTestSuite) TestGetConsensusState() { + var ( + height exported.Height + path *ibctesting.Path + ) + + testCases := []struct { + name string + malleate func() + expPass bool + expPanic bool + }{ + { + "success", func() {}, true, false, + }, + { + "consensus state not found", func() { + // use height with no consensus state set + height = height.Increment() + }, false, false, + }, + { + "not a consensus state interface", func() { + // marshal an empty client state and set as consensus state + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + clientStateBz := clienttypes.MustMarshalClientState(suite.chainA.App.AppCodec(), &gno.ClientState{}) + store.Set(host.ConsensusStateKey(height), clientStateBz) + }, false, true, + }, + { + "invalid consensus state (solomachine)", func() { + // marshal and set solomachine consensus state + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + consensusStateBz := clienttypes.MustMarshalConsensusState(suite.chainA.App.AppCodec(), &solomachine.ConsensusState{}) + store.Set(host.ConsensusStateKey(height), consensusStateBz) + }, false, true, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() + path = ibctesting.NewPath(suite.chainA, suite.chainB) + + path.Setup() + + height = path.EndpointA.GetClientLatestHeight() + + tc.malleate() // change vars as necessary + + if tc.expPanic { + suite.Require().Panics(func() { + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + gno.GetConsensusState(store, suite.chainA.Codec, height) + }) + + return + } + + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + consensusState, found := gno.GetConsensusState(store, suite.chainA.Codec, height) + + if tc.expPass { + suite.Require().True(found) + + expConsensusState, found := suite.chainA.GetConsensusState(path.EndpointA.ClientID, height) + suite.Require().True(found) + suite.Require().Equal(expConsensusState, consensusState) + } else { + suite.Require().False(found) + suite.Require().Nil(consensusState) + } + }) + } +} + +func (suite *GnoTestSuite) TestGetProcessedTime() { + path := ibctesting.NewPath(suite.chainA, suite.chainB) + suite.coordinator.UpdateTime() + + expectedTime := suite.chainA.ProposedHeader.Time + + // Verify ProcessedTime on CreateClient + err := path.EndpointA.CreateClient() + suite.Require().NoError(err) + + height := path.EndpointA.GetClientLatestHeight() + + store := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + actualTime, ok := gno.GetProcessedTime(store, height) + suite.Require().True(ok, "could not retrieve processed time for stored consensus state") + suite.Require().Equal(uint64(expectedTime.UnixNano()), actualTime, "retrieved processed time is not expected value") + + suite.coordinator.UpdateTime() + // coordinator increments time before updating client + expectedTime = suite.chainA.ProposedHeader.Time.Add(ibctesting.TimeIncrement) + + // Verify ProcessedTime on UpdateClient + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height = path.EndpointA.GetClientLatestHeight() + + store = suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + actualTime, ok = gno.GetProcessedTime(store, height) + suite.Require().True(ok, "could not retrieve processed time for stored consensus state") + suite.Require().Equal(uint64(expectedTime.UnixNano()), actualTime, "retrieved processed time is not expected value") + + // try to get processed time for height that doesn't exist in store + _, ok = gno.GetProcessedTime(store, clienttypes.NewHeight(1, 1)) + suite.Require().False(ok, "retrieved processed time for a non-existent consensus state") +} + +func (suite *GnoTestSuite) TestIterationKey() { + testHeights := []exported.Height{ + clienttypes.NewHeight(0, 1), + clienttypes.NewHeight(0, 1234), + clienttypes.NewHeight(7890, 4321), + clienttypes.NewHeight(math.MaxUint64, math.MaxUint64), + } + for _, h := range testHeights { + k := gno.IterationKey(h) + retrievedHeight := gno.GetHeightFromIterationKey(k) + suite.Require().Equal(h, retrievedHeight, "retrieving height from iteration key failed") + } +} + +func (suite *GnoTestSuite) TestIterateConsensusStates() { + nextValsHash := []byte("nextVals") + + // Set iteration keys and consensus states + gno.SetIterationKey(suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), "testClient"), clienttypes.NewHeight(0, 1)) + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState(suite.chainA.GetContext(), "testClient", clienttypes.NewHeight(0, 1), gno.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("hash0-1")), nextValsHash)) + gno.SetIterationKey(suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), "testClient"), clienttypes.NewHeight(4, 9)) + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState(suite.chainA.GetContext(), "testClient", clienttypes.NewHeight(4, 9), gno.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("hash4-9")), nextValsHash)) + gno.SetIterationKey(suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), "testClient"), clienttypes.NewHeight(0, 10)) + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState(suite.chainA.GetContext(), "testClient", clienttypes.NewHeight(0, 10), gno.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("hash0-10")), nextValsHash)) + gno.SetIterationKey(suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), "testClient"), clienttypes.NewHeight(0, 4)) + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState(suite.chainA.GetContext(), "testClient", clienttypes.NewHeight(0, 4), gno.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("hash0-4")), nextValsHash)) + gno.SetIterationKey(suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), "testClient"), clienttypes.NewHeight(40, 1)) + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState(suite.chainA.GetContext(), "testClient", clienttypes.NewHeight(40, 1), gno.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("hash40-1")), nextValsHash)) + + var testArr []string + cb := func(height exported.Height) bool { + testArr = append(testArr, height.String()) + return false + } + + gno.IterateConsensusStateAscending(suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), "testClient"), cb) + expectedArr := []string{"0-1", "0-4", "0-10", "4-9", "40-1"} + suite.Require().Equal(expectedArr, testArr) +} + +func (suite *GnoTestSuite) TestGetNeighboringConsensusStates() { + nextValsHash := []byte("nextVals") + cs01 := gno.NewConsensusState(time.Now().UTC(), commitmenttypes.NewMerkleRoot([]byte("hash0-1")), nextValsHash) + cs04 := gno.NewConsensusState(time.Now().UTC(), commitmenttypes.NewMerkleRoot([]byte("hash0-4")), nextValsHash) + cs49 := gno.NewConsensusState(time.Now().UTC(), commitmenttypes.NewMerkleRoot([]byte("hash4-9")), nextValsHash) + height01 := clienttypes.NewHeight(0, 1) + height04 := clienttypes.NewHeight(0, 4) + height49 := clienttypes.NewHeight(4, 9) + + // Set iteration keys and consensus states + gno.SetIterationKey(suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), "testClient"), height01) + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState(suite.chainA.GetContext(), "testClient", height01, cs01) + gno.SetIterationKey(suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), "testClient"), height04) + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState(suite.chainA.GetContext(), "testClient", height04, cs04) + gno.SetIterationKey(suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), "testClient"), height49) + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState(suite.chainA.GetContext(), "testClient", height49, cs49) + + prevCs01, ok := gno.GetPreviousConsensusState(suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), "testClient"), suite.chainA.Codec, height01) + suite.Require().Nil(prevCs01, "consensus state exists before lowest consensus state") + suite.Require().False(ok) + prevCs49, ok := gno.GetPreviousConsensusState(suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), "testClient"), suite.chainA.Codec, height49) + suite.Require().Equal(cs04, prevCs49, "previous consensus state is not returned correctly") + suite.Require().True(ok) + + nextCs01, ok := gno.GetNextConsensusState(suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), "testClient"), suite.chainA.Codec, height01) + suite.Require().Equal(cs04, nextCs01, "next consensus state not returned correctly") + suite.Require().True(ok) + nextCs49, ok := gno.GetNextConsensusState(suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), "testClient"), suite.chainA.Codec, height49) + suite.Require().Nil(nextCs49, "next consensus state exists after highest consensus state") + suite.Require().False(ok) +} diff --git a/modules/10-gno/update.go b/modules/10-gno/update.go new file mode 100644 index 000000000..92b462216 --- /dev/null +++ b/modules/10-gno/update.go @@ -0,0 +1,343 @@ +package gno + +import ( + "bytes" + "errors" + "fmt" + + bfttypes "github.com/gnolang/gno/tm2/pkg/bft/types" + "github.com/gnolang/gno/tm2/pkg/crypto" + "github.com/gnolang/gno/tm2/pkg/crypto/ed25519" + + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v10/modules/core/23-commitment/types" + host "github.com/cosmos/ibc-go/v10/modules/core/24-host" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + + errorsmod "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// VerifyClientMessage checks if the clientMessage is of type Header or Misbehaviour and verifies the message +func (cs *ClientState) VerifyClientMessage( + ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, + clientMsg exported.ClientMessage, +) error { + switch msg := clientMsg.(type) { + case *Header: + return cs.verifyHeader(ctx, clientStore, cdc, msg) + case *Misbehaviour: + return cs.verifyMisbehaviour(ctx, clientStore, cdc, msg) + default: + return clienttypes.ErrInvalidClientType + } +} + +// verifyHeader returns an error if: +// - the client or header provided are not parseable to gno types +// - the header is invalid +// - header height is less than or equal to the trusted header height +// - header revision is not equal to trusted header revision +// - header valset commit verification fails +// - header timestamp is past the trusting period in relation to the consensus state +// - header timestamp is less than or equal to the consensus state timestamp +func (cs *ClientState) verifyHeader( + ctx sdk.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, + header *Header, +) error { + currentTimestamp := ctx.BlockTime() + fmt.Println(currentTimestamp) + // Retrieve trusted consensus states for each Header in misbehaviour + consState, found := GetConsensusState(clientStore, cdc, header.TrustedHeight) + fmt.Println(consState.LcType) + fmt.Println(consState.Root) + fmt.Println(header.TrustedHeight) + if !found { + return errorsmod.Wrapf(clienttypes.ErrConsensusStateNotFound, "could not get trusted consensus state from clientStore for Header at TrustedHeight: %s", header.TrustedHeight) + } + fmt.Println(consState.NextValidatorsHash) + if err := checkTrustedHeader(header, consState); err != nil { + return err + } + + // UpdateClient only accepts updates with a header at the same revision + // as the trusted consensus state + if header.GetHeight().GetRevisionNumber() != header.TrustedHeight.RevisionNumber { + return errorsmod.Wrapf( + ErrInvalidHeaderHeight, + "header height revision %d does not match trusted header revision %d", + header.GetHeight().GetRevisionNumber(), header.TrustedHeight.RevisionNumber, + ) + } + + gnoTrustedValidators := bfttypes.ValidatorSet{ + Validators: make([]*bfttypes.Validator, len(header.TrustedValidators.Validators)), + Proposer: nil, + } + for i, val := range header.TrustedValidators.Validators { + key := val.PubKey + if (key.GetEd25519()) == nil { + return errorsmod.Wrap(clienttypes.ErrInvalidHeader, "validator pubkey is not ed25519") + } + gnoTrustedValidators.Validators[i] = &bfttypes.Validator{ + Address: crypto.MustAddressFromString(val.Address), + PubKey: ed25519.PubKeyEd25519(key.GetEd25519()), + VotingPower: val.VotingPower, + ProposerPriority: val.ProposerPriority, + } + } + gnoTrustedValidators.TotalVotingPower() // ensure TotalVotingPower is set + if gnoTrustedValidators.IsNilOrEmpty() { + return errorsmod.Wrap(errors.New("not gno validators"), "trusted validator set in not gno validator set type") + } + var dataHash []byte + var lastResultsHash []byte + if len(header.SignedHeader.Header.DataHash) == 0 { + dataHash = nil + } else { + dataHash = header.SignedHeader.Header.DataHash + } + if len(header.SignedHeader.Header.LastResultsHash) == 0 { + lastResultsHash = nil + } else { + lastResultsHash = header.SignedHeader.Header.LastResultsHash + } + gnoHeader := bfttypes.Header{ + Version: header.SignedHeader.Header.Version, + ChainID: header.SignedHeader.Header.ChainId, + Height: header.SignedHeader.Header.Height, + Time: header.SignedHeader.Header.Time, + NumTxs: header.SignedHeader.Header.NumTxs, + TotalTxs: header.SignedHeader.Header.TotalTxs, + LastBlockID: bfttypes.BlockID{Hash: header.SignedHeader.Header.LastBlockId.Hash, PartsHeader: bfttypes.PartSetHeader{Total: int(header.SignedHeader.Header.LastBlockId.PartsHeader.Total), Hash: header.SignedHeader.Header.LastBlockId.PartsHeader.Hash}}, + LastCommitHash: header.SignedHeader.Header.LastCommitHash, + DataHash: dataHash, + ValidatorsHash: header.SignedHeader.Header.ValidatorsHash, + NextValidatorsHash: header.SignedHeader.Header.NextValidatorsHash, + ConsensusHash: header.SignedHeader.Header.ConsensusHash, + AppHash: header.SignedHeader.Header.AppHash, + LastResultsHash: lastResultsHash, + ProposerAddress: crypto.MustAddressFromString(header.SignedHeader.Header.ProposerAddress), + } + gnoCommit := bfttypes.Commit{ + BlockID: bfttypes.BlockID{Hash: header.SignedHeader.Commit.BlockId.Hash, PartsHeader: bfttypes.PartSetHeader{Total: int(header.SignedHeader.Commit.BlockId.PartsHeader.Total), Hash: header.SignedHeader.Commit.BlockId.PartsHeader.Hash}}, + Precommits: make([]*bfttypes.CommitSig, len(header.SignedHeader.Commit.Precommits)), + } + for i, sig := range header.SignedHeader.Commit.Precommits { + if sig == nil { + continue + } + gnoCommit.Precommits[i] = &bfttypes.CommitSig{ + ValidatorIndex: int(sig.ValidatorIndex), + Signature: sig.Signature, + BlockID: bfttypes.BlockID{Hash: sig.BlockId.Hash, PartsHeader: bfttypes.PartSetHeader{Total: int(sig.BlockId.PartsHeader.Total), Hash: sig.BlockId.PartsHeader.Hash}}, + Type: bfttypes.SignedMsgType(sig.Type), + Height: sig.Height, + Round: int(sig.Round), + Timestamp: sig.Timestamp, + ValidatorAddress: crypto.MustAddressFromString(sig.ValidatorAddress), + } + } + gnoSignedHeader := bfttypes.SignedHeader{ + Header: &gnoHeader, + Commit: &gnoCommit, + } + err := gnoSignedHeader.ValidateBasic(header.SignedHeader.Header.ChainId) // ensure signed header is valid + if err != nil { + return errorsmod.Wrap(err, "signed header in not gno signed header type") + } + + gnoValidatorSet := bfttypes.ValidatorSet{ + Validators: make([]*bfttypes.Validator, len(header.ValidatorSet.Validators)), + Proposer: nil, + } + for i, val := range header.ValidatorSet.Validators { + key := val.PubKey + if (key.GetEd25519()) == nil { + return errorsmod.Wrap(clienttypes.ErrInvalidHeader, "validator pubkey is not ed25519") + } + gnoValidatorSet.Validators[i] = &bfttypes.Validator{ + Address: crypto.MustAddressFromString(val.Address), + PubKey: ed25519.PubKeyEd25519(key.GetEd25519()), + VotingPower: val.VotingPower, + ProposerPriority: val.ProposerPriority, + } + } + gnoValidatorSet.TotalVotingPower() // ensure TotalVotingPower is set + if gnoValidatorSet.IsNilOrEmpty() { + return errorsmod.Wrap(errors.New("not gno validators"), "trusted validator set in not gno validator set type") + } + + // assert header height is newer than consensus state + if header.GetHeight().LTE(header.TrustedHeight) { + return errorsmod.Wrapf( + clienttypes.ErrInvalidHeader, + "header height ≤ consensus state height (%s ≤ %s)", header.GetHeight(), header.TrustedHeight, + ) + } + + // Construct a trusted header using the fields in consensus state + // Only Height, Time, and NextValidatorsHash are necessary for verification + // NOTE: updates must be within the same revision + trustedHeader := bfttypes.Header{ + ChainID: cs.GetChainID(), + Height: int64(header.TrustedHeight.RevisionHeight), + Time: consState.Timestamp, + NextValidatorsHash: consState.NextValidatorsHash, + } + signedHeader := bfttypes.SignedHeader{ + Header: &trustedHeader, + } + + // Verify next header with the passed-in trustedVals + // - asserts trusting period not passed + // - assert header timestamp is not past the trusting period + // - assert header timestamp is past latest stored consensus state timestamp + // - assert that a TrustLevel proportion of TrustedValidators signed new Commit + + // TODO: replace with gno light client verification + err = Verify( + &signedHeader, + &gnoTrustedValidators, &gnoSignedHeader, &gnoValidatorSet, + cs.TrustingPeriod, currentTimestamp, cs.MaxClockDrift, cs.TrustLevel.ToTendermint(), + ) + if err != nil { + return errorsmod.Wrap(err, "failed to verify header") + } + + return nil +} + +// UpdateState may be used to either create a consensus state for: +// - a future height greater than the latest client state height +// - a past height that was skipped during bisection +// If we are updating to a past height, a consensus state is created for that height to be persisted in client store +// If we are updating to a future height, the consensus state is created and the client state is updated to reflect +// the new latest height +// A list containing the updated consensus height is returned. +// UpdateState must only be used to update within a single revision, thus header revision number and trusted height's revision +// number must be the same. To update to a new revision, use a separate upgrade path +// UpdateState will prune the oldest consensus state if it is expired. +// If the provided clientMsg is not of type of Header then the handler will noop and empty slice is returned. +func (cs ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) []exported.Height { + header, ok := clientMsg.(*Header) + if !ok { + // clientMsg is invalid Misbehaviour, no update necessary + return []exported.Height{} + } + + // performance: do not prune in checkTx + // simulation must prune for accurate gas estimation + if (!ctx.IsCheckTx() && !ctx.IsReCheckTx()) || ctx.ExecMode() == sdk.ExecModeSimulate { + cs.pruneOldestConsensusState(ctx, cdc, clientStore) + } + + // check for duplicate update + if _, found := GetConsensusState(clientStore, cdc, header.GetHeight()); found { + // perform no-op + return []exported.Height{header.GetHeight()} + } + + height, ok := header.GetHeight().(clienttypes.Height) + if !ok { + panic(fmt.Errorf("cannot convert %T to %T", header.GetHeight(), &clienttypes.Height{})) + } + if height.GT(cs.LatestHeight) { + cs.LatestHeight = height + } + + consensusState := &ConsensusState{ + Timestamp: header.GetTime(), + Root: commitmenttypes.NewMerkleRoot(header.SignedHeader.Header.AppHash), + NextValidatorsHash: header.SignedHeader.Header.NextValidatorsHash, + } + + // set client state, consensus state and associated metadata + setClientState(clientStore, cdc, &cs) + setConsensusState(clientStore, cdc, consensusState, header.GetHeight()) + setConsensusMetadata(ctx, clientStore, header.GetHeight()) + + return []exported.Height{height} +} + +// pruneOldestConsensusState will retrieve the earliest consensus state for this clientID and check if it is expired. If it is, +// that consensus state will be pruned from store along with all associated metadata. This will prevent the client store from +// becoming bloated with expired consensus states that can no longer be used for updates and packet verification. +func (cs ClientState) pruneOldestConsensusState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore) { + // Check the earliest consensus state to see if it is expired, if so then set the prune height + // so that we can delete consensus state and all associated metadata. + var ( + pruneHeight exported.Height + ) + + pruneCb := func(height exported.Height) bool { + consState, found := GetConsensusState(clientStore, cdc, height) + // this error should never occur + if !found { + panic(errorsmod.Wrapf(clienttypes.ErrConsensusStateNotFound, "failed to retrieve consensus state at height: %s", height)) + } + + if cs.IsExpired(consState.Timestamp, ctx.BlockTime()) { + pruneHeight = height + } + + return true + } + + IterateConsensusStateAscending(clientStore, pruneCb) + + // if pruneHeight is set, delete consensus state and metadata + if pruneHeight != nil { + deleteConsensusState(clientStore, pruneHeight) + deleteConsensusMetadata(clientStore, pruneHeight) + } +} + +// UpdateStateOnMisbehaviour updates state upon misbehaviour, freezing the ClientState. This method should only be called when misbehaviour is detected +// as it does not perform any misbehaviour checks. +func (cs ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, _ exported.ClientMessage) { + cs.FrozenHeight = FrozenHeight + + clientStore.Set(host.ClientStateKey(), clienttypes.MustMarshalClientState(cdc, &cs)) +} + +// checkTrustedHeader checks that consensus state matches trusted fields of Header +func checkTrustedHeader(header *Header, consState *ConsensusState) error { + gnoTrustedValset := bfttypes.ValidatorSet{ + Validators: make([]*bfttypes.Validator, len(header.TrustedValidators.Validators)), + Proposer: nil, + } + for i, val := range header.TrustedValidators.Validators { + key := val.PubKey + if (key.GetEd25519()) == nil { + return errorsmod.Wrap(clienttypes.ErrInvalidHeader, "validator pubkey is not ed25519") + } + fmt.Println(key.GetEd25519()) + fmt.Println(val.VotingPower) + gnoTrustedValset.Validators[i] = &bfttypes.Validator{ + Address: crypto.MustAddressFromString(val.Address), + PubKey: ed25519.PubKeyEd25519(key.GetEd25519()), + VotingPower: val.VotingPower, + ProposerPriority: val.ProposerPriority, + } + } + gnoTrustedValset.TotalVotingPower() // ensure TotalVotingPower is set + if gnoTrustedValset.IsNilOrEmpty() { + return errorsmod.Wrap(errors.New("empty trusted validator set"), "trusted validator set is not gno validator set type") + } + + // assert that trustedVals is NextValidators of last trusted header + // to do this, we check that trustedVals.Hash() == consState.NextValidatorsHash + tvalHash := gnoTrustedValset.Hash() + if !bytes.Equal(consState.NextValidatorsHash, tvalHash) { + return errorsmod.Wrapf( + ErrInvalidValidatorSet, + "trusted validators %s, does not hash to latest trusted validators. Expected: %X, got: %X", + header.TrustedValidators, consState.NextValidatorsHash, tvalHash, + ) + } + return nil +} diff --git a/modules/10-gno/update_test.go b/modules/10-gno/update_test.go new file mode 100644 index 000000000..09ae34e3d --- /dev/null +++ b/modules/10-gno/update_test.go @@ -0,0 +1,958 @@ +package gno_test + +import ( + "errors" + "time" + + storetypes "cosmossdk.io/store/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + + bfttypes "github.com/gnolang/gno/tm2/pkg/bft/types" + + ibcgno "github.com/atomone-hub/atomone/modules/10-gno" + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v10/modules/core/23-commitment/types" + host "github.com/cosmos/ibc-go/v10/modules/core/24-host" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + ibctesting "github.com/cosmos/ibc-go/v10/testing" +) + +func (suite *GnoTestSuite) TestVerifyHeader() { + var ( + path *ibctesting.Path + header *ibcgno.Header + ) + + // Setup different validators and signers for testing different types of updates + altPrivVal := bfttypes.NewMockPV() + altPubKey := altPrivVal.PubKey() + suite.Require().NotNil(altPubKey) + + revisionHeight := int64(height.RevisionHeight) + + // create modified heights to use for test-cases + altVal := bfttypes.NewValidator(altPubKey, 100) + // Create alternative validator set with only altVal, invalid update (too much change in valSet) + altValSet := bfttypes.NewValidatorSet([]*bfttypes.Validator{altVal}) + altSigners := getAltSigners(altVal, altPrivVal) + + testCases := []struct { + name string + malleate func() + expErr error + }{ + { + name: "success", + malleate: func() {}, + expErr: nil, + }, + { + name: "successful verify header for header with a previous height", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight+1] + suite.Require().True(ok) + + // passing the ProposedHeader.Height as the block height as it will become a previous height once we commit N blocks + header = suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers) + + // commit some blocks so that the created Header now has a previous height as the BlockHeight + suite.coordinator.CommitNBlocks(suite.chainB, 5) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + }, + expErr: nil, + }, + { + name: "successful verify header: header with future height and different validator set", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight+1] + suite.Require().True(ok) + + // Create bothValSet with both suite validator and altVal + bothValSet := bfttypes.NewValidatorSet(append(suite.chainB.Vals.Validators, altVal)) + bothSigners := suite.chainB.Signers + bothSigners[altVal.Address.String()] = altPrivVal + + header = suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+5, trustedHeight, suite.chainB.ProposedHeader.Time, bothValSet, suite.chainB.NextVals, trustedVals, bothSigners) + }, + expErr: nil, + }, + { + name: "successful verify header: header with next height and different validator set", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight+1] + suite.Require().True(ok) + + // Create bothValSet with both suite validator and altVal + bothValSet := bfttypes.NewValidatorSet(append(suite.chainB.Vals.Validators, altVal)) + bothSigners := suite.chainB.Signers + bothSigners[altVal.Address.String()] = altPrivVal + + header = suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight, suite.chainB.ProposedHeader.Time, bothValSet, suite.chainB.NextVals, trustedVals, bothSigners) + }, + expErr: nil, + }, + { + name: "unsuccessful updates, passed in incorrect trusted validators for given consensus state", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + // Create bothValSet with both suite validator and altVal + bothValSet := bfttypes.NewValidatorSet(append(suite.chainB.Vals.Validators, altVal)) + bothSigners := suite.chainB.Signers + bothSigners[altVal.Address.String()] = altPrivVal + + header = suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+1, trustedHeight, suite.chainB.ProposedHeader.Time, bothValSet, bothValSet, bothValSet, bothSigners) + }, + expErr: errors.New("invalid validator set"), + }, + { + name: "unsuccessful verify header with next height: update header mismatches nextValSetHash", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight+1] + suite.Require().True(ok) + + // this will err as altValSet.Hash() != consState.NextValidatorsHash + header = suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+1, trustedHeight, suite.chainB.ProposedHeader.Time, altValSet, altValSet, trustedVals, altSigners) + }, + expErr: errors.New("failed to verify header"), + }, + { + name: "unsuccessful update with future height: too much change in validator set", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight+1] + suite.Require().True(ok) + + header = suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+1, trustedHeight, suite.chainB.ProposedHeader.Time, altValSet, altValSet, trustedVals, altSigners) + }, + expErr: errors.New("failed to verify header: cant trust new val set"), + }, + { + name: "unsuccessful verify header: header height revision and trusted height revision mismatch", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight+1] + suite.Require().True(ok) + + header = suite.chainB.CreateTMClientHeader(chainIDRevision1, 3, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers) + }, + expErr: errors.New("invalid client header"), + }, + { + name: "unsuccessful verify header: header height < consensus height", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight+1] + suite.Require().True(ok) + + heightMinus1 := clienttypes.NewHeight(trustedHeight.RevisionNumber, trustedHeight.RevisionHeight-1) + + // Make new header at height less than latest client state + header = suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(heightMinus1.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers) + }, + expErr: errors.New("invalid client header"), + }, + { + name: "unsuccessful verify header: header basic validation failed", + malleate: func() { + // cause header to fail validatebasic by changing commit height to mismatch header height + header.Commit.Height = revisionHeight - 1 + }, + expErr: errors.New("header and commit height mismatch"), + }, + { + name: "unsuccessful verify header: header timestamp is not past last client timestamp", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + header = suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+1, trustedHeight, suite.chainB.ProposedHeader.Time.Add(-time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers) + }, + expErr: errors.New("failed to verify header"), + }, + { + name: "unsuccessful verify header: header with incorrect header chain-id", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + header = suite.chainB.CreateTMClientHeader(chainID, suite.chainB.ProposedHeader.Height+1, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers) + }, + expErr: errors.New("header height revision 0 does not match trusted header revision 1"), + }, + { + name: "unsuccessful update: trusting period has passed since last client timestamp", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight] + suite.Require().True(ok) + + header = suite.chainA.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+1, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers) + + suite.chainB.ExpireClient(ibctesting.TrustingPeriod) + }, + expErr: errors.New("failed to verify header"), + }, + { + name: "unsuccessful update for a previous revision", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight+1] + suite.Require().True(ok) + + // passing the ProposedHeader.Height as the block height as it will become an update to previous revision once we upgrade the client + header = suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers) + + // increment the revision of the chain + err = path.EndpointB.UpgradeChain() + suite.Require().NoError(err) + }, + expErr: errors.New("failed to verify header"), + }, + { + name: "successful update with identical header to a previous update", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight+1] + suite.Require().True(ok) + + // passing the ProposedHeader.Height as the block height as it will become a previous height once we commit N blocks + header = suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers) + + // update client so the header constructed becomes a duplicate + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + }, + expErr: nil, + }, + + { + name: "unsuccessful update to a future revision", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight+1] + suite.Require().True(ok) + + header = suite.chainB.CreateTMClientHeader(suite.chainB.ChainID+"-1", suite.chainB.ProposedHeader.Height+5, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers) + }, + expErr: errors.New("failed to verify header"), + }, + + { + name: "unsuccessful update: header height revision and trusted height revision mismatch", + malleate: func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight+1] + suite.Require().True(ok) + + // increment the revision of the chain + err = path.EndpointB.UpgradeChain() + suite.Require().NoError(err) + + header = suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers) + }, + expErr: errors.New("header height revision 2 does not match trusted header revision 1"), + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() + path = ibctesting.NewPath(suite.chainA, suite.chainB) + + err := path.EndpointA.CreateClient() + suite.Require().NoError(err) + + // ensure counterparty state is committed + suite.coordinator.CommitBlock(suite.chainB) + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + header, err = path.EndpointA.Counterparty.Chain.IBCClientHeader(path.EndpointA.Counterparty.Chain.LatestCommittedHeader, trustedHeight) + suite.Require().NoError(err) + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().NoError(err) + + tc.malleate() + + err = lightClientModule.VerifyClientMessage(suite.chainA.GetContext(), path.EndpointA.ClientID, header) + + if tc.expErr == nil { + suite.Require().NoError(err, tc.name) + } else { + suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.expErr.Error()) + } + }) + } +} + +func (suite *GnoTestSuite) TestUpdateState() { + var ( + path *ibctesting.Path + clientMessage exported.ClientMessage + clientStore storetypes.KVStore + consensusHeights []exported.Height + pruneHeight clienttypes.Height + prevClientState exported.ClientState + prevConsensusState exported.ConsensusState + ) + + testCases := []struct { + name string + malleate func() + expResult func() + expPass bool + }{ + { + "success with height later than latest height", func() { + tmHeader, ok := clientMessage.(*ibcgno.Header) + suite.Require().True(ok) + suite.Require().True(path.EndpointA.GetClientLatestHeight().(clienttypes.Height).LT(tmHeader.GetHeight())) + }, + func() { + tmHeader, ok := clientMessage.(*ibcgno.Header) + suite.Require().True(ok) + + clientState, ok := path.EndpointA.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + suite.Require().True(clientState.LatestHeight.EQ(tmHeader.GetHeight())) // new update, updated client state should have changed + suite.Require().True(clientState.LatestHeight.EQ(consensusHeights[0])) + }, true, + }, + { + "success with height earlier than latest height", func() { + // commit a block so the pre-created ClientMessage + // isn't used to update the client to a newer height + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + tmHeader, ok := clientMessage.(*ibcgno.Header) + suite.Require().True(ok) + suite.Require().True(path.EndpointA.GetClientLatestHeight().(clienttypes.Height).GT(tmHeader.GetHeight())) + + prevClientState = path.EndpointA.GetClientState() + }, + func() { + clientState, ok := path.EndpointA.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + suite.Require().Equal(clientState, prevClientState) // fill in height, no change to client state + suite.Require().True(clientState.LatestHeight.GT(consensusHeights[0])) + }, true, + }, + { + "success with duplicate header", func() { + // update client in advance + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + // use the same header which just updated the client + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + clientMessage, err = path.EndpointA.Counterparty.Chain.IBCClientHeader(path.EndpointA.Counterparty.Chain.LatestCommittedHeader, trustedHeight) + suite.Require().NoError(err) + + tmHeader, ok := clientMessage.(*ibcgno.Header) + suite.Require().True(ok) + suite.Require().Equal(path.EndpointA.GetClientLatestHeight().(clienttypes.Height), tmHeader.GetHeight()) + + prevClientState = path.EndpointA.GetClientState() + prevConsensusState = path.EndpointA.GetConsensusState(tmHeader.GetHeight()) + }, + func() { + clientState, ok := path.EndpointA.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + suite.Require().Equal(clientState, prevClientState) + suite.Require().True(clientState.LatestHeight.EQ(consensusHeights[0])) + + tmHeader, ok := clientMessage.(*ibcgno.Header) + suite.Require().True(ok) + suite.Require().Equal(path.EndpointA.GetConsensusState(tmHeader.GetHeight()), prevConsensusState) + }, true, + }, + { + "success with pruned consensus state", func() { + // this height will be expired and pruned + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + var ok bool + pruneHeight, ok = path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + // Increment the time by a week + suite.coordinator.IncrementTimeBy(7 * 24 * time.Hour) + + // create the consensus state that can be used as trusted height for next update + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + // Increment the time by another week, then update the client. + // This will cause the first two consensus states to become expired. + suite.coordinator.IncrementTimeBy(7 * 24 * time.Hour) + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + // ensure counterparty state is committed + suite.coordinator.CommitBlock(suite.chainB) + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + clientMessage, err = path.EndpointA.Counterparty.Chain.IBCClientHeader(path.EndpointA.Counterparty.Chain.LatestCommittedHeader, trustedHeight) + suite.Require().NoError(err) + }, + func() { + tmHeader, ok := clientMessage.(*ibcgno.Header) + suite.Require().True(ok) + + clientState, ok := path.EndpointA.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + suite.Require().True(clientState.LatestHeight.EQ(tmHeader.GetHeight())) // new update, updated client state should have changed + suite.Require().True(clientState.LatestHeight.EQ(consensusHeights[0])) + + // ensure consensus state was pruned + _, found := path.EndpointA.Chain.GetConsensusState(path.EndpointA.ClientID, pruneHeight) + suite.Require().False(found) + }, true, + }, + { + "success with pruned consensus state using duplicate header", func() { + // this height will be expired and pruned + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + var ok bool + pruneHeight, ok = path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + // assert that a consensus state exists at the prune height + consensusState, found := path.EndpointA.Chain.GetConsensusState(path.EndpointA.ClientID, pruneHeight) + suite.Require().True(found) + suite.Require().NotNil(consensusState) + + // Increment the time by a week + suite.coordinator.IncrementTimeBy(7 * 24 * time.Hour) + + // create the consensus state that can be used as trusted height for next update + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + // Increment the time by another week, then update the client. + // This will cause the first two consensus states to become expired. + suite.coordinator.IncrementTimeBy(7 * 24 * time.Hour) + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + // use the same header which just updated the client + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + clientMessage, err = path.EndpointA.Counterparty.Chain.IBCClientHeader(path.EndpointA.Counterparty.Chain.LatestCommittedHeader, trustedHeight) + suite.Require().NoError(err) + }, + func() { + tmHeader, ok := clientMessage.(*ibcgno.Header) + suite.Require().True(ok) + + clientState, ok := path.EndpointA.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + suite.Require().True(clientState.LatestHeight.EQ(tmHeader.GetHeight())) // new update, updated client state should have changed + suite.Require().True(clientState.LatestHeight.EQ(consensusHeights[0])) + + // ensure consensus state was pruned + _, found := path.EndpointA.Chain.GetConsensusState(path.EndpointA.ClientID, pruneHeight) + suite.Require().False(found) + }, true, + }, + { + "invalid ClientMessage type", func() { + clientMessage = &ibcgno.Misbehaviour{} + }, + func() {}, + false, + }, + } + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + pruneHeight = clienttypes.ZeroHeight() + path = ibctesting.NewPath(suite.chainA, suite.chainB) + + err := path.EndpointA.CreateClient() + suite.Require().NoError(err) + + // ensure counterparty state is committed + suite.coordinator.CommitBlock(suite.chainB) + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + clientMessage, err = path.EndpointA.Counterparty.Chain.IBCClientHeader(path.EndpointA.Counterparty.Chain.LatestCommittedHeader, trustedHeight) + suite.Require().NoError(err) + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().NoError(err) + + tc.malleate() + + clientStore = suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + + if tc.expPass { + consensusHeights = lightClientModule.UpdateState(suite.chainA.GetContext(), path.EndpointA.ClientID, clientMessage) + + header, ok := clientMessage.(*ibcgno.Header) + suite.Require().True(ok) + + expConsensusState := &ibcgno.ConsensusState{ + Timestamp: header.GetTime(), + Root: commitmenttypes.NewMerkleRoot(header.SignedHeader.Header.AppHash), + NextValidatorsHash: header.SignedHeader.Header.NextValidatorsHash, + } + + bz := clientStore.Get(host.ConsensusStateKey(header.GetHeight())) + updatedConsensusState := clienttypes.MustUnmarshalConsensusState(suite.chainA.App.AppCodec(), bz) + + suite.Require().Equal(expConsensusState, updatedConsensusState) + + } else { + consensusHeights = lightClientModule.UpdateState(suite.chainA.GetContext(), path.EndpointA.ClientID, clientMessage) + suite.Require().Empty(consensusHeights) + + consensusState, found := suite.chainA.GetSimApp().GetIBCKeeper().ClientKeeper.GetClientConsensusState(suite.chainA.GetContext(), path.EndpointA.ClientID, clienttypes.NewHeight(1, uint64(suite.chainB.GetContext().BlockHeight()))) + suite.Require().False(found) + suite.Require().Nil(consensusState) + } + + // perform custom checks + tc.expResult() + }) + } +} + +func (suite *GnoTestSuite) TestUpdateStateCheckTx() { + path := ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupClients() + + createClientMessage := func() exported.ClientMessage { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + header, err := path.EndpointB.Chain.IBCClientHeader(path.EndpointB.Chain.LatestCommittedHeader, trustedHeight) + suite.Require().NoError(err) + return header + } + + // get the first height as it will be pruned first. + var pruneHeight exported.Height + getFirstHeightCb := func(height exported.Height) bool { + pruneHeight = height + return true + } + ctx := path.EndpointA.Chain.GetContext() + clientStore := path.EndpointA.Chain.App.GetIBCKeeper().ClientKeeper.ClientStore(ctx, path.EndpointA.ClientID) + ibcgno.IterateConsensusStateAscending(clientStore, getFirstHeightCb) + + // Increment the time by a week + suite.coordinator.IncrementTimeBy(7 * 24 * time.Hour) + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().NoError(err) + + ctx = path.EndpointA.Chain.GetContext().WithIsCheckTx(true) + lightClientModule.UpdateState(ctx, path.EndpointA.ClientID, createClientMessage()) + + // Increment the time by another week, then update the client. + // This will cause the first two consensus states to become expired. + suite.coordinator.IncrementTimeBy(7 * 24 * time.Hour) + ctx = path.EndpointA.Chain.GetContext().WithIsCheckTx(true) + lightClientModule.UpdateState(ctx, path.EndpointA.ClientID, createClientMessage()) + + assertPrune := func(pruned bool) { + // check consensus states and associated metadata + consState, ok := path.EndpointA.Chain.GetConsensusState(path.EndpointA.ClientID, pruneHeight) + suite.Require().Equal(!pruned, ok) + + processTime, ok := ibcgno.GetProcessedTime(clientStore, pruneHeight) + suite.Require().Equal(!pruned, ok) + + processHeight, ok := ibcgno.GetProcessedHeight(clientStore, pruneHeight) + suite.Require().Equal(!pruned, ok) + + consKey := ibcgno.GetIterationKey(clientStore, pruneHeight) + + if pruned { + suite.Require().Nil(consState, "expired consensus state not pruned") + suite.Require().Empty(processTime, "processed time metadata not pruned") + suite.Require().Nil(processHeight, "processed height metadata not pruned") + suite.Require().Nil(consKey, "iteration key not pruned") + } else { + suite.Require().NotNil(consState, "expired consensus state pruned") + suite.Require().NotEqual(uint64(0), processTime, "processed time metadata pruned") + suite.Require().NotNil(processHeight, "processed height metadata pruned") + suite.Require().NotNil(consKey, "iteration key pruned") + } + } + + assertPrune(false) + + // simulation mode must prune to calculate gas correctly + ctx = ctx.WithExecMode(sdk.ExecModeSimulate) + lightClientModule.UpdateState(ctx, path.EndpointA.ClientID, createClientMessage()) + + assertPrune(true) +} + +func (suite *GnoTestSuite) TestPruneConsensusState() { + // create path and setup clients + path := ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupClients() + + // get the first height as it will be pruned first. + var pruneHeight exported.Height + getFirstHeightCb := func(height exported.Height) bool { + pruneHeight = height + return true + } + ctx := path.EndpointA.Chain.GetContext() + clientStore := path.EndpointA.Chain.App.GetIBCKeeper().ClientKeeper.ClientStore(ctx, path.EndpointA.ClientID) + ibcgno.IterateConsensusStateAscending(clientStore, getFirstHeightCb) + + // this height will be expired but not pruned + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + expiredHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + // expected values that must still remain in store after pruning + expectedConsState, ok := path.EndpointA.Chain.GetConsensusState(path.EndpointA.ClientID, expiredHeight) + suite.Require().True(ok) + ctx = path.EndpointA.Chain.GetContext() + clientStore = path.EndpointA.Chain.App.GetIBCKeeper().ClientKeeper.ClientStore(ctx, path.EndpointA.ClientID) + expectedProcessTime, ok := ibcgno.GetProcessedTime(clientStore, expiredHeight) + suite.Require().True(ok) + expectedProcessHeight, ok := ibcgno.GetProcessedHeight(clientStore, expiredHeight) + suite.Require().True(ok) + expectedConsKey := ibcgno.GetIterationKey(clientStore, expiredHeight) + suite.Require().NotNil(expectedConsKey) + + // Increment the time by a week + suite.coordinator.IncrementTimeBy(7 * 24 * time.Hour) + + // create the consensus state that can be used as trusted height for next update + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + // Increment the time by another week, then update the client. + // This will cause the first two consensus states to become expired. + suite.coordinator.IncrementTimeBy(7 * 24 * time.Hour) + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + ctx = path.EndpointA.Chain.GetContext() + clientStore = path.EndpointA.Chain.App.GetIBCKeeper().ClientKeeper.ClientStore(ctx, path.EndpointA.ClientID) + + // check that the first expired consensus state got deleted along with all associated metadata + consState, ok := path.EndpointA.Chain.GetConsensusState(path.EndpointA.ClientID, pruneHeight) + suite.Require().Nil(consState, "expired consensus state not pruned") + suite.Require().False(ok) + // check processed time metadata is pruned + processTime, ok := ibcgno.GetProcessedTime(clientStore, pruneHeight) + suite.Require().Equal(uint64(0), processTime, "processed time metadata not pruned") + suite.Require().False(ok) + processHeight, ok := ibcgno.GetProcessedHeight(clientStore, pruneHeight) + suite.Require().Nil(processHeight, "processed height metadata not pruned") + suite.Require().False(ok) + + // check iteration key metadata is pruned + consKey := ibcgno.GetIterationKey(clientStore, pruneHeight) + suite.Require().Nil(consKey, "iteration key not pruned") + + // check that second expired consensus state doesn't get deleted + // this ensures that there is a cap on gas cost of UpdateClient + consState, ok = path.EndpointA.Chain.GetConsensusState(path.EndpointA.ClientID, expiredHeight) + suite.Require().Equal(expectedConsState, consState, "consensus state incorrectly pruned") + suite.Require().True(ok) + // check processed time metadata is not pruned + processTime, ok = ibcgno.GetProcessedTime(clientStore, expiredHeight) + suite.Require().Equal(expectedProcessTime, processTime, "processed time metadata incorrectly pruned") + suite.Require().True(ok) + + // check processed height metadata is not pruned + processHeight, ok = ibcgno.GetProcessedHeight(clientStore, expiredHeight) + suite.Require().Equal(expectedProcessHeight, processHeight, "processed height metadata incorrectly pruned") + suite.Require().True(ok) + + // check iteration key metadata is not pruned + consKey = ibcgno.GetIterationKey(clientStore, expiredHeight) + suite.Require().Equal(expectedConsKey, consKey, "iteration key incorrectly pruned") +} + +func (suite *GnoTestSuite) TestCheckForMisbehaviour() { + var ( + path *ibctesting.Path + clientMessage exported.ClientMessage + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "valid update no misbehaviour", + func() {}, + false, + }, + { + "consensus state already exists, already updated", + func() { + header, ok := clientMessage.(*ibcgno.Header) + suite.Require().True(ok) + + consensusState := &ibcgno.ConsensusState{ + Timestamp: header.GetTime(), + Root: commitmenttypes.NewMerkleRoot(header.SignedHeader.Header.AppHash), + NextValidatorsHash: header.SignedHeader.Header.NextValidatorsHash, + } + + tmHeader, ok := clientMessage.(*ibcgno.Header) + suite.Require().True(ok) + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState(suite.chainA.GetContext(), path.EndpointA.ClientID, tmHeader.GetHeight(), consensusState) + }, + false, + }, + { + "invalid fork misbehaviour: identical headers", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight+1] + suite.Require().True(ok) + + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + height, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + misbehaviourHeader := suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, int64(height.RevisionHeight), trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers) + clientMessage = &ibcgno.Misbehaviour{ + Header1: misbehaviourHeader, + Header2: misbehaviourHeader, + } + }, false, + }, + { + "invalid time misbehaviour: monotonically increasing time", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight+1] + suite.Require().True(ok) + + clientMessage = &ibcgno.Misbehaviour{ + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+3, trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, false, + }, + { + "consensus state already exists, app hash mismatch", + func() { + header, ok := clientMessage.(*ibcgno.Header) + suite.Require().True(ok) + + consensusState := &ibcgno.ConsensusState{ + Timestamp: header.GetTime(), + Root: commitmenttypes.NewMerkleRoot([]byte{}), // empty bytes + NextValidatorsHash: header.Header.NextValidatorsHash, + } + + tmHeader, ok := clientMessage.(*ibcgno.Header) + suite.Require().True(ok) + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState(suite.chainA.GetContext(), path.EndpointA.ClientID, tmHeader.GetHeight(), consensusState) + }, + true, + }, + { + "previous consensus state exists and header time is before previous consensus state time", + func() { + header, ok := clientMessage.(*ibcgno.Header) + suite.Require().True(ok) + + // offset header timestamp before previous consensus state timestamp + header.Header.Time = header.GetTime().Add(-time.Hour) + }, + true, + }, + { + "next consensus state exists and header time is after next consensus state time", + func() { + header, ok := clientMessage.(*ibcgno.Header) + suite.Require().True(ok) + + // commit block and update client, adding a new consensus state + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + // increase timestamp of current header + header.Header.Time = header.Header.Time.Add(time.Hour) + }, + true, + }, + { + "valid fork misbehaviour returns true", + func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + header1, err := path.EndpointA.Counterparty.Chain.IBCClientHeader(path.EndpointA.Counterparty.Chain.LatestCommittedHeader, trustedHeight) + suite.Require().NoError(err) + + // commit block and update client + suite.coordinator.CommitBlock(suite.chainB) + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + trustedHeight, ok = path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + header2, err := path.EndpointA.Counterparty.Chain.IBCClientHeader(path.EndpointA.Counterparty.Chain.LatestCommittedHeader, trustedHeight) + suite.Require().NoError(err) + + // assign the same height, each header will have a different commit hash + header1.Header.Height = header2.Header.Height + + clientMessage = &ibcgno.Misbehaviour{ + Header1: header1, + Header2: header2, + ClientId: path.EndpointA.ClientID, + } + }, + true, + }, + { + "valid time misbehaviour: not monotonically increasing time", func() { + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + + trustedVals, ok := suite.chainB.TrustedValidators[trustedHeight.RevisionHeight+1] + suite.Require().True(ok) + + clientMessage = &ibcgno.Misbehaviour{ + Header2: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height+3, trustedHeight, suite.chainB.ProposedHeader.Time.Add(time.Minute), suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + Header1: suite.chainB.CreateTMClientHeader(suite.chainB.ChainID, suite.chainB.ProposedHeader.Height, trustedHeight, suite.chainB.ProposedHeader.Time, suite.chainB.Vals, suite.chainB.NextVals, trustedVals, suite.chainB.Signers), + } + }, true, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + // reset suite to create fresh application state + suite.SetupTest() + path = ibctesting.NewPath(suite.chainA, suite.chainB) + + err := path.EndpointA.CreateClient() + suite.Require().NoError(err) + + // ensure counterparty state is committed + suite.coordinator.CommitBlock(suite.chainB) + trustedHeight, ok := path.EndpointA.GetClientLatestHeight().(clienttypes.Height) + suite.Require().True(ok) + clientMessage, err = path.EndpointA.Counterparty.Chain.IBCClientHeader(path.EndpointA.Counterparty.Chain.LatestCommittedHeader, trustedHeight) + suite.Require().NoError(err) + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().NoError(err) + + tc.malleate() + + foundMisbehaviour := lightClientModule.CheckForMisbehaviour( + suite.chainA.GetContext(), + path.EndpointA.ClientID, + clientMessage, + ) + + if tc.expPass { + suite.Require().True(foundMisbehaviour) + } else { + suite.Require().False(foundMisbehaviour) + } + }) + } +} + +func (suite *GnoTestSuite) TestUpdateStateOnMisbehaviour() { + var path *ibctesting.Path + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + // reset suite to create fresh application state + suite.SetupTest() + path = ibctesting.NewPath(suite.chainA, suite.chainB) + + err := path.EndpointA.CreateClient() + suite.Require().NoError(err) + + lightClientModule, err := suite.chainA.App.GetIBCKeeper().ClientKeeper.Route(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().NoError(err) + + tc.malleate() + + clientStore := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + + lightClientModule.UpdateStateOnMisbehaviour(suite.chainA.GetContext(), path.EndpointA.ClientID, nil) + + if tc.expPass { + clientStateBz := clientStore.Get(host.ClientStateKey()) + suite.Require().NotEmpty(clientStateBz) + + newClientState := clienttypes.MustUnmarshalClientState(suite.chainA.Codec, clientStateBz) + suite.Require().Equal(frozenHeight, newClientState.(*ibcgno.ClientState).FrozenHeight) + } + }) + } +} diff --git a/modules/10-gno/upgrade.go b/modules/10-gno/upgrade.go new file mode 100644 index 000000000..78c908294 --- /dev/null +++ b/modules/10-gno/upgrade.go @@ -0,0 +1,188 @@ +package gno + +import ( + "fmt" + "time" + + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v10/modules/core/23-commitment/types" + commitmenttypesv2 "github.com/cosmos/ibc-go/v10/modules/core/23-commitment/types/v2" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + upgradetypes "cosmossdk.io/x/upgrade/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// VerifyUpgradeAndUpdateState checks if the upgraded client has been committed by the current client +// It will zero out all client-specific fields and verify all data in client state that must +// be the same across all valid gno clients for the new chain. +// Note, if there is a decrease in the UnbondingPeriod, then the TrustingPeriod, despite being a client-specific field +// is scaled down by the same ratio. +// VerifyUpgrade will return an error if: +// - the upgradedClient is not a gno ClientState +// - the latest height of the client state does not have the same revision number or has a greater +// height than the committed client. +// - the height of upgraded client is not greater than that of current client +// - the latest height of the new client does not match or is greater than the height in committed client +// - any gno chain specified parameter in upgraded client such as ChainID, UnbondingPeriod, +// and ProofSpecs do not match parameters set by committed client +func (cs ClientState) VerifyUpgradeAndUpdateState( + ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, + upgradedClient exported.ClientState, upgradedConsState exported.ConsensusState, + upgradeClientProof, upgradeConsStateProof []byte, +) error { + if len(cs.UpgradePath) == 0 { + return errorsmod.Wrap(clienttypes.ErrInvalidUpgradeClient, "cannot upgrade client, no upgrade path set") + } + + // upgraded client state and consensus state must be IBC gno client state and consensus state + // this may be modified in the future to upgrade to a new IBC gno type + // counterparty must also commit to the upgraded consensus state at a sub-path under the upgrade path specified + tmUpgradeClient, ok := upgradedClient.(*ClientState) + if !ok { + return errorsmod.Wrapf(clienttypes.ErrInvalidClientType, "upgraded client must be gno client. expected: %T got: %T", + &ClientState{}, upgradedClient) + } + + tmUpgradeConsState, ok := upgradedConsState.(*ConsensusState) + if !ok { + return errorsmod.Wrapf(clienttypes.ErrInvalidConsensus, "upgraded consensus state must be gno consensus state. expected %T, got: %T", + &ConsensusState{}, upgradedConsState) + } + + // unmarshal proofs + var merkleProofClient, merkleProofConsState commitmenttypes.MerkleProof + if err := cdc.Unmarshal(upgradeClientProof, &merkleProofClient); err != nil { + return errorsmod.Wrapf(commitmenttypes.ErrInvalidProof, "could not unmarshal client merkle proof: %v", err) + } + if err := cdc.Unmarshal(upgradeConsStateProof, &merkleProofConsState); err != nil { + return errorsmod.Wrapf(commitmenttypes.ErrInvalidProof, "could not unmarshal consensus state merkle proof: %v", err) + } + + // last height of current counterparty chain must be client's latest height + lastHeight := cs.LatestHeight + + // Must prove against latest consensus state to ensure we are verifying against latest upgrade plan + // This verifies that upgrade is intended for the provided revision, since committed client must exist + // at this consensus state + consState, found := GetConsensusState(clientStore, cdc, lastHeight) + if !found { + return errorsmod.Wrap(clienttypes.ErrConsensusStateNotFound, "could not retrieve consensus state for lastHeight") + } + + // Verify client proof + bz, err := cdc.MarshalInterface(tmUpgradeClient.ZeroCustomFields()) + if err != nil { + return errorsmod.Wrapf(clienttypes.ErrInvalidClient, "could not marshal client state: %v", err) + } + // construct clientState Merkle path + upgradeClientPath := constructUpgradeClientMerklePath(cs.UpgradePath, lastHeight) + if err := merkleProofClient.VerifyMembership(cs.ProofSpecs, consState.GetRoot(), upgradeClientPath, bz); err != nil { + return errorsmod.Wrapf(err, "client state proof failed. Path: %s", upgradeClientPath.GetKeyPath()) + } + + // Verify consensus state proof + bz, err = cdc.MarshalInterface(upgradedConsState) + if err != nil { + return errorsmod.Wrapf(clienttypes.ErrInvalidConsensus, "could not marshal consensus state: %v", err) + } + // construct consensus state Merkle path + upgradeConsStatePath := constructUpgradeConsStateMerklePath(cs.UpgradePath, lastHeight) + if err := merkleProofConsState.VerifyMembership(cs.ProofSpecs, consState.GetRoot(), upgradeConsStatePath, bz); err != nil { + return errorsmod.Wrapf(err, "consensus state proof failed. Path: %s", upgradeConsStatePath.GetKeyPath()) + } + + trustingPeriod := cs.TrustingPeriod + if tmUpgradeClient.UnbondingPeriod < cs.UnbondingPeriod { + trustingPeriod = calculateNewTrustingPeriod(trustingPeriod, cs.UnbondingPeriod, tmUpgradeClient.UnbondingPeriod) + } + + // Construct new client state and consensus state + // Relayer chosen client parameters are ignored. + // All chain-chosen parameters come from committed client, all client-chosen parameters + // come from current client. + newClientState := NewClientState( + tmUpgradeClient.ChainId, cs.TrustLevel, trustingPeriod, tmUpgradeClient.UnbondingPeriod, + cs.MaxClockDrift, tmUpgradeClient.LatestHeight, tmUpgradeClient.ProofSpecs, tmUpgradeClient.UpgradePath, + ) + + if err := newClientState.Validate(); err != nil { + return errorsmod.Wrap(err, "updated client state failed basic validation") + } + + // The new consensus state is merely used as a trusted kernel against which headers on the new + // chain can be verified. The root is just a stand-in sentinel value as it cannot be known in advance, thus no proof verification will pass. + // The timestamp and the NextValidatorsHash of the consensus state is the blocktime and NextValidatorsHash + // of the last block committed by the old chain. This will allow the first block of the new chain to be verified against + // the last validators of the old chain so long as it is submitted within the TrustingPeriod of this client. + // NOTE: We do not set processed time for this consensus state since this consensus state should not be used for packet verification + // as the root is empty. The next consensus state submitted using update will be usable for packet-verification. + newConsState := NewConsensusState( + tmUpgradeConsState.Timestamp, commitmenttypes.NewMerkleRoot([]byte(SentinelRoot)), tmUpgradeConsState.NextValidatorsHash, + ) + + setClientState(clientStore, cdc, newClientState) + setConsensusState(clientStore, cdc, newConsState, newClientState.LatestHeight) + setConsensusMetadata(ctx, clientStore, tmUpgradeClient.LatestHeight) + + return nil +} + +// construct MerklePath for the committed client from upgradePath +func constructUpgradeClientMerklePath(upgradePath []string, lastHeight exported.Height) commitmenttypesv2.MerklePath { + // copy all elements from upgradePath except final element + clientPath := make([]string, len(upgradePath)-1) + copy(clientPath, upgradePath) + + // append lastHeight and `upgradedClient` to last key of upgradePath and use as lastKey of clientPath + // this will create the IAVL key that is used to store client in upgrade store + lastKey := upgradePath[len(upgradePath)-1] + appendedKey := fmt.Sprintf("%s/%d/%s", lastKey, lastHeight.GetRevisionHeight(), upgradetypes.KeyUpgradedClient) + + clientPath = append(clientPath, appendedKey) + + var clientKey [][]byte + for _, part := range clientPath { + clientKey = append(clientKey, []byte(part)) + } + + return commitmenttypes.NewMerklePath(clientKey...) +} + +// construct MerklePath for the committed consensus state from upgradePath +func constructUpgradeConsStateMerklePath(upgradePath []string, lastHeight exported.Height) commitmenttypesv2.MerklePath { + // copy all elements from upgradePath except final element + consPath := make([]string, len(upgradePath)-1) + copy(consPath, upgradePath) + + // append lastHeight and `upgradedClient` to last key of upgradePath and use as lastKey of clientPath + // this will create the IAVL key that is used to store client in upgrade store + lastKey := upgradePath[len(upgradePath)-1] + appendedKey := fmt.Sprintf("%s/%d/%s", lastKey, lastHeight.GetRevisionHeight(), upgradetypes.KeyUpgradedConsState) + + consPath = append(consPath, appendedKey) + + var consStateKey [][]byte + for _, part := range consPath { + consStateKey = append(consStateKey, []byte(part)) + } + + return commitmenttypes.NewMerklePath(consStateKey...) +} + +// calculateNewTrustingPeriod converts the provided durations to decimal representation to avoid floating-point precision issues +// and calculates the new trusting period, decreasing it by the ratio between the original and new unbonding period. +func calculateNewTrustingPeriod(trustingPeriod, originalUnbonding, newUnbonding time.Duration) time.Duration { + origUnbondingDec := sdkmath.LegacyNewDec(originalUnbonding.Nanoseconds()) + newUnbondingDec := sdkmath.LegacyNewDec(newUnbonding.Nanoseconds()) + trustingPeriodDec := sdkmath.LegacyNewDec(trustingPeriod.Nanoseconds()) + + // compute new trusting period: trustingPeriod * newUnbonding / originalUnbonding + newTrustingPeriodDec := trustingPeriodDec.Mul(newUnbondingDec).Quo(origUnbondingDec) + return time.Duration(newTrustingPeriodDec.TruncateInt64()) +} diff --git a/modules/10-gno/upgrade_test.go b/modules/10-gno/upgrade_test.go new file mode 100644 index 000000000..bb979b1d2 --- /dev/null +++ b/modules/10-gno/upgrade_test.go @@ -0,0 +1,697 @@ +package gno_test + +import ( + "errors" + "time" + + sdkmath "cosmossdk.io/math" + upgradetypes "cosmossdk.io/x/upgrade/types" + + ibcgno "github.com/atomone-hub/atomone/modules/10-gno" + clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" + commitmenttypes "github.com/cosmos/ibc-go/v10/modules/core/23-commitment/types" + "github.com/cosmos/ibc-go/v10/modules/core/exported" + solomachine "github.com/cosmos/ibc-go/v10/modules/light-clients/06-solomachine" + ibctesting "github.com/cosmos/ibc-go/v10/testing" +) + +func (suite *GnoTestSuite) TestVerifyUpgrade() { + var ( + newChainID string + upgradedClient exported.ClientState + upgradedConsState exported.ConsensusState + lastHeight clienttypes.Height + path *ibctesting.Path + upgradedClientProof, upgradedConsensusStateProof []byte + upgradedClientBz, upgradedConsStateBz []byte + err error + ) + + testCases := []struct { + name string + setup func() + expErr error + }{ + { + name: "successful upgrade", + setup: func() { + // upgrade Height is at next block + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) //nolint:errcheck // ignore error for test + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedConsensusState(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedConsStateBz) //nolint:errcheck // ignore error for test + + // commit upgrade store changes and update clients + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: nil, + }, + { + name: "successful upgrade to same revision", + setup: func() { + upgradedClient = ibcgno.NewClientState(suite.chainB.ChainID, ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod+trustingPeriod, maxClockDrift, clienttypes.NewHeight(clienttypes.ParseChainID(suite.chainB.ChainID), upgradedClient.(*ibcgno.ClientState).LatestHeight.GetRevisionHeight()+10), commitmenttypes.GetSDKSpecs(), upgradePath) + upgradedClient = upgradedClient.(*ibcgno.ClientState).ZeroCustomFields() + upgradedClientBz, err = clienttypes.MarshalClientState(suite.chainA.App.AppCodec(), upgradedClient) + suite.Require().NoError(err) + + // upgrade Height is at next block + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) //nolint:errcheck // ignore error for test + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedConsensusState(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedConsStateBz) //nolint:errcheck // ignore error for test + + // commit upgrade store changes and update clients + + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: nil, + }, + { + name: "successful upgrade with new unbonding period", + setup: func() { + newUnbondingPeriod := time.Hour * 24 * 7 * 2 + upgradedClient = ibcgno.NewClientState(suite.chainB.ChainID, ibcgno.DefaultTrustLevel, trustingPeriod, newUnbondingPeriod, maxClockDrift, clienttypes.NewHeight(clienttypes.ParseChainID(suite.chainB.ChainID), upgradedClient.(*ibcgno.ClientState).LatestHeight.GetRevisionHeight()+10), commitmenttypes.GetSDKSpecs(), upgradePath) + upgradedClient = upgradedClient.(*ibcgno.ClientState).ZeroCustomFields() + upgradedClientBz, err = clienttypes.MarshalClientState(suite.chainA.App.AppCodec(), upgradedClient) + suite.Require().NoError(err) + + // upgrade Height is at next block + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) //nolint:errcheck // ignore error for test + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedConsensusState(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedConsStateBz) //nolint:errcheck // ignore error for test + + // commit upgrade store changes and update clients + + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: nil, + }, + { + name: "unsuccessful upgrade: upgrade path not set", + setup: func() { + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + // set upgrade path to empty + tmCs.UpgradePath = []string{} + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID, tmCs) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: clienttypes.ErrInvalidUpgradeClient, + }, + { + name: "unsuccessful upgrade: upgrade consensus state must be tendermint consensus state", + setup: func() { + upgradedConsState = &solomachine.ConsensusState{} + + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: clienttypes.ErrInvalidConsensus, + }, + { + name: "unsuccessful upgrade: upgrade height revision height is more than the current client revision height", + setup: func() { + // upgrade Height is 10 blocks from now + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+10)) + + // zero custom fields and store in upgrade store + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) //nolint:errcheck // ignore error for test + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedConsensusState(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedConsStateBz) //nolint:errcheck // ignore error for test + + // commit upgrade store changes and update clients + + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: commitmenttypes.ErrInvalidProof, + }, + { + name: "unsuccessful upgrade: committed client does not have zeroed custom fields", + setup: func() { + // non-zeroed upgrade client + upgradedClient = ibcgno.NewClientState(newChainID, ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod+trustingPeriod, maxClockDrift, newClientHeight, commitmenttypes.GetSDKSpecs(), upgradePath) + upgradedClientBz, err = clienttypes.MarshalClientState(suite.chainA.App.AppCodec(), upgradedClient) + suite.Require().NoError(err) + + // upgrade Height is at next block + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) //nolint:errcheck // ignore error for test + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedConsensusState(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedConsStateBz) //nolint:errcheck // ignore error for test + + // commit upgrade store changes and update clients + + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: commitmenttypes.ErrInvalidProof, + }, + { + name: "unsuccessful upgrade: chain-specified parameters do not match committed client", + setup: func() { + // upgrade Height is at next block + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + err := suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) + suite.Require().NoError(err) + err = suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedConsensusState(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedConsStateBz) + suite.Require().NoError(err) + + // change upgradedClient client-specified parameters + upgradedClient = ibcgno.NewClientState("wrongchainID", ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, newClientHeight, commitmenttypes.GetSDKSpecs(), upgradePath) + + suite.coordinator.CommitBlock(suite.chainB) + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: commitmenttypes.ErrInvalidProof, + }, + { + name: "unsuccessful upgrade: client-specified parameters do not match previous client", + setup: func() { + // upgrade Height is at next block + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + err := suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) + suite.Require().NoError(err) + err = suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedConsensusState(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedConsStateBz) + suite.Require().NoError(err) + + // change upgradedClient client-specified parameters + upgradedClient = ibcgno.NewClientState(newChainID, ibcgno.DefaultTrustLevel, ubdPeriod, ubdPeriod+trustingPeriod, maxClockDrift+5, lastHeight, commitmenttypes.GetSDKSpecs(), upgradePath) + + suite.coordinator.CommitBlock(suite.chainB) + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: commitmenttypes.ErrInvalidProof, + }, + { + name: "unsuccessful upgrade: upgrade client is not tendermint", + setup: func() { + upgradedClient = &solomachine.ClientState{} + }, + expErr: clienttypes.ErrInvalidClientType, + }, + { + name: "unsuccessful upgrade: relayer-submitted consensus state does not match counterparty-committed consensus state", + setup: func() { + // change submitted upgradedConsensusState + upgradedConsState = &ibcgno.ConsensusState{ + NextValidatorsHash: []byte("maliciousValidators"), + } + + // commit upgrade store changes and update clients + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: commitmenttypes.ErrInvalidProof, + }, + { + name: "unsuccessful upgrade: client proof unmarshal failed", + setup: func() { + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + + upgradedClientProof = []byte("proof") + }, + expErr: errors.New("could not unmarshal client merkle proof"), + }, + { + name: "unsuccessful upgrade: consensus state proof unmarshal failed", + setup: func() { + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + + upgradedConsensusStateProof = []byte("proof") + }, + expErr: errors.New("could not unmarshal consensus state merkle proof"), + }, + { + name: "unsuccessful upgrade: client proof verification failed", + setup: func() { + // do not store upgraded client + + // upgrade Height is at next block + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedConsensusState(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedConsStateBz) //nolint:errcheck // ignore error for test + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: commitmenttypes.ErrInvalidProof, + }, + { + name: "unsuccessful upgrade: consensus state proof verification failed", + setup: func() { + // do not store upgraded client + + // upgrade Height is at next block + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) //nolint:errcheck // ignore error for test + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: commitmenttypes.ErrInvalidProof, + }, + { + name: "unsuccessful upgrade: client state merkle path is empty", + setup: func() { + // upgrade Height is at next block + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) //nolint:errcheck // ignore error for test + + // commit upgrade store changes and update clients + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + + // SetClientState with empty string upgrade path + tmClient, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + tmClient.UpgradePath = []string{""} + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID, tmClient) + }, + expErr: errors.New("client state proof failed"), + }, + { + name: "unsuccessful upgrade: upgraded height is not greater than current height", + setup: func() { + // upgrade Height is at next block + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) //nolint:errcheck // ignore error for test + + // commit upgrade store changes and update clients + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: errors.New("consensus state proof failed"), + }, + { + name: "unsuccessful upgrade: consensus state for upgrade height cannot be found", + setup: func() { + // upgrade Height is at next block + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+100)) + + // zero custom fields and store in upgrade store + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) //nolint:errcheck // ignore error for + + // commit upgrade store changes and update clients + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: commitmenttypes.ErrInvalidProof, + }, + { + name: "unsuccessful upgrade: client is expired", + setup: func() { + // zero custom fields and store in upgrade store + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) //nolint:errcheck // ignore error for test + + // commit upgrade store changes and update clients + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + // expire chainB's client + suite.chainA.ExpireClient(ubdPeriod) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: commitmenttypes.ErrInvalidProof, + }, + { + name: "unsuccessful upgrade: updated unbonding period is equal to trusting period", + setup: func() { + // upgrade Height is at next block + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) //nolint:errcheck // ignore error for test + + // commit upgrade store changes and update clients + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: commitmenttypes.ErrInvalidProof, + }, + { + name: "unsuccessful upgrade: final client is not valid", + setup: func() { + // new client has smaller unbonding period such that old trusting period is no longer valid + upgradedClient = ibcgno.NewClientState(newChainID, ibcgno.DefaultTrustLevel, trustingPeriod, trustingPeriod, maxClockDrift, newClientHeight, commitmenttypes.GetSDKSpecs(), upgradePath) + upgradedClientBz, err = clienttypes.MarshalClientState(suite.chainA.App.AppCodec(), upgradedClient) + suite.Require().NoError(err) + + // upgrade Height is at next block + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) //nolint:errcheck // ignore error for testing + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedConsensusState(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedConsStateBz) //nolint:errcheck // ignore error for testing + + // commit upgrade store changes and update clients + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), tmCs.LatestHeight.GetRevisionHeight()) + }, + expErr: commitmenttypes.ErrInvalidProof, + }, + { + name: "unsuccessful upgrade: consensus state not found for latest height", + setup: func() { + // upgrade Height is at next block + lastHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedClientBz) //nolint:errcheck // ignore error for test + suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedConsensusState(suite.chainB.GetContext(), int64(lastHeight.GetRevisionHeight()), upgradedConsStateBz) //nolint:errcheck // ignore error for test + + // commit upgrade store changes and update clients + + suite.coordinator.CommitBlock(suite.chainB) + err := path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + cs, found := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID) + suite.Require().True(found) + tmCs, ok := cs.(*ibcgno.ClientState) + suite.Require().True(ok) + + revisionHeight := tmCs.LatestHeight.GetRevisionHeight() + + // set latest height to a height where consensus state does not exist + tmCs.LatestHeight = clienttypes.NewHeight(tmCs.LatestHeight.GetRevisionNumber(), tmCs.LatestHeight.GetRevisionHeight()+5) + suite.chainA.App.GetIBCKeeper().ClientKeeper.SetClientState(suite.chainA.GetContext(), path.EndpointA.ClientID, tmCs) + + upgradedClientProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(lastHeight.GetRevisionHeight())), revisionHeight) + upgradedConsensusStateProof, _ = suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(lastHeight.GetRevisionHeight())), revisionHeight) + }, + expErr: clienttypes.ErrConsensusStateNotFound, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + // reset suite + suite.SetupTest() + path = ibctesting.NewPath(suite.chainA, suite.chainB) + + path.SetupClients() + + clientState, ok := path.EndpointA.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + revisionNumber := clienttypes.ParseChainID(clientState.ChainId) + + var err error + newChainID, err = clienttypes.SetRevisionNumber(clientState.ChainId, revisionNumber+1) + suite.Require().NoError(err) + + upgradedClient = ibcgno.NewClientState(newChainID, ibcgno.DefaultTrustLevel, trustingPeriod, ubdPeriod+trustingPeriod, maxClockDrift, clienttypes.NewHeight(revisionNumber+1, clientState.LatestHeight.GetRevisionHeight()+1), commitmenttypes.GetSDKSpecs(), upgradePath) + + if upgraded, ok := upgradedClient.(*ibcgno.ClientState); ok { + upgradedClient = upgraded.ZeroCustomFields() + } + + upgradedClientBz, err = clienttypes.MarshalClientState(suite.chainA.App.AppCodec(), upgradedClient) + suite.Require().NoError(err) + + upgradedConsState = &ibcgno.ConsensusState{ + NextValidatorsHash: []byte("nextValsHash"), + } + upgradedConsStateBz, err = clienttypes.MarshalConsensusState(suite.chainA.App.AppCodec(), upgradedConsState) + suite.Require().NoError(err) + + tc.setup() + + cs, ok := suite.chainA.GetClientState(path.EndpointA.ClientID).(*ibcgno.ClientState) + suite.Require().True(ok) + clientStore := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + + // Call ZeroCustomFields on upgraded clients to clear any client-chosen parameters in test-case upgradedClient + if upgraded, ok := upgradedClient.(*ibcgno.ClientState); ok { + upgradedClient = upgraded.ZeroCustomFields() + } + + err = cs.VerifyUpgradeAndUpdateState( + suite.chainA.GetContext(), + suite.cdc, + clientStore, + upgradedClient, + upgradedConsState, + upgradedClientProof, + upgradedConsensusStateProof, + ) + + if tc.expErr == nil { + suite.Require().NoError(err, "verify upgrade failed on valid case: %s", tc.name) + + clientState, ok := suite.chainA.GetClientState(path.EndpointA.ClientID).(*ibcgno.ClientState) + suite.Require().True(ok) + suite.Require().NotNil(clientState, "verify upgrade failed on valid case: %s", tc.name) + + consensusState, found := suite.chainA.GetConsensusState(path.EndpointA.ClientID, clientState.LatestHeight) + suite.Require().NotNil(consensusState, "verify upgrade failed on valid case: %s", tc.name) + suite.Require().True(found) + } else { + suite.Require().ErrorContains(err, tc.expErr.Error(), "verify upgrade passed on invalid case: %s", tc.name) + } + }) + } +} + +func (suite *GnoTestSuite) TestVerifyUpgradeWithNewUnbonding() { + suite.SetupTest() + path := ibctesting.NewPath(suite.chainA, suite.chainB) + path.SetupClients() + + clientState, ok := path.EndpointA.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + + newUnbondingPeriod := time.Hour * 24 * 7 * 2 // update the unbonding period to two weeks + upgradeClient := ibcgno.NewClientState(clientState.ChainId, ibcgno.DefaultTrustLevel, trustingPeriod, newUnbondingPeriod, maxClockDrift, clienttypes.NewHeight(1, clientState.LatestHeight.GetRevisionHeight()+1), commitmenttypes.GetSDKSpecs(), upgradePath) + + upgradedClientBz, err := clienttypes.MarshalClientState(suite.chainA.App.AppCodec(), upgradeClient.ZeroCustomFields()) + suite.Require().NoError(err) + + upgradedConsState := &ibcgno.ConsensusState{NextValidatorsHash: []byte("nextValsHash")} // mocked consensus state + upgradedConsStateBz, err := clienttypes.MarshalConsensusState(suite.chainA.App.AppCodec(), upgradedConsState) + suite.Require().NoError(err) + + // zero custom fields and store in chainB upgrade store + upgradeHeight := clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) // upgrade is at next block height + err = suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetRevisionHeight()), upgradedClientBz) + suite.Require().NoError(err) + err = suite.chainB.GetSimApp().UpgradeKeeper.SetUpgradedConsensusState(suite.chainB.GetContext(), int64(upgradeHeight.GetRevisionHeight()), upgradedConsStateBz) + suite.Require().NoError(err) + + // commit upgrade store changes on chainB and update client on chainA + suite.coordinator.CommitBlock(suite.chainB) + + err = path.EndpointA.UpdateClient() + suite.Require().NoError(err) + + upgradedClientProof, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetRevisionHeight())), uint64(suite.chainB.LatestCommittedHeader.Header.Height)) + upgradedConsensusStateProof, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedConsStateKey(int64(upgradeHeight.GetRevisionHeight())), uint64(suite.chainB.LatestCommittedHeader.Header.Height)) + + tmClientState, ok := path.EndpointA.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + + clientStore := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(suite.chainA.GetContext(), path.EndpointA.ClientID) + err = tmClientState.VerifyUpgradeAndUpdateState( + suite.chainA.GetContext(), + suite.cdc, + clientStore, + upgradeClient, + upgradedConsState, + upgradedClientProof, + upgradedConsensusStateProof, + ) + suite.Require().NoError(err) + + upgradedClient, ok := path.EndpointA.GetClientState().(*ibcgno.ClientState) + suite.Require().True(ok) + + // assert the unbonding period and the trusting period have been updated correctly + suite.Require().Equal(newUnbondingPeriod, upgradedClient.UnbondingPeriod) + + // expected trusting period = trustingPeriod * newUnbonding / originalUnbonding (224 hours = 9 days and 8 hours) + origUnbondingDec := sdkmath.LegacyNewDec(ubdPeriod.Nanoseconds()) + newUnbondingDec := sdkmath.LegacyNewDec(newUnbondingPeriod.Nanoseconds()) + trustingPeriodDec := sdkmath.LegacyNewDec(trustingPeriod.Nanoseconds()) + + expTrustingPeriod := trustingPeriodDec.Mul(newUnbondingDec).Quo(origUnbondingDec) + suite.Require().Equal(time.Duration(expTrustingPeriod.TruncateInt64()), upgradedClient.TrustingPeriod) +} diff --git a/modules/10-gno/verifier.go b/modules/10-gno/verifier.go new file mode 100644 index 000000000..f3075ae84 --- /dev/null +++ b/modules/10-gno/verifier.go @@ -0,0 +1,312 @@ +package gno + +import ( + "bytes" + "errors" + "fmt" + math "math" + "time" + + bfttypes "github.com/gnolang/gno/tm2/pkg/bft/types" + + cmtmath "github.com/cometbft/cometbft/libs/math" + "github.com/cometbft/cometbft/types" + + errorsmod "cosmossdk.io/errors" +) + +// DefaultTrustLevel - new header can be trusted if at least one correct +// validator signed it. +var LCDefaultTrustLevel = cmtmath.Fraction{Numerator: 1, Denominator: 3} + +// VerifyNonAdjacent verifies non-adjacent untrustedHeader against +// trustedHeader. It ensures that: +// +// a) trustedHeader can still be trusted (if not, ErrOldHeaderExpired is returned) +// b) untrustedHeader is valid (if not, ErrInvalidHeader is returned) +// c) trustLevel ([1/3, 1]) of trustedHeaderVals (or trustedHeaderNextVals) +// signed correctly (if not, ErrNewValSetCantBeTrusted is returned) +// d) more than 2/3 of untrustedVals have signed h2 +// (otherwise, ErrInvalidHeader is returned) +// e) headers are non-adjacent. +// +// maxClockDrift defines how much untrustedHeader.Time can drift into the +// future. +func VerifyNonAdjacent( + trustedHeader *bfttypes.SignedHeader, // height=X + trustedVals *bfttypes.ValidatorSet, // height=X or height=X+1 + untrustedHeader *bfttypes.SignedHeader, // height=Y + untrustedVals *bfttypes.ValidatorSet, // height=Y + trustingPeriod time.Duration, + now time.Time, + maxClockDrift time.Duration, + trustLevel cmtmath.Fraction, +) error { + if untrustedHeader.Height == trustedHeader.Height+1 { + return errors.New("headers must be non adjacent in height") + } + + if HeaderExpired(trustedHeader, trustingPeriod, now) { + return errorsmod.Wrapf(ErrOldHeaderExpired, "trusted header expired at %v (now: %v)", trustedHeader.Time.Add(trustingPeriod), now) + } + + if err := verifyNewHeaderAndVals( + untrustedHeader, untrustedVals, + trustedHeader, + now, maxClockDrift); err != nil { + return errorsmod.Wrapf(ErrInvalidHeader, "failed to verify new header and vals: %v", err) + } + + // Ensure that +`trustLevel` (default 1/3) or more of last trusted validators signed correctly. + err := VerifyLightCommit(trustedVals, trustedHeader.ChainID, untrustedHeader.Commit.BlockID, untrustedHeader.Height, untrustedHeader.Commit, trustLevel) + if err != nil { + return errorsmod.Wrapf(ErrNewValSetCantBeTrusted, "trusted validators failed to verify commit: %v", err) + } + + // Ensure that +2/3 of new validators signed correctly. + // + // NOTE: this should always be the last check because untrustedVals can be + // intentionally made very large to DOS the light client. not the case for + // VerifyAdjacent, where validator set is known in advance. + if err := untrustedVals.VerifyCommit(trustedHeader.ChainID, untrustedHeader.Commit.BlockID, + untrustedHeader.Height, untrustedHeader.Commit); err != nil { + return errorsmod.Wrapf(ErrInvalidHeader, "failed to verify commit: %v", err) + } + + return nil +} + +// VerifyAdjacent verifies directly adjacent untrustedHeader against +// trustedHeader. It ensures that: +// +// a) trustedHeader can still be trusted (if not, ErrOldHeaderExpired is returned) +// b) untrustedHeader is valid (if not, ErrInvalidHeader is returned) +// c) untrustedHeader.ValidatorsHash equals trustedHeader.NextValidatorsHash +// d) more than 2/3 of new validators (untrustedVals) have signed h2 +// (otherwise, ErrInvalidHeader is returned) +// e) headers are adjacent. +// +// maxClockDrift defines how much untrustedHeader.Time can drift into the +// future. +func VerifyAdjacent( + trustedHeader *bfttypes.SignedHeader, // height=X + untrustedHeader *bfttypes.SignedHeader, // height=X+1 + untrustedVals *bfttypes.ValidatorSet, // height=X+1 + trustingPeriod time.Duration, + now time.Time, + maxClockDrift time.Duration, +) error { + if untrustedHeader.Height != trustedHeader.Height+1 { + return errors.New("headers must be adjacent in height") + } + + if HeaderExpired(trustedHeader, trustingPeriod, now) { + return errorsmod.Wrapf(ErrOldHeaderExpired, "trusted header expired at %v (now: %v)", trustedHeader.Time.Add(trustingPeriod), now) + } + + if err := verifyNewHeaderAndVals( + untrustedHeader, untrustedVals, + trustedHeader, + now, maxClockDrift); err != nil { + return errorsmod.Wrapf(ErrInvalidHeader, "failed to verify new header and vals: %v", err) + } + + // Check the validator hashes are the same + if !bytes.Equal(untrustedHeader.ValidatorsHash, trustedHeader.NextValidatorsHash) { + err := fmt.Errorf("expected old header next validators (%X) to match those from new header (%X)", + trustedHeader.NextValidatorsHash, + untrustedHeader.ValidatorsHash, + ) + return err + } + + // Ensure that +2/3 of new validators signed correctly. + if err := untrustedVals.VerifyCommit(trustedHeader.ChainID, untrustedHeader.Commit.BlockID, + untrustedHeader.Height, untrustedHeader.Commit); err != nil { + return errorsmod.Wrapf(ErrInvalidHeader, "failed to verify commit: %v", err) + } + + return nil +} + +// Verify combines both VerifyAdjacent and VerifyNonAdjacent functions. +func Verify( + trustedHeader *bfttypes.SignedHeader, // height=X + trustedVals *bfttypes.ValidatorSet, // height=X or height=X+1 + untrustedHeader *bfttypes.SignedHeader, // height=Y + untrustedVals *bfttypes.ValidatorSet, // height=Y + trustingPeriod time.Duration, + now time.Time, + maxClockDrift time.Duration, + trustLevel cmtmath.Fraction, +) error { + if untrustedHeader.Height != trustedHeader.Height+1 { + return VerifyNonAdjacent(trustedHeader, trustedVals, untrustedHeader, untrustedVals, + trustingPeriod, now, maxClockDrift, trustLevel) + } + + return VerifyAdjacent(trustedHeader, untrustedHeader, untrustedVals, trustingPeriod, now, maxClockDrift) +} + +func verifyNewHeaderAndVals( + untrustedHeader *bfttypes.SignedHeader, + untrustedVals *bfttypes.ValidatorSet, + trustedHeader *bfttypes.SignedHeader, + now time.Time, + maxClockDrift time.Duration, +) error { + if err := untrustedHeader.ValidateBasic(trustedHeader.ChainID); err != nil { + return fmt.Errorf("untrustedHeader.ValidateBasic failed: %w", err) + } + + if untrustedHeader.Height <= trustedHeader.Height { + return fmt.Errorf("expected new header height %d to be greater than one of old header %d", + untrustedHeader.Height, + trustedHeader.Height) + } + + if !untrustedHeader.Time.After(trustedHeader.Time) { + return fmt.Errorf("expected new header time %v to be after old header time %v", + untrustedHeader.Time, + trustedHeader.Time) + } + + if !untrustedHeader.Time.Before(now.Add(maxClockDrift)) { + return fmt.Errorf("new header has a time from the future %v (now: %v; max clock drift: %v)", + untrustedHeader.Time, + now, + maxClockDrift) + } + + if !bytes.Equal(untrustedHeader.ValidatorsHash, untrustedVals.Hash()) { + return fmt.Errorf("expected new header validators (%X) to match those that were supplied (%X) at height %d", + untrustedHeader.ValidatorsHash, + untrustedVals.Hash(), + untrustedHeader.Height, + ) + } + + return nil +} + +// ValidateTrustLevel checks that trustLevel is within the allowed range [1/3, +// 1]. If not, it returns an error. 1/3 is the minimum amount of trust needed +// which does not break the security model. +func ValidateTrustLevel(lvl cmtmath.Fraction) error { + if lvl.Numerator*3 < lvl.Denominator || // < 1/3 + lvl.Numerator > lvl.Denominator || // > 1 + lvl.Denominator == 0 { + return fmt.Errorf("trustLevel must be within [1/3, 1], given %v", lvl) + } + return nil +} + +func VerifyLightCommit(vals *bfttypes.ValidatorSet, chainID string, blockID bfttypes.BlockID, height int64, commit *bfttypes.Commit, trustLevel cmtmath.Fraction) error { + if err := commit.ValidateBasic(); err != nil { + return err + } + if vals.Size() != len(commit.Precommits) { + return errorsmod.Wrapf(ErrNewValSetCantBeTrusted, "%s", bfttypes.NewErrInvalidCommitPrecommits(vals.Size(), len(commit.Precommits)).Error()) + } + if height != commit.Height() { + return errorsmod.Wrapf(ErrNewValSetCantBeTrusted, "%s", bfttypes.NewErrInvalidCommitHeight(height, commit.Height()).Error()) + } + if !blockID.Equals(commit.BlockID) { + return fmt.Errorf("invalid commit -- wrong block id: want %v got %v", + blockID, commit.BlockID) + } + + talliedVotingPower := int64(0) + + for idx, precommit := range commit.Precommits { + if precommit == nil { + continue // OK, some precommits can be missing. + } + _, val := vals.GetByIndex(idx) + // Validate signature. + precommitSignBytes := commit.VoteSignBytes(chainID, idx) + if !val.PubKey.VerifyBytes(precommitSignBytes, precommit.Signature) { + return fmt.Errorf("invalid commit -- invalid signature: %v", precommit) + } + // Good precommit! + if blockID.Equals(precommit.BlockID) { + talliedVotingPower += val.VotingPower + } + // else { + // It's OK that the BlockID doesn't match. We include stray + // precommits to measure validator availability. + // } + } + + // safely calculate voting power needed. + totalVotingPowerMulByNumerator, overflow := safeMul(vals.TotalVotingPower(), int64(trustLevel.Numerator)) + if overflow { + return errorsmod.Wrapf(ErrNewValSetCantBeTrusted, "int64 overflow while calculating voting power needed. please provide smaller trustLevel numerator") + } + votingPowerNeeded := totalVotingPowerMulByNumerator / int64(trustLevel.Denominator) + if talliedVotingPower > votingPowerNeeded { + return nil + } + return errorsmod.Wrapf(ErrNewValSetCantBeTrusted, "Invalid commit -- insufficient old voting power: got %v, needed %v", talliedVotingPower, vals.TotalVotingPower()*2/3+1) +} + +func safeMul(a, b int64) (int64, bool) { + if a == 0 || b == 0 { + return 0, false + } + + absOfB := b + if b < 0 { + absOfB = -b + } + + absOfA := a + if a < 0 { + absOfA = -a + } + + if absOfA > math.MaxInt64/absOfB { + return 0, true + } + + return a * b, false +} + +// HeaderExpired return true if the given header expired. +func HeaderExpired(h *bfttypes.SignedHeader, trustingPeriod time.Duration, now time.Time) bool { + expirationTime := h.Time.Add(trustingPeriod) + return !expirationTime.After(now) +} + +// VerifyBackwards verifies an untrusted header with a height one less than +// that of an adjacent trusted header. It ensures that: +// +// a) untrusted header is valid +// b) untrusted header has a time before the trusted header +// c) that the LastBlockID hash of the trusted header is the same as the hash +// of the trusted header +// +// For any of these cases ErrInvalidHeader is returned. +func VerifyBackwards(untrustedHeader, trustedHeader *types.Header) error { + if err := untrustedHeader.ValidateBasic(); err != nil { + return errorsmod.Wrapf(ErrInvalidHeader, "untrustedHeader.ValidateBasic failed: %v", err) + } + + if untrustedHeader.ChainID != trustedHeader.ChainID { + return errorsmod.Wrapf(ErrInvalidHeader, "header belongs to another chain: %v", untrustedHeader.ChainID) + } + + if !untrustedHeader.Time.Before(trustedHeader.Time) { + return errorsmod.Wrapf(ErrInvalidHeader, "expected older header time %v to be before new header time %v", + untrustedHeader.Time, + trustedHeader.Time) + } + + if !bytes.Equal(untrustedHeader.Hash(), trustedHeader.LastBlockID.Hash) { + return errorsmod.Wrapf(ErrInvalidHeader, "expected older header hash %X to match trusted header's last block %X", + untrustedHeader.Hash(), + trustedHeader.LastBlockID.Hash) + } + + return nil +} diff --git a/proto/atomone/coredaos/v1/coredaos.proto b/proto/atomone/coredaos/v1/coredaos.proto index 858ebf135..3900b67f7 100644 --- a/proto/atomone/coredaos/v1/coredaos.proto +++ b/proto/atomone/coredaos/v1/coredaos.proto @@ -9,19 +9,22 @@ option go_package = "github.com/atomone-hub/atomone/x/coredaos/types"; // Params defines the parameters for the x/coredaos module. message Params { - // steering_dao_address defines the address which has authority - // to execute messages as Steering DAO. - string steering_dao_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // steering_dao_address defines the address which has authority + // to execute messages as Steering DAO. + string steering_dao_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - // oversight_dao_address defines the address which has authority - // to execute messages as Oversight DAO. - string oversight_dao_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // oversight_dao_address defines the address which has authority + // to execute messages as Oversight DAO. + string oversight_dao_address = 2 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - // voting_period_extensions_limit defines the maximum number of times - // a proposal's voting period can be extended. - uint32 voting_period_extensions_limit = 3; + // voting_period_extensions_limit defines the maximum number of times + // a proposal's voting period can be extended. + uint32 voting_period_extensions_limit = 3; - // voting_period_extension_duration defines the duration for which - // a proposal's voting period can be extended. - google.protobuf.Duration voting_period_extension_duration = 4 [(gogoproto.stdduration) = true]; + // voting_period_extension_duration defines the duration for which + // a proposal's voting period can be extended. + google.protobuf.Duration voting_period_extension_duration = 4 + [ (gogoproto.stdduration) = true ]; } diff --git a/proto/atomone/coredaos/v1/genesis.proto b/proto/atomone/coredaos/v1/genesis.proto index c59b5c106..54f744d69 100644 --- a/proto/atomone/coredaos/v1/genesis.proto +++ b/proto/atomone/coredaos/v1/genesis.proto @@ -9,5 +9,6 @@ option go_package = "github.com/atomone-hub/atomone/x/coredaos/types"; // GenesisState defines the x/coredaos module's genesis state. message GenesisState { - Params params = 1 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + Params params = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } diff --git a/proto/atomone/coredaos/v1/query.proto b/proto/atomone/coredaos/v1/query.proto index fdd055395..b3ae731ba 100644 --- a/proto/atomone/coredaos/v1/query.proto +++ b/proto/atomone/coredaos/v1/query.proto @@ -13,10 +13,10 @@ option go_package = "github.com/atomone-hub/atomone/x/coredaos/types"; // Query defines the gRPC querier service. service Query { - // Parameters queries the parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/atomone/coredaos/v1/params"; - } + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/atomone/coredaos/v1/params"; + } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -24,6 +24,6 @@ message QueryParamsRequest {} // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { - // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; + // params holds all the parameters of this module. + Params params = 1 [ (gogoproto.nullable) = false ]; } diff --git a/proto/atomone/coredaos/v1/tx.proto b/proto/atomone/coredaos/v1/tx.proto index 068882ec1..92a4a0e34 100644 --- a/proto/atomone/coredaos/v1/tx.proto +++ b/proto/atomone/coredaos/v1/tx.proto @@ -11,48 +11,51 @@ option go_package = "github.com/atomone-hub/atomone/x/coredaos/types"; // Msg defines the Msg service. service Msg { - option (cosmos.msg.v1.service) = true; - - // AnnotateProposal defines a method to annotate a proposal with additional information. - // It is only available to the Steering DAO. - rpc AnnotateProposal(MsgAnnotateProposal) returns (MsgAnnotateProposalResponse); - - // EndorseProposal defines a method to endorse a proposal, and for law proposals this also - // results in the lowering of the passing threshold to the passing threshold of regular proposals. - // It is only available to the Steering DAO. - rpc EndorseProposal(MsgEndorseProposal) returns (MsgEndorseProposalResponse); - - // ExtendVotingPeriod defines a method to extend the voting period of a proposal. - // It is available to both the Steering DAO and the Oversight DAO. - rpc ExtendVotingPeriod(MsgExtendVotingPeriod) returns (MsgExtendVotingPeriodResponse); - - // VetoProposal defines a method to veto a proposal. - // It is only available to the Oversight DAO. - rpc VetoProposal(MsgVetoProposal) returns (MsgVetoProposalResponse); - - // UpdateParams defines a governance operation for updating the x/coredaos - // module parameters. The authority is defined in the keeper. - rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + option (cosmos.msg.v1.service) = true; + + // AnnotateProposal defines a method to annotate a proposal with additional + // information. It is only available to the Steering DAO. + rpc AnnotateProposal(MsgAnnotateProposal) + returns (MsgAnnotateProposalResponse); + + // EndorseProposal defines a method to endorse a proposal, and for law + // proposals this also results in the lowering of the passing threshold to the + // passing threshold of regular proposals. It is only available to the + // Steering DAO. + rpc EndorseProposal(MsgEndorseProposal) returns (MsgEndorseProposalResponse); + + // ExtendVotingPeriod defines a method to extend the voting period of a + // proposal. It is available to both the Steering DAO and the Oversight DAO. + rpc ExtendVotingPeriod(MsgExtendVotingPeriod) + returns (MsgExtendVotingPeriodResponse); + + // VetoProposal defines a method to veto a proposal. + // It is only available to the Oversight DAO. + rpc VetoProposal(MsgVetoProposal) returns (MsgVetoProposalResponse); + + // UpdateParams defines a governance operation for updating the x/coredaos + // module parameters. The authority is defined in the keeper. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgAnnotateProposal defines a message for annotating a proposal. message MsgAnnotateProposal { - option (cosmos.msg.v1.signer) = "annotator"; - option (amino.name) = "atomone/coredaos/v1/MsgAnnotateProposal"; + option (cosmos.msg.v1.signer) = "annotator"; + option (amino.name) = "atomone/coredaos/v1/MsgAnnotateProposal"; - // annotator is the address of the dao annotating the proposal. - string annotator = 1; + // annotator is the address of the dao annotating the proposal. + string annotator = 1; - // proposal_id is the ID of the proposal to annotate. - uint64 proposal_id = 2; + // proposal_id is the ID of the proposal to annotate. + uint64 proposal_id = 2; - // annotation is the annotation to add to the proposal. - string annotation = 3; + // annotation is the annotation to add to the proposal. + string annotation = 3; - // overwrite is a boolean indicating whether to overwrite the existing annotation. - // Must be set to true if the proposal already has an annotation. - // Ignored if the proposal does not have yet an annotation. - bool overwrite = 4; + // overwrite is a boolean indicating whether to overwrite the existing + // annotation. Must be set to true if the proposal already has an annotation. + // Ignored if the proposal does not have yet an annotation. + bool overwrite = 4; } // MsgAnnotateProposalResponse defines the response for MsgAnnotateProposal. @@ -60,29 +63,30 @@ message MsgAnnotateProposalResponse {} // MsgEndorseProposal defines a message for endorsing a proposal. message MsgEndorseProposal { - option (cosmos.msg.v1.signer) = "endorser"; - option (amino.name) = "atomone/coredaos/v1/MsgEndorseProposal"; + option (cosmos.msg.v1.signer) = "endorser"; + option (amino.name) = "atomone/coredaos/v1/MsgEndorseProposal"; - // endorser is the address of the dao endorsing the proposal. - string endorser = 1; + // endorser is the address of the dao endorsing the proposal. + string endorser = 1; - // proposal_id is the ID of the proposal to endorse. - uint64 proposal_id = 2; + // proposal_id is the ID of the proposal to endorse. + uint64 proposal_id = 2; } // MsgEndorseProposalResponse defines the response for MsgEndorseProposal. message MsgEndorseProposalResponse {} -// MsgExtendVotingPeriod defines a message for extending the voting period of a proposal. +// MsgExtendVotingPeriod defines a message for extending the voting period of a +// proposal. message MsgExtendVotingPeriod { - option (cosmos.msg.v1.signer) = "extender"; - option (amino.name) = "atomone/coredaos/v1/MsgExtendVotingPeriod"; + option (cosmos.msg.v1.signer) = "extender"; + option (amino.name) = "atomone/coredaos/v1/MsgExtendVotingPeriod"; - // extender is the address of the dao extending the voting period. - string extender = 1; + // extender is the address of the dao extending the voting period. + string extender = 1; - // proposal_id is the ID of the proposal to extend. - uint64 proposal_id = 2; + // proposal_id is the ID of the proposal to extend. + uint64 proposal_id = 2; } // MsgExtendVotingPeriodResponse defines the response for MsgExtendVotingPeriod. @@ -90,18 +94,18 @@ message MsgExtendVotingPeriodResponse {} // MsgVetoProposal defines a message for vetoing a proposal. message MsgVetoProposal { - option (cosmos.msg.v1.signer) = "vetoer"; - option (amino.name) = "atomone/coredaos/v1/MsgVetoProposal"; + option (cosmos.msg.v1.signer) = "vetoer"; + option (amino.name) = "atomone/coredaos/v1/MsgVetoProposal"; - // vetoer is the address of the dao vetoing the proposal. - string vetoer = 1; + // vetoer is the address of the dao vetoing the proposal. + string vetoer = 1; - // proposal_id is the ID of the proposal to veto. - uint64 proposal_id = 2; + // proposal_id is the ID of the proposal to veto. + uint64 proposal_id = 2; - // burn_deposit is a boolean indicating whether to burn the deposit of the proposal. - // If true, the deposit is burned and not refunded. - bool burn_deposit = 3; + // burn_deposit is a boolean indicating whether to burn the deposit of the + // proposal. If true, the deposit is burned and not refunded. + bool burn_deposit = 3; } // MsgVetoProposalResponse defines the response for MsgVetoProposal. @@ -109,15 +113,16 @@ message MsgVetoProposalResponse {} // MsgUpdateParams is the Msg/UpdateParams request type. message MsgUpdateParams { - option (cosmos.msg.v1.signer) = "authority"; - // authority is the address that controls the module (defaults to x/gov unless - // overwritten). - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // params defines the x/coredaos parameters to update. - // - // NOTE: All parameters must be supplied. - Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + option (cosmos.msg.v1.signer) = "authority"; + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // params defines the x/coredaos parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // MsgUpdateParamsResponse defines the response structure for executing a diff --git a/proto/atomone/dynamicfee/v1/params.proto b/proto/atomone/dynamicfee/v1/params.proto index e1f1b58d0..830621dfb 100644 --- a/proto/atomone/dynamicfee/v1/params.proto +++ b/proto/atomone/dynamicfee/v1/params.proto @@ -58,7 +58,7 @@ message Params { (gogoproto.nullable) = false ]; - // DefaultMaxBlockGas is the default max block gas. + // DefaultMaxBlockGas is the default max block gas. // This parameter is used by the dynamicfee module // in the case consensus_params.block.max_gas returns 0 or -1. uint64 default_max_block_gas = 7; diff --git a/proto/atomone/dynamicfee/v1/tx.proto b/proto/atomone/dynamicfee/v1/tx.proto index cb34402f8..39b24a51e 100644 --- a/proto/atomone/dynamicfee/v1/tx.proto +++ b/proto/atomone/dynamicfee/v1/tx.proto @@ -14,7 +14,8 @@ option go_package = "github.com/atomone-hub/atomone/x/dynamicfee/types"; service Msg { option (cosmos.msg.v1.service) = true; - // UpdateParams defines a method for updating the dynamicfee module parameters. + // UpdateParams defines a method for updating the dynamicfee module + // parameters. rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } diff --git a/proto/atomone/gov/v1/genesis.proto b/proto/atomone/gov/v1/genesis.proto index 20860a74f..2942a2329 100644 --- a/proto/atomone/gov/v1/genesis.proto +++ b/proto/atomone/gov/v1/genesis.proto @@ -41,19 +41,20 @@ message GenesisState { // last updated value for the dynamic min initial deposit LastMinDeposit last_min_initial_deposit = 11; - + // governance participation EMA // If unset or set to 0, the quorum for the next proposal will be set to the // params.MinQuorum value. - string participation_ema = 12 [(cosmos_proto.scalar) = "cosmos.Dec"]; - + string participation_ema = 12 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; + // governance participation EMA for constitution amendment proposals. // If unset or set to 0, the quorum for the next constitution amendment // proposal will be set to the params.MinConstitutionAmendmentQuorum value. - string constitution_amendment_participation_ema = 13 [(cosmos_proto.scalar) = "cosmos.Dec"]; + string constitution_amendment_participation_ema = 13 + [ (cosmos_proto.scalar) = "cosmos.Dec" ]; // governance participation EMA for law proposals. // If unset or set to 0, the quorum for the next law proposal will be set to // the params.LawMinQuorum value. - string law_participation_ema = 14 [(cosmos_proto.scalar) = "cosmos.Dec"]; + string law_participation_ema = 14 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; } diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index b5b5889c5..0b5527afb 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -154,7 +154,7 @@ message TallyResult { // abstain_count is the number of abstain votes on a proposal. string abstain_count = 2 [ (cosmos_proto.scalar) = "cosmos.Int" ]; // no_count is the number of no votes on a proposal. - string no_count = 3 [(cosmos_proto.scalar) = "cosmos.Int"]; + string no_count = 3 [ (cosmos_proto.scalar) = "cosmos.Int" ]; } // Vote defines a vote on a governance proposal. @@ -179,7 +179,8 @@ message Vote { message QuorumCheckQueueEntry { // quorum_timeout_time is the time after which quorum checks start happening // and voting period is extended if proposal reaches quorum. - google.protobuf.Timestamp quorum_timeout_time = 1 [(gogoproto.stdtime) = true]; + google.protobuf.Timestamp quorum_timeout_time = 1 + [ (gogoproto.stdtime) = true ]; // quorum_check_count is the number of times quorum will be checked. // This is a snapshot of the parameter value with the same name when the @@ -216,75 +217,83 @@ message VotingParams { message TallyParams { // Minimum percentage of total stake needed to vote for a result to be // considered valid. - string quorum = 1 [ (cosmos_proto.scalar) = "cosmos.Dec", deprecated = true]; + string quorum = 1 [ (cosmos_proto.scalar) = "cosmos.Dec", deprecated = true ]; // Minimum proportion of Yes votes for proposal to pass. Default value: 2/3. - string threshold = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; + string threshold = 2 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; // quorum for constitution amendment proposals - string constitution_amendment_quorum = 3 [(cosmos_proto.scalar) = "cosmos.Dec", deprecated = true]; + string constitution_amendment_quorum = 3 + [ (cosmos_proto.scalar) = "cosmos.Dec", deprecated = true ]; - // Minimum proportion of Yes votes for a Constitution Amendment proposal to pass. Default value: 0.9. - string constitution_amendment_threshold = 4 [(cosmos_proto.scalar) = "cosmos.Dec"]; + // Minimum proportion of Yes votes for a Constitution Amendment proposal to + // pass. Default value: 0.9. + string constitution_amendment_threshold = 4 + [ (cosmos_proto.scalar) = "cosmos.Dec" ]; // quorum for law proposals - string law_quorum = 5 [(cosmos_proto.scalar) = "cosmos.Dec", deprecated = true]; + string law_quorum = 5 + [ (cosmos_proto.scalar) = "cosmos.Dec", deprecated = true ]; - // Minimum proportion of Yes votes for a Law proposal to pass. Default value: 0.9. - string law_threshold = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; + // Minimum proportion of Yes votes for a Law proposal to pass. Default value: + // 0.9. + string law_threshold = 6 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; } message MinDepositThrottler { - // Floor value for the minimum deposit required for a proposal to enter the voting period. + // Floor value for the minimum deposit required for a proposal to enter the + // voting period. repeated cosmos.base.v1beta1.Coin floor_value = 1 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - // Duration that dictates after how long the dynamic minimum deposit should be recalculated - // for time-based decreases. - google.protobuf.Duration update_period = 2 [(gogoproto.stdduration) = true]; + // Duration that dictates after how long the dynamic minimum deposit should be + // recalculated for time-based decreases. + google.protobuf.Duration update_period = 2 [ (gogoproto.stdduration) = true ]; // The number of active proposals the dynamic minimum deposit should target. uint64 target_active_proposals = 3; - // The ratio of increase for the minimum deposit when the number of active proposals - // is at or above the target. - string increase_ratio = 4 [(cosmos_proto.scalar) = "cosmos.Dec"]; + // The ratio of increase for the minimum deposit when the number of active + // proposals is at or above the target. + string increase_ratio = 4 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; - // The ratio of decrease for the minimum deposit when the number of active proposals - // is 1 less than the target. - string decrease_ratio = 5 [(cosmos_proto.scalar) = "cosmos.Dec"]; + // The ratio of decrease for the minimum deposit when the number of active + // proposals is 1 less than the target. + string decrease_ratio = 5 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; - // A positive integer representing the sensitivity of dynamic minimum deposit + // A positive integer representing the sensitivity of dynamic minimum deposit // decreases to the distance from the target number of active proposals. - // The higher the number, the lower the sensitivity. A value of 1 represents the - // highest sensitivity. + // The higher the number, the lower the sensitivity. A value of 1 represents + // the highest sensitivity. uint64 decrease_sensitivity_target_distance = 6; } message MinInitialDepositThrottler { - // Floor value for the minimum initial deposit required for a proposal to enter the deposit period. + // Floor value for the minimum initial deposit required for a proposal to + // enter the deposit period. repeated cosmos.base.v1beta1.Coin floor_value = 1 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - // Duration that dictates after how long the dynamic minimum deposit should be recalculated - // for time-based decreases. - google.protobuf.Duration update_period = 2 [(gogoproto.stdduration) = true]; + // Duration that dictates after how long the dynamic minimum deposit should be + // recalculated for time-based decreases. + google.protobuf.Duration update_period = 2 [ (gogoproto.stdduration) = true ]; - // The number of proposals in deposit period the dynamic minimum initial deposit should target. + // The number of proposals in deposit period the dynamic minimum initial + // deposit should target. uint64 target_proposals = 3; - // The ratio of increase for the minimum initial deposit when the number of proposals - // in deposit period is at or above the target. - string increase_ratio = 4 [(cosmos_proto.scalar) = "cosmos.Dec"]; + // The ratio of increase for the minimum initial deposit when the number of + // proposals in deposit period is at or above the target. + string increase_ratio = 4 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; - // The ratio of decrease for the minimum initial deposit when the number of proposals - // in deposit period is 1 less than the target. - string decrease_ratio = 5 [(cosmos_proto.scalar) = "cosmos.Dec"]; + // The ratio of decrease for the minimum initial deposit when the number of + // proposals in deposit period is 1 less than the target. + string decrease_ratio = 5 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; - // A positive integer representing the sensitivity of dynamic minimum initial + // A positive integer representing the sensitivity of dynamic minimum initial // deposit decreases to the distance from the target number of proposals - // in deposit period. The higher the number, the lower the sensitivity. A value - // of 1 represents the highest sensitivity. + // in deposit period. The higher the number, the lower the sensitivity. A + // value of 1 represents the highest sensitivity. uint64 decrease_sensitivity_target_distance = 6; } @@ -298,8 +307,11 @@ message Params { // While setting this value returns an error, when queried it is set to the // value of the current minimum deposit value as determined by the dynamic // system for backward compatibility. - repeated cosmos.base.v1beta1.Coin min_deposit = 1 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true, deprecated = true ]; + repeated cosmos.base.v1beta1.Coin min_deposit = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + deprecated = true + ]; // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 // months. @@ -311,13 +323,15 @@ message Params { // Minimum percentage of total stake needed to vote for a result to be // considered valid. Default value: 0.25. - string quorum = 4 [(cosmos_proto.scalar) = "cosmos.Dec", deprecated = true]; + string quorum = 4 [ (cosmos_proto.scalar) = "cosmos.Dec", deprecated = true ]; // Minimum proportion of Yes votes for proposal to pass. Default value: 2/3. - string threshold = 5 [(cosmos_proto.scalar) = "cosmos.Dec"]; + string threshold = 5 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; - // The ratio representing the proportion of the deposit value that must be paid at proposal submission. - string min_initial_deposit_ratio = 7 [(cosmos_proto.scalar) = "cosmos.Dec", deprecated = true ]; + // The ratio representing the proportion of the deposit value that must be + // paid at proposal submission. + string min_initial_deposit_ratio = 7 + [ (cosmos_proto.scalar) = "cosmos.Dec", deprecated = true ]; // burn deposits if a proposal does not meet quorum bool burn_vote_quorum = 13; @@ -335,27 +349,35 @@ message Params { string min_deposit_ratio = 15 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; // quorum for constitution amendment proposals - string constitution_amendment_quorum = 16 [(cosmos_proto.scalar) = "cosmos.Dec", deprecated = true]; + string constitution_amendment_quorum = 16 + [ (cosmos_proto.scalar) = "cosmos.Dec", deprecated = true ]; - // Minimum proportion of Yes votes for a Constitution Amendment proposal to pass. Default value: 0.9. - string constitution_amendment_threshold = 17 [(cosmos_proto.scalar) = "cosmos.Dec"]; + // Minimum proportion of Yes votes for a Constitution Amendment proposal to + // pass. Default value: 0.9. + string constitution_amendment_threshold = 17 + [ (cosmos_proto.scalar) = "cosmos.Dec" ]; // quorum for law proposals - string law_quorum = 18 [(cosmos_proto.scalar) = "cosmos.Dec", deprecated = true]; + string law_quorum = 18 + [ (cosmos_proto.scalar) = "cosmos.Dec", deprecated = true ]; - // Minimum proportion of Yes votes for a Law proposal to pass. Default value: 0.9. - string law_threshold = 19 [(cosmos_proto.scalar) = "cosmos.Dec"]; + // Minimum proportion of Yes votes for a Law proposal to pass. Default value: + // 0.9. + string law_threshold = 19 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; - // Duration of time after a proposal enters the voting period, during which quorum - // must be achieved to not incur in a voting period extension. - google.protobuf.Duration quorum_timeout = 20 [(gogoproto.stdduration) = true]; + // Duration of time after a proposal enters the voting period, during which + // quorum must be achieved to not incur in a voting period extension. + google.protobuf.Duration quorum_timeout = 20 + [ (gogoproto.stdduration) = true ]; - // Duration that expresses the maximum amount of time by which a proposal voting period - // can be extended. - google.protobuf.Duration max_voting_period_extension = 21 [(gogoproto.stdduration) = true]; + // Duration that expresses the maximum amount of time by which a proposal + // voting period can be extended. + google.protobuf.Duration max_voting_period_extension = 21 + [ (gogoproto.stdduration) = true ]; - // Number of times a proposal should be checked for quorum after the quorum timeout - // has elapsed. Used to compute the amount of time in between quorum checks. + // Number of times a proposal should be checked for quorum after the quorum + // timeout has elapsed. Used to compute the amount of time in between quorum + // checks. uint64 quorum_check_count = 22; MinDepositThrottler min_deposit_throttler = 23; @@ -363,22 +385,24 @@ message Params { MinInitialDepositThrottler min_initial_deposit_throttler = 24; // Minimum proportion of No Votes for a proposal deposit to be burnt. - string burn_deposit_no_threshold = 25 [(cosmos_proto.scalar) = "cosmos.Dec"]; + string burn_deposit_no_threshold = 25 + [ (cosmos_proto.scalar) = "cosmos.Dec" ]; // Achievable quorum - QuorumRange quorum_range = 26 [(cosmos_proto.scalar) = "cosmos.Dec"]; + QuorumRange quorum_range = 26 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; // Achievable quorum for constitution amendment proposals - QuorumRange constitution_amendment_quorum_range = 27 [(cosmos_proto.scalar) = "cosmos.Dec"]; + QuorumRange constitution_amendment_quorum_range = 27 + [ (cosmos_proto.scalar) = "cosmos.Dec" ]; // Achievable quorum for law proposals - QuorumRange law_quorum_range = 28 [(cosmos_proto.scalar) = "cosmos.Dec"]; + QuorumRange law_quorum_range = 28 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; } message QuorumRange { // Maximum achievable quorum - string max = 1 [(cosmos_proto.scalar) = "cosmos.Dec"]; + string max = 1 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; // Minimum achievable quorum - string min = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; + string min = 2 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; } diff --git a/proto/atomone/gov/v1/query.proto b/proto/atomone/gov/v1/query.proto index 48efe8526..a61ab4390 100644 --- a/proto/atomone/gov/v1/query.proto +++ b/proto/atomone/gov/v1/query.proto @@ -15,7 +15,8 @@ option go_package = "github.com/atomone-hub/atomone/x/gov/types/v1"; // Query defines the gRPC querier service for gov module service Query { // Constitution queries the chain's constitution. - rpc Constitution(QueryConstitutionRequest) returns (QueryConstitutionResponse) { + rpc Constitution(QueryConstitutionRequest) + returns (QueryConstitutionResponse) { option (google.api.http).get = "/atomone/gov/v1/constitution"; } @@ -72,7 +73,8 @@ service Query { // MinInitialDeposit queries the minimum initial deposit // currently required for a proposal to be submitted. - rpc MinInitialDeposit(QueryMinInitialDepositRequest) returns (QueryMinInitialDepositResponse) { + rpc MinInitialDeposit(QueryMinInitialDepositRequest) + returns (QueryMinInitialDepositResponse) { option (google.api.http).get = "/atomone/gov/v1/mininitialdeposit"; } @@ -81,19 +83,21 @@ service Query { option (google.api.http).get = "/atomone/gov/v1/quorums"; } - // ParticipationEMAs queries the state of the proposal participation exponential moving averages. - rpc ParticipationEMAs(QueryParticipationEMAsRequest) returns (QueryParticipationEMAsResponse) { + // ParticipationEMAs queries the state of the proposal participation + // exponential moving averages. + rpc ParticipationEMAs(QueryParticipationEMAsRequest) + returns (QueryParticipationEMAsResponse) { option (google.api.http).get = "/atomone/gov/v1/participationemas"; } } -// QueryConstitutionRequest is the request type for the Query/Constitution RPC method +// QueryConstitutionRequest is the request type for the Query/Constitution RPC +// method message QueryConstitutionRequest {} -// QueryConstitutionResponse is the response type for the Query/Constitution RPC method -message QueryConstitutionResponse { - string constitution = 1; -} +// QueryConstitutionResponse is the response type for the Query/Constitution RPC +// method +message QueryConstitutionResponse { string constitution = 1; } // QueryProposalRequest is the request type for the Query/Proposal RPC method. message QueryProposalRequest { @@ -234,22 +238,30 @@ message QueryTallyResultResponse { TallyResult tally = 1; } -// QueryMinDepositRequest is the request type for the Query/MinDeposit RPC method. +// QueryMinDepositRequest is the request type for the Query/MinDeposit RPC +// method. message QueryMinDepositRequest {} -// QueryMinDepositResponse is the response type for the Query/MinDeposit RPC method. +// QueryMinDepositResponse is the response type for the Query/MinDeposit RPC +// method. message QueryMinDepositResponse { - // min_deposit defines the minimum deposit required for a proposal to enter voting period. - repeated cosmos.base.v1beta1.Coin min_deposit = 1 [ (gogoproto.nullable) = false]; + // min_deposit defines the minimum deposit required for a proposal to enter + // voting period. + repeated cosmos.base.v1beta1.Coin min_deposit = 1 + [ (gogoproto.nullable) = false ]; } -// QueryMinInitialDepositRequest is the request type for the Query/MinInitialDeposit RPC method. +// QueryMinInitialDepositRequest is the request type for the +// Query/MinInitialDeposit RPC method. message QueryMinInitialDepositRequest {} -// QueryMinInitialDepositResponse is the response type for the Query/MinInitialDeposit RPC method. +// QueryMinInitialDepositResponse is the response type for the +// Query/MinInitialDeposit RPC method. message QueryMinInitialDepositResponse { - // min_initial_deposit defines the minimum initial deposit required for a proposal to be submitted. - repeated cosmos.base.v1beta1.Coin min_initial_deposit = 1 [ (gogoproto.nullable) = false]; + // min_initial_deposit defines the minimum initial deposit required for a + // proposal to be submitted. + repeated cosmos.base.v1beta1.Coin min_initial_deposit = 1 + [ (gogoproto.nullable) = false ]; } // QueryQuorumsRequest is the request type for the Query/Quorums RPC method. @@ -262,24 +274,29 @@ message QueryQuorumsResponse { // constitution_amendment_quorum defines the requested quorum for // constitution amendment proposals. - string constitution_amendment_quorum = 2 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; + string constitution_amendment_quorum = 2 + [ (cosmos_proto.scalar) = "cosmos.Dec" ]; // law_quorum defines the requested quorum for law proposals. string law_quorum = 3 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; } -// QueryParticipationEMAsRequest is the request type for the Query/ParticipationEMAs RPC method. +// QueryParticipationEMAsRequest is the request type for the +// Query/ParticipationEMAs RPC method. message QueryParticipationEMAsRequest {} -// QueryParticipationEMAsResponse is the response type for the Query/ParticipationEMAs RPC method. +// QueryParticipationEMAsResponse is the response type for the +// Query/ParticipationEMAs RPC method. message QueryParticipationEMAsResponse { // participation_ema defines the requested participation EMA for proposals. string participation_ema = 1 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; - // constitution_amendment_participation_ema defines the requested participation EMA for - // constitution amendment proposals. - string constitution_amendment_participation_ema = 2 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; + // constitution_amendment_participation_ema defines the requested + // participation EMA for constitution amendment proposals. + string constitution_amendment_participation_ema = 2 + [ (cosmos_proto.scalar) = "cosmos.Dec" ]; - // law_participation_ema defines the requestedparticipation EMA for law proposals. + // law_participation_ema defines the requestedparticipation EMA for law + // proposals. string law_participation_ema = 3 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; } diff --git a/proto/atomone/gov/v1/tx.proto b/proto/atomone/gov/v1/tx.proto index f05db7f93..d1c22c8b3 100644 --- a/proto/atomone/gov/v1/tx.proto +++ b/proto/atomone/gov/v1/tx.proto @@ -205,7 +205,8 @@ message MsgProposeLaw { // MsgProposeLaw message. message MsgProposeLawResponse {} -// MsgConstitutionAmendment is the Msg/ProposeConstitutionAmendment request type. +// MsgConstitutionAmendment is the Msg/ProposeConstitutionAmendment request +// type. message MsgProposeConstitutionAmendment { option (cosmos.msg.v1.signer) = "authority"; option (amino.name) = "atomone/x/gov/v1/MsgProposeAmendment"; @@ -214,10 +215,11 @@ message MsgProposeConstitutionAmendment { // overwritten). string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - // amendment is the amendment to the constitution. It must be in valid GNU patch format. + // amendment is the amendment to the constitution. It must be in valid GNU + // patch format. string amendment = 2; } -// MsgProposeConstitutionAmendmentResponse defines the response structure for executing a -// MsgProposeConstitutionAmendment message. +// MsgProposeConstitutionAmendmentResponse defines the response structure for +// executing a MsgProposeConstitutionAmendment message. message MsgProposeConstitutionAmendmentResponse {} \ No newline at end of file diff --git a/proto/atomone/photon/v1/genesis.proto b/proto/atomone/photon/v1/genesis.proto index 8c06bb80a..7a3fd78b6 100644 --- a/proto/atomone/photon/v1/genesis.proto +++ b/proto/atomone/photon/v1/genesis.proto @@ -9,5 +9,6 @@ option go_package = "github.com/atomone-hub/atomone/x/photon/types"; // GenesisState defines the x/photon module's genesis state. message GenesisState { - Params params = 1 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + Params params = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } diff --git a/proto/atomone/photon/v1/query.proto b/proto/atomone/photon/v1/query.proto index ef9d5e5dc..2ef80ca02 100644 --- a/proto/atomone/photon/v1/query.proto +++ b/proto/atomone/photon/v1/query.proto @@ -15,7 +15,8 @@ service Query { option (google.api.http).get = "/atomone/photon/v1/params"; } // ConversionRate queries the photon's conversion rate - rpc ConversionRate(QueryConversionRateRequest) returns (QueryConversionRateResponse) { + rpc ConversionRate(QueryConversionRateRequest) + returns (QueryConversionRateResponse) { option (google.api.http).get = "/atomone/photon/v1/conversion_rate"; } } @@ -29,11 +30,13 @@ message QueryParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; } -// QueryConversionRateRequest is request type for the Query/ConversionRate RPC method. +// QueryConversionRateRequest is request type for the Query/ConversionRate RPC +// method. message QueryConversionRateRequest {} -// QueryConversionRateResponse is response type for the Query/ConversionRate RPC method. +// QueryConversionRateResponse is response type for the Query/ConversionRate RPC +// method. message QueryConversionRateResponse { - // conversion_rate represents the factor used to convert atone to photon. + // conversion_rate represents the factor used to convert atone to photon. string conversion_rate = 1 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; } diff --git a/proto/atomone/photon/v1/tx.proto b/proto/atomone/photon/v1/tx.proto index 9b8dc3019..6aaf9f356 100644 --- a/proto/atomone/photon/v1/tx.proto +++ b/proto/atomone/photon/v1/tx.proto @@ -38,11 +38,9 @@ message MsgMintPhoton { // MsgMintPhotonResponse defines the response structure for executing a // MsgMintPhoton message. message MsgMintPhotonResponse { - cosmos.base.v1beta1.Coin minted = 1 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; - // conversion_rate represents the factor used to convert atone to photon. + cosmos.base.v1beta1.Coin minted = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + // conversion_rate represents the factor used to convert atone to photon. string conversion_rate = 2 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; } diff --git a/proto/buf.lock b/proto/buf.lock index 92f38120d..47bb44305 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -16,13 +16,23 @@ deps: repository: gogo-proto commit: 88ef6483f90f478fb938c37dde52ece3 digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba + - remote: buf.build + owner: cosmos + repository: ibc + commit: 857539074f9c4dda961f9db5dcf8e462 + digest: shake256:e8892cbffb31dd4daedda8dd293f224bc4b718b9854128a0dd35fdf984c8d4c31a006c49cc4bcdfb5d20782a6755f25eea8264f3674c83fcefd809d904102015 + - remote: buf.build + owner: cosmos + repository: ics23 + commit: dc427cb4519143d8996361c045a29ad7 + digest: shake256:f6611c56170e2cb6354fa6e367a225fed7b8b0defca3252f05e842fe311be46997680ebf57d8644b52c1f2cca49b366ffe89ce5e8db5fd055a15259c88e4e41e - remote: buf.build owner: googleapis repository: googleapis - commit: 61b203b9a9164be9a834f58c37be6f62 - digest: shake256:e619113001d6e284ee8a92b1561e5d4ea89a47b28bf0410815cb2fa23914df8be9f1a6a98dcf069f5bc2d829a2cfb1ac614863be45cd4f8a5ad8606c5f200224 + commit: 72c8614f3bd0466ea67931ef2c43d608 + digest: shake256:b3ac4d383db09f92ab0ca85d12bff8c49eddf7031bd3a854c260b6ac4ed6a2bb85b52b3393c316d28f8038bf3b8e70cb3d16470e8cc4423007678fb6d89d36d4 - remote: buf.build owner: protocolbuffers repository: wellknowntypes - commit: 3ddd61d1f53d485abd3d3a2b47a62b8e - digest: shake256:9e6799d56700d0470c3723a2fd027e8b4a41a07085a0c90c58e05f6c0038fac9b7a0170acd7692707a849983b1b8189aa33e7b73f91d68157f7136823115546b + commit: a4aee59cf3714106961b09d99b349cd1 + digest: shake256:7e2aa4fb37e2be8dc8a4bcbebaec00635abbcc7333df40ba6412a666335f66c5c0705ce4cc5c207e728412ac3d81850545f90e8535da66712a17ab42923be6bd diff --git a/proto/buf.yaml b/proto/buf.yaml index 3dcc274ec..c9c4c2117 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -11,7 +11,8 @@ deps: - buf.build/cosmos/gogo-proto - buf.build/googleapis/googleapis - buf.build/protocolbuffers/wellknowntypes - + - buf.build/cosmos/ics23 + - buf.build/cosmos/ibc breaking: use: - FILE diff --git a/proto/ibc/lightclients/gno/v1/gno.proto b/proto/ibc/lightclients/gno/v1/gno.proto new file mode 100644 index 000000000..c44b03f7f --- /dev/null +++ b/proto/ibc/lightclients/gno/v1/gno.proto @@ -0,0 +1,220 @@ +syntax = "proto3"; + +package ibc.lightclients.gno.v1; + +import "cosmos/ics23/v1/proofs.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/core/commitment/v1/commitment.proto"; +import "tendermint/crypto/keys.proto"; + +option go_package = "github.com/atomone-hub/atomone/modules/10-gno;gno"; + +// ClientState from Gno tracks the current validator set, latest height, +// and a possible frozen height. +message ClientState { + option (gogoproto.goproto_getters) = false; + + string chain_id = 1; + Fraction trust_level = 2 [(gogoproto.nullable) = false]; + // duration of the period since the LatestTimestamp during which the + // submitted headers are valid for upgrade + google.protobuf.Duration trusting_period = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true + ]; + // duration of the staking unbonding period + google.protobuf.Duration unbonding_period = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true + ]; + // defines how much new (untrusted) header's Time can drift into the future. + google.protobuf.Duration max_clock_drift = 5 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true + ]; + // Block height when the client was frozen due to a misbehaviour + ibc.core.client.v1.Height frozen_height = 6 [(gogoproto.nullable) = false]; + // Latest height the client was updated to + ibc.core.client.v1.Height latest_height = 7 [(gogoproto.nullable) = false]; + + // Proof specifications used in verifying counterparty state + repeated cosmos.ics23.v1.ProofSpec proof_specs = 8; + + // Path at which next upgraded client will be committed. + // Each element corresponds to the key for a single CommitmentProof in the + // chained proof. NOTE: ClientState must stored under + // `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored + // under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using + // the default upgrade module, upgrade_path should be []string{"upgrade", + // "upgradedIBCState"}` + repeated string upgrade_path = 9; + + // allow_update_after_expiry is deprecated + bool allow_update_after_expiry = 10 [deprecated = true]; + // allow_update_after_misbehaviour is deprecated + bool allow_update_after_misbehaviour = 11 [deprecated = true]; + + // In order to distinguisgh between Gno and Tendermint light clients + // we add a client type field. This is useful for clients that + // may support multiple light client types. + string lc_type = 12; +} + +// ConsensusState defines the consensus state from Gno. +message ConsensusState { + option (gogoproto.goproto_getters) = false; + + // timestamp that corresponds to the block height in which the ConsensusState + // was stored. + google.protobuf.Timestamp timestamp = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; + // commitment root (i.e app hash) + ibc.core.commitment.v1.MerkleRoot root = 2 [(gogoproto.nullable) = false]; + bytes next_validators_hash = 3; + // In order to distinguisgh between Gno and Tendermint light clients + // we add a client type field. This is useful for clients that + // may support multiple light client types. + string lc_type = 4; +} + +// Misbehaviour is a wrapper over two conflicting Headers +// that implements Misbehaviour interface expected by ICS-02 +message Misbehaviour { + option (gogoproto.goproto_getters) = false; + + // ClientID is deprecated + string client_id = 1 [deprecated = true]; + Header header_1 = 2 [(gogoproto.customname) = "Header1"]; + Header header_2 = 3 [(gogoproto.customname) = "Header2"]; +} + +// Header defines the Tendermint client consensus Header. +// It encapsulates all the information necessary to update from a trusted +// Tendermint ConsensusState. The inclusion of TrustedHeight and +// TrustedValidators allows this update to process correctly, so long as the +// ConsensusState for the TrustedHeight exists, this removes race conditions +// among relayers The SignedHeader and ValidatorSet are the new untrusted update +// fields for the client. The TrustedHeight is the height of a stored +// ConsensusState on the client that will be used to verify the new untrusted +// header. The Trusted ConsensusState must be within the unbonding period of +// current time in order to correctly verify, and the TrustedValidators must +// hash to TrustedConsensusState.NextValidatorsHash since that is the last +// trusted validator set at the TrustedHeight. +message Header { + SignedHeader signed_header = 1; + + ValidatorSet validator_set = 2; + ibc.core.client.v1.Height trusted_height = 3 [(gogoproto.nullable) = false]; + ValidatorSet trusted_validators = 4; +} + +message Block { + GnoHeader header = 1; + Data data = 2; + Commit last_commit = 3; +} + +message GnoHeader { + string version = 1; + string chain_id = 2; + sint64 height = 3; + google.protobuf.Timestamp time = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; + sint64 num_txs = 5; + sint64 total_txs = 6; + string app_version = 7; + BlockID last_block_id = 8; + bytes last_commit_hash = 9; + bytes data_hash = 10; + bytes validators_hash = 11; + bytes next_validators_hash = 12; + bytes consensus_hash = 13; + bytes app_hash = 14; + bytes last_results_hash = 15; + string proposer_address = 16; +} + +message Data { + repeated bytes txs = 1; +} + +message Commit { + BlockID block_id = 1; + repeated CommitSig precommits = 2; +} + +message BlockID { + bytes hash = 1; + PartSetHeader parts_header = 2 [json_name = "parts"]; +} + +message SignedHeader { + GnoHeader header = 1; + Commit commit = 2; +} + +message LightBlock { + SignedHeader signed_header = 1; + ValidatorSet validator_set = 2; +} +message CommitSig { + uint32 type = 1; + sint64 height = 2; + sint64 round = 3; + BlockID block_id = 4; + google.protobuf.Timestamp timestamp = 5 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; + string validator_address = 6; + sint64 validator_index = 7; + bytes signature = 8; +} + +message Vote { + uint32 type = 1; + sint64 height = 2; + sint64 round = 3; + BlockID block_id = 4; + google.protobuf.Timestamp timestamp = 5 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; + string validator_address = 6; + sint64 validator_index = 7; + bytes signature = 8; +} + +message PartSet {} + +message PartSetHeader { + sint64 total = 1; + bytes hash = 2; +} + +message Validator { + string address = 1; + tendermint.crypto.PublicKey pub_key = 2; + sint64 voting_power = 3; + sint64 proposer_priority = 4; +} + +message ValidatorSet { + repeated Validator validators = 1; + Validator proposer = 2; +} + +// Fraction defines the protobuf message type for tmmath.Fraction that only +// supports positive values. +message Fraction { + uint64 numerator = 1; + uint64 denominator = 2; +} diff --git a/proto/tm2/bft/abci/abci.proto b/proto/tm2/bft/abci/abci.proto new file mode 100644 index 000000000..75482bfcb --- /dev/null +++ b/proto/tm2/bft/abci/abci.proto @@ -0,0 +1,199 @@ +syntax = "proto3"; + +package tm2.bft.abci; + +// imports +import "tm2/crypto/merkle.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/gnolang/gno/tm2/pkg/bft/abci/types"; + +// messages +message RequestBase {} + +message RequestEcho { + RequestBase request_base = 1 [ json_name = "RequestBase" ]; + string message = 2 [ json_name = "Message" ]; +} + +message RequestFlush { + RequestBase request_base = 1 [ json_name = "RequestBase" ]; +} + +message RequestInfo { + RequestBase request_base = 1 [ json_name = "RequestBase" ]; +} + +message RequestSetOption { + RequestBase request_base = 1 [ json_name = "RequestBase" ]; + string key = 2 [ json_name = "Key" ]; + string value = 3 [ json_name = "Value" ]; +} + +message RequestInitChain { + RequestBase request_base = 1 [ json_name = "RequestBase" ]; + google.protobuf.Timestamp time = 2 [ json_name = "Time" ]; + string chain_id = 3 [ json_name = "ChainID" ]; + ConsensusParams consensus_params = 4 [ json_name = "ConsensusParams" ]; + repeated ValidatorUpdate validators = 5 [ json_name = "Validators" ]; + google.protobuf.Any app_state = 6 [ json_name = "AppState" ]; +} + +message RequestQuery { + RequestBase request_base = 1 [ json_name = "RequestBase" ]; + bytes data = 2 [ json_name = "Data" ]; + string path = 3 [ json_name = "Path" ]; + sint64 height = 4 [ json_name = "Height" ]; + bool prove = 5 [ json_name = "Prove" ]; +} + +message RequestBeginBlock { + RequestBase request_base = 1 [ json_name = "RequestBase" ]; + bytes hash = 2 [ json_name = "Hash" ]; + google.protobuf.Any header = 3 [ json_name = "Header" ]; + LastCommitInfo last_commit_info = 4 [ json_name = "LastCommitInfo" ]; +} + +message RequestCheckTx { + RequestBase request_base = 1 [ json_name = "RequestBase" ]; + bytes tx = 2 [ json_name = "Tx" ]; + sint64 type = 3 [ json_name = "Type" ]; +} + +message RequestDeliverTx { + RequestBase request_base = 1 [ json_name = "RequestBase" ]; + bytes tx = 2 [ json_name = "Tx" ]; +} + +message RequestEndBlock { + RequestBase request_base = 1 [ json_name = "RequestBase" ]; + sint64 height = 2 [ json_name = "Height" ]; +} + +message RequestCommit { + RequestBase request_base = 1 [ json_name = "RequestBase" ]; +} + +message ResponseBase { + google.protobuf.Any error = 1 [ json_name = "Error" ]; + bytes data = 2 [ json_name = "Data" ]; + repeated google.protobuf.Any events = 3 [ json_name = "Events" ]; + string log = 4 [ json_name = "Log" ]; + string info = 5 [ json_name = "Info" ]; +} + +message ResponseException { + ResponseBase response_base = 1 [ json_name = "ResponseBase" ]; +} + +message ResponseEcho { + ResponseBase response_base = 1 [ json_name = "ResponseBase" ]; + string message = 2 [ json_name = "Message" ]; +} + +message ResponseFlush { + ResponseBase response_base = 1 [ json_name = "ResponseBase" ]; +} + +message ResponseInfo { + ResponseBase response_base = 1 [ json_name = "ResponseBase" ]; + string abci_version = 2 [ json_name = "ABCIVersion" ]; + string app_version = 3 [ json_name = "AppVersion" ]; + sint64 last_block_height = 4 [ json_name = "LastBlockHeight" ]; + bytes last_block_app_hash = 5 [ json_name = "LastBlockAppHash" ]; +} + +message ResponseSetOption { + ResponseBase response_base = 1 [ json_name = "ResponseBase" ]; +} + +message ResponseInitChain { + ResponseBase response_base = 1 [ json_name = "ResponseBase" ]; + ConsensusParams consensus_params = 2 [ json_name = "ConsensusParams" ]; + repeated ValidatorUpdate validators = 3 [ json_name = "Validators" ]; + repeated ResponseDeliverTx tx_responses = 4 [ json_name = "TxResponses" ]; +} + +message ResponseQuery { + ResponseBase response_base = 1 [ json_name = "ResponseBase" ]; + bytes key = 2 [ json_name = "Key" ]; + bytes value = 3 [ json_name = "Value" ]; + tm2.crypto.Proof proof = 4 [ json_name = "Proof" ]; + sint64 height = 5 [ json_name = "Height" ]; +} + +message ResponseBeginBlock { + ResponseBase response_base = 1 [ json_name = "ResponseBase" ]; +} + +message ResponseCheckTx { + ResponseBase response_base = 1 [ json_name = "ResponseBase" ]; + sint64 gas_wanted = 2 [ json_name = "GasWanted" ]; + sint64 gas_used = 3 [ json_name = "GasUsed" ]; +} + +message ResponseDeliverTx { + ResponseBase response_base = 1 [ json_name = "ResponseBase" ]; + sint64 gas_wanted = 2 [ json_name = "GasWanted" ]; + sint64 gas_used = 3 [ json_name = "GasUsed" ]; +} + +message ResponseEndBlock { + ResponseBase response_base = 1 [ json_name = "ResponseBase" ]; + repeated ValidatorUpdate validator_updates = 2 + [ json_name = "ValidatorUpdates" ]; + ConsensusParams consensus_params = 3 [ json_name = "ConsensusParams" ]; + repeated google.protobuf.Any events = 4 [ json_name = "Events" ]; +} + +message ResponseCommit { + ResponseBase response_base = 1 [ json_name = "ResponseBase" ]; +} + +message StringError { string value = 1; } + +message ConsensusParams { + BlockParams block = 1 [ json_name = "Block" ]; + ValidatorParams validator = 2 [ json_name = "Validator" ]; +} + +message BlockParams { + sint64 max_tx_bytes = 1 [ json_name = "MaxTxBytes" ]; + sint64 max_data_bytes = 2 [ json_name = "MaxDataBytes" ]; + sint64 max_block_bytes = 3 [ json_name = "MaxBlockBytes" ]; + sint64 max_gas = 4 [ json_name = "MaxGas" ]; + sint64 time_iota_ms = 5 [ json_name = "TimeIotaMS" ]; +} + +message ValidatorParams { + repeated string pub_key_type_ur_ls = 1 [ json_name = "PubKeyTypeURLs" ]; +} + +message ValidatorUpdate { + string address = 1 [ json_name = "Address" ]; + google.protobuf.Any pub_key = 2 [ json_name = "PubKey" ]; + sint64 power = 3 [ json_name = "Power" ]; +} + +message LastCommitInfo { + sint32 round = 1 [ json_name = "Round" ]; + repeated VoteInfo votes = 2 [ json_name = "Votes" ]; +} + +message VoteInfo { + string address = 1 [ json_name = "Address" ]; + sint64 power = 2 [ json_name = "Power" ]; + bool signed_last_block = 3 [ json_name = "SignedLastBlock" ]; +} + +message EventString { string value = 1; } + +message MockHeader { + string version = 1; + string chain_id = 2; + sint64 height = 3; + google.protobuf.Timestamp time = 4; + sint64 num_txs = 5; + sint64 total_txs = 6; +} diff --git a/proto/tm2/bft/types.proto b/proto/tm2/bft/types.proto new file mode 100644 index 000000000..70be98435 --- /dev/null +++ b/proto/tm2/bft/types.proto @@ -0,0 +1,164 @@ +syntax = "proto3"; +package tm2.bft; + +// imports +import "tm2/bft/abci/abci.proto"; +import "tm2/crypto/merkle.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; + +// messages +message Proposal { + uint32 type = 1 [ json_name = "Type" ]; + sint64 height = 2; + sint64 round = 3; + sint64 pol_round = 4; + BlockID block_id = 5; + google.protobuf.Timestamp timestamp = 6; + bytes signature = 7; +} + +message Block { + Header header = 1; + Data data = 2; + Commit last_commit = 3; +} + +message Header { + string version = 1; + string chain_id = 2; + sint64 height = 3; + google.protobuf.Timestamp time = 4; + sint64 num_txs = 5; + sint64 total_txs = 6; + string app_version = 7; + BlockID last_block_id = 8; + bytes last_commit_hash = 9; + bytes data_hash = 10; + bytes validators_hash = 11; + bytes next_validators_hash = 12; + bytes consensus_hash = 13; + bytes app_hash = 14; + bytes last_results_hash = 15; + string proposer_address = 16; +} + +message Data { repeated bytes txs = 1; } + +message Commit { + BlockID block_id = 1; + repeated CommitSig precommits = 2; +} + +message BlockID { + bytes hash = 1; + PartSetHeader parts_header = 2 [ json_name = "parts" ]; +} + +message SignedHeader { + Header header = 1; + Commit commit = 2; +} + +message LightBlock { + SignedHeader signed_header = 1; + ValidatorSet validator_set = 2; +} +message CommitSig { + uint32 type = 1; + sint64 height = 2; + sint64 round = 3; + BlockID block_id = 4; + google.protobuf.Timestamp timestamp = 5; + string validator_address = 6; + sint64 validator_index = 7; + bytes signature = 8; +} + +message Vote { + uint32 type = 1; + sint64 height = 2; + sint64 round = 3; + BlockID block_id = 4; + google.protobuf.Timestamp timestamp = 5; + string validator_address = 6; + sint64 validator_index = 7; + bytes signature = 8; +} + +message Part { + sint64 index = 1; + bytes bytes = 2; + tm2.crypto.SimpleProof proof = 3; +} + +message PartSet {} + +message PartSetHeader { + sint64 total = 1; + bytes hash = 2; +} + +message Validator { + string address = 1; + google.protobuf.Any pub_key = 2; + sint64 voting_power = 3; + sint64 proposer_priority = 4; +} + +message ValidatorSet { + repeated Validator validators = 1; + Validator proposer = 2; +} + +message EventNewBlock { + Block block = 1; + tm2.bft.abci.ResponseBeginBlock result_begin_block = 2; + tm2.bft.abci.ResponseEndBlock result_end_block = 3; +} + +message EventNewBlockHeader { + Header header = 1; + tm2.bft.abci.ResponseBeginBlock result_begin_block = 2; + tm2.bft.abci.ResponseEndBlock result_end_block = 3; +} + +message EventTx { TxResult result = 1; } + +message EventVote { Vote vote = 1; } + +message EventValidatorSetUpdates { + repeated tm2.bft.abci.ValidatorUpdate validator_updates = 1; +} + +message DuplicateVoteEvidence { + google.protobuf.Any pub_key = 1 [ json_name = "PubKey" ]; + Vote vote_a = 2 [ json_name = "VoteA" ]; + Vote vote_b = 3 [ json_name = "VoteB" ]; +} + +message MockGoodEvidence { + sint64 height = 1 [ json_name = "Height" ]; + string address = 2 [ json_name = "Address" ]; +} + +message MockRandomGoodEvidence { + MockGoodEvidence mock_good_evidence = 1 [ json_name = "MockGoodEvidence" ]; +} + +message MockBadEvidence { + MockGoodEvidence mock_good_evidence = 1 [ json_name = "MockGoodEvidence" ]; +} + +message TxResult { + sint64 height = 1; + uint32 index = 2; + bytes tx = 3; + tm2.bft.abci.ResponseDeliverTx response = 4; +} + +message MockAppState { string account_owner = 1; } + +message VoteSet {} + +message TYPES_BytesList { repeated bytes Value = 1; } diff --git a/proto/tm2/bitarray/bitarray.proto b/proto/tm2/bitarray/bitarray.proto new file mode 100644 index 000000000..400c39aa8 --- /dev/null +++ b/proto/tm2/bitarray/bitarray.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +package tm2.bitarray; + +option go_package = "github.com/gnolang/gno/tm2/pkg/bitarray/pb"; + +// messages +message BitArray { + sint64 bits = 1; + repeated uint64 elems = 2; +} \ No newline at end of file diff --git a/proto/tm2/crypto/merkle.proto b/proto/tm2/crypto/merkle.proto new file mode 100644 index 000000000..b5d4260f7 --- /dev/null +++ b/proto/tm2/crypto/merkle.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package tm2.crypto; + +option go_package = "github.com/gnolang/gno/tm2/pkg/crypto/merkle/pb"; + +// messages +message ProofOp { + string type = 1; + bytes key = 2; + bytes data = 3; +} + +message Proof { repeated ProofOp ops = 1; } + +message SimpleProof { + sint64 total = 1; + sint64 index = 2; + bytes leaf_hash = 3; + repeated bytes aunts = 4; +} + +message SimpleProofNode { + bytes hash = 1 [ json_name = "Hash" ]; + SimpleProofNode parent = 2 [ json_name = "Parent" ]; + SimpleProofNode left = 3 [ json_name = "Left" ]; + SimpleProofNode right = 4 [ json_name = "Right" ]; +} + +message MERKLE_BytesList { repeated bytes Value = 1; } \ No newline at end of file diff --git a/proto/tm2/tx/tx.proto b/proto/tm2/tx/tx.proto new file mode 100644 index 000000000..64b0a4d5f --- /dev/null +++ b/proto/tm2/tx/tx.proto @@ -0,0 +1,32 @@ +syntax = 'proto3'; + +package tm2.tx; + +import "google/protobuf/any.proto"; + +message Tx { + // specific message types + repeated google.protobuf.Any messages = 1; + // transaction costs (fee) + TxFee fee = 2; + // the signatures for the transaction + repeated TxSignature signatures = 3; + // memo attached to the transaction + string memo = 4; +} + +message TxFee { + // gas limit + sint64 gas_wanted = 1; + // gas fee details () + string gas_fee = 2; +} + +message TxSignature { + // public key associated with the signature + google.protobuf.Any pub_key = 1; + // the signature + bytes signature = 2; +} + +message PubKeySecp256k1 { bytes key = 1; } diff --git a/x/coredaos/types/tx.pb.go b/x/coredaos/types/tx.pb.go index 84052150d..700e6326d 100644 --- a/x/coredaos/types/tx.pb.go +++ b/x/coredaos/types/tx.pb.go @@ -39,8 +39,8 @@ type MsgAnnotateProposal struct { ProposalId uint64 `protobuf:"varint,2,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` // annotation is the annotation to add to the proposal. Annotation string `protobuf:"bytes,3,opt,name=annotation,proto3" json:"annotation,omitempty"` - // overwrite is a boolean indicating whether to overwrite the existing annotation. - // Must be set to true if the proposal already has an annotation. + // overwrite is a boolean indicating whether to overwrite the existing + // annotation. Must be set to true if the proposal already has an annotation. // Ignored if the proposal does not have yet an annotation. Overwrite bool `protobuf:"varint,4,opt,name=overwrite,proto3" json:"overwrite,omitempty"` } @@ -235,7 +235,8 @@ func (m *MsgEndorseProposalResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgEndorseProposalResponse proto.InternalMessageInfo -// MsgExtendVotingPeriod defines a message for extending the voting period of a proposal. +// MsgExtendVotingPeriod defines a message for extending the voting period of a +// proposal. type MsgExtendVotingPeriod struct { // extender is the address of the dao extending the voting period. Extender string `protobuf:"bytes,1,opt,name=extender,proto3" json:"extender,omitempty"` @@ -333,8 +334,8 @@ type MsgVetoProposal struct { Vetoer string `protobuf:"bytes,1,opt,name=vetoer,proto3" json:"vetoer,omitempty"` // proposal_id is the ID of the proposal to veto. ProposalId uint64 `protobuf:"varint,2,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // burn_deposit is a boolean indicating whether to burn the deposit of the proposal. - // If true, the deposit is burned and not refunded. + // burn_deposit is a boolean indicating whether to burn the deposit of the + // proposal. If true, the deposit is burned and not refunded. BurnDeposit bool `protobuf:"varint,3,opt,name=burn_deposit,json=burnDeposit,proto3" json:"burn_deposit,omitempty"` } @@ -598,15 +599,16 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // AnnotateProposal defines a method to annotate a proposal with additional information. - // It is only available to the Steering DAO. + // AnnotateProposal defines a method to annotate a proposal with additional + // information. It is only available to the Steering DAO. AnnotateProposal(ctx context.Context, in *MsgAnnotateProposal, opts ...grpc.CallOption) (*MsgAnnotateProposalResponse, error) - // EndorseProposal defines a method to endorse a proposal, and for law proposals this also - // results in the lowering of the passing threshold to the passing threshold of regular proposals. - // It is only available to the Steering DAO. + // EndorseProposal defines a method to endorse a proposal, and for law + // proposals this also results in the lowering of the passing threshold to the + // passing threshold of regular proposals. It is only available to the + // Steering DAO. EndorseProposal(ctx context.Context, in *MsgEndorseProposal, opts ...grpc.CallOption) (*MsgEndorseProposalResponse, error) - // ExtendVotingPeriod defines a method to extend the voting period of a proposal. - // It is available to both the Steering DAO and the Oversight DAO. + // ExtendVotingPeriod defines a method to extend the voting period of a + // proposal. It is available to both the Steering DAO and the Oversight DAO. ExtendVotingPeriod(ctx context.Context, in *MsgExtendVotingPeriod, opts ...grpc.CallOption) (*MsgExtendVotingPeriodResponse, error) // VetoProposal defines a method to veto a proposal. // It is only available to the Oversight DAO. @@ -671,15 +673,16 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. type MsgServer interface { - // AnnotateProposal defines a method to annotate a proposal with additional information. - // It is only available to the Steering DAO. + // AnnotateProposal defines a method to annotate a proposal with additional + // information. It is only available to the Steering DAO. AnnotateProposal(context.Context, *MsgAnnotateProposal) (*MsgAnnotateProposalResponse, error) - // EndorseProposal defines a method to endorse a proposal, and for law proposals this also - // results in the lowering of the passing threshold to the passing threshold of regular proposals. - // It is only available to the Steering DAO. + // EndorseProposal defines a method to endorse a proposal, and for law + // proposals this also results in the lowering of the passing threshold to the + // passing threshold of regular proposals. It is only available to the + // Steering DAO. EndorseProposal(context.Context, *MsgEndorseProposal) (*MsgEndorseProposalResponse, error) - // ExtendVotingPeriod defines a method to extend the voting period of a proposal. - // It is available to both the Steering DAO and the Oversight DAO. + // ExtendVotingPeriod defines a method to extend the voting period of a + // proposal. It is available to both the Steering DAO and the Oversight DAO. ExtendVotingPeriod(context.Context, *MsgExtendVotingPeriod) (*MsgExtendVotingPeriodResponse, error) // VetoProposal defines a method to veto a proposal. // It is only available to the Oversight DAO. diff --git a/x/dynamicfee/types/tx.pb.go b/x/dynamicfee/types/tx.pb.go index bc9dd384d..f6b35b677 100644 --- a/x/dynamicfee/types/tx.pb.go +++ b/x/dynamicfee/types/tx.pb.go @@ -171,7 +171,8 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // UpdateParams defines a method for updating the dynamicfee module parameters. + // UpdateParams defines a method for updating the dynamicfee module + // parameters. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) } @@ -194,7 +195,8 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. type MsgServer interface { - // UpdateParams defines a method for updating the dynamicfee module parameters. + // UpdateParams defines a method for updating the dynamicfee module + // parameters. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) } diff --git a/x/gov/module.go b/x/gov/module.go index 0ab12e7ef..8da64d7a8 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -325,7 +325,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { // ProposalContents returns all the gov content functions used to // simulate governance proposals. -func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { //nolint:staticcheck +func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { return simulation.ProposalContents() } diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 21f1c99b4..885e8d1da 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -47,7 +47,7 @@ const ( ) // WeightedOperations returns all the operations from the module with their respective weights -func WeightedOperations(appParams simtypes.AppParams, cdc codec.JSONCodec, ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper, wMsgs []simtypes.WeightedProposalMsg, wContents []simtypes.WeightedProposalContent) simulation.WeightedOperations { //nolint:staticcheck +func WeightedOperations(appParams simtypes.AppParams, cdc codec.JSONCodec, ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper, wMsgs []simtypes.WeightedProposalMsg, wContents []simtypes.WeightedProposalContent) simulation.WeightedOperations { var ( weightMsgDeposit int weightMsgVote int @@ -145,7 +145,7 @@ func SimulateMsgSubmitProposal(ak types.AccountKeeper, bk types.BankKeeper, k *k // SimulateMsgSubmitLegacyProposal simulates creating a msg Submit Proposal // voting on the proposal, and subsequently slashing the proposal. It is implemented using // future operations. -func SimulateMsgSubmitLegacyProposal(ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper, contentSim simtypes.ContentSimulatorFn) simtypes.Operation { //nolint:staticcheck +func SimulateMsgSubmitLegacyProposal(ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper, contentSim simtypes.ContentSimulatorFn) simtypes.Operation { return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { // 1) submit proposal now diff --git a/x/gov/simulation/proposals.go b/x/gov/simulation/proposals.go index a6a0aa8d3..596bc5fd5 100644 --- a/x/gov/simulation/proposals.go +++ b/x/gov/simulation/proposals.go @@ -51,7 +51,7 @@ func SimulateTextProposal(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) sdk // ProposalContents defines the module weighted proposals' contents // -//nolint:staticcheck + func ProposalContents() []simtypes.WeightedProposalContent { return []simtypes.WeightedProposalContent{ simulation.NewWeightedProposalContent( @@ -64,7 +64,7 @@ func ProposalContents() []simtypes.WeightedProposalContent { // SimulateTextProposalContent returns a random text proposal content. // -//nolint:staticcheck + func SimulateLegacyTextProposalContent(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) simtypes.Content { return v1beta1.NewTextProposal( simtypes.RandStringOfLength(r, 140), diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index a79510b2f..54184626d 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -807,11 +807,13 @@ type TallyParams struct { Threshold string `protobuf:"bytes,2,opt,name=threshold,proto3" json:"threshold,omitempty"` // quorum for constitution amendment proposals ConstitutionAmendmentQuorum string `protobuf:"bytes,3,opt,name=constitution_amendment_quorum,json=constitutionAmendmentQuorum,proto3" json:"constitution_amendment_quorum,omitempty"` // Deprecated: Do not use. - // Minimum proportion of Yes votes for a Constitution Amendment proposal to pass. Default value: 0.9. + // Minimum proportion of Yes votes for a Constitution Amendment proposal to + // pass. Default value: 0.9. ConstitutionAmendmentThreshold string `protobuf:"bytes,4,opt,name=constitution_amendment_threshold,json=constitutionAmendmentThreshold,proto3" json:"constitution_amendment_threshold,omitempty"` // quorum for law proposals LawQuorum string `protobuf:"bytes,5,opt,name=law_quorum,json=lawQuorum,proto3" json:"law_quorum,omitempty"` // Deprecated: Do not use. - // Minimum proportion of Yes votes for a Law proposal to pass. Default value: 0.9. + // Minimum proportion of Yes votes for a Law proposal to pass. Default value: + // 0.9. LawThreshold string `protobuf:"bytes,6,opt,name=law_threshold,json=lawThreshold,proto3" json:"law_threshold,omitempty"` } @@ -894,23 +896,24 @@ func (m *TallyParams) GetLawThreshold() string { } type MinDepositThrottler struct { - // Floor value for the minimum deposit required for a proposal to enter the voting period. + // Floor value for the minimum deposit required for a proposal to enter the + // voting period. FloorValue []types.Coin `protobuf:"bytes,1,rep,name=floor_value,json=floorValue,proto3" json:"floor_value"` - // Duration that dictates after how long the dynamic minimum deposit should be recalculated - // for time-based decreases. + // Duration that dictates after how long the dynamic minimum deposit should be + // recalculated for time-based decreases. UpdatePeriod *time.Duration `protobuf:"bytes,2,opt,name=update_period,json=updatePeriod,proto3,stdduration" json:"update_period,omitempty"` // The number of active proposals the dynamic minimum deposit should target. TargetActiveProposals uint64 `protobuf:"varint,3,opt,name=target_active_proposals,json=targetActiveProposals,proto3" json:"target_active_proposals,omitempty"` - // The ratio of increase for the minimum deposit when the number of active proposals - // is at or above the target. + // The ratio of increase for the minimum deposit when the number of active + // proposals is at or above the target. IncreaseRatio string `protobuf:"bytes,4,opt,name=increase_ratio,json=increaseRatio,proto3" json:"increase_ratio,omitempty"` - // The ratio of decrease for the minimum deposit when the number of active proposals - // is 1 less than the target. + // The ratio of decrease for the minimum deposit when the number of active + // proposals is 1 less than the target. DecreaseRatio string `protobuf:"bytes,5,opt,name=decrease_ratio,json=decreaseRatio,proto3" json:"decrease_ratio,omitempty"` // A positive integer representing the sensitivity of dynamic minimum deposit // decreases to the distance from the target number of active proposals. - // The higher the number, the lower the sensitivity. A value of 1 represents the - // highest sensitivity. + // The higher the number, the lower the sensitivity. A value of 1 represents + // the highest sensitivity. DecreaseSensitivityTargetDistance uint64 `protobuf:"varint,6,opt,name=decrease_sensitivity_target_distance,json=decreaseSensitivityTargetDistance,proto3" json:"decrease_sensitivity_target_distance,omitempty"` } @@ -990,23 +993,25 @@ func (m *MinDepositThrottler) GetDecreaseSensitivityTargetDistance() uint64 { } type MinInitialDepositThrottler struct { - // Floor value for the minimum initial deposit required for a proposal to enter the deposit period. + // Floor value for the minimum initial deposit required for a proposal to + // enter the deposit period. FloorValue []types.Coin `protobuf:"bytes,1,rep,name=floor_value,json=floorValue,proto3" json:"floor_value"` - // Duration that dictates after how long the dynamic minimum deposit should be recalculated - // for time-based decreases. + // Duration that dictates after how long the dynamic minimum deposit should be + // recalculated for time-based decreases. UpdatePeriod *time.Duration `protobuf:"bytes,2,opt,name=update_period,json=updatePeriod,proto3,stdduration" json:"update_period,omitempty"` - // The number of proposals in deposit period the dynamic minimum initial deposit should target. + // The number of proposals in deposit period the dynamic minimum initial + // deposit should target. TargetProposals uint64 `protobuf:"varint,3,opt,name=target_proposals,json=targetProposals,proto3" json:"target_proposals,omitempty"` - // The ratio of increase for the minimum initial deposit when the number of proposals - // in deposit period is at or above the target. + // The ratio of increase for the minimum initial deposit when the number of + // proposals in deposit period is at or above the target. IncreaseRatio string `protobuf:"bytes,4,opt,name=increase_ratio,json=increaseRatio,proto3" json:"increase_ratio,omitempty"` - // The ratio of decrease for the minimum initial deposit when the number of proposals - // in deposit period is 1 less than the target. + // The ratio of decrease for the minimum initial deposit when the number of + // proposals in deposit period is 1 less than the target. DecreaseRatio string `protobuf:"bytes,5,opt,name=decrease_ratio,json=decreaseRatio,proto3" json:"decrease_ratio,omitempty"` // A positive integer representing the sensitivity of dynamic minimum initial // deposit decreases to the distance from the target number of proposals - // in deposit period. The higher the number, the lower the sensitivity. A value - // of 1 represents the highest sensitivity. + // in deposit period. The higher the number, the lower the sensitivity. A + // value of 1 represents the highest sensitivity. DecreaseSensitivityTargetDistance uint64 `protobuf:"varint,6,opt,name=decrease_sensitivity_target_distance,json=decreaseSensitivityTargetDistance,proto3" json:"decrease_sensitivity_target_distance,omitempty"` } @@ -1106,7 +1111,8 @@ type Params struct { Quorum string `protobuf:"bytes,4,opt,name=quorum,proto3" json:"quorum,omitempty"` // Deprecated: Do not use. // Minimum proportion of Yes votes for proposal to pass. Default value: 2/3. Threshold string `protobuf:"bytes,5,opt,name=threshold,proto3" json:"threshold,omitempty"` - // The ratio representing the proportion of the deposit value that must be paid at proposal submission. + // The ratio representing the proportion of the deposit value that must be + // paid at proposal submission. MinInitialDepositRatio string `protobuf:"bytes,7,opt,name=min_initial_deposit_ratio,json=minInitialDepositRatio,proto3" json:"min_initial_deposit_ratio,omitempty"` // Deprecated: Do not use. // burn deposits if a proposal does not meet quorum BurnVoteQuorum bool `protobuf:"varint,13,opt,name=burn_vote_quorum,json=burnVoteQuorum,proto3" json:"burn_vote_quorum,omitempty"` @@ -1122,20 +1128,23 @@ type Params struct { MinDepositRatio string `protobuf:"bytes,15,opt,name=min_deposit_ratio,json=minDepositRatio,proto3" json:"min_deposit_ratio,omitempty"` // quorum for constitution amendment proposals ConstitutionAmendmentQuorum string `protobuf:"bytes,16,opt,name=constitution_amendment_quorum,json=constitutionAmendmentQuorum,proto3" json:"constitution_amendment_quorum,omitempty"` // Deprecated: Do not use. - // Minimum proportion of Yes votes for a Constitution Amendment proposal to pass. Default value: 0.9. + // Minimum proportion of Yes votes for a Constitution Amendment proposal to + // pass. Default value: 0.9. ConstitutionAmendmentThreshold string `protobuf:"bytes,17,opt,name=constitution_amendment_threshold,json=constitutionAmendmentThreshold,proto3" json:"constitution_amendment_threshold,omitempty"` // quorum for law proposals LawQuorum string `protobuf:"bytes,18,opt,name=law_quorum,json=lawQuorum,proto3" json:"law_quorum,omitempty"` // Deprecated: Do not use. - // Minimum proportion of Yes votes for a Law proposal to pass. Default value: 0.9. + // Minimum proportion of Yes votes for a Law proposal to pass. Default value: + // 0.9. LawThreshold string `protobuf:"bytes,19,opt,name=law_threshold,json=lawThreshold,proto3" json:"law_threshold,omitempty"` - // Duration of time after a proposal enters the voting period, during which quorum - // must be achieved to not incur in a voting period extension. + // Duration of time after a proposal enters the voting period, during which + // quorum must be achieved to not incur in a voting period extension. QuorumTimeout *time.Duration `protobuf:"bytes,20,opt,name=quorum_timeout,json=quorumTimeout,proto3,stdduration" json:"quorum_timeout,omitempty"` - // Duration that expresses the maximum amount of time by which a proposal voting period - // can be extended. + // Duration that expresses the maximum amount of time by which a proposal + // voting period can be extended. MaxVotingPeriodExtension *time.Duration `protobuf:"bytes,21,opt,name=max_voting_period_extension,json=maxVotingPeriodExtension,proto3,stdduration" json:"max_voting_period_extension,omitempty"` - // Number of times a proposal should be checked for quorum after the quorum timeout - // has elapsed. Used to compute the amount of time in between quorum checks. + // Number of times a proposal should be checked for quorum after the quorum + // timeout has elapsed. Used to compute the amount of time in between quorum + // checks. QuorumCheckCount uint64 `protobuf:"varint,22,opt,name=quorum_check_count,json=quorumCheckCount,proto3" json:"quorum_check_count,omitempty"` MinDepositThrottler *MinDepositThrottler `protobuf:"bytes,23,opt,name=min_deposit_throttler,json=minDepositThrottler,proto3" json:"min_deposit_throttler,omitempty"` MinInitialDepositThrottler *MinInitialDepositThrottler `protobuf:"bytes,24,opt,name=min_initial_deposit_throttler,json=minInitialDepositThrottler,proto3" json:"min_initial_deposit_throttler,omitempty"` diff --git a/x/gov/types/v1/query.pb.go b/x/gov/types/v1/query.pb.go index 60310a0ba..c1d7f18f0 100644 --- a/x/gov/types/v1/query.pb.go +++ b/x/gov/types/v1/query.pb.go @@ -32,7 +32,8 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryConstitutionRequest is the request type for the Query/Constitution RPC method +// QueryConstitutionRequest is the request type for the Query/Constitution RPC +// method type QueryConstitutionRequest struct { } @@ -69,7 +70,8 @@ func (m *QueryConstitutionRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryConstitutionRequest proto.InternalMessageInfo -// QueryConstitutionResponse is the response type for the Query/Constitution RPC method +// QueryConstitutionResponse is the response type for the Query/Constitution RPC +// method type QueryConstitutionResponse struct { Constitution string `protobuf:"bytes,1,opt,name=constitution,proto3" json:"constitution,omitempty"` } @@ -977,7 +979,8 @@ func (m *QueryTallyResultResponse) GetTally() *TallyResult { return nil } -// QueryMinDepositRequest is the request type for the Query/MinDeposit RPC method. +// QueryMinDepositRequest is the request type for the Query/MinDeposit RPC +// method. type QueryMinDepositRequest struct { } @@ -1014,9 +1017,11 @@ func (m *QueryMinDepositRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryMinDepositRequest proto.InternalMessageInfo -// QueryMinDepositResponse is the response type for the Query/MinDeposit RPC method. +// QueryMinDepositResponse is the response type for the Query/MinDeposit RPC +// method. type QueryMinDepositResponse struct { - // min_deposit defines the minimum deposit required for a proposal to enter voting period. + // min_deposit defines the minimum deposit required for a proposal to enter + // voting period. MinDeposit []types.Coin `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3" json:"min_deposit"` } @@ -1060,7 +1065,8 @@ func (m *QueryMinDepositResponse) GetMinDeposit() []types.Coin { return nil } -// QueryMinInitialDepositRequest is the request type for the Query/MinInitialDeposit RPC method. +// QueryMinInitialDepositRequest is the request type for the +// Query/MinInitialDeposit RPC method. type QueryMinInitialDepositRequest struct { } @@ -1097,9 +1103,11 @@ func (m *QueryMinInitialDepositRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryMinInitialDepositRequest proto.InternalMessageInfo -// QueryMinInitialDepositResponse is the response type for the Query/MinInitialDeposit RPC method. +// QueryMinInitialDepositResponse is the response type for the +// Query/MinInitialDeposit RPC method. type QueryMinInitialDepositResponse struct { - // min_initial_deposit defines the minimum initial deposit required for a proposal to be submitted. + // min_initial_deposit defines the minimum initial deposit required for a + // proposal to be submitted. MinInitialDeposit []types.Coin `protobuf:"bytes,1,rep,name=min_initial_deposit,json=minInitialDeposit,proto3" json:"min_initial_deposit"` } @@ -1245,7 +1253,8 @@ func (m *QueryQuorumsResponse) GetLawQuorum() string { return "" } -// QueryParticipationEMAsRequest is the request type for the Query/ParticipationEMAs RPC method. +// QueryParticipationEMAsRequest is the request type for the +// Query/ParticipationEMAs RPC method. type QueryParticipationEMAsRequest struct { } @@ -1282,14 +1291,16 @@ func (m *QueryParticipationEMAsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParticipationEMAsRequest proto.InternalMessageInfo -// QueryParticipationEMAsResponse is the response type for the Query/ParticipationEMAs RPC method. +// QueryParticipationEMAsResponse is the response type for the +// Query/ParticipationEMAs RPC method. type QueryParticipationEMAsResponse struct { // participation_ema defines the requested participation EMA for proposals. ParticipationEma string `protobuf:"bytes,1,opt,name=participation_ema,json=participationEma,proto3" json:"participation_ema,omitempty"` - // constitution_amendment_participation_ema defines the requested participation EMA for - // constitution amendment proposals. + // constitution_amendment_participation_ema defines the requested + // participation EMA for constitution amendment proposals. ConstitutionAmendmentParticipationEma string `protobuf:"bytes,2,opt,name=constitution_amendment_participation_ema,json=constitutionAmendmentParticipationEma,proto3" json:"constitution_amendment_participation_ema,omitempty"` - // law_participation_ema defines the requestedparticipation EMA for law proposals. + // law_participation_ema defines the requestedparticipation EMA for law + // proposals. LawParticipationEma string `protobuf:"bytes,3,opt,name=law_participation_ema,json=lawParticipationEma,proto3" json:"law_participation_ema,omitempty"` } @@ -1508,7 +1519,8 @@ type QueryClient interface { MinInitialDeposit(ctx context.Context, in *QueryMinInitialDepositRequest, opts ...grpc.CallOption) (*QueryMinInitialDepositResponse, error) // Quorums queries the dynamically set quorums. Quorums(ctx context.Context, in *QueryQuorumsRequest, opts ...grpc.CallOption) (*QueryQuorumsResponse, error) - // ParticipationEMAs queries the state of the proposal participation exponential moving averages. + // ParticipationEMAs queries the state of the proposal participation + // exponential moving averages. ParticipationEMAs(ctx context.Context, in *QueryParticipationEMAsRequest, opts ...grpc.CallOption) (*QueryParticipationEMAsResponse, error) } @@ -1665,7 +1677,8 @@ type QueryServer interface { MinInitialDeposit(context.Context, *QueryMinInitialDepositRequest) (*QueryMinInitialDepositResponse, error) // Quorums queries the dynamically set quorums. Quorums(context.Context, *QueryQuorumsRequest) (*QueryQuorumsResponse, error) - // ParticipationEMAs queries the state of the proposal participation exponential moving averages. + // ParticipationEMAs queries the state of the proposal participation + // exponential moving averages. ParticipationEMAs(context.Context, *QueryParticipationEMAsRequest) (*QueryParticipationEMAsResponse, error) } diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 791d2634a..553ae3502 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -775,12 +775,14 @@ func (m *MsgProposeLawResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgProposeLawResponse proto.InternalMessageInfo -// MsgConstitutionAmendment is the Msg/ProposeConstitutionAmendment request type. +// MsgConstitutionAmendment is the Msg/ProposeConstitutionAmendment request +// type. type MsgProposeConstitutionAmendment struct { // authority is the address that controls the module (defaults to x/gov unless // overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // amendment is the amendment to the constitution. It must be in valid GNU patch format. + // amendment is the amendment to the constitution. It must be in valid GNU + // patch format. Amendment string `protobuf:"bytes,2,opt,name=amendment,proto3" json:"amendment,omitempty"` } @@ -831,8 +833,8 @@ func (m *MsgProposeConstitutionAmendment) GetAmendment() string { return "" } -// MsgProposeConstitutionAmendmentResponse defines the response structure for executing a -// MsgProposeConstitutionAmendment message. +// MsgProposeConstitutionAmendmentResponse defines the response structure for +// executing a MsgProposeConstitutionAmendment message. type MsgProposeConstitutionAmendmentResponse struct { } diff --git a/x/photon/types/query.pb.go b/x/photon/types/query.pb.go index 67f77195c..7efafd3ce 100644 --- a/x/photon/types/query.pb.go +++ b/x/photon/types/query.pb.go @@ -113,7 +113,8 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } -// QueryConversionRateRequest is request type for the Query/ConversionRate RPC method. +// QueryConversionRateRequest is request type for the Query/ConversionRate RPC +// method. type QueryConversionRateRequest struct { } @@ -150,7 +151,8 @@ func (m *QueryConversionRateRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryConversionRateRequest proto.InternalMessageInfo -// QueryConversionRateResponse is response type for the Query/ConversionRate RPC method. +// QueryConversionRateResponse is response type for the Query/ConversionRate RPC +// method. type QueryConversionRateResponse struct { // conversion_rate represents the factor used to convert atone to photon. ConversionRate string `protobuf:"bytes,1,opt,name=conversion_rate,json=conversionRate,proto3" json:"conversion_rate,omitempty"`