From 57b96ca8d82052b34f49ec57d1160cffe54cb667 Mon Sep 17 00:00:00 2001 From: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:01:29 +0200 Subject: [PATCH 01/22] test: Add light client attack to e2e tests (#1249) * Add light client attack to e2e tests * Add details about the attack types * Rename validatorAddress to validatorPrivateKeyAddress * Add URL to CometMock to flag * Improve wording for light client attack run * Add submitting equivocation proposals and change consu->consumerName --- tests/e2e/actions.go | 93 ++++++++++++++++-- tests/e2e/main.go | 14 ++- tests/e2e/steps.go | 19 +++- tests/e2e/steps_light_client_attack.go | 130 +++++++++++++++++++++++++ 4 files changed, 244 insertions(+), 12 deletions(-) create mode 100644 tests/e2e/steps_light_client_attack.go diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index fccc27a957..c05b21bfef 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -1606,10 +1606,10 @@ func (tr TestRun) setValidatorDowntime(chain chainID, validator validatorID, dow if tr.useCometmock { // send set_signing_status either to down or up for validator - validatorAddress := tr.GetValidatorAddress(chain, validator) + validatorPrivateKeyAddress := tr.GetValidatorPrivateKeyAddress(chain, validator) method := "set_signing_status" - params := fmt.Sprintf(`{"private_key_address":"%s","status":"%s"}`, validatorAddress, lastArg) + params := fmt.Sprintf(`{"private_key_address":"%s","status":"%s"}`, validatorPrivateKeyAddress, lastArg) address := tr.getQueryNodeRPCAddress(chain) tr.curlJsonRPCRequest(method, params, address) @@ -1639,10 +1639,10 @@ func (tr TestRun) setValidatorDowntime(chain chainID, validator validatorID, dow } } -func (tr TestRun) GetValidatorAddress(chain chainID, validator validatorID) string { - var validatorAddress string +func (tr TestRun) GetValidatorPrivateKeyAddress(chain chainID, validator validatorID) string { + var validatorPrivateKeyAddress string if chain == chainID("provi") { - validatorAddress = tr.getValidatorKeyAddressFromString(tr.validatorConfigs[validator].privValidatorKey) + validatorPrivateKeyAddress = tr.getValidatorKeyAddressFromString(tr.validatorConfigs[validator].privValidatorKey) } else { var valAddressString string if tr.validatorConfigs[validator].useConsumerKey { @@ -1650,9 +1650,9 @@ func (tr TestRun) GetValidatorAddress(chain chainID, validator validatorID) stri } else { valAddressString = tr.validatorConfigs[validator].privValidatorKey } - validatorAddress = tr.getValidatorKeyAddressFromString(valAddressString) + validatorPrivateKeyAddress = tr.getValidatorKeyAddressFromString(valAddressString) } - return validatorAddress + return validatorPrivateKeyAddress } type unjailValidatorAction struct { @@ -1813,10 +1813,10 @@ func (tr TestRun) invokeDoublesignSlash( } tr.waitBlocks("provi", 10, 2*time.Minute) } else { // tr.useCometMock - validatorAddress := tr.GetValidatorAddress(action.chain, action.validator) + validatorPrivateKeyAddress := tr.GetValidatorPrivateKeyAddress(action.chain, action.validator) method := "cause_double_sign" - params := fmt.Sprintf(`{"private_key_address":"%s"}`, validatorAddress) + params := fmt.Sprintf(`{"private_key_address":"%s"}`, validatorPrivateKeyAddress) address := tr.getQueryNodeRPCAddress(action.chain) @@ -1826,6 +1826,81 @@ func (tr TestRun) invokeDoublesignSlash( } } +// Cause light client attack evidence for a certain validator to appear on the given chain. +// The evidence will look like the validator equivocated to a light client. +// See https://github.com/cometbft/cometbft/tree/main/spec/light-client/accountability +// for more information about light client attacks. +type lightClientEquivocationAttackAction struct { + validator validatorID + chain chainID +} + +func (tr TestRun) lightClientEquivocationAttack( + action lightClientEquivocationAttackAction, + verbose bool, +) { + tr.lightClientAttack(action.validator, action.chain, LightClientEquivocationAttack) +} + +// Cause light client attack evidence for a certain validator to appear on the given chain. +// The evidence will look like the validator tried to perform an amnesia attack. +// See https://github.com/cometbft/cometbft/tree/main/spec/light-client/accountability +// for more information about light client attacks. +type lightClientAmnesiaAttackAction struct { + validator validatorID + chain chainID +} + +func (tr TestRun) lightClientAmnesiaAttack( + action lightClientAmnesiaAttackAction, + verbose bool, +) { + tr.lightClientAttack(action.validator, action.chain, LightClientAmnesiaAttack) +} + +// Cause light client attack evidence for a certain validator to appear on the given chain. +// The evidence will look like the validator tried to perform a lunatic attack. +// See https://github.com/cometbft/cometbft/tree/main/spec/light-client/accountability +// for more information about light client attacks. +type lightClientLunaticAttackAction struct { + validator validatorID + chain chainID +} + +func (tr TestRun) lightClientLunaticAttack( + action lightClientLunaticAttackAction, + verbose bool, +) { + tr.lightClientAttack(action.validator, action.chain, LightClientLunaticAttack) +} + +type LightClientAttackType string + +const ( + LightClientEquivocationAttack LightClientAttackType = "Equivocation" + LightClientAmnesiaAttack LightClientAttackType = "Amnesia" + LightClientLunaticAttack LightClientAttackType = "Lunatic" +) + +func (tr TestRun) lightClientAttack( + validator validatorID, + chain chainID, + attackType LightClientAttackType, +) { + if !tr.useCometmock { + log.Fatal("light client attack is only supported with CometMock") + } + validatorPrivateKeyAddress := tr.GetValidatorPrivateKeyAddress(chain, validator) + + method := "cause_light_client_attack" + params := fmt.Sprintf(`{"private_key_address":"%s", "misbehaviour_type": "%s"}`, validatorPrivateKeyAddress, attackType) + + address := tr.getQueryNodeRPCAddress(chain) + + tr.curlJsonRPCRequest(method, params, address) + tr.waitBlocks(chain, 1, 10*time.Second) +} + type assignConsumerPubKeyAction struct { chain chainID validator validatorID diff --git a/tests/e2e/main.go b/tests/e2e/main.go index e9336422ae..1998e95a2e 100644 --- a/tests/e2e/main.go +++ b/tests/e2e/main.go @@ -39,7 +39,7 @@ var ( parallel = flag.Bool("parallel", false, "run all tests in parallel") localSdkPath = flag.String("local-sdk-path", "", "path of a local sdk version to build and reference in integration tests") - useCometmock = flag.Bool("use-cometmock", false, "use cometmock instead of CometBFT") + useCometmock = flag.Bool("use-cometmock", false, "use cometmock instead of CometBFT. see https://github.com/informalsystems/CometMock") useGorelayer = flag.Bool("use-gorelayer", false, "use go relayer instead of Hermes") ) @@ -56,6 +56,12 @@ var ( description: `This is like the happy path, but skips steps that involve starting or stopping nodes for the same chain outside of the chain setup or teardown. This is suited for CometMock+Gorelayer testing`, + }, + "light-client-attack": { + testRun: DefaultTestRun(), steps: lightClientAttackSteps, + description: `This is like the short happy path, but will slash validators for LightClientAttackEvidence instead of DuplicateVoteEvidence. +This is suited for CometMock+Gorelayer testing, but currently does not work with CometBFT, +since causing light client attacks is not implemented.`, }, "happy-path": {testRun: DefaultTestRun(), steps: happyPathSteps, description: "happy path tests"}, "changeover": {testRun: ChangeoverTestRun(), steps: changeoverSteps, description: "changeover tests"}, @@ -238,6 +244,12 @@ func (tr *TestRun) runStep(step Step, verbose bool) { tr.unjailValidator(action, verbose) case doublesignSlashAction: tr.invokeDoublesignSlash(action, verbose) + case lightClientAmnesiaAttackAction: + tr.lightClientAmnesiaAttack(action, verbose) + case lightClientEquivocationAttackAction: + tr.lightClientEquivocationAttack(action, verbose) + case lightClientLunaticAttackAction: + tr.lightClientLunaticAttack(action, verbose) case registerRepresentativeAction: tr.registerRepresentative(action, verbose) case assignConsumerPubKeyAction: diff --git a/tests/e2e/steps.go b/tests/e2e/steps.go index b33d19783a..6fb284c07a 100644 --- a/tests/e2e/steps.go +++ b/tests/e2e/steps.go @@ -39,9 +39,24 @@ var shortHappyPathSteps = concatSteps( stepsDowntime("consu"), stepsRejectEquivocationProposal("consu", 2), // prop to tombstone bob is rejected stepsDoubleSignOnProviderAndConsumer("consu"), // carol double signs on provider, bob double signs on consumer + stepsSubmitEquivocationProposal("consu", 2), // now prop to tombstone bob is submitted and accepted stepsStartRelayer(), - stepsConsumerRemovalPropNotPassing("consu", 2), // submit removal prop but vote no on it - chain should stay - stepsStopChain("consu", 3), // stop chain + stepsConsumerRemovalPropNotPassing("consu", 3), // submit removal prop but vote no on it - chain should stay + stepsStopChain("consu", 4), // stop chain +) + +var lightClientAttackSteps = concatSteps( + stepsStartChains([]string{"consu"}, false), + stepsDelegate("consu"), + stepsUnbond("consu"), + stepsRedelegateShort("consu"), + stepsDowntime("consu"), + stepsRejectEquivocationProposal("consu", 2), // prop to tombstone bob is rejected + stepsLightClientAttackOnProviderAndConsumer("consu"), // carol double signs on provider, bob double signs on consumer + stepsSubmitEquivocationProposal("consu", 2), // now prop to tombstone bob is submitted and accepted + stepsStartRelayer(), + stepsConsumerRemovalPropNotPassing("consu", 3), // submit removal prop but vote no on it - chain should stay + stepsStopChain("consu", 4), // stop chain ) var slashThrottleSteps = concatSteps( diff --git a/tests/e2e/steps_light_client_attack.go b/tests/e2e/steps_light_client_attack.go new file mode 100644 index 0000000000..f00d5f5bd6 --- /dev/null +++ b/tests/e2e/steps_light_client_attack.go @@ -0,0 +1,130 @@ +package main + +// Steps that make carol double sign on the provider, and bob double sign on a single consumer +func stepsLightClientAttackOnProviderAndConsumer(consumerName string) []Step { + return []Step{ + { + // provider double sign + action: lightClientEquivocationAttackAction{ + chain: chainID("provi"), + validator: validatorID("carol"), + }, + state: State{ + // slash on provider + chainID("provi"): ChainState{ + ValPowers: &map[validatorID]uint{ + validatorID("alice"): 509, + validatorID("bob"): 500, + validatorID("carol"): 0, // from 500 to 0 + }, + }, + chainID(consumerName): ChainState{ + ValPowers: &map[validatorID]uint{ + validatorID("alice"): 509, + validatorID("bob"): 500, + validatorID("carol"): 495, // not tombstoned on consumerName yet + }, + }, + }, + }, + { + // relay power change to consumerName + action: relayPacketsAction{ + chainA: chainID("provi"), + chainB: chainID(consumerName), + port: "provider", + channel: 0, // consumerName channel + }, + state: State{ + chainID("provi"): ChainState{ + ValPowers: &map[validatorID]uint{ + validatorID("alice"): 509, + validatorID("bob"): 500, + validatorID("carol"): 0, + }, + }, + chainID(consumerName): ChainState{ + ValPowers: &map[validatorID]uint{ + validatorID("alice"): 509, + validatorID("bob"): 500, + validatorID("carol"): 0, // tombstoning visible on consumerName + }, + }, + }, + }, + { + // consumer double sign + // provider will only log the double sign slash + // stepsSubmitEquivocationProposal will cause the double sign slash to be executed + action: lightClientEquivocationAttackAction{ + chain: chainID(consumerName), + validator: validatorID("bob"), + }, + state: State{ + chainID("provi"): ChainState{ + ValPowers: &map[validatorID]uint{ + validatorID("alice"): 509, + validatorID("bob"): 500, + validatorID("carol"): 0, + }, + }, + chainID(consumerName): ChainState{ + ValPowers: &map[validatorID]uint{ + validatorID("alice"): 509, + validatorID("bob"): 500, + validatorID("carol"): 0, + }, + }, + }, + }, + { + action: relayPacketsAction{ + chainA: chainID("provi"), + chainB: chainID(consumerName), + port: "provider", + channel: 0, + }, + state: State{ + chainID("provi"): ChainState{ + ValPowers: &map[validatorID]uint{ + validatorID("alice"): 509, + validatorID("bob"): 500, // not tombstoned + validatorID("carol"): 0, + }, + }, + chainID(consumerName): ChainState{ + ValPowers: &map[validatorID]uint{ + validatorID("alice"): 509, + validatorID("bob"): 500, // not tombstoned + validatorID("carol"): 0, + }, + }, + }, + }, + { + // consumer learns about the double sign + action: relayPacketsAction{ + chainA: chainID("provi"), + chainB: chainID(consumerName), + port: "provider", + channel: 0, + }, + state: State{ + chainID("provi"): ChainState{ + ValPowers: &map[validatorID]uint{ + validatorID("alice"): 509, + validatorID("bob"): 500, + validatorID("carol"): 0, + }, + }, + chainID(consumerName): ChainState{ + ValPowers: &map[validatorID]uint{ + validatorID("alice"): 509, + validatorID("bob"): 500, // not tombstoned + validatorID("carol"): 0, + }, + }, + }, + }, + } +} From d0dda4bd06c0429d22b7324e3f561e379531fa36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 09:48:07 +0200 Subject: [PATCH 02/22] build(deps): bump google.golang.org/grpc from 1.57.0 to 1.58.0 (#1284) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.57.0 to 1.58.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.57.0...v1.58.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 14 +++++++------- go.sum | 28 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 6cc988a794..7b54164770 100644 --- a/go.mod +++ b/go.mod @@ -26,17 +26,17 @@ require ( golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb golang.org/x/net v0.12.0 // indirect golang.org/x/sys v0.11.0 // indirect - google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect - google.golang.org/grpc v1.57.0 + google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect + google.golang.org/grpc v1.58.0 google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 v2.4.0 ) require ( cloud.google.com/go v0.110.4 // indirect - cloud.google.com/go/compute v1.20.1 // indirect + cloud.google.com/go/compute v1.21.0 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.0 // indirect + cloud.google.com/go/iam v1.1.1 // indirect cloud.google.com/go/storage v1.30.1 // indirect cosmossdk.io/api v0.3.1 cosmossdk.io/core v0.5.1 // indirect @@ -152,7 +152,7 @@ require ( github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect + golang.org/x/oauth2 v0.10.0 // indirect golang.org/x/term v0.10.0 // indirect golang.org/x/text v0.12.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect @@ -167,7 +167,7 @@ require ( require ( github.com/spf13/viper v1.16.0 - google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 + google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 ) require ( @@ -182,7 +182,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/rs/zerolog v1.30.0 // indirect - golang.org/x/sync v0.2.0 // indirect + golang.org/x/sync v0.3.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect ) diff --git a/go.sum b/go.sum index 03e76f9812..045c45ef25 100644 --- a/go.sum +++ b/go.sum @@ -73,8 +73,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg= -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute v1.21.0 h1:JNBsyXVoOoNJtTQcnEY5uYpZIbeCTYIeDe0Xh1bySMk= +cloud.google.com/go/compute v1.21.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= @@ -114,8 +114,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v1.1.0 h1:67gSqaPukx7O8WLLHMa0PNs3EBGd2eE4d+psbO/CO94= -cloud.google.com/go/iam v1.1.0/go.mod h1:nxdHjaKfCr7fNYx/HJMM8LgiMugmveWlkatear5gVyk= +cloud.google.com/go/iam v1.1.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y= +cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= @@ -1357,8 +1357,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= 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= @@ -1373,8 +1373,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= 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= @@ -1761,10 +1761,10 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 h1:Au6te5hbKUV8pIYWHqOUZ1pva5qK/rwbIhoXEUB9Lu8= -google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:O9kGHb51iE/nOGvQaDUuadVYqovW56s5emA88lQnj6Y= -google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 h1:s5YSX+ZH5b5vS9rnpGymvIyMpLRJizowqDlOuyjXnTk= -google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 h1:Z0hjGZePRE0ZBWotvtrwxFNrNE9CUAGtplaDK5NNI/g= +google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98/go.mod h1:S7mY02OqCJTD0E1OiQy1F72PWFB4bZJ87cAtLPYgDR0= +google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw= +google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -1808,8 +1808,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.58.0 h1:32JY8YpPMSR45K+c3o6b8VL73V+rR8k+DeMIr4vRH8o= +google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= 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= From 67bb558fcb841b17a4f54fd2dbd191210ecd444f Mon Sep 17 00:00:00 2001 From: Marius Poke Date: Tue, 12 Sep 2023 13:00:28 +0200 Subject: [PATCH 03/22] ci: update mergify and dependabot for v2.x-lsm (#1281) update mergify and dependabot for v2.x-lsm --- .github/dependabot.yml | 20 ++++++++++++++++++++ .mergify.yml | 16 ++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 647408015a..404825428c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -28,6 +28,26 @@ updates: labels: - dependencies + - package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + target-branch: "release/v2.0.x-lsm" + # Only allow automated security-related dependency updates on release branches. + open-pull-requests-limit: 0 + labels: + - dependencies + + - package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + target-branch: "release/v2.1.x-lsm" + # Only allow automated security-related dependency updates on release branches. + open-pull-requests-limit: 0 + labels: + - dependencies + - package-ecosystem: gomod directory: "/" schedule: diff --git a/.mergify.yml b/.mergify.yml index e08625bf28..226075ed45 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -18,6 +18,22 @@ pull_request_rules: backport: branches: - release/v2.0.x + - name: Backport patches to the release/v2.0.x-lsm branch + conditions: + - base=main + - label=A:backport/v2.0.x-lsm + actions: + backport: + branches: + - release/v2.0.x-lsm + - name: Backport patches to the release/v2.1.x-lsm branch + conditions: + - base=main + - label=A:backport/v2.1.x-lsm + actions: + backport: + branches: + - release/v2.1.x-lsm - name: Backport patches to the release/v3.0.x branch conditions: - base=main From d842bca21ad73d16a4e94e0214227ff1077d42d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 17:12:21 +0200 Subject: [PATCH 04/22] build(deps): bump github.com/oxyno-zeta/gomock-extra-matcher from 1.1.0 to 1.2.0 (#1286) build(deps): bump github.com/oxyno-zeta/gomock-extra-matcher Bumps [github.com/oxyno-zeta/gomock-extra-matcher](https://github.com/oxyno-zeta/gomock-extra-matcher) from 1.1.0 to 1.2.0. - [Release notes](https://github.com/oxyno-zeta/gomock-extra-matcher/releases) - [Changelog](https://github.com/oxyno-zeta/gomock-extra-matcher/blob/master/release.config.js) - [Commits](https://github.com/oxyno-zeta/gomock-extra-matcher/compare/v1.1.0...v1.2.0) --- updated-dependencies: - dependency-name: github.com/oxyno-zeta/gomock-extra-matcher dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 3 ++- go.sum | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7b54164770..3fc1b177b7 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/gorilla/mux v1.8.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/kylelemons/godebug v1.1.0 - github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 + github.com/oxyno-zeta/gomock-extra-matcher v1.2.0 github.com/rakyll/statik v0.1.7 // indirect github.com/spf13/cast v1.5.1 github.com/spf13/cobra v1.7.0 @@ -182,6 +182,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/rs/zerolog v1.30.0 // indirect + go.uber.org/mock v0.2.0 // indirect golang.org/x/sync v0.3.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect ) diff --git a/go.sum b/go.sum index 045c45ef25..033aa8adf2 100644 --- a/go.sum +++ b/go.sum @@ -960,8 +960,8 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= -github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 h1:Yyk5ov0ZPKBXtVEeIWtc4J2XVrHuNoIK+0F2BUJgtsc= -github.com/oxyno-zeta/gomock-extra-matcher v1.1.0/go.mod h1:UMGTHYEmJ1dRq8LDZ7VTAYO4nqM3GD1UGC3RJEUxEz0= +github.com/oxyno-zeta/gomock-extra-matcher v1.2.0 h1:WPEclU0y0PMwUzdDcaKZvld4aXpa3fkzjiUMQdcBEHg= +github.com/oxyno-zeta/gomock-extra-matcher v1.2.0/go.mod h1:S0r7HmKeCGsHmvIVFMjKWwswb4+30nCNWbXRMBVPkaU= 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= @@ -1164,6 +1164,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= @@ -1188,6 +1189,8 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe 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/mock v0.2.0 h1:TaP3xedm7JaAgScZO7tlvlKrqT0p7I6OsdGB5YNSMDU= +go.uber.org/mock v0.2.0/go.mod h1:J0y0rp9L3xiff1+ZBfKxlC1fz2+aO16tw0tsDOixfuM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= @@ -1262,6 +1265,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 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.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1574,6 +1578,7 @@ 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.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 48a21869e9a56cafff53b5c51077a96d1e3c4926 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Tue, 12 Sep 2023 09:42:40 -0700 Subject: [PATCH 05/22] feat!: provider proposal for changing reward denoms (#1280) * new provider prop type * add methods and tests for new prop, update docs * remove old tx, fix tests * e2e handling * fix command type * boilerplate * fix e2e tests * Update CHANGELOG.md * lint * validate denoms * Update proposal.go * rm msg string * fix tests * rm chain in change denom action * lint * test for invalid denom * events for both add and remove * Update proposal_test.go --- CHANGELOG.md | 1 + app/provider/app.go | 1 + docs/docs/features/proposals.md | 17 + .../ccv/provider/v1/provider.proto | 13 + .../ccv/provider/v1/tx.proto | 17 - tests/e2e/actions.go | 58 +- tests/e2e/main.go | 4 +- tests/e2e/steps_democracy.go | 26 +- tests/e2e/steps_reward_denom.go | 26 +- tests/integration/distribution.go | 33 +- x/ccv/provider/client/cli/tx.go | 37 -- x/ccv/provider/client/proposal_handler.go | 97 ++- x/ccv/provider/handler.go | 3 - x/ccv/provider/keeper/distribution.go | 25 +- x/ccv/provider/keeper/distribution_test.go | 50 -- x/ccv/provider/keeper/msg_server.go | 21 - x/ccv/provider/keeper/proposal.go | 28 + x/ccv/provider/proposal_handler.go | 2 + x/ccv/provider/proposal_handler_test.go | 24 +- x/ccv/provider/types/codec.go | 6 +- x/ccv/provider/types/msg.go | 48 +- x/ccv/provider/types/proposal.go | 64 +- x/ccv/provider/types/proposal_test.go | 49 ++ x/ccv/provider/types/provider.pb.go | 588 ++++++++++++++---- x/ccv/provider/types/tx.pb.go | 424 +------------ x/ccv/types/events.go | 18 +- 26 files changed, 872 insertions(+), 808 deletions(-) delete mode 100644 x/ccv/provider/keeper/distribution_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index ce07a8e132..032927214a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Add an entry to the unreleased provider section whenever merging a PR to main that is not targeted at a specific release. These entries will eventually be included in a provider release. +* (feature!) [#1280](https://github.com/cosmos/interchain-security/pull/1280) provider proposal for changing reward denoms * (feature!) [#1244](https://github.com/cosmos/interchain-security/pull/1244) Update the default consumer unbonding period to 2 weeks. * (deps) [#1259](https://github.com/cosmos/interchain-security/pull/1259) Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.47.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.5). * (deps!) [#1258](https://github.com/cosmos/interchain-security/pull/1258) Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v7.3.0](https://github.com/cosmos/ibc-go/releases/tag/v7.3.0). diff --git a/app/provider/app.go b/app/provider/app.go index ef3f6508f7..4550ec77d2 100644 --- a/app/provider/app.go +++ b/app/provider/app.go @@ -141,6 +141,7 @@ var ( ibcproviderclient.ConsumerAdditionProposalHandler, ibcproviderclient.ConsumerRemovalProposalHandler, ibcproviderclient.EquivocationProposalHandler, + ibcproviderclient.ChangeRewardDenomsProposalHandler, }, ), params.AppModuleBasic{}, diff --git a/docs/docs/features/proposals.md b/docs/docs/features/proposals.md index 25664bfc1e..de4f2dc421 100644 --- a/docs/docs/features/proposals.md +++ b/docs/docs/features/proposals.md @@ -105,6 +105,23 @@ Minimal example: } ``` +## ChangeRewardDenomProposal +:::tip +`ChangeRewardDenomProposal` will only be accepted on the provider chain if at least one of the denomsToAdd or denomsToRemove fields is populated with at least one denom. Also, a denom cannot be repeated in both sets. +::: + +Proposal type used to mutate the set of denoms accepted by the provider as rewards. + +Minimal example: +```js +{ + "title": "Add untrn as a reward denom", + "description": "Here is more information about the proposal", + "denomsToAdd": ["untrn"], + "denomsToRemove": [] +} +``` + ### Notes When submitting equivocation evidence through an `EquivocationProposal` please take note that you need to use the consensus address (`valcons`) of the offending validator on the **provider chain**. Besides that, the `height` and the `time` fields should be mapped to the **provider chain** to avoid your evidence being rejected. diff --git a/proto/interchain_security/ccv/provider/v1/provider.proto b/proto/interchain_security/ccv/provider/v1/provider.proto index 9423e1f924..b0de16097b 100644 --- a/proto/interchain_security/ccv/provider/v1/provider.proto +++ b/proto/interchain_security/ccv/provider/v1/provider.proto @@ -116,6 +116,19 @@ message EquivocationProposal { repeated cosmos.evidence.v1beta1.Equivocation equivocations = 3; } +// ChangeRewardDenomsProposal is a governance proposal on the provider chain to +// mutate the set of denoms accepted by the provider as rewards. +message ChangeRewardDenomsProposal { + // the title of the proposal + string title = 1; + // the description of the proposal + string description = 2; + // the list of consumer reward denoms to add + repeated string denoms_to_add = 3; + // the list of consumer reward denoms to remove + repeated string denoms_to_remove = 4; +} + // A persisted queue entry indicating that a slash packet data instance needs to // be handled. This type belongs in the "global" queue, to coordinate slash // packet handling times between consumers. diff --git a/proto/interchain_security/ccv/provider/v1/tx.proto b/proto/interchain_security/ccv/provider/v1/tx.proto index 952ba31c09..7d4cce685e 100644 --- a/proto/interchain_security/ccv/provider/v1/tx.proto +++ b/proto/interchain_security/ccv/provider/v1/tx.proto @@ -12,8 +12,6 @@ import "google/protobuf/any.proto"; service Msg { rpc AssignConsumerKey(MsgAssignConsumerKey) returns (MsgAssignConsumerKeyResponse); - rpc RegisterConsumerRewardDenom(MsgRegisterConsumerRewardDenom) - returns (MsgRegisterConsumerRewardDenomResponse); } message MsgAssignConsumerKey { @@ -30,18 +28,3 @@ message MsgAssignConsumerKey { } message MsgAssignConsumerKeyResponse {} - -// MsgRegisterConsumerRewardDenom allows an account to register -// a consumer reward denom, i.e., add it to the list of denoms -// accepted by the provider as rewards. -message MsgRegisterConsumerRewardDenom { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string denom = 1; - string depositor = 2; -} - -// MsgRegisterConsumerRewardDenomResponse defines the -// Msg/RegisterConsumerRewardDenom response type. -message MsgRegisterConsumerRewardDenomResponse {} diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index c05b21bfef..2256156958 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -1751,35 +1751,63 @@ func (tr TestRun) registerRepresentative( wg.Wait() } -type registerConsumerRewardDenomAction struct { - chain chainID - from validatorID - denom string +type submitChangeRewardDenomsProposalAction struct { + denom string + deposit uint + from validatorID } -func (tr TestRun) registerConsumerRewardDenom(action registerConsumerRewardDenomAction, verbose bool) { +func (tr TestRun) submitChangeRewardDenomsProposal(action submitChangeRewardDenomsProposalAction, verbose bool) { + providerChain := tr.chainConfigs[chainID("provi")] + + prop := client.ChangeRewardDenomsProposalJSON{ + Summary: "Change reward denoms", + ChangeRewardDenomsProposal: types.ChangeRewardDenomsProposal{ + Title: "Change reward denoms", + Description: "Change reward denoms", + DenomsToAdd: []string{action.denom}, + DenomsToRemove: []string{"stake"}, + }, + Deposit: fmt.Sprint(action.deposit) + `stake`, + } + + bz, err := json.Marshal(prop) + if err != nil { + log.Fatal(err) + } + + jsonStr := string(bz) + if strings.Contains(jsonStr, "'") { + log.Fatal("prop json contains single quote") + } + //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, - "tx", "provider", "register-consumer-reward-denom", action.denom, + bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, + "/bin/bash", "-c", fmt.Sprintf(`echo '%s' > %s`, jsonStr, "/change-reward-denoms-proposal.json")).CombinedOutput() + if err != nil { + log.Fatal(err, "\n", string(bz)) + } + + //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. + // CHANGE REWARDS DENOM PROPOSAL + bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, providerChain.binaryName, + "tx", "gov", "submit-legacy-proposal", "change-reward-denoms", "/change-reward-denoms-proposal.json", `--from`, `validator`+fmt.Sprint(action.from), - `--chain-id`, string(action.chain), - `--home`, tr.getValidatorHome(action.chain, action.from), - `--node`, tr.getValidatorNode(action.chain, action.from), + `--chain-id`, string(providerChain.chainId), + `--home`, tr.getValidatorHome(providerChain.chainId, action.from), + `--node`, tr.getValidatorNode(providerChain.chainId, action.from), `--gas`, "9000000", `--keyring-backend`, `test`, `-y`, ).CombinedOutput() - if verbose { - fmt.Println("redelegate cmd:", string(bz)) - } - if err != nil { log.Fatal(err, "\n", string(bz)) } - tr.waitBlocks(action.chain, 2, 10*time.Second) + // wait for inclusion in a block -> '--broadcast-mode block' is deprecated + tr.waitBlocks(chainID("provi"), 2, 30*time.Second) } // Creates an additional node on selected chain diff --git a/tests/e2e/main.go b/tests/e2e/main.go index 1998e95a2e..baf2db05da 100644 --- a/tests/e2e/main.go +++ b/tests/e2e/main.go @@ -258,8 +258,8 @@ func (tr *TestRun) runStep(step Step, verbose bool) { tr.waitForSlashThrottleDequeue(action, verbose) case startRelayerAction: tr.startRelayer(action, verbose) - case registerConsumerRewardDenomAction: - tr.registerConsumerRewardDenom(action, verbose) + case submitChangeRewardDenomsProposalAction: + tr.submitChangeRewardDenomsProposal(action, verbose) default: log.Fatalf("unknown action in testRun %s: %#v", tr.name, action) } diff --git a/tests/e2e/steps_democracy.go b/tests/e2e/steps_democracy.go index 7264c44341..85e9e8cbd7 100644 --- a/tests/e2e/steps_democracy.go +++ b/tests/e2e/steps_democracy.go @@ -133,19 +133,29 @@ func stepsDemocracy(consumerName string) []Step { }, }, { - action: registerConsumerRewardDenomAction{ - chain: chainID("provi"), - from: validatorID("bob"), - denom: consumerRewardDenom, + action: submitChangeRewardDenomsProposalAction{ + denom: consumerRewardDenom, + deposit: 10000001, + from: validatorID("bob"), + }, + state: State{ + chainID("provi"): ChainState{ + // Denom not yet registered, gov prop needs to pass first + RegisteredConsumerRewardDenoms: &[]string{}, + }, + }, + }, + { + action: voteGovProposalAction{ + chain: chainID("provi"), + from: []validatorID{validatorID("alice"), validatorID("bob"), validatorID("carol")}, + vote: []string{"yes", "yes", "yes"}, + propNumber: 2, }, state: State{ chainID("provi"): ChainState{ // Check that the denom is registered on provider chain RegisteredConsumerRewardDenoms: &[]string{consumerRewardDenom}, - ValBalances: &map[validatorID]uint{ - // make sure that bob's account was debited - validatorID("bob"): 9490000000, - }, }, }, }, diff --git a/tests/e2e/steps_reward_denom.go b/tests/e2e/steps_reward_denom.go index 9aad8ec7a8..cc9934f3f8 100644 --- a/tests/e2e/steps_reward_denom.go +++ b/tests/e2e/steps_reward_denom.go @@ -131,19 +131,29 @@ func stepsRewardDenomConsumer(consumerName string) []Step { }, }, { - action: registerConsumerRewardDenomAction{ - chain: chainID("provi"), - from: validatorID("bob"), - denom: "ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9", + action: submitChangeRewardDenomsProposalAction{ + denom: "ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9", + deposit: 10000001, + from: validatorID("bob"), + }, + state: State{ + chainID("provi"): ChainState{ + // Denom not yet registered, gov prop needs to pass first + RegisteredConsumerRewardDenoms: &[]string{}, + }, + }, + }, + { + action: voteGovProposalAction{ + chain: chainID("provi"), + from: []validatorID{validatorID("alice"), validatorID("bob"), validatorID("carol")}, + vote: []string{"yes", "yes", "yes"}, + propNumber: 2, }, state: State{ chainID("provi"): ChainState{ // Check that the denom is registered on provider chain RegisteredConsumerRewardDenoms: &[]string{"ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9"}, - ValBalances: &map[validatorID]uint{ - // make sure that bob's account was debited - validatorID("bob"): 9490000000, - }, }, }, }, diff --git a/tests/integration/distribution.go b/tests/integration/distribution.go index 65b82eecd6..668cf8cc7e 100644 --- a/tests/integration/distribution.go +++ b/tests/integration/distribution.go @@ -7,7 +7,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" icstestingutils "github.com/cosmos/interchain-security/v3/testutil/integration" consumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" @@ -96,41 +95,13 @@ func (s *CCVTestSuite) TestRewardsDistribution() { // Check that the coins got into the ConsumerRewardsPool s.Require().True(rewardCoins[ibcCoinIndex].Amount.Equal(providerExpectedRewards[0].Amount)) - // Attempt to register the consumer reward denom, but fail because the account has no coins - - // Get the balance of delAddr to send it out - senderCoins := providerBankKeeper.GetAllBalances(s.providerCtx(), delAddr) - - // Send the coins to the governance module just to have a place to send them - err = providerBankKeeper.SendCoinsFromAccountToModule(s.providerCtx(), delAddr, govtypes.ModuleName, senderCoins) - s.Require().NoError(err) - - // Attempt to register the consumer reward denom, but fail because the account has no coins - err = s.providerApp.GetProviderKeeper().RegisterConsumerRewardDenom(s.providerCtx(), rewardCoins[ibcCoinIndex].Denom, delAddr) - s.Require().Error(err) - // Advance a block and check that the coins are still in the ConsumerRewardsPool s.providerChain.NextBlock() rewardCoins = providerBankKeeper.GetAllBalances(s.providerCtx(), rewardPool) s.Require().True(rewardCoins[ibcCoinIndex].Amount.Equal(providerExpectedRewards[0].Amount)) - // Successfully register the consumer reward denom this time - - // Send the coins back to the delAddr - err = providerBankKeeper.SendCoinsFromModuleToAccount(s.providerCtx(), govtypes.ModuleName, delAddr, senderCoins) - s.Require().NoError(err) - - // log the sender's coins - senderCoins1 := providerBankKeeper.GetAllBalances(s.providerCtx(), delAddr) - - // Register the consumer reward denom - err = s.providerApp.GetProviderKeeper().RegisterConsumerRewardDenom(s.providerCtx(), rewardCoins[ibcCoinIndex].Denom, delAddr) - s.Require().NoError(err) - - // Check that the delAddr has the right amount less money in it after paying the fee - senderCoins2 := providerBankKeeper.GetAllBalances(s.providerCtx(), delAddr) - consumerRewardDenomRegistrationFee := s.providerApp.GetProviderKeeper().GetConsumerRewardDenomRegistrationFee(s.providerCtx()) - s.Require().Equal(senderCoins1.Sub(senderCoins2...), sdk.NewCoins(consumerRewardDenomRegistrationFee)) + // Set the consumer reward denom. This would be done by a governance proposal in prod + s.providerApp.GetProviderKeeper().SetConsumerRewardDenom(s.providerCtx(), rewardCoins[ibcCoinIndex].Denom) s.providerChain.NextBlock() diff --git a/x/ccv/provider/client/cli/tx.go b/x/ccv/provider/client/cli/tx.go index 7e0609d74c..0d37ef52a9 100644 --- a/x/ccv/provider/client/cli/tx.go +++ b/x/ccv/provider/client/cli/tx.go @@ -2,7 +2,6 @@ package cli import ( "fmt" - "strings" "github.com/spf13/cobra" @@ -10,7 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ) @@ -26,7 +24,6 @@ func GetTxCmd() *cobra.Command { } cmd.AddCommand(NewAssignConsumerKeyCmd()) - cmd.AddCommand(NewRegisterConsumerRewardDenomCmd()) return cmd } @@ -68,37 +65,3 @@ func NewAssignConsumerKeyCmd() *cobra.Command { return cmd } - -func NewRegisterConsumerRewardDenomCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "register-consumer-reward-denom [denom]", - Args: cobra.ExactArgs(1), - Short: "Registers a denom that can be sent from consumer chains to all validators and delegators as a reward", - Long: strings.TrimSpace( - fmt.Sprintf(`Registers a denom that can be sent from consumer chains to all validators and delegators as a reward. - -Costs a fee, which is specified in genesis.json under the "consumer_reward_denom_fee" key. Will fail if the sending account has an insufficient balance. - -Example: -$ %s tx provider register-consumer-reward-denom untrn --from mykey -`, - version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - depositorAddr := clientCtx.GetFromAddress() - - msg := types.NewMsgRegisterConsumerRewardDenom(args[0], depositorAddr) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/ccv/provider/client/proposal_handler.go b/x/ccv/provider/client/proposal_handler.go index 8ec6e89bfd..2b28c63466 100644 --- a/x/ccv/provider/client/proposal_handler.go +++ b/x/ccv/provider/client/proposal_handler.go @@ -24,9 +24,10 @@ import ( ) var ( - ConsumerAdditionProposalHandler = govclient.NewProposalHandler(SubmitConsumerAdditionPropTxCmd) - ConsumerRemovalProposalHandler = govclient.NewProposalHandler(SubmitConsumerRemovalProposalTxCmd) - EquivocationProposalHandler = govclient.NewProposalHandler(SubmitEquivocationProposalTxCmd) + ConsumerAdditionProposalHandler = govclient.NewProposalHandler(SubmitConsumerAdditionPropTxCmd) + ConsumerRemovalProposalHandler = govclient.NewProposalHandler(SubmitConsumerRemovalProposalTxCmd) + EquivocationProposalHandler = govclient.NewProposalHandler(SubmitEquivocationProposalTxCmd) + ChangeRewardDenomsProposalHandler = govclient.NewProposalHandler(SubmitChangeRewardDenomsProposalTxCmd) ) // SubmitConsumerAdditionPropTxCmd returns a CLI command handler for submitting @@ -229,6 +230,63 @@ Where proposal.json contains: } } +// SubmitChangeRewardDenomsProposalTxCmd returns a CLI command handler for submitting +// a change reward denoms proposal via a transaction. +func SubmitChangeRewardDenomsProposalTxCmd() *cobra.Command { + return &cobra.Command{ + Use: "change-reward-denoms [proposal-file]", + Args: cobra.ExactArgs(1), + Short: "Submit a change reward denoms proposal", + Long: `Submit an change reward denoms proposal with an initial deposit. + The proposal details must be supplied via a JSON file. + + Example: + $ tx gov submit-legacy-proposal change-reward-denoms --from= + + Where proposal.json contains: + { + "title": "Change reward denoms", + "summary": "Change reward denoms", + "denoms_to_add": ["untrn"], + "denoms_to_remove": ["stake"], + "deposit": "10000stake" + } + `, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + proposal, err := ParseChangeRewardDenomsProposalJSON(args[0]) + if err != nil { + return err + } + + content := types.NewChangeRewardDenomsProposal(proposal.Title, proposal.Summary, proposal.DenomsToAdd, proposal.DenomsToRemove) + + from := clientCtx.GetFromAddress() + + msgContent, err := govv1.NewLegacyContent(content, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + if err != nil { + return err + } + + deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit) + if err != nil { + return err + } + + msg, err := govv1.NewMsgSubmitProposal([]sdk.Msg{msgContent}, deposit, from.String(), "", content.GetTitle(), proposal.Summary) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } +} + type ConsumerAdditionProposalJSON struct { Title string `json:"title"` Summary string `json:"summary"` @@ -305,6 +363,21 @@ type ConsumerRemovalProposalReq struct { Deposit sdk.Coins `json:"deposit"` } +func ParseConsumerRemovalProposalJSON(proposalFile string) (ConsumerRemovalProposalJSON, error) { + proposal := ConsumerRemovalProposalJSON{} + + contents, err := os.ReadFile(filepath.Clean(proposalFile)) + if err != nil { + return proposal, err + } + + if err := json.Unmarshal(contents, &proposal); err != nil { + return proposal, err + } + + return proposal, nil +} + type EquivocationProposalJSON struct { // evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" Summary string `json:"summary"` @@ -337,18 +410,28 @@ func ParseEquivocationProposalJSON(proposalFile string) (EquivocationProposalJSO return proposal, nil } -func ParseConsumerRemovalProposalJSON(proposalFile string) (ConsumerRemovalProposalJSON, error) { - proposal := ConsumerRemovalProposalJSON{} +type ChangeRewardDenomsProposalJSON struct { + Summary string `json:"summary"` + types.ChangeRewardDenomsProposal + Deposit string `json:"deposit"` +} + +type ChangeRewardDenomsProposalReq struct { + Proposer sdk.AccAddress `json:"proposer"` + types.ChangeRewardDenomsProposal + Deposit sdk.Coins `json:"deposit"` +} + +func ParseChangeRewardDenomsProposalJSON(proposalFile string) (ChangeRewardDenomsProposalJSON, error) { + proposal := ChangeRewardDenomsProposalJSON{} contents, err := os.ReadFile(filepath.Clean(proposalFile)) if err != nil { return proposal, err } - if err := json.Unmarshal(contents, &proposal); err != nil { return proposal, err } - return proposal, nil } diff --git a/x/ccv/provider/handler.go b/x/ccv/provider/handler.go index 71da622fce..067d896cda 100644 --- a/x/ccv/provider/handler.go +++ b/x/ccv/provider/handler.go @@ -20,9 +20,6 @@ func NewHandler(k *keeper.Keeper) sdk.Handler { case *types.MsgAssignConsumerKey: res, err := msgServer.AssignConsumerKey(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgRegisterConsumerRewardDenom: - res, err := msgServer.RegisterConsumerRewardDenom(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) default: return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } diff --git a/x/ccv/provider/keeper/distribution.go b/x/ccv/provider/keeper/distribution.go index a1dff6faf4..1b3336aefa 100644 --- a/x/ccv/provider/keeper/distribution.go +++ b/x/ccv/provider/keeper/distribution.go @@ -3,7 +3,6 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ) @@ -15,22 +14,6 @@ func (k Keeper) EndBlockRD(ctx sdk.Context) { k.TransferRewardsToFeeCollector(ctx) } -func (k Keeper) RegisterConsumerRewardDenom(ctx sdk.Context, denom string, sender sdk.AccAddress) error { - // Check if the denom is already registered - if k.ConsumerRewardDenomExists(ctx, denom) { - return consumertypes.ErrConsumerRewardDenomAlreadyRegistered - } - - // Send the consumer reward denom registration fee to the community pool - err := k.distributionKeeper.FundCommunityPool(ctx, sdk.NewCoins(k.GetConsumerRewardDenomRegistrationFee(ctx)), sender) - if err != nil { - return err - } - k.SetConsumerRewardDenom(ctx, denom) - k.Logger(ctx).Info("new consumer reward denom registered:", "denom", denom, "sender", sender.String()) - return nil -} - func (k Keeper) GetConsumerRewardsPoolAddressStr(ctx sdk.Context) string { return k.accountKeeper.GetModuleAccount( ctx, types.ConsumerRewardsPool).GetAddress().String() @@ -53,6 +36,14 @@ func (k Keeper) ConsumerRewardDenomExists( return bz != nil } +func (k Keeper) DeleteConsumerRewardDenom( + ctx sdk.Context, + denom string, +) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.ConsumerRewardDenomsKey(denom)) +} + func (k Keeper) GetAllConsumerRewardDenoms(ctx sdk.Context) (consumerRewardDenoms []string) { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, []byte{types.ConsumerRewardDenomsBytePrefix}) diff --git a/x/ccv/provider/keeper/distribution_test.go b/x/ccv/provider/keeper/distribution_test.go deleted file mode 100644 index a470feea74..0000000000 --- a/x/ccv/provider/keeper/distribution_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package keeper_test - -import ( - "testing" - - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" - - sdk "github.com/cosmos/cosmos-sdk/types" - - testutil "github.com/cosmos/interchain-security/v3/testutil/keeper" - consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" - "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" -) - -// TestRegisterConsumerRewardDenom tests the RegisterConsumerRewardDenom method. -func TestRegisterConsumerRewardDenom(t *testing.T) { - // Setup - providerKeeper, ctx, ctrl, mocks := testutil.GetProviderKeeperAndCtx(t, testutil.NewInMemKeeperParams(t)) - defer ctrl.Finish() - defaultParams := types.DefaultParams() - providerKeeper.SetParams(ctx, defaultParams) - accAddr := sdk.AccAddress([]byte("addr1")) - gomock.InOrder( - mocks.MockDistributionKeeper.EXPECT().FundCommunityPool(ctx, - sdk.NewCoins(defaultParams.ConsumerRewardDenomRegistrationFee), accAddr).Return(nil).Times(2), - ) - - // Register a consumer reward denom, confirm it's persisted as expected - err := providerKeeper.RegisterConsumerRewardDenom(ctx, "denom1", accAddr) - require.NoError(t, err) - require.True(t, providerKeeper.ConsumerRewardDenomExists(ctx, "denom1")) - allDenoms := providerKeeper.GetAllConsumerRewardDenoms(ctx) - require.Len(t, allDenoms, 1) - require.Equal(t, "denom1", allDenoms[0]) - - // Register another consumer reward denom, confirm both denoms are persisted as expected - err = providerKeeper.RegisterConsumerRewardDenom(ctx, "denom2", accAddr) - require.NoError(t, err) - require.True(t, providerKeeper.ConsumerRewardDenomExists(ctx, "denom2")) - allDenoms = providerKeeper.GetAllConsumerRewardDenoms(ctx) - require.Len(t, allDenoms, 2) - require.Equal(t, "denom1", allDenoms[0]) - require.Equal(t, "denom2", allDenoms[1]) - - // Try to register first consumer reward denom again, confirm it fails - err = providerKeeper.RegisterConsumerRewardDenom(ctx, "denom1", accAddr) - require.Error(t, err) - require.Equal(t, consumertypes.ErrConsumerRewardDenomAlreadyRegistered, err) -} diff --git a/x/ccv/provider/keeper/msg_server.go b/x/ccv/provider/keeper/msg_server.go index 195e2a7215..2aa0fed46c 100644 --- a/x/ccv/provider/keeper/msg_server.go +++ b/x/ccv/provider/keeper/msg_server.go @@ -108,24 +108,3 @@ func (k msgServer) AssignConsumerKey(goCtx context.Context, msg *types.MsgAssign return &types.MsgAssignConsumerKeyResponse{}, nil } - -func (k msgServer) RegisterConsumerRewardDenom(goCtx context.Context, msg *types.MsgRegisterConsumerRewardDenom) (*types.MsgRegisterConsumerRewardDenomResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - depositer, err := sdk.AccAddressFromBech32(msg.Depositor) - if err != nil { - return nil, err - } - - if err := k.Keeper.RegisterConsumerRewardDenom(ctx, msg.Denom, depositer); err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent(sdk.NewEvent( - ccvtypes.EventTypeRegisterConsumerRewardDenom, - sdk.NewAttribute(ccvtypes.AttributeConsumerRewardDenom, msg.Denom), - sdk.NewAttribute(ccvtypes.AttributeConsumerRewardDepositor, msg.Depositor), - )) - - return &types.MsgRegisterConsumerRewardDenomResponse{}, nil -} diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 7e4eb557f7..53c5f4396f 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -616,3 +616,31 @@ func (k Keeper) HandleEquivocationProposal(ctx sdk.Context, p *types.Equivocatio } return nil } + +func (k Keeper) HandleConsumerRewardDenomProposal(ctx sdk.Context, p *types.ChangeRewardDenomsProposal) error { + for _, denomToAdd := range p.DenomsToAdd { + // Log error and move on if one of the denoms is already registered + if k.ConsumerRewardDenomExists(ctx, denomToAdd) { + ctx.Logger().Error("denom %s already registered", denomToAdd) + continue + } + k.SetConsumerRewardDenom(ctx, denomToAdd) + ctx.EventManager().EmitEvent(sdk.NewEvent( + ccv.EventTypeAddConsumerRewardDenom, + sdk.NewAttribute(ccv.AttributeConsumerRewardDenom, denomToAdd), + )) + } + for _, denomToRemove := range p.DenomsToRemove { + // Log error and move on if one of the denoms is not registered + if !k.ConsumerRewardDenomExists(ctx, denomToRemove) { + ctx.Logger().Error("denom %s not registered", denomToRemove) + continue + } + k.DeleteConsumerRewardDenom(ctx, denomToRemove) + ctx.EventManager().EmitEvent(sdk.NewEvent( + ccv.EventTypeRemoveConsumerRewardDenom, + sdk.NewAttribute(ccv.AttributeConsumerRewardDenom, denomToRemove), + )) + } + return nil +} diff --git a/x/ccv/provider/proposal_handler.go b/x/ccv/provider/proposal_handler.go index 137cbecec7..7af7ec4e5f 100644 --- a/x/ccv/provider/proposal_handler.go +++ b/x/ccv/provider/proposal_handler.go @@ -23,6 +23,8 @@ func NewProviderProposalHandler(k keeper.Keeper) govv1beta1.Handler { return k.HandleConsumerRemovalProposal(ctx, c) case *types.EquivocationProposal: return k.HandleEquivocationProposal(ctx, c) + case *types.ChangeRewardDenomsProposal: + return k.HandleConsumerRewardDenomProposal(ctx, c) default: return errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized ccv proposal content type: %T", c) } diff --git a/x/ccv/provider/proposal_handler_test.go b/x/ccv/provider/proposal_handler_test.go index e8963421d2..8f1322b3d2 100644 --- a/x/ccv/provider/proposal_handler_test.go +++ b/x/ccv/provider/proposal_handler_test.go @@ -27,12 +27,13 @@ func TestProviderProposalHandler(t *testing.T) { equivocation := &evidencetypes.Equivocation{Height: 42} testCases := []struct { - name string - content govv1beta1.Content - blockTime time.Time - expValidConsumerAddition bool - expValidConsumerRemoval bool - expValidEquivocation bool + name string + content govv1beta1.Content + blockTime time.Time + expValidConsumerAddition bool + expValidConsumerRemoval bool + expValidEquivocation bool + expValidChangeRewardDenom bool }{ { name: "valid consumer addition proposal", @@ -72,6 +73,13 @@ func TestProviderProposalHandler(t *testing.T) { blockTime: hourFromNow, expValidEquivocation: true, }, + { + name: "valid change reward denoms proposal", + content: providertypes.NewChangeRewardDenomsProposal( + "title", "description", []string{"denom1"}, []string{"denom2"}), + blockTime: hourFromNow, + expValidChangeRewardDenom: true, + }, { name: "nil proposal", content: nil, @@ -114,6 +122,8 @@ func TestProviderProposalHandler(t *testing.T) { case tc.expValidEquivocation: providerKeeper.SetSlashLog(ctx, providertypes.NewProviderConsAddress(equivocation.GetConsensusAddress())) mocks.MockEvidenceKeeper.EXPECT().HandleEquivocationEvidence(ctx, equivocation) + case tc.expValidChangeRewardDenom: + // Nothing to mock } // Execution @@ -121,7 +131,7 @@ func TestProviderProposalHandler(t *testing.T) { err := proposalHandler(ctx, tc.content) if tc.expValidConsumerAddition || tc.expValidConsumerRemoval || - tc.expValidEquivocation { + tc.expValidEquivocation || tc.expValidChangeRewardDenom { require.NoError(t, err) } else { require.Error(t, err) diff --git a/x/ccv/provider/types/codec.go b/x/ccv/provider/types/codec.go index 54c29442ae..ceed3bf789 100644 --- a/x/ccv/provider/types/codec.go +++ b/x/ccv/provider/types/codec.go @@ -28,12 +28,12 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &MsgAssignConsumerKey{}, ) registry.RegisterImplementations( - (*sdk.Msg)(nil), - &MsgRegisterConsumerRewardDenom{}, + (*govv1beta1.Content)(nil), + &EquivocationProposal{}, ) registry.RegisterImplementations( (*govv1beta1.Content)(nil), - &EquivocationProposal{}, + &ChangeRewardDenomsProposal{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/ccv/provider/types/msg.go b/x/ccv/provider/types/msg.go index 67ad99d10c..901aa03600 100644 --- a/x/ccv/provider/types/msg.go +++ b/x/ccv/provider/types/msg.go @@ -9,8 +9,7 @@ import ( // provider message types const ( - TypeMsgAssignConsumerKey = "assign_consumer_key" - TypeMsgRegisterConsumerRewardDenom = "register_consumer_reward_denom" + TypeMsgAssignConsumerKey = "assign_consumer_key" ) var _ sdk.Msg = &MsgAssignConsumerKey{} @@ -94,48 +93,3 @@ func ParseConsumerKeyFromJson(jsonStr string) (pkType, key string, err error) { } return pubKey.Type, pubKey.Key, nil } - -// NewMsgRegisterConsumerRewardDenom returns a new MsgRegisterConsumerRewardDenom with a sender and -// a funding amount. -func NewMsgRegisterConsumerRewardDenom(denom string, depositor sdk.AccAddress) *MsgRegisterConsumerRewardDenom { - return &MsgRegisterConsumerRewardDenom{ - Denom: denom, - Depositor: depositor.String(), - } -} - -// Route returns the MsgRegisterConsumerRewardDenom message route. -func (msg MsgRegisterConsumerRewardDenom) Route() string { return ModuleName } - -// Type returns the MsgRegisterConsumerRewardDenom message type. -func (msg MsgRegisterConsumerRewardDenom) Type() string { return TypeMsgRegisterConsumerRewardDenom } - -// GetSigners returns the signer addresses that are expected to sign the result -// of GetSignBytes. -func (msg MsgRegisterConsumerRewardDenom) GetSigners() []sdk.AccAddress { - depoAddr, err := sdk.AccAddressFromBech32(msg.Depositor) - if err != nil { - panic(err) - } - return []sdk.AccAddress{depoAddr} -} - -// GetSignBytes returns the raw bytes for a MsgRegisterConsumerRewardDenom message that -// the expected signer needs to sign. -func (msg MsgRegisterConsumerRewardDenom) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) - return sdk.MustSortJSON(bz) -} - -// ValidateBasic performs basic MsgRegisterConsumerRewardDenom message validation. -func (msg MsgRegisterConsumerRewardDenom) ValidateBasic() error { - if !sdk.NewCoin(msg.Denom, sdk.NewInt(0)).IsValid() { - return ErrInvalidConsumerRewardDenom - } - _, err := sdk.AccAddressFromBech32(msg.Depositor) - if err != nil { - return ErrInvalidDepositorAddress - } - - return nil -} diff --git a/x/ccv/provider/types/proposal.go b/x/ccv/provider/types/proposal.go index c369ec95f1..b2286d4adf 100644 --- a/x/ccv/provider/types/proposal.go +++ b/x/ccv/provider/types/proposal.go @@ -10,6 +10,7 @@ import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" @@ -17,21 +18,24 @@ import ( ) const ( - ProposalTypeConsumerAddition = "ConsumerAddition" - ProposalTypeConsumerRemoval = "ConsumerRemoval" - ProposalTypeEquivocation = "Equivocation" + ProposalTypeConsumerAddition = "ConsumerAddition" + ProposalTypeConsumerRemoval = "ConsumerRemoval" + ProposalTypeEquivocation = "Equivocation" + ProposalTypeChangeRewardDenoms = "ChangeRewardDenoms" ) var ( _ govv1beta1.Content = &ConsumerAdditionProposal{} _ govv1beta1.Content = &ConsumerRemovalProposal{} _ govv1beta1.Content = &EquivocationProposal{} + _ govv1beta1.Content = &ChangeRewardDenomsProposal{} ) func init() { govv1beta1.RegisterProposalType(ProposalTypeConsumerAddition) govv1beta1.RegisterProposalType(ProposalTypeConsumerRemoval) govv1beta1.RegisterProposalType(ProposalTypeEquivocation) + govv1beta1.RegisterProposalType(ProposalTypeChangeRewardDenoms) } // NewConsumerAdditionProposal creates a new consumer addition proposal. @@ -231,3 +235,57 @@ func (sp *EquivocationProposal) ValidateBasic() error { } return nil } + +func NewChangeRewardDenomsProposal(title, description string, + denomsToAdd, denomsToRemove []string, +) govv1beta1.Content { + return &ChangeRewardDenomsProposal{ + Title: title, + Description: description, + DenomsToAdd: denomsToAdd, + DenomsToRemove: denomsToRemove, + } +} + +// ProposalRoute returns the routing key of a change reward denoms proposal. +func (crdp *ChangeRewardDenomsProposal) ProposalRoute() string { return RouterKey } + +// ProposalType returns the type of a change reward denoms proposal. +func (crdp *ChangeRewardDenomsProposal) ProposalType() string { + return ProposalTypeChangeRewardDenoms +} + +// ValidateBasic runs basic stateless validity checks on a ChangeRewardDenomsProposal. +func (crdp *ChangeRewardDenomsProposal) ValidateBasic() error { + emptyDenomsToAdd := len(crdp.DenomsToAdd) == 0 + emptyDenomsToRemove := len(crdp.DenomsToRemove) == 0 + // Return error if both sets are empty or nil + if emptyDenomsToAdd && emptyDenomsToRemove { + return fmt.Errorf( + "invalid change reward denoms proposal: both denoms to add and denoms to remove are empty") + } + + // Return error if a denom is in both sets + for _, denomToAdd := range crdp.DenomsToAdd { + for _, denomToRemove := range crdp.DenomsToRemove { + if denomToAdd == denomToRemove { + return fmt.Errorf( + "invalid change reward denoms proposal: %s cannot be both added and removed", denomToAdd) + } + } + } + + // Return error if any denom is "invalid" + for _, denom := range crdp.DenomsToAdd { + if !sdk.NewCoin(denom, sdk.NewInt(1)).IsValid() { + return fmt.Errorf("invalid change reward denoms proposal: %s is not a valid denom", denom) + } + } + for _, denom := range crdp.DenomsToRemove { + if !sdk.NewCoin(denom, sdk.NewInt(1)).IsValid() { + return fmt.Errorf("invalid change reward denoms proposal: %s is not a valid denom", denom) + } + } + + return nil +} diff --git a/x/ccv/provider/types/proposal_test.go b/x/ccv/provider/types/proposal_test.go index fac4c7fc4b..357c555d0e 100644 --- a/x/ccv/provider/types/proposal_test.go +++ b/x/ccv/provider/types/proposal_test.go @@ -362,3 +362,52 @@ func TestEquivocationProposalValidateBasic(t *testing.T) { }) } } + +func TestChangeRewardDenomsProposalValidateBasic(t *testing.T) { + tcs := []struct { + name string + proposal govv1beta1.Content + expectError bool + expectPanic bool + }{ + { + name: "invalid change reward denoms proposal, none to add or remove", + proposal: types.NewChangeRewardDenomsProposal( + "title", "description", []string{}, []string{}), + expectError: true, + }, + { + name: "invalid change reward denoms proposal, same denom in both sets", + proposal: types.NewChangeRewardDenomsProposal( + "title", "description", []string{"denom1"}, []string{"denom1"}), + expectError: true, + }, + { + name: "valid change reward denoms proposal", + proposal: types.NewChangeRewardDenomsProposal( + "title", "description", []string{"denom1"}, []string{"denom2"}), + expectError: false, + }, + { + name: "invalid prop, invalid denom, will panic", + proposal: types.NewChangeRewardDenomsProposal( + "title", "description", []string{"!@blah"}, []string{"denom2"}), + expectPanic: true, + }, + } + + for _, tc := range tcs { + t.Run(tc.name, func(t *testing.T) { + if tc.expectPanic { + require.Panics(t, func() { tc.proposal.ValidateBasic() }) + return + } + err := tc.proposal.ValidateBasic() + if tc.expectError { + require.Error(t, err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index 398010307c..ef0aa6e5e1 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -268,6 +268,80 @@ func (m *EquivocationProposal) GetEquivocations() []*types1.Equivocation { return nil } +// ChangeRewardDenomsProposal is a governance proposal on the provider chain to +// mutate the set of denoms accepted by the provider as rewards. +type ChangeRewardDenomsProposal struct { + // the title of the proposal + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // the description of the proposal + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // the list of consumer reward denoms to add + DenomsToAdd []string `protobuf:"bytes,3,rep,name=denoms_to_add,json=denomsToAdd,proto3" json:"denoms_to_add,omitempty"` + // the list of consumer reward denoms to remove + DenomsToRemove []string `protobuf:"bytes,4,rep,name=denoms_to_remove,json=denomsToRemove,proto3" json:"denoms_to_remove,omitempty"` +} + +func (m *ChangeRewardDenomsProposal) Reset() { *m = ChangeRewardDenomsProposal{} } +func (m *ChangeRewardDenomsProposal) String() string { return proto.CompactTextString(m) } +func (*ChangeRewardDenomsProposal) ProtoMessage() {} +func (*ChangeRewardDenomsProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_f22ec409a72b7b72, []int{3} +} +func (m *ChangeRewardDenomsProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChangeRewardDenomsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChangeRewardDenomsProposal.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 *ChangeRewardDenomsProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChangeRewardDenomsProposal.Merge(m, src) +} +func (m *ChangeRewardDenomsProposal) XXX_Size() int { + return m.Size() +} +func (m *ChangeRewardDenomsProposal) XXX_DiscardUnknown() { + xxx_messageInfo_ChangeRewardDenomsProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_ChangeRewardDenomsProposal proto.InternalMessageInfo + +func (m *ChangeRewardDenomsProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *ChangeRewardDenomsProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *ChangeRewardDenomsProposal) GetDenomsToAdd() []string { + if m != nil { + return m.DenomsToAdd + } + return nil +} + +func (m *ChangeRewardDenomsProposal) GetDenomsToRemove() []string { + if m != nil { + return m.DenomsToRemove + } + return nil +} + // A persisted queue entry indicating that a slash packet data instance needs to // be handled. This type belongs in the "global" queue, to coordinate slash // packet handling times between consumers. @@ -292,7 +366,7 @@ func (m *GlobalSlashEntry) Reset() { *m = GlobalSlashEntry{} } func (m *GlobalSlashEntry) String() string { return proto.CompactTextString(m) } func (*GlobalSlashEntry) ProtoMessage() {} func (*GlobalSlashEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{3} + return fileDescriptor_f22ec409a72b7b72, []int{4} } func (m *GlobalSlashEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -382,7 +456,7 @@ func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{4} + return fileDescriptor_f22ec409a72b7b72, []int{5} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -484,7 +558,7 @@ func (m *SlashAcks) Reset() { *m = SlashAcks{} } func (m *SlashAcks) String() string { return proto.CompactTextString(m) } func (*SlashAcks) ProtoMessage() {} func (*SlashAcks) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{5} + return fileDescriptor_f22ec409a72b7b72, []int{6} } func (m *SlashAcks) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -531,7 +605,7 @@ func (m *ConsumerAdditionProposals) Reset() { *m = ConsumerAdditionPropo func (m *ConsumerAdditionProposals) String() string { return proto.CompactTextString(m) } func (*ConsumerAdditionProposals) ProtoMessage() {} func (*ConsumerAdditionProposals) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{6} + return fileDescriptor_f22ec409a72b7b72, []int{7} } func (m *ConsumerAdditionProposals) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -578,7 +652,7 @@ func (m *ConsumerRemovalProposals) Reset() { *m = ConsumerRemovalProposa func (m *ConsumerRemovalProposals) String() string { return proto.CompactTextString(m) } func (*ConsumerRemovalProposals) ProtoMessage() {} func (*ConsumerRemovalProposals) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{7} + return fileDescriptor_f22ec409a72b7b72, []int{8} } func (m *ConsumerRemovalProposals) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -623,7 +697,7 @@ func (m *AddressList) Reset() { *m = AddressList{} } func (m *AddressList) String() string { return proto.CompactTextString(m) } func (*AddressList) ProtoMessage() {} func (*AddressList) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{8} + return fileDescriptor_f22ec409a72b7b72, []int{9} } func (m *AddressList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -668,7 +742,7 @@ func (m *ChannelToChain) Reset() { *m = ChannelToChain{} } func (m *ChannelToChain) String() string { return proto.CompactTextString(m) } func (*ChannelToChain) ProtoMessage() {} func (*ChannelToChain) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{9} + return fileDescriptor_f22ec409a72b7b72, []int{10} } func (m *ChannelToChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -722,7 +796,7 @@ func (m *VscUnbondingOps) Reset() { *m = VscUnbondingOps{} } func (m *VscUnbondingOps) String() string { return proto.CompactTextString(m) } func (*VscUnbondingOps) ProtoMessage() {} func (*VscUnbondingOps) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{10} + return fileDescriptor_f22ec409a72b7b72, []int{11} } func (m *VscUnbondingOps) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -777,7 +851,7 @@ func (m *UnbondingOp) Reset() { *m = UnbondingOp{} } func (m *UnbondingOp) String() string { return proto.CompactTextString(m) } func (*UnbondingOp) ProtoMessage() {} func (*UnbondingOp) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{11} + return fileDescriptor_f22ec409a72b7b72, []int{12} } func (m *UnbondingOp) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -829,7 +903,7 @@ func (m *InitTimeoutTimestamp) Reset() { *m = InitTimeoutTimestamp{} } func (m *InitTimeoutTimestamp) String() string { return proto.CompactTextString(m) } func (*InitTimeoutTimestamp) ProtoMessage() {} func (*InitTimeoutTimestamp) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{12} + return fileDescriptor_f22ec409a72b7b72, []int{13} } func (m *InitTimeoutTimestamp) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -881,7 +955,7 @@ func (m *VscSendTimestamp) Reset() { *m = VscSendTimestamp{} } func (m *VscSendTimestamp) String() string { return proto.CompactTextString(m) } func (*VscSendTimestamp) ProtoMessage() {} func (*VscSendTimestamp) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{13} + return fileDescriptor_f22ec409a72b7b72, []int{14} } func (m *VscSendTimestamp) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -933,7 +1007,7 @@ func (m *ValidatorSetChangePackets) Reset() { *m = ValidatorSetChangePac func (m *ValidatorSetChangePackets) String() string { return proto.CompactTextString(m) } func (*ValidatorSetChangePackets) ProtoMessage() {} func (*ValidatorSetChangePackets) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{14} + return fileDescriptor_f22ec409a72b7b72, []int{15} } func (m *ValidatorSetChangePackets) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -979,7 +1053,7 @@ func (m *MaturedUnbondingOps) Reset() { *m = MaturedUnbondingOps{} } func (m *MaturedUnbondingOps) String() string { return proto.CompactTextString(m) } func (*MaturedUnbondingOps) ProtoMessage() {} func (*MaturedUnbondingOps) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{15} + return fileDescriptor_f22ec409a72b7b72, []int{16} } func (m *MaturedUnbondingOps) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1025,7 +1099,7 @@ func (m *ExportedVscSendTimestamp) Reset() { *m = ExportedVscSendTimesta func (m *ExportedVscSendTimestamp) String() string { return proto.CompactTextString(m) } func (*ExportedVscSendTimestamp) ProtoMessage() {} func (*ExportedVscSendTimestamp) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{16} + return fileDescriptor_f22ec409a72b7b72, []int{17} } func (m *ExportedVscSendTimestamp) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1078,7 +1152,7 @@ func (m *KeyAssignmentReplacement) Reset() { *m = KeyAssignmentReplaceme func (m *KeyAssignmentReplacement) String() string { return proto.CompactTextString(m) } func (*KeyAssignmentReplacement) ProtoMessage() {} func (*KeyAssignmentReplacement) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{17} + return fileDescriptor_f22ec409a72b7b72, []int{18} } func (m *KeyAssignmentReplacement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1141,7 +1215,7 @@ func (m *ValidatorConsumerPubKey) Reset() { *m = ValidatorConsumerPubKey func (m *ValidatorConsumerPubKey) String() string { return proto.CompactTextString(m) } func (*ValidatorConsumerPubKey) ProtoMessage() {} func (*ValidatorConsumerPubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{18} + return fileDescriptor_f22ec409a72b7b72, []int{19} } func (m *ValidatorConsumerPubKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1204,7 +1278,7 @@ func (m *ValidatorByConsumerAddr) Reset() { *m = ValidatorByConsumerAddr func (m *ValidatorByConsumerAddr) String() string { return proto.CompactTextString(m) } func (*ValidatorByConsumerAddr) ProtoMessage() {} func (*ValidatorByConsumerAddr) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{19} + return fileDescriptor_f22ec409a72b7b72, []int{20} } func (m *ValidatorByConsumerAddr) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1266,7 +1340,7 @@ func (m *ConsumerAddrsToPrune) Reset() { *m = ConsumerAddrsToPrune{} } func (m *ConsumerAddrsToPrune) String() string { return proto.CompactTextString(m) } func (*ConsumerAddrsToPrune) ProtoMessage() {} func (*ConsumerAddrsToPrune) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{20} + return fileDescriptor_f22ec409a72b7b72, []int{21} } func (m *ConsumerAddrsToPrune) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1320,6 +1394,7 @@ func init() { proto.RegisterType((*ConsumerAdditionProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerAdditionProposal") proto.RegisterType((*ConsumerRemovalProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerRemovalProposal") proto.RegisterType((*EquivocationProposal)(nil), "interchain_security.ccv.provider.v1.EquivocationProposal") + proto.RegisterType((*ChangeRewardDenomsProposal)(nil), "interchain_security.ccv.provider.v1.ChangeRewardDenomsProposal") proto.RegisterType((*GlobalSlashEntry)(nil), "interchain_security.ccv.provider.v1.GlobalSlashEntry") proto.RegisterType((*Params)(nil), "interchain_security.ccv.provider.v1.Params") proto.RegisterType((*SlashAcks)(nil), "interchain_security.ccv.provider.v1.SlashAcks") @@ -1345,112 +1420,115 @@ func init() { } var fileDescriptor_f22ec409a72b7b72 = []byte{ - // 1674 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4f, 0x6f, 0x1b, 0xc7, - 0x15, 0xd7, 0x8a, 0x94, 0x2c, 0x3e, 0xea, 0x9f, 0x57, 0x72, 0x4c, 0xb9, 0x2a, 0x45, 0x6f, 0x9a, - 0x54, 0x45, 0x90, 0x65, 0x24, 0xa3, 0x40, 0x60, 0x34, 0x08, 0x24, 0xca, 0x89, 0x15, 0x35, 0xb1, - 0xb2, 0x52, 0x65, 0xb4, 0x3d, 0x2c, 0x86, 0xb3, 0x63, 0x72, 0xa0, 0xdd, 0x9d, 0xf5, 0xcc, 0xec, - 0xda, 0xbc, 0xf4, 0xdc, 0x63, 0x7a, 0x0b, 0xda, 0x4b, 0xda, 0x2f, 0xd0, 0xaf, 0x91, 0x63, 0x8e, - 0x3d, 0x25, 0x85, 0x7d, 0xe8, 0xa1, 0x5f, 0xa2, 0x98, 0xd9, 0xbf, 0xa4, 0x44, 0x95, 0x46, 0x9b, - 0xdb, 0xec, 0x9b, 0xf7, 0x7e, 0xef, 0xff, 0x7b, 0x43, 0xc2, 0x3e, 0x0d, 0x25, 0xe1, 0x78, 0x88, - 0x68, 0xe8, 0x0a, 0x82, 0x63, 0x4e, 0xe5, 0xa8, 0x8b, 0x71, 0xd2, 0x8d, 0x38, 0x4b, 0xa8, 0x47, - 0x78, 0x37, 0xd9, 0x2b, 0xce, 0x76, 0xc4, 0x99, 0x64, 0xe6, 0xdb, 0xd7, 0xc8, 0xd8, 0x18, 0x27, - 0x76, 0xc1, 0x97, 0xec, 0xdd, 0xfb, 0x60, 0x1a, 0x70, 0xb2, 0xd7, 0x15, 0x43, 0xc4, 0x89, 0xe7, - 0x62, 0x16, 0x8a, 0x38, 0xc8, 0x61, 0xef, 0xbd, 0x73, 0x83, 0xc4, 0x0b, 0xca, 0x49, 0xc6, 0xb6, - 0x39, 0x60, 0x03, 0xa6, 0x8f, 0x5d, 0x75, 0xca, 0xa8, 0x3b, 0x03, 0xc6, 0x06, 0x3e, 0xe9, 0xea, - 0xaf, 0x7e, 0xfc, 0xac, 0x2b, 0x69, 0x40, 0x84, 0x44, 0x41, 0x94, 0x31, 0xb4, 0x27, 0x19, 0xbc, - 0x98, 0x23, 0x49, 0x59, 0x98, 0x03, 0xd0, 0x3e, 0xee, 0x62, 0xc6, 0x49, 0x17, 0xfb, 0x94, 0x84, - 0x52, 0x69, 0x4d, 0x4f, 0x19, 0x43, 0x57, 0x31, 0xf8, 0x74, 0x30, 0x94, 0x29, 0x59, 0x74, 0x25, - 0x09, 0x3d, 0xc2, 0x03, 0x9a, 0x32, 0x97, 0x5f, 0x99, 0xc0, 0x76, 0xe5, 0x1e, 0xf3, 0x51, 0x24, - 0x59, 0xf7, 0x92, 0x8c, 0x44, 0x76, 0xfb, 0x2e, 0x66, 0x22, 0x60, 0xa2, 0x4b, 0x54, 0xc4, 0x42, - 0x4c, 0xba, 0xc9, 0x5e, 0x9f, 0x48, 0xb4, 0x57, 0x10, 0x72, 0xbb, 0x33, 0xbe, 0x3e, 0x12, 0x25, - 0x0f, 0x66, 0x34, 0xb3, 0xdb, 0xfa, 0x61, 0x11, 0x5a, 0xbd, 0x2c, 0x90, 0x07, 0x9e, 0x47, 0x95, - 0x4b, 0xa7, 0x9c, 0x45, 0x4c, 0x20, 0xdf, 0xdc, 0x84, 0x05, 0x49, 0xa5, 0x4f, 0x5a, 0x46, 0xc7, - 0xd8, 0x6d, 0x38, 0xe9, 0x87, 0xd9, 0x81, 0xa6, 0x47, 0x04, 0xe6, 0x34, 0x52, 0xcc, 0xad, 0x79, - 0x7d, 0x57, 0x25, 0x99, 0x5b, 0xb0, 0x94, 0xe6, 0x81, 0x7a, 0xad, 0x9a, 0xbe, 0xbe, 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x53, 0xc4, 0x86, 0x73, - 0xb7, 0x60, 0x18, 0x9b, 0xc6, 0xc2, 0x7a, 0x02, 0x9b, 0xc7, 0x65, 0xe3, 0x17, 0x83, 0x7e, 0xcc, - 0x43, 0x63, 0x7c, 0x51, 0x6e, 0x43, 0xa3, 0x78, 0xe4, 0x6b, 0xef, 0xeb, 0x4e, 0x49, 0xb0, 0x02, - 0x58, 0xbf, 0x10, 0xf8, 0x8c, 0x84, 0x5e, 0x09, 0x36, 0x25, 0x00, 0x87, 0x93, 0x40, 0x33, 0x3f, - 0x22, 0x4b, 0x75, 0x0c, 0xb6, 0x2e, 0x90, 0x4f, 0x3d, 0x24, 0x19, 0x3f, 0x23, 0x52, 0xa5, 0x71, - 0x40, 0xf2, 0x76, 0x74, 0xa0, 0xee, 0x53, 0x21, 0xb3, 0xca, 0xfa, 0x70, 0x6a, 0x65, 0x25, 0x7b, - 0xf6, 0x34, 0x90, 0x23, 0x24, 0x51, 0xd6, 0x8b, 0x1a, 0xcb, 0xfa, 0x39, 0x6c, 0x7c, 0x8e, 0x64, - 0xcc, 0x89, 0x37, 0x96, 0xe3, 0x75, 0xa8, 0xa9, 0xfc, 0x19, 0x3a, 0x7f, 0xea, 0x68, 0xfd, 0xcd, - 0x80, 0xd6, 0xa3, 0x97, 0x11, 0xe3, 0x92, 0x78, 0x57, 0x22, 0x72, 0x43, 0x78, 0x2f, 0x61, 0x43, - 0x05, 0x4b, 0x90, 0xd0, 0x73, 0x0b, 0x3f, 0xd3, 0x3c, 0x36, 0xf7, 0x7f, 0x39, 0x53, 0x77, 0x4c, - 0xaa, 0xcb, 0x1c, 0xb8, 0x9d, 0x4c, 0xd0, 0x85, 0xf5, 0x27, 0x03, 0x5a, 0x27, 0x64, 0x74, 0x20, - 0x04, 0x1d, 0x84, 0x01, 0x09, 0xa5, 0x9a, 0x83, 0x08, 0x13, 0x75, 0x34, 0xdf, 0x86, 0x95, 0x62, - 0xef, 0xea, 0x75, 0x6b, 0xe8, 0x75,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34, 0xa0, 0x72, 0x18, 0xf7, 0x6d, - 0xcc, 0x82, 0x6e, 0xf6, 0xfb, 0xba, 0xd4, 0xf5, 0x7e, 0xf1, 0xe7, 0x43, 0xf2, 0xa0, 0xfb, 0x72, - 0xfc, 0xcf, 0x10, 0x39, 0x8a, 0x88, 0xe8, 0x2f, 0xea, 0xa9, 0xf0, 0xe0, 0x3f, 0x01, 0x00, 0x00, - 0xff, 0xff, 0xcb, 0x43, 0xd2, 0x10, 0x3d, 0x11, 0x00, 0x00, + // 1723 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4b, 0x73, 0x1b, 0xc7, + 0x11, 0xe6, 0x12, 0x20, 0x45, 0x34, 0xf8, 0xd2, 0x92, 0xb2, 0x40, 0x85, 0x01, 0xa9, 0x75, 0xec, + 0x30, 0xe5, 0xf2, 0xc2, 0xa4, 0x2a, 0x55, 0x2e, 0x55, 0x5c, 0x2e, 0x12, 0x94, 0x2d, 0x9a, 0xb1, + 0x45, 0x2f, 0x19, 0xaa, 0x92, 0x1c, 0xb6, 0x06, 0x33, 0x23, 0x60, 0x8a, 0xbb, 0x3b, 0xab, 0x99, + 0xc1, 0x4a, 0xb8, 0xe4, 0x9c, 0xa3, 0x73, 0x73, 0x25, 0x17, 0x27, 0x7f, 0x20, 0x7f, 0xc3, 0x47, + 0x1f, 0x73, 0xb2, 0x53, 0xd2, 0x21, 0x87, 0xfc, 0x89, 0xd4, 0xcc, 0x3e, 0x01, 0x3e, 0x02, 0x95, + 0x93, 0xdb, 0xa2, 0xa7, 0xfb, 0xeb, 0x9e, 0x7e, 0x7c, 0x3d, 0x24, 0xec, 0xb1, 0x48, 0x51, 0x81, + 0x07, 0x88, 0x45, 0xbe, 0xa4, 0x78, 0x28, 0x98, 0x1a, 0x75, 0x30, 0x4e, 0x3a, 0xb1, 0xe0, 0x09, + 0x23, 0x54, 0x74, 0x92, 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x46, 0x15, 0xee, 0x13, 0xff, 0x25, 0xb6, 0xc2, 0x6d, 0x35, 0x36, 0x5c, 0xb5, + 0xbf, 0x74, 0x81, 0xda, 0xe5, 0x0b, 0x38, 0x7f, 0xb5, 0x60, 0xbd, 0xea, 0x55, 0x9e, 0xf1, 0x13, + 0x31, 0x8c, 0xe8, 0x4d, 0xde, 0xcb, 0xf1, 0x9b, 0xad, 0x8e, 0xdf, 0x53, 0x58, 0x1e, 0x0b, 0x4a, + 0x66, 0xd9, 0xf8, 0x60, 0xaa, 0x1e, 0xab, 0xb0, 0xab, 0xb7, 0x54, 0xbd, 0x87, 0x3c, 0x78, 0xfa, + 0xed, 0xab, 0xb6, 0xf5, 0xdd, 0xab, 0xb6, 0xf5, 0xcf, 0x57, 0x6d, 0xeb, 0xab, 0xd7, 0xed, 0x99, + 0xef, 0x5e, 0xb7, 0x67, 0xfe, 0xf1, 0xba, 0x3d, 0xf3, 0xbb, 0x8f, 0xfa, 0x4c, 0x0d, 0x86, 0x3d, + 0x17, 0xf3, 0xb0, 0x93, 0xfd, 0x13, 0xa0, 0xf4, 0xf5, 0x7e, 0xf1, 0x1f, 0x92, 0xe4, 0x41, 0xe7, + 0xe5, 0xf8, 0x7f, 0x6c, 0xd4, 0x28, 0xa6, 0xb2, 0x37, 0x6f, 0x58, 0xe1, 0xc1, 0x7f, 0x02, 0x00, + 0x00, 0xff, 0xff, 0x47, 0xa2, 0xef, 0x46, 0xe2, 0x11, 0x00, 0x00, } func (m *ConsumerAdditionProposal) Marshal() (dAtA []byte, err error) { @@ -1680,6 +1758,61 @@ func (m *EquivocationProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ChangeRewardDenomsProposal) 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 *ChangeRewardDenomsProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChangeRewardDenomsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DenomsToRemove) > 0 { + for iNdEx := len(m.DenomsToRemove) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DenomsToRemove[iNdEx]) + copy(dAtA[i:], m.DenomsToRemove[iNdEx]) + i = encodeVarintProvider(dAtA, i, uint64(len(m.DenomsToRemove[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.DenomsToAdd) > 0 { + for iNdEx := len(m.DenomsToAdd) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DenomsToAdd[iNdEx]) + copy(dAtA[i:], m.DenomsToAdd[iNdEx]) + i = encodeVarintProvider(dAtA, i, uint64(len(m.DenomsToAdd[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProvider(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProvider(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *GlobalSlashEntry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2574,6 +2707,35 @@ func (m *EquivocationProposal) Size() (n int) { return n } +func (m *ChangeRewardDenomsProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } + if len(m.DenomsToAdd) > 0 { + for _, s := range m.DenomsToAdd { + l = len(s) + n += 1 + l + sovProvider(uint64(l)) + } + } + if len(m.DenomsToRemove) > 0 { + for _, s := range m.DenomsToRemove { + l = len(s) + n += 1 + l + sovProvider(uint64(l)) + } + } + return n +} + func (m *GlobalSlashEntry) Size() (n int) { if m == nil { return 0 @@ -3720,6 +3882,184 @@ func (m *EquivocationProposal) Unmarshal(dAtA []byte) error { } return nil } +func (m *ChangeRewardDenomsProposal) 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 ErrIntOverflowProvider + } + 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: ChangeRewardDenomsProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChangeRewardDenomsProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + 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 ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + 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 ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomsToAdd", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + 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 ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomsToAdd = append(m.DenomsToAdd, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomsToRemove", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + 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 ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomsToRemove = append(m.DenomsToRemove, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProvider(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProvider + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *GlobalSlashEntry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ccv/provider/types/tx.pb.go b/x/ccv/provider/types/tx.pb.go index 32bca37998..c5bebf0cd5 100644 --- a/x/ccv/provider/types/tx.pb.go +++ b/x/ccv/provider/types/tx.pb.go @@ -111,92 +111,9 @@ func (m *MsgAssignConsumerKeyResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAssignConsumerKeyResponse proto.InternalMessageInfo -// MsgRegisterConsumerRewardDenom allows an account to register -// a consumer reward denom, i.e., add it to the list of denoms -// accepted by the provider as rewards. -type MsgRegisterConsumerRewardDenom struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` -} - -func (m *MsgRegisterConsumerRewardDenom) Reset() { *m = MsgRegisterConsumerRewardDenom{} } -func (m *MsgRegisterConsumerRewardDenom) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterConsumerRewardDenom) ProtoMessage() {} -func (*MsgRegisterConsumerRewardDenom) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{2} -} -func (m *MsgRegisterConsumerRewardDenom) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterConsumerRewardDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterConsumerRewardDenom.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 *MsgRegisterConsumerRewardDenom) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterConsumerRewardDenom.Merge(m, src) -} -func (m *MsgRegisterConsumerRewardDenom) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterConsumerRewardDenom) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterConsumerRewardDenom.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterConsumerRewardDenom proto.InternalMessageInfo - -// MsgRegisterConsumerRewardDenomResponse defines the -// Msg/RegisterConsumerRewardDenom response type. -type MsgRegisterConsumerRewardDenomResponse struct { -} - -func (m *MsgRegisterConsumerRewardDenomResponse) Reset() { - *m = MsgRegisterConsumerRewardDenomResponse{} -} -func (m *MsgRegisterConsumerRewardDenomResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterConsumerRewardDenomResponse) ProtoMessage() {} -func (*MsgRegisterConsumerRewardDenomResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_43221a4391e9fbf4, []int{3} -} -func (m *MsgRegisterConsumerRewardDenomResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterConsumerRewardDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterConsumerRewardDenomResponse.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 *MsgRegisterConsumerRewardDenomResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterConsumerRewardDenomResponse.Merge(m, src) -} -func (m *MsgRegisterConsumerRewardDenomResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterConsumerRewardDenomResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterConsumerRewardDenomResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterConsumerRewardDenomResponse proto.InternalMessageInfo - func init() { proto.RegisterType((*MsgAssignConsumerKey)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKey") proto.RegisterType((*MsgAssignConsumerKeyResponse)(nil), "interchain_security.ccv.provider.v1.MsgAssignConsumerKeyResponse") - proto.RegisterType((*MsgRegisterConsumerRewardDenom)(nil), "interchain_security.ccv.provider.v1.MsgRegisterConsumerRewardDenom") - proto.RegisterType((*MsgRegisterConsumerRewardDenomResponse)(nil), "interchain_security.ccv.provider.v1.MsgRegisterConsumerRewardDenomResponse") } func init() { @@ -204,36 +121,31 @@ func init() { } var fileDescriptor_43221a4391e9fbf4 = []byte{ - // 453 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0x3d, 0x6b, 0x14, 0x41, - 0x18, 0xc7, 0x77, 0x13, 0xd4, 0x64, 0x8c, 0x82, 0xc3, 0x15, 0x97, 0xf3, 0xd8, 0xd3, 0x15, 0x24, - 0x85, 0xee, 0x10, 0x53, 0x88, 0x01, 0x8b, 0x4b, 0x6c, 0x24, 0x5c, 0xb3, 0x8d, 0x60, 0xe1, 0xb1, - 0x37, 0x33, 0x4e, 0x06, 0xb3, 0xf3, 0x2c, 0xf3, 0xcc, 0xad, 0xd9, 0x6f, 0x60, 0xa9, 0x95, 0x6d, - 0xbe, 0x81, 0x5f, 0x43, 0xb0, 0x49, 0x69, 0x25, 0x72, 0xd7, 0x58, 0xfb, 0x09, 0x64, 0xdf, 0x3c, - 0xc5, 0xe3, 0x08, 0x92, 0xee, 0x79, 0xdb, 0xff, 0xff, 0xb7, 0x33, 0xf3, 0x90, 0x07, 0xda, 0x38, - 0x69, 0xf9, 0x71, 0xa2, 0xcd, 0x18, 0x25, 0x9f, 0x5a, 0xed, 0x0a, 0xc6, 0x79, 0xce, 0x32, 0x0b, - 0xb9, 0x16, 0xd2, 0xb2, 0x7c, 0x97, 0xb9, 0xd3, 0x28, 0xb3, 0xe0, 0x80, 0xde, 0x5b, 0x32, 0x1d, - 0x71, 0x9e, 0x47, 0xed, 0x74, 0x94, 0xef, 0xf6, 0xfa, 0x0a, 0x40, 0x9d, 0x48, 0x96, 0x64, 0x9a, - 0x25, 0xc6, 0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fc, 0xe1, 0xbf, 0x43, 0xee, 0xaf, 0xd6, 0x6f, 0x49, - 0x1e, 0x7d, 0x59, 0x23, 0xeb, 0x23, 0x54, 0xf4, 0x83, 0x4f, 0x6e, 0xfd, 0x7b, 0x90, 0x4f, 0xa2, - 0x0b, 0xdc, 0x78, 0xb4, 0xec, 0x57, 0x7b, 0xc3, 0xff, 0xfe, 0xb4, 0x65, 0xa3, 0x9f, 0x7c, 0x72, - 0x7b, 0xd5, 0x19, 0x1d, 0x5e, 0xd4, 0x62, 0x85, 0x48, 0xef, 0xe8, 0x12, 0x44, 0x5a, 0xe2, 0x83, - 0x17, 0x9f, 0x67, 0x81, 0x7f, 0x3e, 0x0b, 0xfc, 0xef, 0xb3, 0xc0, 0x7f, 0x3f, 0x0f, 0xbc, 0xf3, - 0x79, 0xe0, 0x7d, 0x9d, 0x07, 0xde, 0xcb, 0xa7, 0x4a, 0xbb, 0xe3, 0xe9, 0x24, 0xe2, 0x90, 0x36, - 0xef, 0x9b, 0x2d, 0x7c, 0x1f, 0xfe, 0x5e, 0xbd, 0x7c, 0x8f, 0x9d, 0xfe, 0xbd, 0x7f, 0xae, 0xc8, - 0x24, 0x4e, 0xae, 0x56, 0x2f, 0x7e, 0xef, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x72, 0xb0, 0xd5, - 0x84, 0xb0, 0x03, 0x00, 0x00, + // 375 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0x3d, 0x4f, 0xeb, 0x30, + 0x14, 0x8d, 0x5f, 0xa5, 0xf7, 0xfa, 0xfc, 0xfa, 0x9e, 0xf4, 0xa2, 0x0e, 0x6d, 0x55, 0xa5, 0x10, + 0x16, 0x06, 0x88, 0x55, 0x3a, 0x20, 0x2a, 0x31, 0xb4, 0x4c, 0x08, 0x75, 0xe9, 0x82, 0xc4, 0x12, + 0xa5, 0x8e, 0x71, 0x2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 0xd2, 0xb5, 0x57, 0x53, 0xa2, 0x94, + 0x3d, 0xac, 0x14, 0xc4, 0x9e, 0xef, 0x4b, 0x73, 0x1b, 0x56, 0x70, 0x6e, 0xe1, 0x5e, 0x91, 0xa4, + 0x56, 0x4a, 0x75, 0xff, 0xe0, 0xb5, 0x6d, 0xb7, 0x7c, 0x3d, 0x6b, 0x19, 0x2f, 0xb3, 0x96, 0x61, + 0x5b, 0xb0, 0xb9, 0x29, 0xd8, 0x90, 0xa8, 0x50, 0x70, 0x45, 0x0e, 0xee, 0x01, 0x2c, 0x0d, 0x14, + 0x35, 0x6f, 0x01, 0xfc, 0xff, 0x39, 0xfe, 0x91, 0xf3, 0x85, 0x7f, 0x76, 0x36, 0x19, 0x34, 0x7a, + 0xdf, 0x7e, 0x5a, 0x64, 0xeb, 0x9f, 0x3f, 0x2c, 0x2c, 0x30, 0x5f, 0x58, 0xe0, 0x79, 0x61, 0x81, + 0x9b, 0xa5, 0x65, 0xcc, 0x97, 0x96, 0xf1, 0xb8, 0xb4, 0x8c, 0x8b, 0x63, 0xca, 0xf4, 0x38, 0x1a, + 0x39, 0x58, 0x04, 0xf9, 0x8e, 0xd0, 0xda, 0x6d, 0xff, 0xfd, 0x7c, 0xe2, 0x0e, 0x9a, 0x7e, 0xbc, + 0x21, 0x9d, 0x84, 0x44, 0x8d, 0x7e, 0xa6, 0x5b, 0xeb, 0xbc, 0x05, 0x00, 0x00, 0xff, 0xff, 0x92, + 0xca, 0xcf, 0xe2, 0x74, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -249,7 +161,6 @@ 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 { AssignConsumerKey(ctx context.Context, in *MsgAssignConsumerKey, opts ...grpc.CallOption) (*MsgAssignConsumerKeyResponse, error) - RegisterConsumerRewardDenom(ctx context.Context, in *MsgRegisterConsumerRewardDenom, opts ...grpc.CallOption) (*MsgRegisterConsumerRewardDenomResponse, error) } type msgClient struct { @@ -269,19 +180,9 @@ func (c *msgClient) AssignConsumerKey(ctx context.Context, in *MsgAssignConsumer return out, nil } -func (c *msgClient) RegisterConsumerRewardDenom(ctx context.Context, in *MsgRegisterConsumerRewardDenom, opts ...grpc.CallOption) (*MsgRegisterConsumerRewardDenomResponse, error) { - out := new(MsgRegisterConsumerRewardDenomResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Msg/RegisterConsumerRewardDenom", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // MsgServer is the server API for Msg service. type MsgServer interface { AssignConsumerKey(context.Context, *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) - RegisterConsumerRewardDenom(context.Context, *MsgRegisterConsumerRewardDenom) (*MsgRegisterConsumerRewardDenomResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -291,9 +192,6 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) AssignConsumerKey(ctx context.Context, req *MsgAssignConsumerKey) (*MsgAssignConsumerKeyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AssignConsumerKey not implemented") } -func (*UnimplementedMsgServer) RegisterConsumerRewardDenom(ctx context.Context, req *MsgRegisterConsumerRewardDenom) (*MsgRegisterConsumerRewardDenomResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterConsumerRewardDenom not implemented") -} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -317,24 +215,6 @@ func _Msg_AssignConsumerKey_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } -func _Msg_RegisterConsumerRewardDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRegisterConsumerRewardDenom) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RegisterConsumerRewardDenom(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Msg/RegisterConsumerRewardDenom", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RegisterConsumerRewardDenom(ctx, req.(*MsgRegisterConsumerRewardDenom)) - } - return interceptor(ctx, in, info, handler) -} - var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "interchain_security.ccv.provider.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -343,10 +223,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "AssignConsumerKey", Handler: _Msg_AssignConsumerKey_Handler, }, - { - MethodName: "RegisterConsumerRewardDenom", - Handler: _Msg_RegisterConsumerRewardDenom_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "interchain_security/ccv/provider/v1/tx.proto", @@ -419,66 +295,6 @@ func (m *MsgAssignConsumerKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } -func (m *MsgRegisterConsumerRewardDenom) 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 *MsgRegisterConsumerRewardDenom) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterConsumerRewardDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintTx(dAtA, i, uint64(len(m.Depositor))) - i-- - dAtA[i] = 0x12 - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgRegisterConsumerRewardDenomResponse) 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 *MsgRegisterConsumerRewardDenomResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterConsumerRewardDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -520,32 +336,6 @@ func (m *MsgAssignConsumerKeyResponse) Size() (n int) { return n } -func (m *MsgRegisterConsumerRewardDenom) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Depositor) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgRegisterConsumerRewardDenomResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -748,170 +538,6 @@ func (m *MsgAssignConsumerKeyResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRegisterConsumerRewardDenom) 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 ErrIntOverflowTx - } - 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: MsgRegisterConsumerRewardDenom: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterConsumerRewardDenom: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - 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 ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Depositor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRegisterConsumerRewardDenomResponse) 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 ErrIntOverflowTx - } - 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: MsgRegisterConsumerRewardDenomResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterConsumerRewardDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/ccv/types/events.go b/x/ccv/types/events.go index 8bd3549393..82462f6530 100644 --- a/x/ccv/types/events.go +++ b/x/ccv/types/events.go @@ -2,13 +2,14 @@ package types // CCV events const ( - EventTypeTimeout = "timeout" - EventTypePacket = "ccv_packet" - EventTypeChannelEstablished = "channel_established" - EventTypeFeeTransferChannelOpened = "fee_transfer_channel_opened" - EventTypeConsumerClientCreated = "consumer_client_created" - EventTypeAssignConsumerKey = "assign_consumer_key" - EventTypeRegisterConsumerRewardDenom = "register_consumer_reward_denom" + EventTypeTimeout = "timeout" + EventTypePacket = "ccv_packet" + EventTypeChannelEstablished = "channel_established" + EventTypeFeeTransferChannelOpened = "fee_transfer_channel_opened" + EventTypeConsumerClientCreated = "consumer_client_created" + EventTypeAssignConsumerKey = "assign_consumer_key" + EventTypeAddConsumerRewardDenom = "add_consumer_reward_denom" + EventTypeRemoveConsumerRewardDenom = "remove_consumer_reward_denom" EventTypeExecuteConsumerChainSlash = "execute_consumer_chain_slash" EventTypeFeeDistribution = "fee_distribution" @@ -41,6 +42,5 @@ const ( AttributeDistributionTotal = "total" AttributeDistributionToProvider = "provider_amount" - AttributeConsumerRewardDenom = "consumer_reward_denom" - AttributeConsumerRewardDepositor = "consumer_reward_depositor" + AttributeConsumerRewardDenom = "consumer_reward_denom" ) From 1a009e75531278a1841e70a23a17c27182f89678 Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 13 Sep 2023 12:44:12 +0200 Subject: [PATCH 06/22] docs: introduce ADR on slashing on the provider chain (#1252) * initial draft of the adr * small change on intro.md to avoid huge diff * clean up * take into account Marius' comments * rewrite v0.47 Cosmos SDK link because it was returning 404 and redirecting * more cleaning up * update based on comments * removed confusing sentence on voting power * add missing ADRs in the intro file * add tokens to power conversion * add paragraph on key pruning and references to light-client attacks code * Update template title * Took into account comments. * augment pseudocode to skip redelegation/undelegation entries * fix identation issue --------- Co-authored-by: Karolos Antoniadis --- .../adrs/adr-011-improving-test-confidence.md | 2 +- .../adrs/adr-013-equivocation-slashing.md | 147 ++++++++++++++++++ docs/docs/adrs/intro.md | 5 +- 3 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 docs/docs/adrs/adr-013-equivocation-slashing.md diff --git a/docs/docs/adrs/adr-011-improving-test-confidence.md b/docs/docs/adrs/adr-011-improving-test-confidence.md index 8ba0e6e5a1..397f8f5e01 100644 --- a/docs/docs/adrs/adr-011-improving-test-confidence.md +++ b/docs/docs/adrs/adr-011-improving-test-confidence.md @@ -1,6 +1,6 @@ --- sidebar_position: 12 -title: ADR Template +title: Improving testing and increasing confidence --- # ADR 11: Improving testing and increasing confidence diff --git a/docs/docs/adrs/adr-013-equivocation-slashing.md b/docs/docs/adrs/adr-013-equivocation-slashing.md new file mode 100644 index 0000000000..1351cf5234 --- /dev/null +++ b/docs/docs/adrs/adr-013-equivocation-slashing.md @@ -0,0 +1,147 @@ +--- +sidebar_position: 14 +title: Slashing on the provider for consumer equivocation +--- +# ADR 013: Slashing on the provider for consumer equivocation + +## Changelog +* 1st Sept. 2023: Initial draft + +## Status +Proposed + +## Context +This ADR presents some approaches on how to slash on the provider chain validators that performed equivocations on consumer chains. +Currently, the provider chain can [receive and verify evidence of equivocation](https://github.com/cosmos/interchain-security/pull/1232), but it cannot slash the misbehaving validator. + +In the remainder of this section, we explain how slashing is performed on a single chain and show why slashing on the provider for equivocation on the consumer is challenging. + +Note that future versions of the Cosmos SDK, CometBFT, and ibc-go could modify the way we slash, etc. Therefore, a future reader of this ADR, should note that when we refer to Cosmos SDK, CometBFT, and ibc-go we specifically refer to their [v0.47](https://docs.cosmos.network/v0.47/intro/overview), [v0.37](https://docs.cometbft.com/v0.37/) and [v7.3.0](https://github.com/cosmos/ibc-go/blob/v7.3.0) versions respectively. + +### Single-chain slashing +Slashing is implemented across the [slashing](https://docs.cosmos.network/v0.47/modules/slashing) +and [staking](https://docs.cosmos.network/v0.47/modules/staking) modules. +The slashing module's keeper calls the staking module's `Slash()` method, passing among others, the `infractionHeight` (i.e., the height when the equivocation occurred), the validator's `power` at the infraction height, and the `slashFactor` (currently set to `5%` in case of equivocation on the Cosmos Hub). + +#### Slashing undelegations and redelegations +To slash undelegations, `Slash` goes through all undelegations and checks whether they started before or after the infraction occurred. If an undelegation started before the `infractionHeight`, then it is **not** slashed, otherwise it is slashed by `slashFactor`. + +The slashing of redelegations happens in a similar way, meaning that `Slash` goes through all redelegations and checks whether the redelegations started before or after the `infractionHeight`. + +#### Slashing delegations +Besides undelegations and redelegations, the validator's delegations need to also be slashed. +This is performed by deducting the appropriate amount of tokens from the validator. Note that this deduction is computed based on the voting `power` the misbehaving validator had at the height of the equivocation. As a result of the tokens deduction, +the [tokens per share](https://docs.cosmos.network/v0.47/modules/staking#delegator-shares) +reduce and hence later on, when delegators undelegate or redelegate, the delegators retrieve back less +tokens, effectively having their tokens slashed. The rationale behind this slashing mechanism, as mentioned in the [Cosmos SDK documentation](https://docs.cosmos.network/v0.47/modules/staking#delegator-shares) +> [...] is to simplify the accounting around slashing. Rather than iteratively slashing the tokens of every delegation entry, instead the Validators total bonded tokens can be slashed, effectively reducing the value of each issued delegator share. + +This approach of slashing delegations does not utilize the +`infractionHeight` in any way and hence the following scenario could occur: + 1. a validator `V` performs an equivocation at a height `Hi` + 2. a new delegator `D` delegates to `V` after height `Hi` + 3. evidence of the equivocation by validator `V` is received + 4. the tokens of delegator `D` are slashed + +In the above scenario, delegator `D` is slashed, even though `D`'s voting power did not contribute to the infraction. + + +#### Old evidence +In the single-chain case, old evidence (e.g., from 3 years ago) is ignored. This is achieved through +[CometBFT](https://docs.cometbft.com/v0.37/spec/consensus/evidence) that ignores old evidence based on the parameters `MaxAgeNumBlocks` and `MaxAgeDuration` (see [here](https://github.com/cometbft/cometbft/blob/v0.37.0/evidence/pool.go#271)). +Additionally, note that when the evidence is sent by CometBFT to the application, the evidence is rechecked in the [evidence module](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0/x/evidence/keeper/infraction.go#L54) of Cosmos SDK and if it is old, the evidence is ignored. +In Cosmos Hub, the `MaxAgeNumBlocks` is set to 1000000 (i.e., ~70 days if we assume we need ~6 sec per block) and `MaxAgeDuration` is set to 172800000000000 ns (i.e., 2 days). Because of this check, we can easily exclude old evidence. + +### Slashing for equivocation on the consumer +In the single-chain case, slashing requires both the `infractionHeight` and the voting `power`. +In order to slash on the provider for an equivocation on a consumer, we need to have both the provider's `infractionHeight` and voting `power`. +Note that the `infractionHeight` on the consumer chain must be mapped to a height on the provider chain. +Unless we have a way to find the corresponding `infractionHeight` and `power` on the provider chain, we cannot slash for equivocation on the consumer in the same way as we would slash in the single-chain case. + + +The challenge of figuring out the corresponding `infractionHeight` and `power` values on the provider chain is due to the following trust assumption: + +- We trust the consensus layer and validator set of the consumer chains, _but we do not trust the application layer_. + +As a result, we cannot trust anything that stems from the _application state_ of a consumer chain. + +Note that when a relayer or a user sends evidence through a [MsgSubmitConsumerDoubleVoting](https://github.com/cosmos/interchain-security/pull/1232) message, the provider gets access to [DuplicateVoteEvidence](https://github.com/cometbft/cometbft/blob/v0.37.0/types/evidence.go#L35): +```protobuf +type DuplicateVoteEvidence struct { + VoteA *Vote `json:"vote_a"` + VoteB *Vote `json:"vote_b"` + + // abci specific information + TotalVotingPower int64 + ValidatorPower int64 + Timestamp time.Time +} +``` +The "abci specific information" fields cannot be trusted because they are not signed. Therefore, +we can use neither `ValidatorPower` for slashing on the provider chain, nor the `Timestamp` to check the evidence age. We can get the `infractionHeight` from the votes, but this `infractionHeight` corresponds to the infraction height on the consumer and **not** on the provider chain. +Similarly, when a relayer or a user sends evidence through a [MsgSubmitConsumerMisbehaviour](https://github.com/cosmos/interchain-security/pull/826) message, the provider gets access to [Misbehaviour](https://github.com/cosmos/ibc-go/blob/v7.3.0/proto/ibc/lightclients/tendermint/v1/tendermint.proto#L79) that we cannot use to extract the infraction height, power, or the time on the provider chain. + +## Proposed solution +As a first iteration, we propose the following approach. At the moment the provider receives evidence of equivocation on a consumer: +1. slash all the undelegations and redelegations using `slashFactor`; +2. slash all delegations using as voting `power` the sum of the voting power of the misbehaving validator and the power of all the ongoing undelegations and redelegations. + +**Evidence expiration:** Additionally, because we cannot infer the actual time of the evidence (i.e., the timestamp of the evidence cannot be trusted), we do not consider _evidence expiration_ and hence old evidence is never ignored (e.g., the provider would act on 3 year-old evidence of equivocation on a consumer). +Additionally, we do not need to store equivocation evidence to avoid slashing a validator more than once, because we [do not slash](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0/x/evidence/keeper/infraction.go#L94) tombstoned validators and we [tombstone](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0/x/evidence/keeper/infraction.go#L138) a validator when slashed. + +We do not act on evidence that was signed by a validator [consensus key](https://tutorials.cosmos.network/tutorials/9-path-to-prod/3-keys.html#what-validator-keys) that is _pruned_ when we receive the evidence. We prune a validator's consensus key if the validator has assigned a new consumer key (using `MsgAssignConsumerKey`) and an unbonding period on the consumer chain has elapsed (see [key assignment ADR](https://github.com/cosmos/interchain-security/blob/main/docs/docs/adrs/adr-001-key-assignment.md)). Note that the provider chain is informed that the unbonding period has elapsed on the consumer when the provider receives a `VSCMaturedPacket` and because of this, if the consumer delays the sending of a `VSCMaturedPacket`, we would delay the pruning of the key as well. + +### Implementation +The following logic needs to be added to the [HandleConsumerDoubleVoting](https://github.com/cosmos/interchain-security/pull/1232) and [HandleConsumerMisbehaviour](https://github.com/cosmos/interchain-security/pull/826) methods: +```go +undelegationsInTokens := sdk.NewInt(0) +for _, v := range k.stakingKeeper.GetUnbondingDelegationsFromValidator(ctx, validatorAddress) { + for _, entry := range v.Entries { + if entry.IsMature(now) && !entry.OnHold() { + // undelegation no longer eligible for slashing, skip it + continue + } + undelegationsInTokens = undelegationsInTokens.Add(entry.InitialBalance) + } +} + +redelegationsInTokens := sdk.NewInt(0) +for _, v := range k.stakingKeeper.GetRedelegationsFromSrcValidator(ctx, validatorAddress) { + for _, entry := range v.Entries { + if entry.IsMature(now) && !entry.OnHold() { + // redelegation no longer eligible for slashing, skip it + continue + } + redelegationsInTokens = redelegationsInTokens.Add(entry.InitialBalance) + } +} + +infractionHeight := 0 +undelegationsAndRedelegationsInPower = sdk.TokensToConsensusPower(undelegationsInTokens.Add(redelegationsInTokens)) +totalPower := validator's voting power + undelegationsAndRedelegationsInPower +slashFraction := k.slashingKeeper.SlashFractionDoubleSign(ctx) + +k.stakingKeeper.Slash(ctx, validatorConsAddress, infractionHeight, totalPower, slashFraction, DoubleSign) +``` + +**Infraction height:** We provide a zero `infractionHeight` to the [Slash](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0/x/staking/keeper/slash.go#L33) method in order to slash all ongoing undelegations and redelegations (see checks in [Slash](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0/x/staking/keeper/slash.go#L92), [SlashUnbondingDelegation](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0/x/staking/keeper/slash.go#L195), and [SlashRedelegation](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0/x/staking/keeper/slash.go#L249)). + +**Power:** We pass the sum of the voting power of the misbehaving validator when the evidence was received (i.e., at evidence height) and the power of all the ongoing undelegations and redelegations. +If we assume that the `slashFactor` is `5%`, then the voting power we pass is `power + totalPower(undelegations) + totalPower(redelegations)`. +Hence, when the `Slash` method slashes all the undelegations and redelegations it would end up with `0.05 * power + 0.05 * totalPower(undelegations) + 0.05 * totalPower(redelegations) - 0.05 * totalPower(undelegations) - 0.05 * totalPower(redelegations) = 0.05 * power` and hence it would slash `5%` of the validator's power when the evidence is received. + +### Positive +With the proposed approach we can quickly implement slashing functionality on the provider chain for consumer chain equivocations. +This approach does not need to change the staking module and therefore does not change in any way how slashing is performed today for a single chain. + +### Negative + +- We _definitely_ slash more when it comes to undelegations and redelegations because we slash for all of them without considering an `infractionHeight`. +- We _potentially_ slash more than what we would have slashed if we knew the voting `power` at the corresponding `infractionHeight` in the provider chain. +- We slash on old evidence of equivocation on a consumer. + + +## References +* [ADR 005: Cryptographic verification of equivocation evidence](https://github.com/cosmos/interchain-security/blob/main/docs/docs/adrs/adr-005-cryptographic-equivocation-verification.md) +* [EPIC tracking cryptographic equivocation feature](https://github.com/cosmos/interchain-security/issues/732) +* [Cosmos Hub Forum discussion on cryptographic equivocation slashing](https://forum.cosmos.network/t/cryptographic-equivocation-slashing-design/11400) diff --git a/docs/docs/adrs/intro.md b/docs/docs/adrs/intro.md index 0c1c722366..5ab86c2a93 100644 --- a/docs/docs/adrs/intro.md +++ b/docs/docs/adrs/intro.md @@ -40,4 +40,7 @@ To suggest an ADR, please make use of the [ADR template](./adr-template.md) prov | [007](./adr-007-pause-unbonding-on-eqv-prop.md) | Pause validator unbonding during equivocation proposal | Proposed | | [008](./adr-008-throttle-retries.md) | Throttle with retries | Accepted, In-progress | | [009](./adr-009-soft-opt-out.md) | Soft Opt-out | Accepted, Implemented | -| [009](./adr-010-standalone-changeover.md) | Standalone to Consumer Changeover | Accepted, Implemented | +| [010](./adr-010-standalone-changeover.md) | Standalone to Consumer Changeover | Accepted, Implemented | +| [011](./adr-011-improving-test-confidence.md) | Improving testing and increasing confidence | Proposed | +| [012](./adr-012-separate-releasing.md) | Separate Releasing | Proposed | +| [013](./adr-013-equivocation-slashing.md) | Slashing on the provider for consumer equivocation | Proposed | From f23cbbb7883eb6c95330db81441cdb6de5b2027c Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Thu, 14 Sep 2023 00:53:05 -0700 Subject: [PATCH 07/22] ci: update mergify and dependabot for v3.2.x-consumer (#1297) * update ymls * add newline --------- Co-authored-by: mpoke --- .github/dependabot.yml | 10 ++++++++++ .mergify.yml | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 404825428c..e197c1eab2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -67,3 +67,13 @@ updates: open-pull-requests-limit: 0 labels: - dependencies + + - package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + target-branch: "release/v3.2.x-consumer" + # Only allow automated security-related dependency updates on release branches. + open-pull-requests-limit: 0 + labels: + - dependencies diff --git a/.mergify.yml b/.mergify.yml index 226075ed45..9b6159b9f8 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -50,3 +50,11 @@ pull_request_rules: backport: branches: - release/v3.1.x + - name: Backport patches to the release/v3.2.x-consumer branch + conditions: + - base=main + - label=A:backport/v3.2.x-consumer + actions: + backport: + branches: + - release/v3.2.x-consumer From b3b7818dafe9e74f556a674b0d013a777e66e825 Mon Sep 17 00:00:00 2001 From: Marius Poke Date: Thu, 14 Sep 2023 19:59:36 +0200 Subject: [PATCH 08/22] ci: update bots for v2.1.x-provider-lsm (#1305) update bots for v2.1.x-provider-lsm --- .github/dependabot.yml | 2 +- .mergify.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e197c1eab2..773e5a783f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -42,7 +42,7 @@ updates: directory: "/" schedule: interval: daily - target-branch: "release/v2.1.x-lsm" + target-branch: "release/v2.1.x-provider-lsm" # Only allow automated security-related dependency updates on release branches. open-pull-requests-limit: 0 labels: diff --git a/.mergify.yml b/.mergify.yml index 9b6159b9f8..00764d0a8c 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -26,14 +26,14 @@ pull_request_rules: backport: branches: - release/v2.0.x-lsm - - name: Backport patches to the release/v2.1.x-lsm branch + - name: Backport patches to the release/v2.1.x-provider-lsm branch conditions: - base=main - - label=A:backport/v2.1.x-lsm + - label=A:backport/v2.1.x-provider-lsm actions: backport: branches: - - release/v2.1.x-lsm + - release/v2.1.x-provider-lsm - name: Backport patches to the release/v3.0.x branch conditions: - base=main From d064649b53e143ed3347b310291ecb05dd8679c5 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Fri, 15 Sep 2023 09:05:39 +0200 Subject: [PATCH 09/22] Fix `build` in makefile (#1303) fix build in makefile --- .gitignore | 1 + Makefile | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index a0a3488545..e83a69a504 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ release/ docs/tla/states/ *.out vendor/ +build/ .vscode .idea diff --git a/Makefile b/Makefile index ac7c38f068..a65db076ab 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,8 @@ mockgen_cmd=go run github.com/golang/mock/mockgen mocks: $(mockgen_cmd) -package=keeper -destination=testutil/keeper/mocks.go -source=x/ccv/types/expected_keepers.go + +BUILDDIR ?= $(CURDIR)/build BUILD_TARGETS := build build: BUILD_ARGS=-o $(BUILDDIR)/ From df12b7e6d6d58ea21ba584e66bbcf8350e9c22cf Mon Sep 17 00:00:00 2001 From: bernd-m <43466467+bermuell@users.noreply.github.com> Date: Fri, 15 Sep 2023 17:25:44 +0200 Subject: [PATCH 10/22] refactor: Vaguely named consumer structs (#1288) * Rename GenesisState proto * make proto-gen * proto rename: Params -> ConsumerParams * make proto-gen * App, fix type change for Param renaming * App, fix type change for GenesisState renaming * Fix unit-tests for GenesisState renaming * Fix unit-tests for Params renaming * Addressed review comments * Fix linter issues --- app/consumer-democracy/app.go | 2 +- .../ccv/consumer/v1/query.proto | 2 +- .../ccv/provider/v1/genesis.proto | 2 +- .../ccv/provider/v1/query.proto | 2 +- .../ccv/v1/shared_consumer.proto | 15 +- tests/difference/core/driver/setup.go | 6 +- tests/integration/setup.go | 2 +- testutil/ibc_testing/specific_setup.go | 4 +- x/ccv/consumer/keeper/genesis.go | 12 +- x/ccv/consumer/keeper/genesis_test.go | 22 +- x/ccv/consumer/keeper/keeper.go | 4 +- x/ccv/consumer/keeper/params.go | 4 +- x/ccv/consumer/module.go | 6 +- x/ccv/consumer/types/genesis_test.go | 70 ++-- x/ccv/consumer/types/params_test.go | 2 +- x/ccv/consumer/types/query.pb.go | 93 +++--- x/ccv/provider/keeper/genesis_test.go | 6 +- x/ccv/provider/keeper/keeper.go | 8 +- x/ccv/provider/keeper/key_assignment_test.go | 1 + x/ccv/provider/keeper/proposal.go | 4 +- x/ccv/provider/keeper/proposal_test.go | 2 +- x/ccv/provider/types/consumer.go | 2 +- x/ccv/provider/types/genesis.pb.go | 125 ++++--- x/ccv/provider/types/genesis_test.go | 6 +- x/ccv/provider/types/query.pb.go | 174 +++++----- x/ccv/types/genesis.go | 28 +- x/ccv/types/params.go | 12 +- x/ccv/types/shared_consumer.pb.go | 310 +++++++++--------- 28 files changed, 460 insertions(+), 466 deletions(-) diff --git a/app/consumer-democracy/app.go b/app/consumer-democracy/app.go index 1a35a89a8a..09b13520ae 100644 --- a/app/consumer-democracy/app.go +++ b/app/consumer-democracy/app.go @@ -713,7 +713,7 @@ func New( return fromVM, fmt.Errorf("failed to unmarshal genesis state: %w", err) } - consumerGenesis := ccvtypes.GenesisState{} + consumerGenesis := ccvtypes.ConsumerGenesisState{} appCodec.MustUnmarshalJSON(appState[consumertypes.ModuleName], &consumerGenesis) consumerGenesis.PreCCV = true diff --git a/proto/interchain_security/ccv/consumer/v1/query.proto b/proto/interchain_security/ccv/consumer/v1/query.proto index ff2a5901fe..b21e07341a 100644 --- a/proto/interchain_security/ccv/consumer/v1/query.proto +++ b/proto/interchain_security/ccv/consumer/v1/query.proto @@ -55,7 +55,7 @@ message QueryParamsRequest {} // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { // params holds all the parameters of this module. - interchain_security.ccv.v1.Params params = 1 [ (gogoproto.nullable) = false ]; + interchain_security.ccv.v1.ConsumerParams params = 1 [ (gogoproto.nullable) = false ]; } message QueryProviderInfoRequest {} diff --git a/proto/interchain_security/ccv/provider/v1/genesis.proto b/proto/interchain_security/ccv/provider/v1/genesis.proto index 22da5c4200..9cefe26ee0 100644 --- a/proto/interchain_security/ccv/provider/v1/genesis.proto +++ b/proto/interchain_security/ccv/provider/v1/genesis.proto @@ -64,7 +64,7 @@ message ConsumerState { // InitalHeight defines the initial block height for the consumer chain uint64 initial_height = 4; // ConsumerGenesis defines the initial consumer chain genesis states - interchain_security.ccv.v1.GenesisState consumer_genesis = 5 + interchain_security.ccv.v1.ConsumerGenesisState consumer_genesis = 5 [ (gogoproto.nullable) = false ]; // PendingValsetChanges defines the pending validator set changes for the // consumer chain diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index b0c1dc2b47..6dfcdcb320 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -86,7 +86,7 @@ service Query { message QueryConsumerGenesisRequest { string chain_id = 1; } message QueryConsumerGenesisResponse { - interchain_security.ccv.v1.GenesisState genesis_state = 1 + interchain_security.ccv.v1.ConsumerGenesisState genesis_state = 1 [ (gogoproto.nullable) = false ]; } diff --git a/proto/interchain_security/ccv/v1/shared_consumer.proto b/proto/interchain_security/ccv/v1/shared_consumer.proto index 825a84e346..4a44548ea3 100644 --- a/proto/interchain_security/ccv/v1/shared_consumer.proto +++ b/proto/interchain_security/ccv/v1/shared_consumer.proto @@ -17,13 +17,12 @@ import "google/protobuf/timestamp.proto"; // but not sent over the wire. These schemas could change, only with careful consideration of effects! // -// Params defines the parameters for CCV consumer module. +// ConsumerParams defines the parameters for CCV consumer module. // // Note this type is referenced in both the consumer and provider CCV modules, // and persisted on the provider, see MakeConsumerGenesis and SetConsumerGenesis. // -// TODO: Rename to ConsumerParams. See https://github.com/cosmos/interchain-security/issues/1206 -message Params { +message ConsumerParams { // TODO: Remove enabled flag and find a better way to setup integration tests // See: https://github.com/cosmos/interchain-security/issues/339 bool enabled = 1; @@ -79,19 +78,17 @@ message Params { repeated string provider_reward_denoms = 12; } -// GenesisState defines the CCV consumer chain genesis state. +// ConsumerGenesisState defines the CCV consumer chain genesis state. // // Note this type is referenced in both the consumer and provider CCV modules, // and persisted on the provider, see MakeConsumerGenesis and SetConsumerGenesis. -// -// TODO: Rename to ConsumerGenesisState. See https://github.com/cosmos/interchain-security/issues/1206 -message GenesisState { - Params params = 1 [ (gogoproto.nullable) = false ]; +message ConsumerGenesisState { + ConsumerParams params = 1 [ (gogoproto.nullable) = false ]; string provider_client_id = 2; // empty for a new chain, filled in on restart. string provider_channel_id = 3; // empty for a new chain, filled in on restart. bool new_chain = - 4; // true for new chain GenesisState, false for chain restart. + 4; // true for new chain, false for chain restart. // ProviderClientState filled in on new chain, nil on restart. ibc.lightclients.tendermint.v1.ClientState provider_client_state = 5; // ProviderConsensusState filled in on new chain, nil on restart. diff --git a/tests/difference/core/driver/setup.go b/tests/difference/core/driver/setup.go index 2a4b17eddf..c1d1c272ff 100644 --- a/tests/difference/core/driver/setup.go +++ b/tests/difference/core/driver/setup.go @@ -207,7 +207,7 @@ func (b *Builder) getAppBytesAndSenders( bondDenom := sdk.DefaultBondDenom genesisStaking := stakingtypes.GenesisState{} - genesisConsumer := ccv.GenesisState{} + genesisConsumer := ccv.ConsumerGenesisState{} if genesis[stakingtypes.ModuleName] != nil { // If staking module genesis already exists @@ -522,7 +522,7 @@ func (b *Builder) createConsumersLocalClientGenesis() *ibctmtypes.ClientState { ) } -func (b *Builder) createConsumerGenesis(client *ibctmtypes.ClientState) *ccv.GenesisState { +func (b *Builder) createConsumerGenesis(client *ibctmtypes.ClientState) *ccv.ConsumerGenesisState { providerConsState := b.provider().LastHeader.ConsensusState() valUpdates := tmtypes.TM2PB.ValidatorUpdates(b.provider().Vals) @@ -540,7 +540,7 @@ func (b *Builder) createConsumerGenesis(client *ibctmtypes.ClientState) *ccv.Gen []string{}, []string{}, ) - return ccv.NewInitialGenesisState(client, providerConsState, valUpdates, params) + return ccv.NewInitialConsumerGenesisState(client, providerConsState, valUpdates, params) } // The state of the data returned is equivalent to the state of two chains diff --git a/tests/integration/setup.go b/tests/integration/setup.go index 76f6311dab..8db75519c0 100644 --- a/tests/integration/setup.go +++ b/tests/integration/setup.go @@ -182,7 +182,7 @@ func (s *CCVTestSuite) getSentPacket(chain *ibctesting.TestChain, sequence uint6 func initConsumerChain( s *CCVTestSuite, chainID string, - genesisState *ccv.GenesisState, + genesisState *ccv.ConsumerGenesisState, ) { providerKeeper := s.providerApp.GetProviderKeeper() bundle := s.consumerBundles[chainID] diff --git a/testutil/ibc_testing/specific_setup.go b/testutil/ibc_testing/specific_setup.go index 8ac559d740..1c5529e22a 100644 --- a/testutil/ibc_testing/specific_setup.go +++ b/testutil/ibc_testing/specific_setup.go @@ -51,7 +51,7 @@ func ConsumerAppIniter(initValPowers []types.ValidatorUpdate) AppIniter { }, ) // Feed consumer genesis with provider validators - var consumerGenesis ccvtypes.GenesisState + var consumerGenesis ccvtypes.ConsumerGenesisState encoding.Codec.MustUnmarshalJSON(genesisState[consumertypes.ModuleName], &consumerGenesis) consumerGenesis.InitialValSet = initValPowers consumerGenesis.Params.Enabled = true @@ -69,7 +69,7 @@ func DemocracyConsumerAppIniter(initValPowers []types.ValidatorUpdate) AppIniter genesisState := appConsumerDemocracy.NewDefaultGenesisState(encoding.Codec) // Feed consumer genesis with provider validators // TODO See if useful for democracy - var consumerGenesis ccvtypes.GenesisState + var consumerGenesis ccvtypes.ConsumerGenesisState encoding.Codec.MustUnmarshalJSON(genesisState[consumertypes.ModuleName], &consumerGenesis) consumerGenesis.InitialValSet = initValPowers consumerGenesis.Params.Enabled = true diff --git a/x/ccv/consumer/keeper/genesis.go b/x/ccv/consumer/keeper/genesis.go index 2ac38f650c..f20d8849dc 100644 --- a/x/ccv/consumer/keeper/genesis.go +++ b/x/ccv/consumer/keeper/genesis.go @@ -16,7 +16,7 @@ import ( // 1. A client to the provider was never created, i.e. a new consumer chain is started for the first time. // 2. A consumer chain restarts after a client to the provider was created, but the CCV channel handshake is still in progress // 3. A consumer chain restarts after the CCV channel handshake was completed. -func (k Keeper) InitGenesis(ctx sdk.Context, state *ccv.GenesisState) []abci.ValidatorUpdate { +func (k Keeper) InitGenesis(ctx sdk.Context, state *ccv.ConsumerGenesisState) []abci.ValidatorUpdate { // PreCCV is true during the process of a standalone to consumer changeover. // At the PreCCV point in the process, the standalone chain has just been upgraded to include // the consumer ccv module, but the standalone staking keeper is still managing the validator set. @@ -115,10 +115,10 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state *ccv.GenesisState) []abci.Val } // ExportGenesis returns the CCV consumer module's exported genesis -func (k Keeper) ExportGenesis(ctx sdk.Context) (genesis *ccv.GenesisState) { +func (k Keeper) ExportGenesis(ctx sdk.Context) (genesis *ccv.ConsumerGenesisState) { params := k.GetConsumerParams(ctx) if !params.Enabled { - return ccv.DefaultGenesisState() + return ccv.DefaultConsumerGenesisState() } // export the current validator set @@ -137,7 +137,7 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) (genesis *ccv.GenesisState) { panic("provider client does not exist although provider channel does exist") } - genesis = ccv.NewRestartGenesisState( + genesis = ccv.NewRestartConsumerGenesisState( clientID, channelID, k.GetAllPacketMaturityTimes(ctx), @@ -153,11 +153,11 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) (genesis *ccv.GenesisState) { // if provider clientID and channelID don't exist on the consumer chain, // then CCV protocol is disabled for this chain return a default genesis state if !ok { - return ccv.DefaultGenesisState() + return ccv.DefaultConsumerGenesisState() } // export client states and pending slashing requests into a new chain genesis - genesis = ccv.NewRestartGenesisState( + genesis = ccv.NewRestartConsumerGenesisState( clientID, "", nil, diff --git a/x/ccv/consumer/keeper/genesis_test.go b/x/ccv/consumer/keeper/genesis_test.go index 9cb489b3c0..a07388a6cb 100644 --- a/x/ccv/consumer/keeper/genesis_test.go +++ b/x/ccv/consumer/keeper/genesis_test.go @@ -100,8 +100,8 @@ func TestInitGenesis(t *testing.T) { testCases := []struct { name string malleate func(sdk.Context, testkeeper.MockedKeepers) - genesis *ccv.GenesisState - assertStates func(sdk.Context, consumerkeeper.Keeper, *ccv.GenesisState) + genesis *ccv.ConsumerGenesisState + assertStates func(sdk.Context, consumerkeeper.Keeper, *ccv.ConsumerGenesisState) }{ { "start a new chain", @@ -112,13 +112,13 @@ func TestInitGenesis(t *testing.T) { testkeeper.ExpectGetCapabilityMock(ctx, mocks, 1), ) }, - ccv.NewInitialGenesisState( + ccv.NewInitialConsumerGenesisState( provClientState, provConsState, valset, params, ), - func(ctx sdk.Context, ck consumerkeeper.Keeper, gs *ccv.GenesisState) { + func(ctx sdk.Context, ck consumerkeeper.Keeper, gs *ccv.ConsumerGenesisState) { assertConsumerPortIsBound(t, ctx, &ck) assertProviderClientID(t, ctx, &ck, provClientID) @@ -134,7 +134,7 @@ func TestInitGenesis(t *testing.T) { testkeeper.ExpectGetCapabilityMock(ctx, mocks, 2), ) }, - ccv.NewRestartGenesisState( + ccv.NewRestartConsumerGenesisState( provClientID, "", matPackets, @@ -145,7 +145,7 @@ func TestInitGenesis(t *testing.T) { ccv.LastTransmissionBlockHeight{}, params, ), - func(ctx sdk.Context, ck consumerkeeper.Keeper, gs *ccv.GenesisState) { + func(ctx sdk.Context, ck consumerkeeper.Keeper, gs *ccv.ConsumerGenesisState) { assertConsumerPortIsBound(t, ctx, &ck) obtainedPendingPackets := ck.GetPendingPackets(ctx) @@ -170,7 +170,7 @@ func TestInitGenesis(t *testing.T) { ) }, // create a genesis for a restarted chain - ccv.NewRestartGenesisState( + ccv.NewRestartConsumerGenesisState( provClientID, provChannelID, matPackets, @@ -183,7 +183,7 @@ func TestInitGenesis(t *testing.T) { ccv.LastTransmissionBlockHeight{Height: int64(100)}, params, ), - func(ctx sdk.Context, ck consumerkeeper.Keeper, gs *ccv.GenesisState) { + func(ctx sdk.Context, ck consumerkeeper.Keeper, gs *ccv.ConsumerGenesisState) { assertConsumerPortIsBound(t, ctx, &ck) gotChannelID, ok := ck.GetProviderChannel(ctx) @@ -289,7 +289,7 @@ func TestExportGenesis(t *testing.T) { testCases := []struct { name string malleate func(sdk.Context, consumerkeeper.Keeper, testkeeper.MockedKeepers) - expGenesis *ccv.GenesisState + expGenesis *ccv.ConsumerGenesisState }{ { "export a chain without an established CCV channel", @@ -307,7 +307,7 @@ func TestExportGenesis(t *testing.T) { ck.SetHeightValsetUpdateID(ctx, defaultHeightValsetUpdateIDs[0].Height, defaultHeightValsetUpdateIDs[0].ValsetUpdateId) }, - ccv.NewRestartGenesisState( + ccv.NewRestartConsumerGenesisState( provClientID, "", nil, @@ -343,7 +343,7 @@ func TestExportGenesis(t *testing.T) { ck.SetOutstandingDowntime(ctx, sdk.ConsAddress(validator.Address.Bytes())) ck.SetLastTransmissionBlockHeight(ctx, ltbh) }, - ccv.NewRestartGenesisState( + ccv.NewRestartConsumerGenesisState( provClientID, provChannelID, matPackets, diff --git a/x/ccv/consumer/keeper/keeper.go b/x/ccv/consumer/keeper/keeper.go index 2d3e78e0f8..b84f3d1864 100644 --- a/x/ccv/consumer/keeper/keeper.go +++ b/x/ccv/consumer/keeper/keeper.go @@ -309,7 +309,7 @@ func (k Keeper) DeletePreCCV(ctx sdk.Context) { func (k Keeper) SetInitialValSet(ctx sdk.Context, initialValSet []tmtypes.ValidatorUpdate) { store := ctx.KVStore(k.storeKey) - initialValSetState := ccv.GenesisState{ + initialValSetState := ccv.ConsumerGenesisState{ InitialValSet: initialValSet, } bz := k.cdc.MustMarshal(&initialValSetState) @@ -318,7 +318,7 @@ func (k Keeper) SetInitialValSet(ctx sdk.Context, initialValSet []tmtypes.Valida func (k Keeper) GetInitialValSet(ctx sdk.Context) []tmtypes.ValidatorUpdate { store := ctx.KVStore(k.storeKey) - initialValSet := ccv.GenesisState{} + initialValSet := ccv.ConsumerGenesisState{} bz := store.Get(types.InitialValSetKey()) if bz != nil { k.cdc.MustUnmarshal(bz, &initialValSet) diff --git a/x/ccv/consumer/keeper/params.go b/x/ccv/consumer/keeper/params.go index 770edf229e..12524fe3d2 100644 --- a/x/ccv/consumer/keeper/params.go +++ b/x/ccv/consumer/keeper/params.go @@ -11,7 +11,7 @@ import ( // GetParams returns the params for the consumer ccv module // NOTE: it is different from the GetParams method which is required to implement StakingKeeper interface -func (k Keeper) GetConsumerParams(ctx sdk.Context) ccvtypes.Params { +func (k Keeper) GetConsumerParams(ctx sdk.Context) ccvtypes.ConsumerParams { return ccvtypes.NewParams( k.GetEnabled(ctx), k.GetBlocksPerDistributionTransmission(ctx), @@ -29,7 +29,7 @@ func (k Keeper) GetConsumerParams(ctx sdk.Context) ccvtypes.Params { } // SetParams sets the paramset for the consumer module -func (k Keeper) SetParams(ctx sdk.Context, params ccvtypes.Params) { +func (k Keeper) SetParams(ctx sdk.Context, params ccvtypes.ConsumerParams) { k.paramStore.SetParamSet(ctx, ¶ms) } diff --git a/x/ccv/consumer/module.go b/x/ccv/consumer/module.go index a9f4a4fc7e..e175205530 100644 --- a/x/ccv/consumer/module.go +++ b/x/ccv/consumer/module.go @@ -52,12 +52,12 @@ func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) // DefaultGenesis returns default genesis state as raw bytes for the ibc // consumer module. func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(ccvtypes.DefaultGenesisState()) + return cdc.MustMarshalJSON(ccvtypes.DefaultConsumerGenesisState()) } // ValidateGenesis performs genesis state validation for the ibc consumer module. func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { - var data ccvtypes.GenesisState + var data ccvtypes.ConsumerGenesisState if err := cdc.UnmarshalJSON(bz, &data); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", consumertypes.ModuleName, err) } @@ -112,7 +112,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // InitGenesis performs genesis initialization for the consumer module. It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { - var genesisState ccvtypes.GenesisState + var genesisState ccvtypes.ConsumerGenesisState cdc.MustUnmarshalJSON(data, &genesisState) return am.keeper.InitGenesis(ctx, &genesisState) } diff --git a/x/ccv/consumer/types/genesis_test.go b/x/ccv/consumer/types/genesis_test.go index 453a3aab20..d543c4df21 100644 --- a/x/ccv/consumer/types/genesis_test.go +++ b/x/ccv/consumer/types/genesis_test.go @@ -52,39 +52,39 @@ func TestValidateInitialGenesisState(t *testing.T) { cases := []struct { name string - gs *types.GenesisState + gs *types.ConsumerGenesisState expError bool }{ { "valid new consumer genesis state", - types.NewInitialGenesisState(cs, consensusState, valUpdates, params), + types.NewInitialConsumerGenesisState(cs, consensusState, valUpdates, params), false, }, { "invalid new consumer genesis state: nil client state", - types.NewInitialGenesisState(nil, consensusState, valUpdates, params), + types.NewInitialConsumerGenesisState(nil, consensusState, valUpdates, params), true, }, { "invalid new consumer genesis state: invalid client state", - types.NewInitialGenesisState(&ibctmtypes.ClientState{ChainId: "badClientState"}, + types.NewInitialConsumerGenesisState(&ibctmtypes.ClientState{ChainId: "badClientState"}, consensusState, valUpdates, params), true, }, { "invalid new consumer genesis state: nil consensus state", - types.NewInitialGenesisState(cs, nil, valUpdates, params), + types.NewInitialConsumerGenesisState(cs, nil, valUpdates, params), true, }, { "invalid new consumer genesis state: invalid consensus state", - types.NewInitialGenesisState(cs, &ibctmtypes.ConsensusState{Timestamp: time.Now()}, + types.NewInitialConsumerGenesisState(cs, &ibctmtypes.ConsensusState{Timestamp: time.Now()}, valUpdates, params), true, }, { "invalid new consumer genesis state: client id not empty", - &types.GenesisState{ + &types.ConsumerGenesisState{ Params: params, ProviderClientId: "ccvclient", ProviderChannelId: "", @@ -103,7 +103,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: channel id not empty", - &types.GenesisState{ + &types.ConsumerGenesisState{ Params: params, ProviderClientId: "", ProviderChannelId: "ccvchannel", @@ -122,7 +122,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: non-empty unbonding sequences", - &types.GenesisState{ + &types.ConsumerGenesisState{ Params: params, ProviderClientId: "", ProviderChannelId: "", @@ -141,7 +141,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: non-empty last transmission packet", - &types.GenesisState{ + &types.ConsumerGenesisState{ Params: params, ProviderClientId: "", ProviderChannelId: "", @@ -160,7 +160,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: non-empty pending consumer packets", - &types.GenesisState{ + &types.ConsumerGenesisState{ Params: params, ProviderClientId: "", ProviderChannelId: "", @@ -179,12 +179,12 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: nil initial validator set", - types.NewInitialGenesisState(cs, consensusState, nil, params), + types.NewInitialConsumerGenesisState(cs, consensusState, nil, params), true, }, { "invalid new consumer genesis state: invalid consensus state validator set hash", - types.NewInitialGenesisState( + types.NewInitialConsumerGenesisState( cs, ibctmtypes.NewConsensusState( time.Now(), commitmenttypes.NewMerkleRoot([]byte("apphash")), []byte("wrong_length_hash")), valUpdates, params), @@ -192,7 +192,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: initial validator set does not match validator set hash", - types.NewInitialGenesisState( + types.NewInitialConsumerGenesisState( cs, ibctmtypes.NewConsensusState( time.Now(), commitmenttypes.NewMerkleRoot([]byte("apphash")), []byte("9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08")), valUpdates, params), @@ -200,7 +200,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: initial validator set does not match validator set hash", - types.NewInitialGenesisState( + types.NewInitialConsumerGenesisState( cs, ibctmtypes.NewConsensusState( time.Now(), commitmenttypes.NewMerkleRoot([]byte("apphash")), []byte("9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08")), valUpdates, params), @@ -208,7 +208,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: invalid params - ccvTimeoutPeriod", - types.NewInitialGenesisState(cs, consensusState, valUpdates, + types.NewInitialConsumerGenesisState(cs, consensusState, valUpdates, types.NewParams( true, types.DefaultBlocksPerDistributionTransmission, @@ -227,7 +227,7 @@ func TestValidateInitialGenesisState(t *testing.T) { }, { "invalid new consumer genesis state: invalid params - distributionTransmissionChannel", - types.NewInitialGenesisState(cs, consensusState, valUpdates, + types.NewInitialConsumerGenesisState(cs, consensusState, valUpdates, types.NewParams( true, types.DefaultBlocksPerDistributionTransmission, @@ -256,9 +256,9 @@ func TestValidateInitialGenesisState(t *testing.T) { } } -// TestValidateRestartGenesisState tests a NewRestartGenesisState instantiation, +// TestValidateRestartConsumerGenesisState tests a NewRestartGenesisState instantiation, // and its Validate() method over different genesis scenarios -func TestValidateRestartGenesisState(t *testing.T) { +func TestValidateRestartConsumerGenesisState(t *testing.T) { // generate validator private/public key cId := crypto.NewCryptoIdentityFromIntSeed(234234) pubKey := cId.TMCryptoPubKey() @@ -299,25 +299,25 @@ func TestValidateRestartGenesisState(t *testing.T) { cases := []struct { name string - gs *types.GenesisState + gs *types.ConsumerGenesisState expError bool }{ { "valid restart consumer genesis state: empty maturing packets", - types.NewRestartGenesisState("ccvclient", "ccvchannel", nil, valUpdates, heightToValsetUpdateID, + types.NewRestartConsumerGenesisState("ccvclient", "ccvchannel", nil, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{List: []types.ConsumerPacketData{matConsumerPacket, slashConsumerPacket}}, nil, types.LastTransmissionBlockHeight{Height: 100}, params), false, }, { "valid restart consumer genesis state: handshake in progress ", - types.NewRestartGenesisState("ccvclient", "", nil, valUpdates, heightToValsetUpdateID, + types.NewRestartConsumerGenesisState("ccvclient", "", nil, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{List: []types.ConsumerPacketData{slashConsumerPacket}}, nil, types.LastTransmissionBlockHeight{}, params), false, }, { "valid restart consumer genesis state: maturing packets", - types.NewRestartGenesisState("ccvclient", "ccvchannel", []types.MaturingVSCPacket{ + types.NewRestartConsumerGenesisState("ccvclient", "ccvchannel", []types.MaturingVSCPacket{ {VscId: 1, MaturityTime: time.Now().UTC()}, {VscId: 3, MaturityTime: time.Now().UTC()}, {VscId: 5, MaturityTime: time.Now().UTC()}, @@ -328,26 +328,26 @@ func TestValidateRestartGenesisState(t *testing.T) { }, { "invalid restart consumer genesis state: provider id is empty", - types.NewRestartGenesisState("", "ccvchannel", nil, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), + types.NewRestartConsumerGenesisState("", "ccvchannel", nil, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), true, }, { "invalid restart consumer genesis state: maturing packet vscId is invalid", - types.NewRestartGenesisState("ccvclient", "ccvchannel", []types.MaturingVSCPacket{ + types.NewRestartConsumerGenesisState("ccvclient", "ccvchannel", []types.MaturingVSCPacket{ {VscId: 0, MaturityTime: time.Now().UTC()}, }, valUpdates, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), true, }, { "invalid restart consumer genesis state: maturing packet time is invalid", - types.NewRestartGenesisState("ccvclient", "ccvchannel", []types.MaturingVSCPacket{ + types.NewRestartConsumerGenesisState("ccvclient", "ccvchannel", []types.MaturingVSCPacket{ {VscId: 1, MaturityTime: time.Time{}}, }, valUpdates, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), true, }, { "invalid restart consumer genesis: client state defined", - &types.GenesisState{ + &types.ConsumerGenesisState{ Params: params, ProviderClientId: "ccvclient", ProviderChannelId: "ccvchannel", @@ -366,7 +366,7 @@ func TestValidateRestartGenesisState(t *testing.T) { }, { "invalid restart consumer genesis: consensus state defined", - &types.GenesisState{ + &types.ConsumerGenesisState{ Params: params, ProviderClientId: "ccvclient", ProviderChannelId: "ccvchannel", @@ -385,37 +385,37 @@ func TestValidateRestartGenesisState(t *testing.T) { }, { "invalid restart consumer genesis state: nil initial validator set", - types.NewRestartGenesisState("ccvclient", "ccvchannel", nil, nil, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), + types.NewRestartConsumerGenesisState("ccvclient", "ccvchannel", nil, nil, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), true, }, { "invalid restart consumer genesis state: nil height to validator set id mapping", - types.NewRestartGenesisState("ccvclient", "", + types.NewRestartConsumerGenesisState("ccvclient", "", []types.MaturingVSCPacket{{VscId: 1, MaturityTime: time.Time{}}}, valUpdates, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), true, }, { "invalid restart consumer genesis state: maturing packet defined when handshake is still in progress", - types.NewRestartGenesisState("ccvclient", "", + types.NewRestartConsumerGenesisState("ccvclient", "", []types.MaturingVSCPacket{{VscId: 1, MaturityTime: time.Time{}}}, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, params), true, }, { "invalid restart consumer genesis state: outstanding downtime defined when handshake is still in progress", - types.NewRestartGenesisState("ccvclient", "", + types.NewRestartConsumerGenesisState("ccvclient", "", nil, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{}, []types.OutstandingDowntime{{ValidatorConsensusAddress: "cosmosvalconsxxx"}}, types.LastTransmissionBlockHeight{}, params), true, }, { "invalid restart consumer genesis state: last transmission block height defined when handshake is still in progress", - types.NewRestartGenesisState("ccvclient", "", + types.NewRestartConsumerGenesisState("ccvclient", "", nil, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{Height: int64(1)}, params), true, }, { "invalid restart consumer genesis state: pending maturing packets defined when handshake is still in progress", - types.NewRestartGenesisState("ccvclient", "", + types.NewRestartConsumerGenesisState("ccvclient", "", nil, valUpdates, heightToValsetUpdateID, types.ConsumerPacketDataList{ List: []types.ConsumerPacketData{ { @@ -428,7 +428,7 @@ func TestValidateRestartGenesisState(t *testing.T) { }, { "invalid restart consumer genesis state: invalid params", - types.NewRestartGenesisState("ccvclient", "ccvchannel", nil, valUpdates, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, + types.NewRestartConsumerGenesisState("ccvclient", "ccvchannel", nil, valUpdates, nil, types.ConsumerPacketDataList{}, nil, types.LastTransmissionBlockHeight{}, types.NewParams( true, types.DefaultBlocksPerDistributionTransmission, diff --git a/x/ccv/consumer/types/params_test.go b/x/ccv/consumer/types/params_test.go index ff5d0f325f..e401ba3e47 100644 --- a/x/ccv/consumer/types/params_test.go +++ b/x/ccv/consumer/types/params_test.go @@ -13,7 +13,7 @@ import ( func TestValidateParams(t *testing.T) { testCases := []struct { name string - params ccvtypes.Params + params ccvtypes.ConsumerParams expPass bool }{ {"default params", ccvtypes.DefaultParams(), true}, diff --git a/x/ccv/consumer/types/query.pb.go b/x/ccv/consumer/types/query.pb.go index 5ed38da3f8..45e3586424 100644 --- a/x/ccv/consumer/types/query.pb.go +++ b/x/ccv/consumer/types/query.pb.go @@ -253,7 +253,7 @@ var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo // QueryParamsResponse is response type for the Query/Params RPC method. type QueryParamsResponse struct { // params holds all the parameters of this module. - Params types.Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + Params types.ConsumerParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` } func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } @@ -289,11 +289,11 @@ func (m *QueryParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo -func (m *QueryParamsResponse) GetParams() types.Params { +func (m *QueryParamsResponse) GetParams() types.ConsumerParams { if m != nil { return m.Params } - return types.Params{} + return types.ConsumerParams{} } type QueryProviderInfoRequest struct { @@ -468,50 +468,51 @@ func init() { } var fileDescriptor_f627751d3cc10225 = []byte{ - // 686 bytes of a gzipped FileDescriptorProto + // 689 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6b, 0x13, 0x41, - 0x14, 0xcf, 0xa6, 0x4d, 0xdb, 0x4c, 0xf5, 0xe0, 0x18, 0x21, 0xae, 0x65, 0x2d, 0xab, 0x60, 0x14, - 0xb2, 0xdb, 0xb4, 0x87, 0xea, 0xa1, 0x5a, 0x6c, 0x2c, 0x06, 0x54, 0xea, 0x22, 0x14, 0xbc, 0x94, - 0xe9, 0x64, 0x9a, 0x0c, 0x24, 0x33, 0xe9, 0xcc, 0xec, 0xd2, 0xde, 0x44, 0xf1, 0x2a, 0x82, 0xdf, - 0xc4, 0x2f, 0xe0, 0xb5, 0xe0, 0xa5, 0xe0, 0xc5, 0x93, 0x48, 0xeb, 0x87, 0xf0, 0x28, 0x3b, 0x3b, - 0x9b, 0x6e, 0xe8, 0xbf, 0xad, 0x7a, 0x9b, 0x79, 0xbf, 0xf7, 0x7e, 0xef, 0xf7, 0xde, 0xbc, 0xb7, - 0x0b, 0x7c, 0xca, 0x14, 0x11, 0xb8, 0x8b, 0x28, 0xdb, 0x90, 0x04, 0x87, 0x82, 0xaa, 0x5d, 0x1f, - 0xe3, 0xc8, 0xc7, 0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x9f, 0x8a, 0xf7, 0xe1, 0xca, + 0xf8, 0xcf, 0x6a, 0xfc, 0x35, 0xa8, 0x6d, 0x13, 0x52, 0xcb, 0xee, 0x3a, 0xfc, 0x6c, 0x80, 0xd9, + 0xcc, 0x28, 0xc3, 0x95, 0xfc, 0xfa, 0x46, 0x56, 0xc2, 0xba, 0x77, 0xf1, 0x40, 0x5d, 0xc3, 0xa2, + 0xaa, 0x61, 0x01, 0x56, 0xc7, 0xd7, 0x90, 0x6c, 0x07, 0xfc, 0x6a, 0x80, 0x2b, 0x27, 0x36, 0x00, + 0xae, 0x5e, 0x40, 0xc1, 0xc9, 0xb5, 0xb2, 0x1e, 0xfc, 0x6d, 0xb8, 0x2e, 0x63, 0x45, 0x95, 0x51, + 0x87, 0x5e, 0x8e, 0x32, 0x74, 0x7c, 0x2d, 0x88, 0xb7, 0xe3, 0xd5, 0xfe, 0xa1, 0x6d, 0x1c, 0x1c, + 0xda, 0xc6, 0xcf, 0x43, 0xdb, 0xf8, 0x78, 0x64, 0x17, 0x0e, 0x8e, 0xec, 0xc2, 0xf7, 0x23, 0xbb, + 0xf0, 0x7a, 0xb5, 0x13, 0xc8, 0x6e, 0xb8, 0xe5, 0x62, 0xd6, 0xf7, 0x30, 0x13, 0x7d, 0x26, 0x32, + 0xdc, 0xb5, 0x21, 0x77, 0xb4, 0xec, 0xed, 0x8e, 0x26, 0x90, 0x7b, 0x03, 0x22, 0xb6, 0xa6, 0xd4, + 0x1f, 0x68, 0xf9, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x91, 0xe8, 0xb3, 0x96, 0x73, 0x07, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/ccv/provider/keeper/genesis_test.go b/x/ccv/provider/keeper/genesis_test.go index 8b101a1ce9..ecde91253c 100644 --- a/x/ccv/provider/keeper/genesis_test.go +++ b/x/ccv/provider/keeper/genesis_test.go @@ -71,7 +71,7 @@ func TestInitAndExportGenesis(t *testing.T) { expClientID, "channel", initHeight, - *ccv.DefaultGenesisState(), + *ccv.DefaultConsumerGenesisState(), []providertypes.VscUnbondingOps{ {VscId: vscID, UnbondingOpIds: ubdIndex}, }, @@ -83,7 +83,7 @@ func TestInitAndExportGenesis(t *testing.T) { expClientID, "", 0, - *ccv.DefaultGenesisState(), + *ccv.DefaultConsumerGenesisState(), nil, []ccv.ValidatorSetChangePacketData{{ValsetUpdateId: vscID}}, nil, @@ -218,7 +218,7 @@ func assertConsumerChainStates(t *testing.T, ctx sdk.Context, pk keeper.Keeper, chainID := cs.ChainId gen, found := pk.GetConsumerGenesis(ctx, chainID) require.True(t, found) - require.Equal(t, *ccv.DefaultGenesisState(), gen) + require.Equal(t, *ccv.DefaultConsumerGenesisState(), gen) clientID, found := pk.GetConsumerClientId(ctx, chainID) require.True(t, found) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index bebef70c56..e9bb1d1bd0 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -251,7 +251,7 @@ func (k Keeper) GetAllChannelToChains(ctx sdk.Context) (channels []types.Channel return channels } -func (k Keeper) SetConsumerGenesis(ctx sdk.Context, chainID string, gen ccv.GenesisState) error { +func (k Keeper) SetConsumerGenesis(ctx sdk.Context, chainID string, gen ccv.ConsumerGenesisState) error { store := ctx.KVStore(k.storeKey) bz, err := gen.Marshal() if err != nil { @@ -262,14 +262,14 @@ func (k Keeper) SetConsumerGenesis(ctx sdk.Context, chainID string, gen ccv.Gene return nil } -func (k Keeper) GetConsumerGenesis(ctx sdk.Context, chainID string) (ccv.GenesisState, bool) { +func (k Keeper) GetConsumerGenesis(ctx sdk.Context, chainID string) (ccv.ConsumerGenesisState, bool) { store := ctx.KVStore(k.storeKey) bz := store.Get(types.ConsumerGenesisKey(chainID)) if bz == nil { - return ccv.GenesisState{}, false + return ccv.ConsumerGenesisState{}, false } - var data ccv.GenesisState + var data ccv.ConsumerGenesisState if err := data.Unmarshal(bz); err != nil { // An error here would indicate something is very wrong, // the ConsumerGenesis is assumed to be correctly serialized in SetConsumerGenesis. diff --git a/x/ccv/provider/keeper/key_assignment_test.go b/x/ccv/provider/keeper/key_assignment_test.go index 8da633a5c9..e9cb1dd646 100644 --- a/x/ccv/provider/keeper/key_assignment_test.go +++ b/x/ccv/provider/keeper/key_assignment_test.go @@ -346,6 +346,7 @@ func checkCorrectPruningProperty(ctx sdk.Context, k providerkeeper.Keeper, chain good := true for _, valByConsAddr := range k.GetAllValidatorsByConsumerAddr(ctx, nil) { + valByConsAddr := valByConsAddr // Fix linter error G601 if _, ok := willBePruned[string(valByConsAddr.ConsumerAddr)]; ok { // Address will be pruned, everything is fine. continue diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 53c5f4396f..7ea7433770 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -238,7 +238,7 @@ func (k Keeper) StopConsumerChain(ctx sdk.Context, chainID string, closeChan boo func (k Keeper) MakeConsumerGenesis( ctx sdk.Context, prop *types.ConsumerAdditionProposal, -) (gen ccv.GenesisState, nextValidatorsHash []byte, err error) { +) (gen ccv.ConsumerGenesisState, nextValidatorsHash []byte, err error) { chainID := prop.ChainId providerUnbondingPeriod := k.stakingKeeper.UnbondingTime(ctx) height := clienttypes.GetSelfHeight(ctx) @@ -316,7 +316,7 @@ func (k Keeper) MakeConsumerGenesis( []string{}, ) - gen = *ccv.NewInitialGenesisState( + gen = *ccv.NewInitialConsumerGenesisState( clientState, consState.(*ibctmtypes.ConsensusState), initialUpdatesWithConsumerKeys, diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index e6b8573e24..135e16eaae 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -907,7 +907,7 @@ func TestMakeConsumerGenesis(t *testing.T) { ] }` - var expectedGenesis ccvtypes.GenesisState + var expectedGenesis ccvtypes.ConsumerGenesisState err = json.Unmarshal([]byte(jsonString), &expectedGenesis) // ignores tabs, newlines and spaces require.NoError(t, err) diff --git a/x/ccv/provider/types/consumer.go b/x/ccv/provider/types/consumer.go index b9eefc3b45..b2621dd001 100644 --- a/x/ccv/provider/types/consumer.go +++ b/x/ccv/provider/types/consumer.go @@ -9,7 +9,7 @@ func NewConsumerStates( clientID, channelID string, initialHeight uint64, - genesis ccv.GenesisState, + genesis ccv.ConsumerGenesisState, unbondingOpsIndexes []VscUnbondingOps, pendingValsetChanges []ccv.ValidatorSetChangePacketData, slashDowntimeAck []string, diff --git a/x/ccv/provider/types/genesis.pb.go b/x/ccv/provider/types/genesis.pb.go index fa952b9b13..e08947ea5e 100644 --- a/x/ccv/provider/types/genesis.pb.go +++ b/x/ccv/provider/types/genesis.pb.go @@ -189,7 +189,7 @@ type ConsumerState struct { // InitalHeight defines the initial block height for the consumer chain InitialHeight uint64 `protobuf:"varint,4,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height,omitempty"` // ConsumerGenesis defines the initial consumer chain genesis states - ConsumerGenesis types.GenesisState `protobuf:"bytes,5,opt,name=consumer_genesis,json=consumerGenesis,proto3" json:"consumer_genesis"` + ConsumerGenesis types.ConsumerGenesisState `protobuf:"bytes,5,opt,name=consumer_genesis,json=consumerGenesis,proto3" json:"consumer_genesis"` // PendingValsetChanges defines the pending validator set changes for the // consumer chain PendingValsetChanges []types.ValidatorSetChangePacketData `protobuf:"bytes,6,rep,name=pending_valset_changes,json=pendingValsetChanges,proto3" json:"pending_valset_changes"` @@ -260,11 +260,11 @@ func (m *ConsumerState) GetInitialHeight() uint64 { return 0 } -func (m *ConsumerState) GetConsumerGenesis() types.GenesisState { +func (m *ConsumerState) GetConsumerGenesis() types.ConsumerGenesisState { if m != nil { return m.ConsumerGenesis } - return types.GenesisState{} + return types.ConsumerGenesisState{} } func (m *ConsumerState) GetPendingValsetChanges() []types.ValidatorSetChangePacketData { @@ -353,66 +353,65 @@ func init() { } var fileDescriptor_48411d9c7900d48e = []byte{ - // 929 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6e, 0x1b, 0x37, - 0x17, 0xf5, 0xd8, 0x8e, 0x63, 0xd1, 0x3f, 0x9f, 0x3f, 0xd6, 0x55, 0xc6, 0x76, 0xaa, 0x18, 0x2a, - 0x02, 0x08, 0x68, 0xab, 0x89, 0x9c, 0x2e, 0xd2, 0x9f, 0x2c, 0xe2, 0xa4, 0x68, 0x85, 0xa2, 0xa8, - 0x20, 0x3b, 0x2e, 0x9a, 0x2e, 0x08, 0x8a, 0x24, 0x24, 0xc6, 0x33, 0xe4, 0x80, 0xe4, 0x8c, 0x2d, - 0x14, 0x05, 0x5a, 0xb4, 0x0f, 0xd0, 0xc7, 0xca, 0xd2, 0xcb, 0xae, 0x82, 0xc2, 0x7e, 0x83, 0xae, - 0xba, 0x2c, 0x86, 0xc3, 0x99, 0x8c, 0x5c, 0x39, 0x90, 0xba, 0xb2, 0xc5, 0xc3, 0x7b, 0xce, 0xb9, - 0xbc, 0xe4, 0xbd, 0x03, 0x3a, 0x5c, 0x18, 0xa6, 0xc8, 0x08, 0x73, 0x81, 0x34, 0x23, 0x89, 0xe2, - 0x66, 0x1c, 0x10, 0x92, 0x06, 0xb1, 0x92, 0x29, 0xa7, 0x4c, 0x05, 0x69, 0x27, 0x18, 0x32, 0xc1, - 0x34, 0xd7, 0xed, 0x58, 0x49, 0x23, 0xe1, 0xfb, 0x53, 0x42, 0xda, 0x84, 0xa4, 0xed, 0x22, 0xa4, - 0x9d, 0x76, 0x76, 0xb7, 0x87, 0x72, 0x28, 0xed, 0xfe, 0x20, 0xfb, 0x2f, 0x0f, 0xdd, 0x7d, 0x70, - 0x93, 0x5a, 0xda, 0x09, 0xf4, 0x08, 0x2b, 0x46, 0x11, 0x91, 0x42, 0x27, 0x11, 0x53, 0x2e,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0x3e, 0xf9, 0xb1, 0x62, 0xc6, 0x31, 0xd3, 0x83, 0x15, 0xfb, - 0x25, 0xf2, 0xf0, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x76, 0xce, 0xb9, 0x61, 0xa4, 0x09, 0x00, - 0x00, + // 925 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xdd, 0x6e, 0xdb, 0x36, + 0x14, 0x8e, 0x12, 0x37, 0x8d, 0x99, 0x9f, 0x65, 0x5c, 0xe6, 0x2a, 0x49, 0xe7, 0x06, 0x1e, 0x0a, + 0x04, 0xd8, 0x66, 0x35, 0xe9, 0x2e, 0xba, 0x9f, 0x5e, 0x34, 0xed, 0xb0, 0x19, 0xc3, 0x30, 0xc3, + 0x49, 0x33, 0xa0, 0xbb, 0x20, 0x68, 0x92, 0xb0, 0xd9, 0x48, 0xa4, 0x40, 0x52, 0x4a, 0x8c, 0x61, + 0x40, 0x87, 0xed, 0x01, 0xf6, 0x58, 0xbd, 0xcc, 0xe5, 0xae, 0x8a, 0x21, 0x79, 0x83, 0x3d, 0xc1, + 0x20, 0x8a, 0x52, 0xe5, 0xcc, 0x2e, 0xec, 0x5d, 0xd9, 0x3a, 0x1f, 0xcf, 0xf7, 0x9d, 0xc3, 0x43, + 0x9e, 0x43, 0x70, 0xc0, 0x85, 0x61, 0x8a, 0x0c, 0x31, 0x17, 0x48, 0x33, 0x92, 0x28, 0x6e, 0x46, + 0x01, 0x21, 0x69, 0x10, 0x2b, 0x99, 0x72, 0xca, 0x54, 0x90, 0x1e, 0x04, 0x03, 0x26, 0x98, 0xe6, + 0xba, 0x1d, 0x2b, 0x69, 0x24, 0xfc, 0x78, 0x82, 0x4b, 0x9b, 0x90, 0xb4, 0x5d, 0xb8, 0xb4, 0xd3, + 0x83, 0x9d, 0xad, 0x81, 0x1c, 0x48, 0xbb, 0x3e, 0xc8, 0xfe, 0xe5, 0xae, 0x3b, 0x0f, 0xa6, 0xa9, + 0xa5, 0x07, 0x81, 0x1e, 0x62, 0xc5, 0x28, 0x22, 0x52, 0xe8, 0x24, 0x62, 0xca, 0x79, 0xdc, 0x7f, + 0x87, 0xc7, 0x39, 0x57, 0xcc, 0x2d, 0x3b, 0x9c, 0x25, 0x8d, 0x32, 0xbe, 0xdc, 0xe7, 0xae, 0x61, + 0x82, 0x32, 0x15, 0x71, 0x61, 0x02, 0xa2, 0x46, 0xb1, 0x91, 0xc1, 0x19, 0x1b, 0xb9, 0x2c, 0x5b, + 0x97, 0xab, 0x60, 0xed, 0xdb, 0x3c, 0xef, 0x63, 0x83, 0x0d, 0x83, 0xfb, 0x60, 0x33, 0xc5, 0xa1, + 0x66, 0x06, 0x25, 0x31, 0xc5, 0x86, 0x21, 0x4e, 0x7d, 0x6f, 0xcf, 0xdb, 0xaf, 0xf5, 0x36, 0x72, + 0xfb, 0x73, 0x6b, 0xee, 0x50, 0xf8, 0x0b, 0x78, 0xaf, 0xc8, 0x02, 0xe9, 0xcc, 0x57, 0xfb, 0x8b, + 0x7b, 0x4b, 0xfb, 0xab, 0x87, 0x87, 0xed, 0x19, 0xb6, 0xae, 0xfd, 0xd4, 0xf9, 0x5a, 0xd9, 0xa3, + 0xe6, 0xeb, 0x37, 0xf7, 0x16, 0xfe, 0x79, 0x73, 0xaf, 0x31, 0xc2, 0x51, 0xf8, 0x65, 0xeb, 0x06, + 0x71, 0xab, 0xb7, 0x41, 0xaa, 0xcb, 0x35, 0xfc, 0x19, 0xac, 0x27, 0xa2, 0x2f, 0x05, 0xe5, 0x62, + 0x80, 0x64, 0xac, 0xfd, 0x25, 0x2b, 0xfd, 0x60, 0x26, 0xe9, 0xe7, 0x85, 0xe7, 0x8f, 0xf1, 0x51, + 0x2d, 0x13, 0xee, 0xad, 0x25, 0x6f, 0x4d, 0x1a, 0xbe, 0x04, 0x5b, 0x11, 0x36, 0x89, 0x62, 0x68, + 0x5c, 0xa3, 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 0xc8, 0x28, 0x20, 0x52, 0x47, 0x52, 0x07, 0x6f, 0xb3, 0xfa, 0xac, 0x7c, 0xaf, 0xa4, + 0x0f, 0x83, 0x8b, 0xf1, 0x47, 0x8b, 0x19, 0xc5, 0x4c, 0xf7, 0x97, 0xed, 0x8b, 0xe4, 0xe1, 0xbf, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x6e, 0x42, 0x2b, 0xac, 0x09, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/ccv/provider/types/genesis_test.go b/x/ccv/provider/types/genesis_test.go index aba1a72e0e..7878afb0a4 100644 --- a/x/ccv/provider/types/genesis_test.go +++ b/x/ccv/provider/types/genesis_test.go @@ -452,7 +452,7 @@ func TestValidateGenesisState(t *testing.T) { nil, []types.ConsumerState{{ ChainId: "chainid", ChannelId: "channel-0", ClientId: "client-id", - ConsumerGenesis: ccv.GenesisState{}, + ConsumerGenesis: ccv.ConsumerGenesisState{}, }}, nil, nil, @@ -757,7 +757,7 @@ func TestValidateGenesisState(t *testing.T) { } } -func getInitialConsumerGenesis(t *testing.T, chainID string) ccv.GenesisState { +func getInitialConsumerGenesis(t *testing.T, chainID string) ccv.ConsumerGenesisState { t.Helper() // generate validator public key cId := crypto.NewCryptoIdentityFromIntSeed(239668) @@ -782,5 +782,5 @@ func getInitialConsumerGenesis(t *testing.T, chainID string) ccv.GenesisState { params := ccv.DefaultParams() params.Enabled = true - return *ccv.NewInitialGenesisState(cs, consensusState, valUpdates, params) + return *ccv.NewInitialConsumerGenesisState(cs, consensusState, valUpdates, params) } diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 9fc9178e09..eac75ded70 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -79,7 +79,7 @@ func (m *QueryConsumerGenesisRequest) GetChainId() string { } type QueryConsumerGenesisResponse struct { - GenesisState types.GenesisState `protobuf:"bytes,1,opt,name=genesis_state,json=genesisState,proto3" json:"genesis_state"` + GenesisState types.ConsumerGenesisState `protobuf:"bytes,1,opt,name=genesis_state,json=genesisState,proto3" json:"genesis_state"` } func (m *QueryConsumerGenesisResponse) Reset() { *m = QueryConsumerGenesisResponse{} } @@ -115,11 +115,11 @@ func (m *QueryConsumerGenesisResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryConsumerGenesisResponse proto.InternalMessageInfo -func (m *QueryConsumerGenesisResponse) GetGenesisState() types.GenesisState { +func (m *QueryConsumerGenesisResponse) GetGenesisState() types.ConsumerGenesisState { if m != nil { return m.GenesisState } - return types.GenesisState{} + return types.ConsumerGenesisState{} } type QueryConsumerChainsRequest struct { @@ -1068,90 +1068,90 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 1323 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, - 0x1f, 0xf5, 0x3a, 0x69, 0x9a, 0x4c, 0xfa, 0xfd, 0xb6, 0x4c, 0x4b, 0x71, 0xb7, 0x95, 0x5d, 0xb6, - 0x02, 0xd2, 0x16, 0x76, 0x1b, 0x57, 0x48, 0x6d, 0x21, 0x75, 0xed, 0x24, 0xa4, 0x51, 0x1b, 0x35, - 0xac, 0xab, 0x56, 0x02, 0xd4, 0x65, 0xb2, 0x3b, 0xd8, 0x2b, 0xd6, 0x3b, 0xdb, 0x99, 0xb1, 0xd3, - 0x80, 0x38, 0x00, 0x12, 0xf4, 0x58, 0x09, 0x71, 0xe3, 0xd0, 0x13, 0xff, 0x05, 0xf7, 0xde, 0xa8, - 0xe8, 0xa5, 0xa7, 0x82, 0x12, 0x0e, 0x1c, 0x11, 0x77, 0x24, 0xb4, 0xb3, 0xb3, 0xfe, 0x11, 0x6f, - 0xec, 0xb5, 0x9b, 0x9b, 0x3d, 0x3b, 0x9f, 0xf7, 0x79, 0xef, 0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, 0xd8, 0x77, 0x5c, 0xbf, 0xd6, 0x99, 0x63, 0x99, 0x58, 0xe1, 0x8f, 0x59, 0x70, 0x26, 0xc5, - 0xeb, 0x1c, 0xde, 0x4a, 0x4f, 0x3d, 0x55, 0x8c, 0x50, 0xd7, 0xf7, 0x0f, 0x50, 0xda, 0x71, 0x43, - 0xd8, 0xb1, 0x0c, 0x17, 0x87, 0xdb, 0x41, 0xdb, 0x88, 0x1d, 0x47, 0xa8, 0xc0, 0xb4, 0xa2, 0x78, - 0x52, 0xb9, 0xfb, 0x64, 0x3b, 0xaf, 0x3c, 0xdd, 0xce, 0x2b, 0x7f, 0x6c, 0xe7, 0x95, 0x47, 0x3b, - 0xf9, 0xcc, 0xd3, 0x9d, 0x7c, 0xe6, 0xf9, 0x4e, 0x3e, 0xf3, 0xd1, 0x42, 0xcd, 0xe5, 0xf5, 0xe6, - 0x86, 0x6e, 0x93, 0x86, 0x61, 0x13, 0xd6, 0x20, 0xac, 0xab, 0xdf, 0x3b, 0xed, 0x7e, 0xad, 0x8b, - 0xc6, 0x83, 0x5d, 0xf3, 0xb7, 0x15, 0x60, 0xb6, 0x31, 0x25, 0xbe, 0x56, 0x2e, 0xfe, 0x17, 0x00, - 0x00, 0xff, 0xff, 0x84, 0xab, 0xda, 0x7b, 0x39, 0x13, 0x00, 0x00, + // 1321 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcf, 0x8f, 0x14, 0x45, + 0x18, 0x9d, 0x9e, 0x5d, 0x96, 0xdd, 0x5a, 0x14, 0x2c, 0x10, 0x87, 0x86, 0xcc, 0x60, 0x13, 0x75, + 0x01, 0xed, 0x66, 0x87, 0x98, 0x00, 0xba, 0x0c, 0x33, 0xcb, 0xba, 0x10, 0x20, 0xac, 0xbd, 0x04, + 0x12, 0x35, 0xb4, 0xb5, 0xdd, 0xe5, 0x4c, 0xc7, 0x9e, 0xae,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0x79, + 0xf0, 0x36, 0xd8, 0x53, 0xf7, 0xc8, 0x06, 0xf2, 0x2c, 0xec, 0x73, 0xba, 0x25, 0x2f, 0xb4, 0xf7, + 0x33, 0x51, 0x59, 0x15, 0x85, 0x02, 0x6d, 0x25, 0x2c, 0x96, 0x04, 0xe6, 0x23, 0x40, 0xb1, 0x04, + 0x57, 0xc0, 0xb4, 0x83, 0x38, 0x12, 0x2e, 0xcc, 0x97, 0x4f, 0x0e, 0x7b, 0x1d, 0x76, 0xd1, 0x0a, + 0xc9, 0x4b, 0x34, 0x51, 0xae, 0x3d, 0x55, 0x80, 0xba, 0xb3, 0x72, 0xb8, 0x06, 0xf6, 0x44, 0x23, + 0x1e, 0x69, 0x97, 0x2a, 0xc6, 0xe9, 0x76, 0x29, 0x67, 0x46, 0xc7, 0x48, 0xfa, 0xf2, 0x39, 0x80, + 0x6d, 0x66, 0x5b, 0x4d, 0xc4, 0x5b, 0x61, 0xdc, 0x90, 0xb8, 0xf9, 0xd1, 0x2f, 0xf5, 0x9b, 0xeb, + 0xcb, 0xd7, 0xa2, 0xa2, 0x1e, 0xf0, 0x7d, 0x6d, 0x66, 0xf7, 0xac, 0xd7, 0x66, 0x22, 0x67, 0xb4, + 0x77, 0xc1, 0x09, 0x31, 0x6e, 0x26, 0xae, 0xbb, 0x8c, 0x63, 0xda, 0x99, 0x37, 0x13, 0x6f, 0x22, + 0xea, 0x5c, 0xc4, 0x3e, 0x69, 0x26, 0x6f, 0xaa, 0x15, 0x70, 0x32, 0xd3, 0x6e, 0x39, 0x9f, 0x07, + 0xc1, 0x8c, 0x23, 0x56, 0xc4, 0xcb, 0x7f, 0xce, 0x94, 0xdf, 0xca, 0x3f, 0xbf, 0x06, 0x76, 0x09, + 0x1c, 0xb8, 0xad, 0x80, 0x03, 0x69, 0xc9, 0x06, 0x5e, 0xc8, 0x34, 0x03, 0x43, 0xe2, 0x94, 0x5a, + 0x7d, 0x01, 0x84, 0x88, 0xbf, 0xb6, 0xf2, 0xed, 0x93, 0xbf, 0x7e, 0xcc, 0x57, 0xe0, 0xd2, 0xe8, + 0xc4, 0x9b, 0x5c, 0xed, 0x32, 0x3a, 0x19, 0xf7, 0xe2, 0x93, 0xf9, 0x35, 0x7c, 0xa2, 0x80, 0xfd, + 0x29, 0x19, 0x09, 0x56, 0xc6, 0x67, 0xd8, 0x93, 0xbd, 0xd4, 0x0b, 0x93, 0x03, 0x48, 0x85, 0x67, + 0x85, 0xc2, 0xd3, 0x70, 0x71, 0x0c, 0x85, 0x51, 0x2a, 0x83, 0xdf, 0xe4, 0x41, 0x61, 0x87, 0xa8, + 0xc5, 0xe0, 0xd5, 0x09, 0x99, 0xa5, 0xa6, 0x3a, 0xf5, 0xda, 0x4b, 0x42, 0x93, 0xa2, 0x2f, 0x09, + 0xd1, 0x35, 0x78, 0x61, 0x5c, 0xd1, 0x61, 0xb8, 0xa6, 0xdc, 0x4a, 0x02, 0x13, 0xfc, 0x4f, 0x01, + 0x6f, 0xa4, 0x27, 0x37, 0x06, 0xaf, 0x4c, 0x4c, 0x7a, 0x30, 0x22, 0xaa, 0x57, 0x5f, 0x0e, 0x98, + 0x34, 0x60, 0x55, 0x18, 0x50, 0x85, 0x95, 0x09, 0x0c, 0x20, 0x41, 0x97, 0xfe, 0x7f, 0x14, 0x19, + 0x0e, 0x52, 0x63, 0x16, 0xfc, 0x28, 0x3b, 0xeb, 0x61, 0x81, 0x51, 0x5d, 0x7d, 0x61, 0x1c, 0x29, + 0xbc, 0x2a, 0x84, 0x7f, 0x00, 0xcf, 0x66, 0xf8, 0x0b, 0x1b, 0x03, 0x59, 0x3d, 0xa9, 0x2d, 0x45, + 0x72, 0x77, 0xfc, 0x9a, 0x48, 0x72, 0x4a, 0x90, 0x9c, 0x48, 0x72, 0x5a, 0x0e, 0x9c, 0x4c, 0x72, + 0x4f, 0x72, 0x84, 0xbf, 0x29, 0x00, 0x0e, 0x46, 0x40, 0x78, 0x3e, 0x3b, 0xc5, 0xb4, 0x64, 0xa9, + 0x56, 0x26, 0xae, 0x97, 0xd2, 0xce, 0x08, 0x69, 0x65, 0x78, 0x6a, 0xb4, 0x34, 0x2e, 0x01, 0xa2, + 0xbf, 0xc7, 0xf0, 0xbb, 0x3c, 0x38, 0x3a, 0x2a, 0x65, 0x8d, 0x73, 0x87, 0x8d, 0xce, 0x7c, 0xe3, + 0xdc, 0x61, 0x19, 0xa2, 0x9f, 0x56, 0x13, 0xda, 0x3f, 0x84, 0xe7, 0x46, 0x6b, 0x0f, 0xb0, 0xef, + 0xb8, 0x7e, 0xbd, 0x33, 0xc7, 0x32, 0xb1, 0xc2, 0x9f, 0xf2, 0xe0, 0x58, 0x86, 0xd7, 0x39, 0xbc, + 0x9e, 0x9d, 0x7a, 0xa6, 0x18, 0xa1, 0xae, 0xbd, 0x3c, 0x40, 0x69, 0xc7, 0x15, 0x61, 0xc7, 0x0a, + 0x5c, 0x1e, 0x6d, 0x07, 0x4d, 0x10, 0x3b, 0x8e, 0x50, 0x81, 0x69, 0x45, 0xf1, 0xa4, 0x76, 0xeb, + 0xd1, 0x76, 0x51, 0x79, 0xbc, 0x5d, 0x54, 0xfe, 0xdc, 0x2e, 0x2a, 0x0f, 0x9e, 0x17, 0x73, 0x8f, + 0x9f, 0x17, 0x73, 0x4f, 0x9f, 0x17, 0x73, 0x9f, 0x2c, 0xd5, 0x5d, 0xde, 0x68, 0x6d, 0xe8, 0x36, + 0x69, 0x1a, 0x36, 0x61, 0x4d, 0xc2, 0xba, 0xfa, 0xbd, 0x97, 0xf4, 0x6b, 0x9f, 0x36, 0xee, 0xf6, + 0xcd, 0xdf, 0x56, 0x80, 0xd9, 0xc6, 0x8c, 0xf8, 0xb7, 0x72, 0xfa, 0xff, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x03, 0xbe, 0x75, 0x9c, 0x41, 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/ccv/types/genesis.go b/x/ccv/types/genesis.go index ff18480ecb..5aae1ed9b5 100644 --- a/x/ccv/types/genesis.go +++ b/x/ccv/types/genesis.go @@ -8,11 +8,11 @@ import ( abci "github.com/cometbft/cometbft/abci/types" ) -// NewInitialGenesisState returns a consumer GenesisState for a completely new consumer chain. -func NewInitialGenesisState(cs *ibctmtypes.ClientState, consState *ibctmtypes.ConsensusState, - initValSet []abci.ValidatorUpdate, params Params, -) *GenesisState { - return &GenesisState{ +// NewInitialConsumerGenesisState returns a ConsumerGenesisState for a completely new consumer chain. +func NewInitialConsumerGenesisState(cs *ibctmtypes.ClientState, consState *ibctmtypes.ConsensusState, + initValSet []abci.ValidatorUpdate, params ConsumerParams, +) *ConsumerGenesisState { + return &ConsumerGenesisState{ Params: params, NewChain: true, ProviderClientState: cs, @@ -21,8 +21,8 @@ func NewInitialGenesisState(cs *ibctmtypes.ClientState, consState *ibctmtypes.Co } } -// NewRestartGenesisState returns a consumer GenesisState that has already been established. -func NewRestartGenesisState( +// NewRestartConsumerGenesisState returns a ConsumerGenesisState that has already been established. +func NewRestartConsumerGenesisState( clientID, channelID string, maturingPackets []MaturingVSCPacket, initValSet []abci.ValidatorUpdate, @@ -30,9 +30,9 @@ func NewRestartGenesisState( pendingConsumerPackets ConsumerPacketDataList, outstandingDowntimes []OutstandingDowntime, lastTransBlockHeight LastTransmissionBlockHeight, - params Params, -) *GenesisState { - return &GenesisState{ + params ConsumerParams, +) *ConsumerGenesisState { + return &ConsumerGenesisState{ Params: params, ProviderClientId: clientID, ProviderChannelId: channelID, @@ -46,10 +46,10 @@ func NewRestartGenesisState( } } -// DefaultGenesisState returns a default disabled consumer chain genesis state. This allows the module to be hooked up to app without getting use +// DefaultConsumerGenesisState returns a default disabled consumer chain genesis state. This allows the module to be hooked up to app without getting use // unless explicitly specified in genesis. -func DefaultGenesisState() *GenesisState { - return &GenesisState{ +func DefaultConsumerGenesisState() *ConsumerGenesisState { + return &ConsumerGenesisState{ Params: DefaultParams(), } } @@ -71,7 +71,7 @@ func DefaultGenesisState() *GenesisState { // - MaturingVSCPackets, OutstandingDowntime, PendingConsumerPacket, LastTransmissionBlockHeight // optional // -func (gs GenesisState) Validate() error { +func (gs ConsumerGenesisState) Validate() error { if !gs.Params.Enabled { return nil } diff --git a/x/ccv/types/params.go b/x/ccv/types/params.go index 6a903c0d8f..1e2d6d180a 100644 --- a/x/ccv/types/params.go +++ b/x/ccv/types/params.go @@ -58,7 +58,7 @@ var ( // ParamKeyTable type declaration for parameters func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) + return paramtypes.NewKeyTable().RegisterParamSet(&ConsumerParams{}) } // NewParams creates new consumer parameters with provided arguments @@ -67,8 +67,8 @@ func NewParams(enabled bool, blocksPerDistributionTransmission int64, ccvTimeoutPeriod, transferTimeoutPeriod time.Duration, consumerRedistributionFraction string, historicalEntries int64, consumerUnbondingPeriod time.Duration, softOptOutThreshold string, rewardDenoms, providerRewardDenoms []string, -) Params { - return Params{ +) ConsumerParams { + return ConsumerParams{ Enabled: enabled, BlocksPerDistributionTransmission: blocksPerDistributionTransmission, DistributionTransmissionChannel: distributionTransmissionChannel, @@ -85,7 +85,7 @@ func NewParams(enabled bool, blocksPerDistributionTransmission int64, } // DefaultParams is the default params for the consumer module -func DefaultParams() Params { +func DefaultParams() ConsumerParams { var rewardDenoms []string var provideRewardDenoms []string return NewParams( @@ -105,7 +105,7 @@ func DefaultParams() Params { } // Validate all ccv-consumer module parameters -func (p Params) Validate() error { +func (p ConsumerParams) Validate() error { if err := ValidateBool(p.Enabled); err != nil { return err } @@ -146,7 +146,7 @@ func (p Params) Validate() error { } // ParamSetPairs implements params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { +func (p *ConsumerParams) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ paramtypes.NewParamSetPair(KeyEnabled, p.Enabled, ValidateBool), paramtypes.NewParamSetPair(KeyBlocksPerDistributionTransmission, diff --git a/x/ccv/types/shared_consumer.pb.go b/x/ccv/types/shared_consumer.pb.go index 4cf8860269..d52508dc6b 100644 --- a/x/ccv/types/shared_consumer.pb.go +++ b/x/ccv/types/shared_consumer.pb.go @@ -31,13 +31,11 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Params defines the parameters for CCV consumer module. +// ConsumerParams defines the parameters for CCV consumer module. // // Note this type is referenced in both the consumer and provider CCV modules, // and persisted on the provider, see MakeConsumerGenesis and SetConsumerGenesis. -// -// TODO: Rename to ConsumerParams. See https://github.com/cosmos/interchain-security/issues/1206 -type Params struct { +type ConsumerParams struct { // TODO: Remove enabled flag and find a better way to setup integration tests // See: https://github.com/cosmos/interchain-security/issues/339 Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` @@ -81,18 +79,18 @@ type Params struct { ProviderRewardDenoms []string `protobuf:"bytes,12,rep,name=provider_reward_denoms,json=providerRewardDenoms,proto3" json:"provider_reward_denoms,omitempty"` } -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { +func (m *ConsumerParams) Reset() { *m = ConsumerParams{} } +func (m *ConsumerParams) String() string { return proto.CompactTextString(m) } +func (*ConsumerParams) ProtoMessage() {} +func (*ConsumerParams) Descriptor() ([]byte, []int) { return fileDescriptor_d0a8be0efc64dfbc, []int{0} } -func (m *Params) XXX_Unmarshal(b []byte) error { +func (m *ConsumerParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ConsumerParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Params.Marshal(b, m, deterministic) + return xxx_messageInfo_ConsumerParams.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -102,113 +100,111 @@ func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) +func (m *ConsumerParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsumerParams.Merge(m, src) } -func (m *Params) XXX_Size() int { +func (m *ConsumerParams) XXX_Size() int { return m.Size() } -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) +func (m *ConsumerParams) XXX_DiscardUnknown() { + xxx_messageInfo_ConsumerParams.DiscardUnknown(m) } -var xxx_messageInfo_Params proto.InternalMessageInfo +var xxx_messageInfo_ConsumerParams proto.InternalMessageInfo -func (m *Params) GetEnabled() bool { +func (m *ConsumerParams) GetEnabled() bool { if m != nil { return m.Enabled } return false } -func (m *Params) GetBlocksPerDistributionTransmission() int64 { +func (m *ConsumerParams) GetBlocksPerDistributionTransmission() int64 { if m != nil { return m.BlocksPerDistributionTransmission } return 0 } -func (m *Params) GetDistributionTransmissionChannel() string { +func (m *ConsumerParams) GetDistributionTransmissionChannel() string { if m != nil { return m.DistributionTransmissionChannel } return "" } -func (m *Params) GetProviderFeePoolAddrStr() string { +func (m *ConsumerParams) GetProviderFeePoolAddrStr() string { if m != nil { return m.ProviderFeePoolAddrStr } return "" } -func (m *Params) GetCcvTimeoutPeriod() time.Duration { +func (m *ConsumerParams) GetCcvTimeoutPeriod() time.Duration { if m != nil { return m.CcvTimeoutPeriod } return 0 } -func (m *Params) GetTransferTimeoutPeriod() time.Duration { +func (m *ConsumerParams) GetTransferTimeoutPeriod() time.Duration { if m != nil { return m.TransferTimeoutPeriod } return 0 } -func (m *Params) GetConsumerRedistributionFraction() string { +func (m *ConsumerParams) GetConsumerRedistributionFraction() string { if m != nil { return m.ConsumerRedistributionFraction } return "" } -func (m *Params) GetHistoricalEntries() int64 { +func (m *ConsumerParams) GetHistoricalEntries() int64 { if m != nil { return m.HistoricalEntries } return 0 } -func (m *Params) GetUnbondingPeriod() time.Duration { +func (m *ConsumerParams) GetUnbondingPeriod() time.Duration { if m != nil { return m.UnbondingPeriod } return 0 } -func (m *Params) GetSoftOptOutThreshold() string { +func (m *ConsumerParams) GetSoftOptOutThreshold() string { if m != nil { return m.SoftOptOutThreshold } return "" } -func (m *Params) GetRewardDenoms() []string { +func (m *ConsumerParams) GetRewardDenoms() []string { if m != nil { return m.RewardDenoms } return nil } -func (m *Params) GetProviderRewardDenoms() []string { +func (m *ConsumerParams) GetProviderRewardDenoms() []string { if m != nil { return m.ProviderRewardDenoms } return nil } -// GenesisState defines the CCV consumer chain genesis state. +// ConsumerGenesisState defines the CCV consumer chain genesis state. // // Note this type is referenced in both the consumer and provider CCV modules, // and persisted on the provider, see MakeConsumerGenesis and SetConsumerGenesis. -// -// TODO: Rename to ConsumerGenesisState. See https://github.com/cosmos/interchain-security/issues/1206 -type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - ProviderClientId string `protobuf:"bytes,2,opt,name=provider_client_id,json=providerClientId,proto3" json:"provider_client_id,omitempty"` - ProviderChannelId string `protobuf:"bytes,3,opt,name=provider_channel_id,json=providerChannelId,proto3" json:"provider_channel_id,omitempty"` - NewChain bool `protobuf:"varint,4,opt,name=new_chain,json=newChain,proto3" json:"new_chain,omitempty"` +type ConsumerGenesisState struct { + Params ConsumerParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + ProviderClientId string `protobuf:"bytes,2,opt,name=provider_client_id,json=providerClientId,proto3" json:"provider_client_id,omitempty"` + ProviderChannelId string `protobuf:"bytes,3,opt,name=provider_channel_id,json=providerChannelId,proto3" json:"provider_channel_id,omitempty"` + NewChain bool `protobuf:"varint,4,opt,name=new_chain,json=newChain,proto3" json:"new_chain,omitempty"` // ProviderClientState filled in on new chain, nil on restart. ProviderClientState *_07_tendermint.ClientState `protobuf:"bytes,5,opt,name=provider_client_state,json=providerClientState,proto3" json:"provider_client_state,omitempty"` // ProviderConsensusState filled in on new chain, nil on restart. @@ -228,18 +224,18 @@ type GenesisState struct { PreCCV bool `protobuf:"varint,13,opt,name=preCCV,proto3" json:"preCCV,omitempty"` } -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { +func (m *ConsumerGenesisState) Reset() { *m = ConsumerGenesisState{} } +func (m *ConsumerGenesisState) String() string { return proto.CompactTextString(m) } +func (*ConsumerGenesisState) ProtoMessage() {} +func (*ConsumerGenesisState) Descriptor() ([]byte, []int) { return fileDescriptor_d0a8be0efc64dfbc, []int{1} } -func (m *GenesisState) XXX_Unmarshal(b []byte) error { +func (m *ConsumerGenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ConsumerGenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + return xxx_messageInfo_ConsumerGenesisState.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -249,103 +245,103 @@ func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) +func (m *ConsumerGenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsumerGenesisState.Merge(m, src) } -func (m *GenesisState) XXX_Size() int { +func (m *ConsumerGenesisState) XXX_Size() int { return m.Size() } -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) +func (m *ConsumerGenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_ConsumerGenesisState.DiscardUnknown(m) } -var xxx_messageInfo_GenesisState proto.InternalMessageInfo +var xxx_messageInfo_ConsumerGenesisState proto.InternalMessageInfo -func (m *GenesisState) GetParams() Params { +func (m *ConsumerGenesisState) GetParams() ConsumerParams { if m != nil { return m.Params } - return Params{} + return ConsumerParams{} } -func (m *GenesisState) GetProviderClientId() string { +func (m *ConsumerGenesisState) GetProviderClientId() string { if m != nil { return m.ProviderClientId } return "" } -func (m *GenesisState) GetProviderChannelId() string { +func (m *ConsumerGenesisState) GetProviderChannelId() string { if m != nil { return m.ProviderChannelId } return "" } -func (m *GenesisState) GetNewChain() bool { +func (m *ConsumerGenesisState) GetNewChain() bool { if m != nil { return m.NewChain } return false } -func (m *GenesisState) GetProviderClientState() *_07_tendermint.ClientState { +func (m *ConsumerGenesisState) GetProviderClientState() *_07_tendermint.ClientState { if m != nil { return m.ProviderClientState } return nil } -func (m *GenesisState) GetProviderConsensusState() *_07_tendermint.ConsensusState { +func (m *ConsumerGenesisState) GetProviderConsensusState() *_07_tendermint.ConsensusState { if m != nil { return m.ProviderConsensusState } return nil } -func (m *GenesisState) GetMaturingPackets() []MaturingVSCPacket { +func (m *ConsumerGenesisState) GetMaturingPackets() []MaturingVSCPacket { if m != nil { return m.MaturingPackets } return nil } -func (m *GenesisState) GetInitialValSet() []types.ValidatorUpdate { +func (m *ConsumerGenesisState) GetInitialValSet() []types.ValidatorUpdate { if m != nil { return m.InitialValSet } return nil } -func (m *GenesisState) GetHeightToValsetUpdateId() []HeightToValsetUpdateID { +func (m *ConsumerGenesisState) GetHeightToValsetUpdateId() []HeightToValsetUpdateID { if m != nil { return m.HeightToValsetUpdateId } return nil } -func (m *GenesisState) GetOutstandingDowntimeSlashing() []OutstandingDowntime { +func (m *ConsumerGenesisState) GetOutstandingDowntimeSlashing() []OutstandingDowntime { if m != nil { return m.OutstandingDowntimeSlashing } return nil } -func (m *GenesisState) GetPendingConsumerPackets() ConsumerPacketDataList { +func (m *ConsumerGenesisState) GetPendingConsumerPackets() ConsumerPacketDataList { if m != nil { return m.PendingConsumerPackets } return ConsumerPacketDataList{} } -func (m *GenesisState) GetLastTransmissionBlockHeight() LastTransmissionBlockHeight { +func (m *ConsumerGenesisState) GetLastTransmissionBlockHeight() LastTransmissionBlockHeight { if m != nil { return m.LastTransmissionBlockHeight } return LastTransmissionBlockHeight{} } -func (m *GenesisState) GetPreCCV() bool { +func (m *ConsumerGenesisState) GetPreCCV() bool { if m != nil { return m.PreCCV } @@ -607,8 +603,8 @@ func (m *ConsumerPacketDataList) GetList() []ConsumerPacketData { } func init() { - proto.RegisterType((*Params)(nil), "interchain_security.ccv.v1.Params") - proto.RegisterType((*GenesisState)(nil), "interchain_security.ccv.v1.GenesisState") + proto.RegisterType((*ConsumerParams)(nil), "interchain_security.ccv.v1.ConsumerParams") + proto.RegisterType((*ConsumerGenesisState)(nil), "interchain_security.ccv.v1.ConsumerGenesisState") proto.RegisterType((*HeightToValsetUpdateID)(nil), "interchain_security.ccv.v1.HeightToValsetUpdateID") proto.RegisterType((*OutstandingDowntime)(nil), "interchain_security.ccv.v1.OutstandingDowntime") proto.RegisterType((*LastTransmissionBlockHeight)(nil), "interchain_security.ccv.v1.LastTransmissionBlockHeight") @@ -621,84 +617,84 @@ func init() { } var fileDescriptor_d0a8be0efc64dfbc = []byte{ - // 1178 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0x8e, 0x9b, 0x34, 0xb5, 0x27, 0x09, 0x4d, 0x27, 0xad, 0xd9, 0x26, 0xc2, 0x71, 0x0d, 0x48, - 0x96, 0xa0, 0xbb, 0x24, 0x2d, 0x42, 0xe2, 0x80, 0x68, 0x6c, 0x4a, 0x83, 0x4a, 0x13, 0x36, 0x69, - 0x0e, 0x45, 0x62, 0x34, 0x9e, 0x99, 0xd8, 0xa3, 0xae, 0x67, 0xac, 0x99, 0xd9, 0x0d, 0xb9, 0x22, - 0x7e, 0x40, 0x8f, 0xfc, 0xa4, 0x1e, 0x7b, 0xe4, 0x04, 0xa8, 0xfd, 0x23, 0x68, 0x3e, 0xd6, 0xb1, - 0xf3, 0x61, 0xca, 0x6d, 0x67, 0xde, 0xe7, 0x79, 0xbf, 0xdf, 0x79, 0x17, 0x7c, 0xc1, 0x85, 0x61, - 0x8a, 0x0c, 0x30, 0x17, 0x48, 0x33, 0x92, 0x2b, 0x6e, 0x4e, 0x13, 0x42, 0x8a, 0xa4, 0xd8, 0x4a, - 0xf4, 0x00, 0x2b, 0x46, 0x11, 0x91, 0x42, 0xe7, 0x43, 0xa6, 0xe2, 0x91, 0x92, 0x46, 0xc2, 0xf5, - 0x4b, 0x18, 0x31, 0x21, 0x45, 0x5c, 0x6c, 0xad, 0x6f, 0x18, 0x26, 0x28, 0x53, 0x43, 0x2e, 0x4c, - 0x82, 0x7b, 0x84, 0x27, 0xe6, 0x74, 0xc4, 0xb4, 0x27, 0xae, 0x27, 0xbc, 0x47, 0x92, 0x8c, 0xf7, - 0x07, 0x86, 0x64, 0x9c, 0x09, 0xa3, 0x93, 0x09, 0x74, 0xb1, 0x35, 0x71, 0x0a, 0x84, 0x7b, 0x96, - 0x40, 0xa4, 0x62, 0x09, 0x19, 0x60, 0x21, 0x58, 0x66, 0x51, 0xe1, 0x33, 0x40, 0x1a, 0x7d, 0x29, - 0xfb, 0x19, 0x4b, 0xdc, 0xa9, 0x97, 0x1f, 0x27, 0x34, 0x57, 0xd8, 0x70, 0x29, 0x82, 0xfc, 0x76, - 0x5f, 0xf6, 0xa5, 0xfb, 0x4c, 0xec, 0x57, 0xb8, 0xfd, 0x74, 0x46, 0xd0, 0x27, 0x5c, 0xb1, 0x00, - 0xdb, 0x3c, 0xaf, 0xdc, 0xf0, 0x21, 0xd3, 0x06, 0x0f, 0x47, 0x1e, 0xd0, 0xfa, 0x7d, 0x11, 0x2c, - 0xee, 0x63, 0x85, 0x87, 0x1a, 0x46, 0xe0, 0x06, 0x13, 0xb8, 0x97, 0x31, 0x1a, 0x55, 0x9a, 0x95, - 0x76, 0x35, 0x2d, 0x8f, 0x70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xff, 0xd1, 0x28, 0xd8, 0xb6, 0xab, 0x0a, 0x00, 0x00, -} - -func (m *Params) Marshal() (dAtA []byte, err error) { + // 1182 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4f, 0x53, 0x1b, 0x37, + 0x14, 0xc7, 0x81, 0x10, 0x5b, 0x40, 0x42, 0x04, 0x71, 0x37, 0x30, 0x35, 0x8e, 0xdb, 0xce, 0x78, + 0xda, 0x66, 0xb7, 0x21, 0xe9, 0x74, 0xa6, 0x87, 0xce, 0x04, 0xd3, 0x14, 0x3a, 0x69, 0xa0, 0x0b, + 0xe1, 0x90, 0xce, 0x54, 0x23, 0x4b, 0xc2, 0xd6, 0x64, 0x2d, 0x79, 0x24, 0xed, 0x52, 0xae, 0x3d, + 0xf7, 0x90, 0x63, 0x3f, 0x52, 0x8e, 0x39, 0xe6, 0xd4, 0x76, 0x92, 0x2f, 0xd2, 0xd1, 0x9f, 0x35, + 0x76, 0x00, 0x97, 0xde, 0x56, 0x7a, 0xbf, 0xdf, 0xfb, 0xff, 0xf4, 0x16, 0x7c, 0xc5, 0x85, 0x61, + 0x8a, 0xf4, 0x31, 0x17, 0x48, 0x33, 0x92, 0x2b, 0x6e, 0x4e, 0x13, 0x42, 0x8a, 0xa4, 0x78, 0x90, + 0xe8, 0x3e, 0x56, 0x8c, 0x22, 0x22, 0x85, 0xce, 0x07, 0x4c, 0xc5, 0x43, 0x25, 0x8d, 0x84, 0x6b, + 0x17, 0x30, 0x62, 0x42, 0x8a, 0xb8, 0x78, 0xb0, 0xb6, 0x6e, 0x98, 0xa0, 0x4c, 0x0d, 0xb8, 0x30, + 0x09, 0xee, 0x12, 0x9e, 0x98, 0xd3, 0x21, 0xd3, 0x9e, 0xb8, 0x96, 0xf0, 0x2e, 0x49, 0x32, 0xde, + 0xeb, 0x1b, 0x92, 0x71, 0x26, 0x8c, 0x4e, 0xc6, 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, 0x9b, 0x2c, 0x96, 0x54, 0x2b, 0x6c, 0x75, 0x41, 0xfd, 0xe2, 0xa6, + 0x81, 0x3b, 0x60, 0x2e, 0xe3, 0xda, 0x7a, 0x39, 0xeb, 0x5f, 0xa0, 0xff, 0xd3, 0x76, 0xa1, 0xe4, + 0x4e, 0xc3, 0xd6, 0xb3, 0xd7, 0xef, 0x1a, 0x95, 0x37, 0xef, 0x1a, 0x95, 0x7f, 0xde, 0x35, 0x2a, + 0xaf, 0xde, 0x37, 0x66, 0xde, 0xbc, 0x6f, 0xcc, 0xbc, 0x7d, 0xdf, 0x98, 0x79, 0xf1, 0xa8, 0xc7, + 0x4d, 0x3f, 0xef, 0xc6, 0x44, 0x0e, 0x12, 0x22, 0xf5, 0x40, 0xea, 0xe4, 0xcc, 0xcc, 0xfd, 0xd1, + 0x1f, 0x5a, 0xf1, 0x30, 0xf9, 0xcd, 0xfd, 0xa6, 0xb9, 0xbf, 0xca, 0xee, 0xbc, 0x8b, 0xef, 0xe1, + 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xb5, 0xe5, 0x15, 0xc3, 0x0a, 0x00, 0x00, +} + +func (m *ConsumerParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -708,12 +704,12 @@ func (m *Params) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Params) MarshalTo(dAtA []byte) (int, error) { +func (m *ConsumerParams) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ConsumerParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -811,7 +807,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *GenesisState) Marshal() (dAtA []byte, err error) { +func (m *ConsumerGenesisState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -821,12 +817,12 @@ func (m *GenesisState) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { +func (m *ConsumerGenesisState) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ConsumerGenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1153,7 +1149,7 @@ func encodeVarintSharedConsumer(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Params) Size() (n int) { +func (m *ConsumerParams) Size() (n int) { if m == nil { return 0 } @@ -1205,7 +1201,7 @@ func (m *Params) Size() (n int) { return n } -func (m *GenesisState) Size() (n int) { +func (m *ConsumerGenesisState) Size() (n int) { if m == nil { return 0 } @@ -1341,7 +1337,7 @@ func sovSharedConsumer(x uint64) (n int) { func sozSharedConsumer(x uint64) (n int) { return sovSharedConsumer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Params) Unmarshal(dAtA []byte) error { +func (m *ConsumerParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1364,10 +1360,10 @@ func (m *Params) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Params: wiretype end group for non-group") + return fmt.Errorf("proto: ConsumerParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsumerParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1740,7 +1736,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } -func (m *GenesisState) Unmarshal(dAtA []byte) error { +func (m *ConsumerGenesisState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1763,10 +1759,10 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + return fmt.Errorf("proto: ConsumerGenesisState: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsumerGenesisState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: From ee48da4e0460711406867e63f068f34ec1a7b63f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 23:09:18 -0700 Subject: [PATCH 11/22] build(deps): bump google.golang.org/grpc from 1.58.0 to 1.58.1 (#1306) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.58.0 to 1.58.1. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.58.0...v1.58.1) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3fc1b177b7..1f05100cd2 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( golang.org/x/net v0.12.0 // indirect golang.org/x/sys v0.11.0 // indirect google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect - google.golang.org/grpc v1.58.0 + google.golang.org/grpc v1.58.1 google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index 033aa8adf2..2246f9decf 100644 --- a/go.sum +++ b/go.sum @@ -1813,8 +1813,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.58.0 h1:32JY8YpPMSR45K+c3o6b8VL73V+rR8k+DeMIr4vRH8o= -google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= +google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= 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= From 27ef1d22fb358ce1159f846fc299ac8b02a2f83e Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Tue, 19 Sep 2023 10:36:51 -0700 Subject: [PATCH 12/22] feat: increment consensus ver and register migration (#1295) * increment consensus ver and register migration * Update CHANGELOG.md * Update migration.go * Update module.go --- CHANGELOG.md | 1 + x/ccv/consumer/keeper/migration.go | 13 +++++++++---- x/ccv/consumer/module.go | 12 ++++++------ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 032927214a..29b6328e94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ Note: Changes: +* (feat) [#1295](https://github.com/cosmos/interchain-security/pull/1295) increment consumer consensus version and register consumer packet migration. * (fix!) [#1262](https://github.com/cosmos/interchain-security/pull/1262) Remove incorrect address validation on `ProviderFeePoolAddrStr` param. * (feature!) [#1244](https://github.com/cosmos/interchain-security/pull/1244) Update the default consumer unbonding period to 2 weeks. * (fix!) [#1244](https://github.com/cosmos/interchain-security/pull/1244) Validate token transfer messages before calling `Transfer()`. diff --git a/x/ccv/consumer/keeper/migration.go b/x/ccv/consumer/keeper/migration.go index 361bb2a62f..5d5d913b9b 100644 --- a/x/ccv/consumer/keeper/migration.go +++ b/x/ccv/consumer/keeper/migration.go @@ -21,23 +21,27 @@ func NewMigrator(ccvConsumerKeeper Keeper, ccvConsumerParamSpace paramtypes.Subs return Migrator{ccvConsumerKeeper: ccvConsumerKeeper, ccvConsumerParamSpace: ccvConsumerParamSpace} } +// Migrate1to2 migrates x/ccvconsumer state from consensus version 1 to 2. +func (m Migrator) Migrate1to2(ctx sdk.Context) error { + return m.ccvConsumerKeeper.MigrateConsumerPacketData(ctx) +} + // MigrateConsumerPacketData migrates consumer packet data according to // https://github.com/cosmos/interchain-security/pull/1037 // // Note an equivalent migration is not required for providers. -func (k Keeper) MigrateConsumerPacketData(ctx sdk.Context) { +func (k Keeper) MigrateConsumerPacketData(ctx sdk.Context) error { // deserialize packet data from old format var depreciatedType ccvtypes.ConsumerPacketDataList store := ctx.KVStore(k.storeKey) bz := store.Get([]byte{consumertypes.PendingDataPacketsBytePrefix}) if bz == nil { ctx.Logger().Info("no pending data packets to migrate") - return + return nil } err := depreciatedType.Unmarshal(bz) if err != nil { - // An error here would indicate something is very wrong - panic(fmt.Errorf("failed to unmarshal pending data packets: %w", err)) + return fmt.Errorf("failed to unmarshal pending data packets: %w", err) } // Delete old data @@ -48,6 +52,7 @@ func (k Keeper) MigrateConsumerPacketData(ctx sdk.Context) { for _, data := range depreciatedType.List { k.AppendPendingPacket(ctx, data.Type, data.Data) } + return nil } // TODO: the following hackyness could be removed if we're able to reference older versions of ICS. diff --git a/x/ccv/consumer/module.go b/x/ccv/consumer/module.go index e175205530..ba38b01d73 100644 --- a/x/ccv/consumer/module.go +++ b/x/ccv/consumer/module.go @@ -107,6 +107,11 @@ func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { consumertypes.RegisterQueryServer(cfg.QueryServer(), am.keeper) + + m := keeper.NewMigrator(am.keeper, am.paramSpace) + if err := cfg.RegisterMigration(consumertypes.ModuleName, 1, m.Migrate1to2); err != nil { + panic(fmt.Sprintf("failed to register migrator for %s: %s", consumertypes.ModuleName, err)) + } } // InitGenesis performs genesis initialization for the consumer module. It returns @@ -126,12 +131,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { - // Note that v1.0.0 consumers should technically be on a different consensus version - // than v1.2.0-multiden and v2.0.0. However, Neutron was the first consumer to launch - // in prod, and they've started on v1.2.0-multiden (which has a ConsensusVersion of 1). - // - // v1.2.0-multiden and v2.0.0 are consensus compatible, so they need return the same ConsensusVersion of 1. - return 1 + return 2 } // BeginBlock implements the AppModule interface From 99a171f4fddda9ecdfc6c7e4963b5d3afb8665b1 Mon Sep 17 00:00:00 2001 From: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Date: Tue, 19 Sep 2023 20:39:11 +0200 Subject: [PATCH 13/22] tests: Export struct fields in the e2e tests (#1313) * Make struct fields in e2e exported * Un-capitalize binary name * Remove prop type * Channel to channel in comments --- tests/e2e/actions.go | 995 +++++++++--------- tests/e2e/actions_sovereign_chain.go | 84 +- tests/e2e/config.go | 350 +++--- tests/e2e/main.go | 20 +- tests/e2e/state.go | 180 ++-- tests/e2e/step_delegation.go | 452 ++++---- tests/e2e/steps.go | 8 +- tests/e2e/steps_democracy.go | 314 +++--- tests/e2e/steps_double_sign.go | 152 +-- tests/e2e/steps_downtime.go | 512 ++++----- tests/e2e/steps_light_client_attack.go | 164 +-- tests/e2e/steps_multi_consumer_delegation.go | 380 +++---- tests/e2e/steps_multi_consumer_double_sign.go | 280 ++--- tests/e2e/steps_multi_consumer_downtime.go | 518 ++++----- tests/e2e/steps_reward_denom.go | 316 +++--- tests/e2e/steps_sovereign_changeover.go | 362 +++---- tests/e2e/steps_start_chains.go | 312 +++--- tests/e2e/steps_stop_chain.go | 96 +- .../e2e/steps_submit_equivocation_proposal.go | 148 +-- 19 files changed, 2824 insertions(+), 2819 deletions(-) diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index 2256156958..36e0c47dd2 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -23,10 +23,10 @@ import ( ) type SendTokensAction struct { - chain chainID - from validatorID - to validatorID - amount uint + Chain ChainID + From ValidatorID + To ValidatorID + Amount uint } const done = "done!!!!!!!!" @@ -35,18 +35,18 @@ func (tr TestRun) sendTokens( action SendTokensAction, verbose bool, ) { - binaryName := tr.chainConfigs[action.chain].binaryName + binaryName := tr.chainConfigs[action.Chain].BinaryName //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, binaryName, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, binaryName, "tx", "bank", "send", - tr.validatorConfigs[action.from].delAddress, - tr.validatorConfigs[action.to].delAddress, - fmt.Sprint(action.amount)+`stake`, + tr.validatorConfigs[action.From].DelAddress, + tr.validatorConfigs[action.To].DelAddress, + fmt.Sprint(action.Amount)+`stake`, - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), - `--home`, tr.getValidatorHome(action.chain, action.from), - `--node`, tr.getValidatorNode(action.chain, action.from), + `--chain-id`, string(tr.chainConfigs[action.Chain].ChainId), + `--home`, tr.getValidatorHome(action.Chain, action.From), + `--node`, tr.getValidatorNode(action.Chain, action.From), `--keyring-backend`, `test`, `-y`, ) @@ -59,28 +59,28 @@ func (tr TestRun) sendTokens( } // wait for inclusion in a block -> '--broadcast-mode block' is deprecated - tr.waitBlocks(action.chain, 2, 30*time.Second) + tr.waitBlocks(action.Chain, 2, 30*time.Second) } type StartChainAction struct { - chain chainID - validators []StartChainValidator + Chain ChainID + Validators []StartChainValidator // Genesis changes specific to this action, appended to genesis changes defined in chain config - genesisChanges string - skipGentx bool + GenesisChanges string + SkipGentx bool } type StartChainValidator struct { - id validatorID - allocation uint - stake uint + Id ValidatorID + Allocation uint + Stake uint } func (tr *TestRun) startChain( action StartChainAction, verbose bool, ) { - chainConfig := tr.chainConfigs[action.chain] + chainConfig := tr.chainConfigs[action.Chain] type jsonValAttrs struct { Mnemonic string `json:"mnemonic"` Allocation string `json:"allocation"` @@ -96,20 +96,20 @@ func (tr *TestRun) startChain( } var validators []jsonValAttrs - for _, val := range action.validators { + for _, val := range action.Validators { validators = append(validators, jsonValAttrs{ - Mnemonic: tr.validatorConfigs[val.id].mnemonic, - NodeKey: tr.validatorConfigs[val.id].nodeKey, - ValId: fmt.Sprint(val.id), - PrivValidatorKey: tr.validatorConfigs[val.id].privValidatorKey, - Allocation: fmt.Sprint(val.allocation) + "stake", - Stake: fmt.Sprint(val.stake) + "stake", - IpSuffix: tr.validatorConfigs[val.id].ipSuffix, - - ConsumerMnemonic: tr.validatorConfigs[val.id].consumerMnemonic, - ConsumerPrivValidatorKey: tr.validatorConfigs[val.id].consumerPrivValidatorKey, + Mnemonic: tr.validatorConfigs[val.Id].Mnemonic, + NodeKey: tr.validatorConfigs[val.Id].NodeKey, + ValId: fmt.Sprint(val.Id), + PrivValidatorKey: tr.validatorConfigs[val.Id].PrivValidatorKey, + Allocation: fmt.Sprint(val.Allocation) + "stake", + Stake: fmt.Sprint(val.Stake) + "stake", + IpSuffix: tr.validatorConfigs[val.Id].IpSuffix, + + ConsumerMnemonic: tr.validatorConfigs[val.Id].ConsumerMnemonic, + ConsumerPrivValidatorKey: tr.validatorConfigs[val.Id].ConsumerPrivValidatorKey, // if true node will be started with consumer key for each consumer chain - StartWithConsumerKey: tr.validatorConfigs[val.id].useConsumerKey, + StartWithConsumerKey: tr.validatorConfigs[val.Id].UseConsumerKey, }) } @@ -120,10 +120,10 @@ func (tr *TestRun) startChain( // Concat genesis changes defined in chain config, with any custom genesis changes for this chain instantiation var genesisChanges string - if action.genesisChanges != "" { - genesisChanges = chainConfig.genesisChanges + " | " + action.genesisChanges + if action.GenesisChanges != "" { + genesisChanges = chainConfig.GenesisChanges + " | " + action.GenesisChanges } else { - genesisChanges = chainConfig.genesisChanges + genesisChanges = chainConfig.GenesisChanges } var cometmockArg string @@ -134,10 +134,10 @@ func (tr *TestRun) startChain( } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "/bin/bash", - "/testnet-scripts/start-chain.sh", chainConfig.binaryName, string(vals), - string(chainConfig.chainId), chainConfig.ipPrefix, genesisChanges, - fmt.Sprint(action.skipGentx), + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "/bin/bash", + "/testnet-scripts/start-chain.sh", chainConfig.BinaryName, string(vals), + string(chainConfig.ChainId), chainConfig.IpPrefix, genesisChanges, + fmt.Sprint(action.SkipGentx), // override config/config.toml for each node on chain // usually timeout_commit and peer_gossip_sleep_duration are changed to vary the test run duration // lower timeout_commit means the blocks are produced faster making the test run shorter @@ -172,25 +172,25 @@ func (tr *TestRun) startChain( } tr.addChainToRelayer(addChainToRelayerAction{ - chain: action.chain, - validator: action.validators[0].id, + Chain: action.Chain, + Validator: action.Validators[0].Id, }, verbose) // store the fact that we started the chain - tr.runningChains[action.chain] = true - fmt.Println("Started chain", action.chain) + tr.runningChains[action.Chain] = true + fmt.Println("Started chain", action.Chain) if tr.timeOffset != 0 { // advance time for this chain so that it is in sync with the rest of the network - tr.AdvanceTimeForChain(action.chain, tr.timeOffset) + tr.AdvanceTimeForChain(action.Chain, tr.timeOffset) } } type submitTextProposalAction struct { - chain chainID - from validatorID - deposit uint - title string - description string + Chain ChainID + From ValidatorID + Deposit uint + Title string + Description string } func (tr TestRun) submitTextProposal( @@ -199,15 +199,15 @@ func (tr TestRun) submitTextProposal( ) { // TEXT PROPOSAL //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, + bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.Chain].BinaryName, "tx", "gov", "submit-legacy-proposal", - `--title`, action.title, - `--description`, action.description, - `--deposit`, fmt.Sprint(action.deposit)+`stake`, - `--from`, `validator`+fmt.Sprint(action.from), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), - `--home`, tr.getValidatorHome(action.chain, action.from), - `--node`, tr.getValidatorNode(action.chain, action.from), + `--title`, action.Title, + `--description`, action.Description, + `--deposit`, fmt.Sprint(action.Deposit)+`stake`, + `--from`, `validator`+fmt.Sprint(action.From), + `--chain-id`, string(tr.chainConfigs[action.Chain].ChainId), + `--home`, tr.getValidatorHome(action.Chain, action.From), + `--node`, tr.getValidatorNode(action.Chain, action.From), `--keyring-backend`, `test`, `-y`, ).CombinedOutput() @@ -216,31 +216,31 @@ func (tr TestRun) submitTextProposal( } // wait for inclusion in a block -> '--broadcast-mode block' is deprecated - tr.waitBlocks(action.chain, 1, 10*time.Second) + tr.waitBlocks(action.Chain, 1, 10*time.Second) } type submitConsumerAdditionProposalAction struct { - preCCV bool - chain chainID - from validatorID - deposit uint - consumerChain chainID - spawnTime uint - initialHeight clienttypes.Height - distributionChannel string + PreCCV bool + Chain ChainID + From ValidatorID + Deposit uint + ConsumerChain ChainID + SpawnTime uint + InitialHeight clienttypes.Height + DistributionChannel string } func (tr TestRun) submitConsumerAdditionProposal( action submitConsumerAdditionProposalAction, verbose bool, ) { - spawnTime := tr.containerConfig.now.Add(time.Duration(action.spawnTime) * time.Millisecond) + spawnTime := tr.containerConfig.Now.Add(time.Duration(action.SpawnTime) * time.Millisecond) params := ccvtypes.DefaultParams() prop := client.ConsumerAdditionProposalJSON{ Title: "Propose the addition of a new chain", Summary: "Gonna be a great chain", - ChainId: string(tr.chainConfigs[action.consumerChain].chainId), - InitialHeight: action.initialHeight, + ChainId: string(tr.chainConfigs[action.ConsumerChain].ChainId), + InitialHeight: action.InitialHeight, GenesisHash: []byte("gen_hash"), BinaryHash: []byte("bin_hash"), SpawnTime: spawnTime, @@ -250,8 +250,8 @@ func (tr TestRun) submitConsumerAdditionProposal( CcvTimeoutPeriod: params.CcvTimeoutPeriod, TransferTimeoutPeriod: params.TransferTimeoutPeriod, UnbondingPeriod: params.UnbondingPeriod, - Deposit: fmt.Sprint(action.deposit) + `stake`, - DistributionTransmissionChannel: action.distributionChannel, + Deposit: fmt.Sprint(action.Deposit) + `stake`, + DistributionTransmissionChannel: action.DistributionChannel, } bz, err := json.Marshal(prop) @@ -265,7 +265,7 @@ func (tr TestRun) submitConsumerAdditionProposal( } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, + bz, err = exec.Command("docker", "exec", tr.containerConfig.InstanceName, "/bin/bash", "-c", fmt.Sprintf(`echo '%s' > %s`, jsonStr, "/temp-proposal.json")).CombinedOutput() if err != nil { @@ -274,13 +274,13 @@ func (tr TestRun) submitConsumerAdditionProposal( //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. // CONSUMER ADDITION PROPOSAL - bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, + bz, err = exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.Chain].BinaryName, "tx", "gov", "submit-legacy-proposal", "consumer-addition", "/temp-proposal.json", - `--from`, `validator`+fmt.Sprint(action.from), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), - `--home`, tr.getValidatorHome(action.chain, action.from), + `--from`, `validator`+fmt.Sprint(action.From), + `--chain-id`, string(tr.chainConfigs[action.Chain].ChainId), + `--home`, tr.getValidatorHome(action.Chain, action.From), `--gas`, `900000`, - `--node`, tr.getValidatorNode(action.chain, action.from), + `--node`, tr.getValidatorNode(action.Chain, action.From), `--keyring-backend`, `test`, `-y`, ).CombinedOutput() @@ -290,28 +290,28 @@ func (tr TestRun) submitConsumerAdditionProposal( } // wait for inclusion in a block -> '--broadcast-mode block' is deprecated - tr.waitBlocks(chainID("provi"), 2, 10*time.Second) + tr.waitBlocks(ChainID("provi"), 2, 10*time.Second) } type submitConsumerRemovalProposalAction struct { - chain chainID - from validatorID - deposit uint - consumerChain chainID - stopTimeOffset time.Duration // offset from time.Now() + Chain ChainID + From ValidatorID + Deposit uint + ConsumerChain ChainID + StopTimeOffset time.Duration // offset from time.Now() } func (tr TestRun) submitConsumerRemovalProposal( action submitConsumerRemovalProposalAction, verbose bool, ) { - stopTime := tr.containerConfig.now.Add(action.stopTimeOffset) + stopTime := tr.containerConfig.Now.Add(action.StopTimeOffset) prop := client.ConsumerRemovalProposalJSON{ - Title: fmt.Sprintf("Stop the %v chain", action.consumerChain), + Title: fmt.Sprintf("Stop the %v chain", action.ConsumerChain), Summary: "It was a great chain", - ChainId: string(tr.chainConfigs[action.consumerChain].chainId), + ChainId: string(tr.chainConfigs[action.ConsumerChain].ChainId), StopTime: stopTime, - Deposit: fmt.Sprint(action.deposit) + `stake`, + Deposit: fmt.Sprint(action.Deposit) + `stake`, } bz, err := json.Marshal(prop) @@ -325,7 +325,7 @@ func (tr TestRun) submitConsumerRemovalProposal( } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, + bz, err = exec.Command("docker", "exec", tr.containerConfig.InstanceName, "/bin/bash", "-c", fmt.Sprintf(`echo '%s' > %s`, jsonStr, "/temp-proposal.json")).CombinedOutput() if err != nil { @@ -333,13 +333,14 @@ func (tr TestRun) submitConsumerRemovalProposal( } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - // CONSUMER REMOVAL PROPOSAL - bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, - "tx", "gov", "submit-legacy-proposal", "consumer-removal", "/temp-proposal.json", - `--from`, `validator`+fmt.Sprint(action.from), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), - `--home`, tr.getValidatorHome(action.chain, action.from), - `--node`, tr.getValidatorNode(action.chain, action.from), + bz, err = exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.Chain].BinaryName, + + "tx", "gov", "submit-legacy-proposal", "consumer-removal", + "/temp-proposal.json", + `--from`, `validator`+fmt.Sprint(action.From), + `--chain-id`, string(tr.chainConfigs[action.Chain].ChainId), + `--home`, tr.getValidatorHome(action.Chain, action.From), + `--node`, tr.getValidatorNode(action.Chain, action.From), `--gas`, "900000", `--keyring-backend`, `test`, `-y`, @@ -350,16 +351,16 @@ func (tr TestRun) submitConsumerRemovalProposal( } // wait for inclusion in a block -> '--broadcast-mode block' is deprecated - tr.waitBlocks(chainID("provi"), 2, 20*time.Second) + tr.waitBlocks(ChainID("provi"), 2, 20*time.Second) } type submitParamChangeLegacyProposalAction struct { - chain chainID - from validatorID - deposit uint - subspace string - key string - value interface{} + Chain ChainID + From ValidatorID + Deposit uint + Subspace string + Key string + Value interface{} } type paramChangeProposalJSON struct { @@ -384,8 +385,8 @@ func (tr TestRun) submitParamChangeProposal( Title: "Legacy Param change", Summary: "Changing legacy module params", Description: "Changing legacy module params", - Changes: []paramChangeJSON{{Subspace: action.subspace, Key: action.key, Value: action.value}}, - Deposit: fmt.Sprint(action.deposit) + `stake`, + Changes: []paramChangeJSON{{Subspace: action.Subspace, Key: action.Key, Value: action.Value}}, + Deposit: fmt.Sprint(action.Deposit) + `stake`, } bz, err := json.Marshal(prop) @@ -399,7 +400,7 @@ func (tr TestRun) submitParamChangeProposal( } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, + bz, err = exec.Command("docker", "exec", tr.containerConfig.InstanceName, "/bin/bash", "-c", fmt.Sprintf(`echo '%s' > %s`, jsonStr, "/params-proposal.json")).CombinedOutput() if err != nil { @@ -407,13 +408,15 @@ func (tr TestRun) submitParamChangeProposal( } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - // PARAM CHANGE PROPOSAL // we should be able to make these all one command which will be cool - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, + // PARAM CHANGE PROPOSAL + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.Chain].BinaryName, + "tx", "gov", "submit-legacy-proposal", "param-change", "/params-proposal.json", - `--from`, `validator`+fmt.Sprint(action.from), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), - `--home`, tr.getValidatorHome(action.chain, action.from), - `--node`, tr.getValidatorNode(action.chain, action.from), + + `--from`, `validator`+fmt.Sprint(action.From), + `--chain-id`, string(tr.chainConfigs[action.Chain].ChainId), + `--home`, tr.getValidatorHome(action.Chain, action.From), + `--node`, tr.getValidatorNode(action.Chain, action.From), `--gas`, "900000", `--keyring-backend`, `test`, `-y`, @@ -425,38 +428,38 @@ func (tr TestRun) submitParamChangeProposal( } // wait for inclusion in a block -> '--broadcast-mode block' is deprecated - tr.waitBlocks(action.chain, 2, 60*time.Second) + tr.waitBlocks(action.Chain, 2, 60*time.Second) } type submitEquivocationProposalAction struct { - chain chainID - height int64 - time time.Time - power int64 - validator validatorID - deposit uint - from validatorID + Chain ChainID + Height int64 + Time time.Time + Power int64 + Validator ValidatorID + Deposit uint + From ValidatorID } func (tr TestRun) submitEquivocationProposal(action submitEquivocationProposalAction, verbose bool) { - val := tr.validatorConfigs[action.validator] - providerChain := tr.chainConfigs[chainID("provi")] + val := tr.validatorConfigs[action.Validator] + providerChain := tr.chainConfigs[ChainID("provi")] prop := client.EquivocationProposalJSON{ Summary: "Validator equivocation!", EquivocationProposal: types.EquivocationProposal{ Title: "Validator equivocation!", - Description: fmt.Sprintf("Validator: %s has committed an equivocation infraction on chainID: %s", action.validator, action.chain), + Description: fmt.Sprintf("Validator: %s has committed an equivocation infraction on ChainID: %s", action.Validator, action.Chain), Equivocations: []*evidencetypes.Equivocation{ { - Height: action.height, - Time: action.time, - Power: action.power, - ConsensusAddress: val.valconsAddress, + Height: action.Height, + Time: action.Time, + Power: action.Power, + ConsensusAddress: val.ValconsAddress, }, }, }, - Deposit: fmt.Sprint(action.deposit) + `stake`, + Deposit: fmt.Sprint(action.Deposit) + `stake`, } bz, err := json.Marshal(prop) @@ -470,7 +473,7 @@ func (tr TestRun) submitEquivocationProposal(action submitEquivocationProposalAc } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, + bz, err = exec.Command("docker", "exec", tr.containerConfig.InstanceName, "/bin/bash", "-c", fmt.Sprintf(`echo '%s' > %s`, jsonStr, "/equivocation-proposal.json")).CombinedOutput() if err != nil { @@ -479,12 +482,14 @@ func (tr TestRun) submitEquivocationProposal(action submitEquivocationProposalAc //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. // EQUIVOCATION PROPOSAL - bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, providerChain.binaryName, + bz, err = exec.Command("docker", "exec", tr.containerConfig.InstanceName, providerChain.BinaryName, + "tx", "gov", "submit-legacy-proposal", "equivocation", "/equivocation-proposal.json", - `--from`, `validator`+fmt.Sprint(action.from), - `--chain-id`, string(providerChain.chainId), - `--home`, tr.getValidatorHome(providerChain.chainId, action.from), - `--node`, tr.getValidatorNode(providerChain.chainId, action.from), + + `--from`, `validator`+fmt.Sprint(action.From), + `--chain-id`, string(providerChain.ChainId), + `--home`, tr.getValidatorHome(providerChain.ChainId, action.From), + `--node`, tr.getValidatorNode(providerChain.ChainId, action.From), `--gas`, "9000000", `--keyring-backend`, `test`, `-y`, @@ -495,14 +500,14 @@ func (tr TestRun) submitEquivocationProposal(action submitEquivocationProposalAc } // wait for inclusion in a block -> '--broadcast-mode block' is deprecated - tr.waitBlocks(chainID("provi"), 2, 30*time.Second) + tr.waitBlocks(ChainID("provi"), 2, 30*time.Second) } type voteGovProposalAction struct { - chain chainID - from []validatorID - vote []string - propNumber uint + Chain ChainID + From []ValidatorID + Vote []string + PropNumber uint } func (tr *TestRun) voteGovProposal( @@ -510,21 +515,21 @@ func (tr *TestRun) voteGovProposal( verbose bool, ) { var wg sync.WaitGroup - for i, val := range action.from { + for i, val := range action.From { wg.Add(1) - vote := action.vote[i] - go func(val validatorID, vote string) { + vote := action.Vote[i] + go func(val ValidatorID, vote string) { defer wg.Done() //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, + bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.Chain].BinaryName, "tx", "gov", "vote", - fmt.Sprint(action.propNumber), vote, + fmt.Sprint(action.PropNumber), vote, `--from`, `validator`+fmt.Sprint(val), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), - `--home`, tr.getValidatorHome(action.chain, val), - `--node`, tr.getValidatorNode(action.chain, val), + `--chain-id`, string(tr.chainConfigs[action.Chain].ChainId), + `--home`, tr.getValidatorHome(action.Chain, val), + `--node`, tr.getValidatorNode(action.Chain, val), `--keyring-backend`, `test`, `--gas`, "900000", `-y`, @@ -537,15 +542,15 @@ func (tr *TestRun) voteGovProposal( wg.Wait() // wait for inclusion in a block -> '--broadcast-mode block' is deprecated - tr.waitBlocks(action.chain, 1, 10*time.Second) - tr.WaitTime(time.Duration(tr.chainConfigs[action.chain].votingWaitTime) * time.Second) + tr.waitBlocks(action.Chain, 1, 10*time.Second) + tr.WaitTime(time.Duration(tr.chainConfigs[action.Chain].VotingWaitTime) * time.Second) } type startConsumerChainAction struct { - consumerChain chainID - providerChain chainID - validators []StartChainValidator - genesisChanges string + ConsumerChain ChainID + ProviderChain ChainID + Validators []StartChainValidator + GenesisChanges string } func (tr *TestRun) startConsumerChain( @@ -553,12 +558,12 @@ func (tr *TestRun) startConsumerChain( verbose bool, ) { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.providerChain].binaryName, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.ProviderChain].BinaryName, "query", "provider", "consumer-genesis", - string(tr.chainConfigs[action.consumerChain].chainId), + string(tr.chainConfigs[action.ConsumerChain].ChainId), - `--node`, tr.getQueryNode(action.providerChain), + `--node`, tr.getQueryNode(action.ProviderChain), `-o`, `json`, ) @@ -572,24 +577,24 @@ func (tr *TestRun) startConsumerChain( } consumerGenesis := ".app_state.ccvconsumer = " + string(bz) - consumerGenesisChanges := tr.chainConfigs[action.consumerChain].genesisChanges + consumerGenesisChanges := tr.chainConfigs[action.ConsumerChain].GenesisChanges if consumerGenesisChanges != "" { - consumerGenesis = consumerGenesis + " | " + consumerGenesisChanges + " | " + action.genesisChanges + consumerGenesis = consumerGenesis + " | " + consumerGenesisChanges + " | " + action.GenesisChanges } tr.startChain(StartChainAction{ - chain: action.consumerChain, - validators: action.validators, - genesisChanges: consumerGenesis, - skipGentx: true, + Chain: action.ConsumerChain, + Validators: action.Validators, + GenesisChanges: consumerGenesis, + SkipGentx: true, }, verbose) } type ChangeoverChainAction struct { - sovereignChain chainID - providerChain chainID - validators []StartChainValidator - genesisChanges string + SovereignChain ChainID + ProviderChain ChainID + Validators []StartChainValidator + GenesisChanges string } func (tr TestRun) changeoverChain( @@ -599,12 +604,12 @@ func (tr TestRun) changeoverChain( // sleep until the consumer chain genesis is ready on consumer time.Sleep(5 * time.Second) //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.providerChain].binaryName, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.ProviderChain].BinaryName, "query", "provider", "consumer-genesis", - string(tr.chainConfigs[action.sovereignChain].chainId), + string(tr.chainConfigs[action.SovereignChain].ChainId), - `--node`, tr.getQueryNode(action.providerChain), + `--node`, tr.getQueryNode(action.ProviderChain), `-o`, `json`, ) @@ -618,14 +623,14 @@ func (tr TestRun) changeoverChain( } consumerGenesis := ".app_state.ccvconsumer = " + string(bz) - consumerGenesisChanges := tr.chainConfigs[action.sovereignChain].genesisChanges + consumerGenesisChanges := tr.chainConfigs[action.SovereignChain].GenesisChanges if consumerGenesisChanges != "" { - consumerGenesis = consumerGenesis + " | " + consumerGenesisChanges + " | " + action.genesisChanges + consumerGenesis = consumerGenesis + " | " + consumerGenesisChanges + " | " + action.GenesisChanges } tr.startChangeover(ChangeoverChainAction{ - validators: action.validators, - genesisChanges: consumerGenesis, + Validators: action.Validators, + GenesisChanges: consumerGenesis, }, verbose) } @@ -633,7 +638,7 @@ func (tr TestRun) startChangeover( action ChangeoverChainAction, verbose bool, ) { - chainConfig := tr.chainConfigs[chainID("sover")] + chainConfig := tr.chainConfigs[ChainID("sover")] type jsonValAttrs struct { Mnemonic string `json:"mnemonic"` Allocation string `json:"allocation"` @@ -649,20 +654,20 @@ func (tr TestRun) startChangeover( } var validators []jsonValAttrs - for _, val := range action.validators { + for _, val := range action.Validators { validators = append(validators, jsonValAttrs{ - Mnemonic: tr.validatorConfigs[val.id].mnemonic, - NodeKey: tr.validatorConfigs[val.id].nodeKey, - ValId: fmt.Sprint(val.id), - PrivValidatorKey: tr.validatorConfigs[val.id].privValidatorKey, - Allocation: fmt.Sprint(val.allocation) + "stake", - Stake: fmt.Sprint(val.stake) + "stake", - IpSuffix: tr.validatorConfigs[val.id].ipSuffix, - - ConsumerMnemonic: tr.validatorConfigs[val.id].consumerMnemonic, - ConsumerPrivValidatorKey: tr.validatorConfigs[val.id].consumerPrivValidatorKey, + Mnemonic: tr.validatorConfigs[val.Id].Mnemonic, + NodeKey: tr.validatorConfigs[val.Id].NodeKey, + ValId: fmt.Sprint(val.Id), + PrivValidatorKey: tr.validatorConfigs[val.Id].PrivValidatorKey, + Allocation: fmt.Sprint(val.Allocation) + "stake", + Stake: fmt.Sprint(val.Stake) + "stake", + IpSuffix: tr.validatorConfigs[val.Id].IpSuffix, + + ConsumerMnemonic: tr.validatorConfigs[val.Id].ConsumerMnemonic, + ConsumerPrivValidatorKey: tr.validatorConfigs[val.Id].ConsumerPrivValidatorKey, // if true node will be started with consumer key for each consumer chain - StartWithConsumerKey: tr.validatorConfigs[val.id].useConsumerKey, + StartWithConsumerKey: tr.validatorConfigs[val.Id].UseConsumerKey, }) } @@ -673,16 +678,16 @@ func (tr TestRun) startChangeover( // Concat genesis changes defined in chain config, with any custom genesis changes for this chain instantiation var genesisChanges string - if action.genesisChanges != "" { - genesisChanges = chainConfig.genesisChanges + " | " + action.genesisChanges + if action.GenesisChanges != "" { + genesisChanges = chainConfig.GenesisChanges + " | " + action.GenesisChanges } else { - genesisChanges = chainConfig.genesisChanges + genesisChanges = chainConfig.GenesisChanges } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "/bin/bash", - "/testnet-scripts/start-changeover.sh", chainConfig.upgradeBinary, string(vals), - "sover", chainConfig.ipPrefix, genesisChanges, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "/bin/bash", + "/testnet-scripts/start-changeover.sh", chainConfig.UpgradeBinary, string(vals), + "sover", chainConfig.IpPrefix, genesisChanges, tr.tendermintConfigOverride, ) @@ -713,8 +718,8 @@ func (tr TestRun) startChangeover( } type addChainToRelayerAction struct { - chain chainID - validator validatorID + Chain ChainID + Validator ValidatorID } const hermesChainConfigTemplate = ` @@ -779,37 +784,37 @@ func (tr TestRun) addChainToGorelayer( action addChainToRelayerAction, verbose bool, ) { - queryNodeIP := tr.getQueryNodeIP(action.chain) - chainId := tr.chainConfigs[action.chain].chainId + queryNodeIP := tr.getQueryNodeIP(action.Chain) + ChainId := tr.chainConfigs[action.Chain].ChainId rpcAddr := "http://" + queryNodeIP + ":26658" chainConfig := fmt.Sprintf(gorelayerChainConfigTemplate, - chainId, + ChainId, rpcAddr, ) //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, "rly", "config", "init").CombinedOutput() + bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "rly", "config", "init").CombinedOutput() if err != nil && !strings.Contains(string(bz), "config already exists") { log.Fatal(err, "\n", string(bz)) } - chainConfigFileName := fmt.Sprintf("/root/%s_config.json", chainId) + chainConfigFileName := fmt.Sprintf("/root/%s_config.json", ChainId) bashCommand := fmt.Sprintf(`echo '%s' >> %s`, chainConfig, chainConfigFileName) //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, "bash", "-c", + bz, err = exec.Command("docker", "exec", tr.containerConfig.InstanceName, "bash", "-c", bashCommand).CombinedOutput() if err != nil { log.Fatal(err, "\n", string(bz)) } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - addChainCommand := exec.Command("docker", "exec", tr.containerConfig.instanceName, "rly", "chains", "add", "--file", chainConfigFileName, string(chainId)) + addChainCommand := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "rly", "chains", "add", "--file", chainConfigFileName, string(ChainId)) executeCommand(addChainCommand, "add chain") //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - keyRestoreCommand := exec.Command("docker", "exec", tr.containerConfig.instanceName, "rly", "keys", "restore", string(chainId), "default", tr.validatorConfigs[action.validator].mnemonic) + keyRestoreCommand := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "rly", "keys", "restore", string(ChainId), "default", tr.validatorConfigs[action.Validator].Mnemonic) executeCommand(keyRestoreCommand, "restore keys") } @@ -817,8 +822,8 @@ func (tr TestRun) addChainToHermes( action addChainToRelayerAction, verbose bool, ) { - queryNodeIP := tr.getQueryNodeIP(action.chain) - chainId := tr.chainConfigs[action.chain].chainId + queryNodeIP := tr.getQueryNodeIP(action.Chain) + ChainId := tr.chainConfigs[action.Chain].ChainId keyName := "query" rpcAddr := "http://" + queryNodeIP + ":26658" grpcAddr := "tcp://" + queryNodeIP + ":9091" @@ -826,7 +831,7 @@ func (tr TestRun) addChainToHermes( chainConfig := fmt.Sprintf(hermesChainConfigTemplate, grpcAddr, - chainId, + ChainId, keyName, rpcAddr, wsAddr, @@ -836,7 +841,7 @@ func (tr TestRun) addChainToHermes( bashCommand := fmt.Sprintf(`echo '%s' >> %s`, chainConfig, "/root/.hermes/config.toml") //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, "bash", "-c", + bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "bash", "-c", bashCommand, ).CombinedOutput() if err != nil { @@ -844,9 +849,9 @@ func (tr TestRun) addChainToHermes( } // Save mnemonic to file within container - saveMnemonicCommand := fmt.Sprintf(`echo '%s' > %s`, tr.validatorConfigs[action.validator].mnemonic, "/root/.hermes/mnemonic.txt") + saveMnemonicCommand := fmt.Sprintf(`echo '%s' > %s`, tr.validatorConfigs[action.Validator].Mnemonic, "/root/.hermes/mnemonic.txt") //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, "bash", "-c", + bz, err = exec.Command("docker", "exec", tr.containerConfig.InstanceName, "bash", "-c", saveMnemonicCommand, ).CombinedOutput() if err != nil { @@ -854,9 +859,9 @@ func (tr TestRun) addChainToHermes( } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", + bz, err = exec.Command("docker", "exec", tr.containerConfig.InstanceName, "hermes", "keys", "add", - "--chain", string(tr.chainConfigs[action.chain].chainId), + "--chain", string(tr.chainConfigs[action.Chain].ChainId), "--mnemonic-file", "/root/.hermes/mnemonic.txt", ).CombinedOutput() @@ -886,10 +891,10 @@ const gorelayerPathConfigTemplate = `{ ` type addIbcConnectionAction struct { - chainA chainID - chainB chainID - clientA uint - clientB uint + ChainA ChainID + ChainB ChainID + ClientA uint + ClientB uint } func (tr TestRun) addIbcConnection( @@ -907,23 +912,23 @@ func (tr TestRun) addIbcConnectionGorelayer( action addIbcConnectionAction, verbose bool, ) { - pathName := tr.GetPathNameForGorelayer(action.chainA, action.chainB) + pathName := tr.GetPathNameForGorelayer(action.ChainA, action.ChainB) - pathConfig := fmt.Sprintf(gorelayerPathConfigTemplate, action.chainA, action.clientA, action.chainB, action.clientB) + pathConfig := fmt.Sprintf(gorelayerPathConfigTemplate, action.ChainA, action.ClientA, action.ChainB, action.ClientB) pathConfigFileName := fmt.Sprintf("/root/%s_config.json", pathName) bashCommand := fmt.Sprintf(`echo '%s' >> %s`, pathConfig, pathConfigFileName) //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - pathConfigCommand := exec.Command("docker", "exec", tr.containerConfig.instanceName, "bash", "-c", + pathConfigCommand := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "bash", "-c", bashCommand) executeCommand(pathConfigCommand, "add path config") //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - newPathCommand := exec.Command("docker", "exec", tr.containerConfig.instanceName, "rly", + newPathCommand := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "rly", "paths", "add", - string(tr.chainConfigs[action.chainA].chainId), - string(tr.chainConfigs[action.chainB].chainId), + string(tr.chainConfigs[action.ChainA].ChainId), + string(tr.chainConfigs[action.ChainB].ChainId), pathName, "--file", pathConfigFileName, ) @@ -931,31 +936,31 @@ func (tr TestRun) addIbcConnectionGorelayer( executeCommand(newPathCommand, "new path") //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - newClientsCommand := exec.Command("docker", "exec", tr.containerConfig.instanceName, "rly", + newClientsCommand := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "rly", "transact", "clients", pathName, ) executeCommand(newClientsCommand, "new clients") - tr.waitBlocks(action.chainA, 1, 10*time.Second) - tr.waitBlocks(action.chainB, 1, 10*time.Second) + tr.waitBlocks(action.ChainA, 1, 10*time.Second) + tr.waitBlocks(action.ChainB, 1, 10*time.Second) //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - newConnectionCommand := exec.Command("docker", "exec", tr.containerConfig.instanceName, "rly", + newConnectionCommand := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "rly", "transact", "connection", pathName, ) executeCommand(newConnectionCommand, "new connection") - tr.waitBlocks(action.chainA, 1, 10*time.Second) - tr.waitBlocks(action.chainB, 1, 10*time.Second) + tr.waitBlocks(action.ChainA, 1, 10*time.Second) + tr.waitBlocks(action.ChainB, 1, 10*time.Second) } type createIbcClientsAction struct { - chainA chainID - chainB chainID + ChainA ChainID + ChainB ChainID } // if clients are not provided hermes will first @@ -966,10 +971,10 @@ func (tr TestRun) createIbcClientsHermes( verbose bool, ) { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "hermes", "create", "connection", - "--a-chain", string(tr.chainConfigs[action.chainA].chainId), - "--b-chain", string(tr.chainConfigs[action.chainB].chainId), + "--a-chain", string(tr.chainConfigs[action.ChainA].ChainId), + "--b-chain", string(tr.chainConfigs[action.ChainB].ChainId), ) cmdReader, err := cmd.StdoutPipe() @@ -1003,11 +1008,11 @@ func (tr TestRun) addIbcConnectionHermes( verbose bool, ) { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "hermes", "create", "connection", - "--a-chain", string(tr.chainConfigs[action.chainA].chainId), - "--a-client", "07-tendermint-"+fmt.Sprint(action.clientA), - "--b-client", "07-tendermint-"+fmt.Sprint(action.clientB), + "--a-chain", string(tr.chainConfigs[action.ChainA].ChainId), + "--a-client", "07-tendermint-"+fmt.Sprint(action.ClientA), + "--b-client", "07-tendermint-"+fmt.Sprint(action.ClientB), ) cmdReader, err := cmd.StdoutPipe() @@ -1037,13 +1042,13 @@ func (tr TestRun) addIbcConnectionHermes( } type addIbcChannelAction struct { - chainA chainID - chainB chainID - connectionA uint - portA string - portB string - order string - version string + ChainA ChainID + ChainB ChainID + ConnectionA uint + PortA string + PortB string + Order string + Version string } type startRelayerAction struct{} @@ -1065,7 +1070,7 @@ func (tr TestRun) startGorelayer( ) { // gorelayer start is running in detached mode //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", "-d", tr.containerConfig.instanceName, "rly", + cmd := exec.Command("docker", "exec", "-d", tr.containerConfig.InstanceName, "rly", "start", ) @@ -1084,7 +1089,7 @@ func (tr TestRun) startHermes( ) { // hermes start is running in detached mode //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", "-d", tr.containerConfig.instanceName, "hermes", + cmd := exec.Command("docker", "exec", "-d", tr.containerConfig.InstanceName, "hermes", "start", ) @@ -1112,15 +1117,15 @@ func (tr TestRun) addIbcChannelGorelayer( action addIbcChannelAction, verbose bool, ) { - pathName := tr.GetPathNameForGorelayer(action.chainA, action.chainB) + pathName := tr.GetPathNameForGorelayer(action.ChainA, action.ChainB) //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "rly", + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "rly", "transact", "channel", pathName, - "--src-port", action.portA, - "--dst-port", action.portB, - "--version", tr.containerConfig.ccvVersion, - "--order", action.order, + "--src-port", action.PortA, + "--dst-port", action.PortB, + "--version", tr.containerConfig.CcvVersion, + "--order", action.Order, "--debug", ) executeCommand(cmd, "addChannel") @@ -1132,20 +1137,20 @@ func (tr TestRun) addIbcChannelHermes( ) { // if version is not specified, use the default version when creating ccv connections // otherwise, use the provided version schema (usually it is ICS20-1 for IBC transfer) - chanVersion := action.version + chanVersion := action.Version if chanVersion == "" { - chanVersion = tr.containerConfig.ccvVersion + chanVersion = tr.containerConfig.CcvVersion } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "hermes", "create", "channel", - "--a-chain", string(tr.chainConfigs[action.chainA].chainId), - "--a-connection", "connection-"+fmt.Sprint(action.connectionA), - "--a-port", action.portA, - "--b-port", action.portB, + "--a-chain", string(tr.chainConfigs[action.ChainA].ChainId), + "--a-connection", "connection-"+fmt.Sprint(action.ConnectionA), + "--a-port", action.PortA, + "--b-port", action.PortB, "--channel-version", chanVersion, - "--order", action.order, + "--order", action.Order, ) if verbose { @@ -1179,14 +1184,14 @@ func (tr TestRun) addIbcChannelHermes( } type transferChannelCompleteAction struct { - chainA chainID - chainB chainID - connectionA uint - portA string - portB string - order string - channelA uint - channelB uint + ChainA ChainID + ChainB ChainID + ConnectionA uint + PortA string + PortB string + Order string + ChannelA uint + ChannelB uint } func (tr TestRun) transferChannelComplete( @@ -1198,41 +1203,41 @@ func (tr TestRun) transferChannelComplete( } //#nosec G204 -- Bypass linter warning for spawning subprocess with chanOpenTryCmd arguments. - chanOpenTryCmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", + chanOpenTryCmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "hermes", "tx", "chan-open-try", - "--dst-chain", string(tr.chainConfigs[action.chainB].chainId), - "--src-chain", string(tr.chainConfigs[action.chainA].chainId), - "--dst-connection", "connection-"+fmt.Sprint(action.connectionA), - "--dst-port", action.portB, - "--src-port", action.portA, - "--src-channel", "channel-"+fmt.Sprint(action.channelA), + "--dst-chain", string(tr.chainConfigs[action.ChainB].ChainId), + "--src-chain", string(tr.chainConfigs[action.ChainA].ChainId), + "--dst-connection", "connection-"+fmt.Sprint(action.ConnectionA), + "--dst-port", action.PortB, + "--src-port", action.PortA, + "--src-channel", "channel-"+fmt.Sprint(action.ChannelA), ) executeCommand(chanOpenTryCmd, "transferChanOpenTry") //#nosec G204 -- Bypass linter warning for spawning subprocess with chanOpenAckCmd arguments. - chanOpenAckCmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", + chanOpenAckCmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "hermes", "tx", "chan-open-ack", - "--dst-chain", string(tr.chainConfigs[action.chainA].chainId), - "--src-chain", string(tr.chainConfigs[action.chainB].chainId), - "--dst-connection", "connection-"+fmt.Sprint(action.connectionA), - "--dst-port", action.portA, - "--src-port", action.portB, - "--dst-channel", "channel-"+fmt.Sprint(action.channelA), - "--src-channel", "channel-"+fmt.Sprint(action.channelB), + "--dst-chain", string(tr.chainConfigs[action.ChainA].ChainId), + "--src-chain", string(tr.chainConfigs[action.ChainB].ChainId), + "--dst-connection", "connection-"+fmt.Sprint(action.ConnectionA), + "--dst-port", action.PortA, + "--src-port", action.PortB, + "--dst-channel", "channel-"+fmt.Sprint(action.ChannelA), + "--src-channel", "channel-"+fmt.Sprint(action.ChannelB), ) executeCommand(chanOpenAckCmd, "transferChanOpenAck") //#nosec G204 -- Bypass linter warning for spawning subprocess with chanOpenConfirmCmd arguments. - chanOpenConfirmCmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", + chanOpenConfirmCmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "hermes", "tx", "chan-open-confirm", - "--dst-chain", string(tr.chainConfigs[action.chainB].chainId), - "--src-chain", string(tr.chainConfigs[action.chainA].chainId), - "--dst-connection", "connection-"+fmt.Sprint(action.connectionA), - "--dst-port", action.portB, - "--src-port", action.portA, - "--dst-channel", "channel-"+fmt.Sprint(action.channelB), - "--src-channel", "channel-"+fmt.Sprint(action.channelA), + "--dst-chain", string(tr.chainConfigs[action.ChainB].ChainId), + "--src-chain", string(tr.chainConfigs[action.ChainA].ChainId), + "--dst-connection", "connection-"+fmt.Sprint(action.ConnectionA), + "--dst-port", action.PortB, + "--src-port", action.PortA, + "--dst-channel", "channel-"+fmt.Sprint(action.ChannelB), + "--src-channel", "channel-"+fmt.Sprint(action.ChannelA), ) executeCommand(chanOpenConfirmCmd, "transferChanOpenConfirm") } @@ -1271,10 +1276,10 @@ func executeCommand(cmd *exec.Cmd, cmdName string) { } type relayPacketsAction struct { - chainA chainID - chainB chainID - port string - channel uint + ChainA ChainID + ChainB ChainID + Port string + Channel uint } func (tr TestRun) relayPackets( @@ -1292,13 +1297,13 @@ func (tr TestRun) relayPacketsGorelayer( action relayPacketsAction, verbose bool, ) { - pathName := tr.GetPathNameForGorelayer(action.chainA, action.chainB) + pathName := tr.GetPathNameForGorelayer(action.ChainA, action.ChainB) // rly transact relay-packets [path-name] --channel [channel-id] //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "rly", "transact", "flush", + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "rly", "transact", "flush", pathName, - "channel-"+fmt.Sprint(action.channel), + "channel-"+fmt.Sprint(action.Channel), ) if verbose { log.Println("relayPackets cmd:", cmd.String()) @@ -1308,8 +1313,8 @@ func (tr TestRun) relayPacketsGorelayer( log.Fatal(err, "\n", string(bz)) } - tr.waitBlocks(action.chainA, 1, 30*time.Second) - tr.waitBlocks(action.chainB, 1, 30*time.Second) + tr.waitBlocks(action.ChainA, 1, 30*time.Second) + tr.waitBlocks(action.ChainB, 1, 30*time.Second) } func (tr TestRun) relayPacketsHermes( @@ -1318,10 +1323,10 @@ func (tr TestRun) relayPacketsHermes( ) { // hermes clear packets ibc0 transfer channel-13 //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "hermes", "clear", "packets", - "--chain", string(tr.chainConfigs[action.chainA].chainId), - "--port", action.port, - "--channel", "channel-"+fmt.Sprint(action.channel), + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "hermes", "clear", "packets", + "--chain", string(tr.chainConfigs[action.ChainA].ChainId), + "--port", action.Port, + "--channel", "channel-"+fmt.Sprint(action.Channel), ) if verbose { log.Println("relayPackets cmd:", cmd.String()) @@ -1332,58 +1337,58 @@ func (tr TestRun) relayPacketsHermes( log.Fatal(err, "\n", string(bz)) } - tr.waitBlocks(action.chainA, 1, 30*time.Second) - tr.waitBlocks(action.chainB, 1, 30*time.Second) + tr.waitBlocks(action.ChainA, 1, 30*time.Second) + tr.waitBlocks(action.ChainB, 1, 30*time.Second) } type relayRewardPacketsToProviderAction struct { - consumerChain chainID - providerChain chainID - port string - channel uint + ConsumerChain ChainID + ProviderChain ChainID + Port string + Channel uint } func (tr TestRun) relayRewardPacketsToProvider( action relayRewardPacketsToProviderAction, verbose bool, ) { - blockPerDistribution, _ := strconv.ParseUint(strings.Trim(tr.getParam(action.consumerChain, Param{Subspace: "ccvconsumer", Key: "BlocksPerDistributionTransmission"}), "\""), 10, 64) - currentBlock := uint64(tr.getBlockHeight(action.consumerChain)) + blockPerDistribution, _ := strconv.ParseUint(strings.Trim(tr.getParam(action.ConsumerChain, Param{Subspace: "ccvconsumer", Key: "BlocksPerDistributionTransmission"}), "\""), 10, 64) + currentBlock := uint64(tr.getBlockHeight(action.ConsumerChain)) if currentBlock <= blockPerDistribution { - tr.waitBlocks(action.consumerChain, uint(blockPerDistribution-currentBlock+1), 60*time.Second) + tr.waitBlocks(action.ConsumerChain, uint(blockPerDistribution-currentBlock+1), 60*time.Second) } - tr.relayPackets(relayPacketsAction{chainA: action.consumerChain, chainB: action.providerChain, port: action.port, channel: action.channel}, verbose) - tr.waitBlocks(action.providerChain, 1, 10*time.Second) + tr.relayPackets(relayPacketsAction{ChainA: action.ConsumerChain, ChainB: action.ProviderChain, Port: action.Port, Channel: action.Channel}, verbose) + tr.waitBlocks(action.ProviderChain, 1, 10*time.Second) } type delegateTokensAction struct { - chain chainID - from validatorID - to validatorID - amount uint + Chain ChainID + From ValidatorID + To ValidatorID + Amount uint } func (tr TestRun) delegateTokens( action delegateTokensAction, verbose bool, ) { - toValCfg := tr.validatorConfigs[action.to] - delegateAddr := toValCfg.valoperAddress - if action.chain != chainID("provi") && toValCfg.useConsumerKey { - delegateAddr = toValCfg.consumerValoperAddress + toValCfg := tr.validatorConfigs[action.To] + delegateAddr := toValCfg.ValoperAddress + if action.Chain != ChainID("provi") && toValCfg.UseConsumerKey { + delegateAddr = toValCfg.ConsumerValoperAddress } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.Chain].BinaryName, "tx", "staking", "delegate", delegateAddr, - fmt.Sprint(action.amount)+`stake`, + fmt.Sprint(action.Amount)+`stake`, - `--from`, `validator`+fmt.Sprint(action.from), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), - `--home`, tr.getValidatorHome(action.chain, action.from), - `--node`, tr.getValidatorNode(action.chain, action.from), + `--from`, `validator`+fmt.Sprint(action.From), + `--chain-id`, string(tr.chainConfigs[action.Chain].ChainId), + `--home`, tr.getValidatorHome(action.Chain, action.From), + `--node`, tr.getValidatorNode(action.Chain, action.From), `--keyring-backend`, `test`, `-y`, ) @@ -1398,36 +1403,36 @@ func (tr TestRun) delegateTokens( } // wait for inclusion in a block -> '--broadcast-mode block' is deprecated - tr.waitBlocks(action.chain, 2, 10*time.Second) + tr.waitBlocks(action.Chain, 2, 10*time.Second) } type unbondTokensAction struct { - chain chainID - sender validatorID - unbondFrom validatorID - amount uint + Chain ChainID + Sender ValidatorID + UnbondFrom ValidatorID + Amount uint } func (tr TestRun) unbondTokens( action unbondTokensAction, verbose bool, ) { - unbondFrom := tr.validatorConfigs[action.unbondFrom].valoperAddress - if tr.validatorConfigs[action.unbondFrom].useConsumerKey { - unbondFrom = tr.validatorConfigs[action.unbondFrom].consumerValoperAddress + unbondFrom := tr.validatorConfigs[action.UnbondFrom].ValoperAddress + if tr.validatorConfigs[action.UnbondFrom].UseConsumerKey { + unbondFrom = tr.validatorConfigs[action.UnbondFrom].ConsumerValoperAddress } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.Chain].BinaryName, "tx", "staking", "unbond", unbondFrom, - fmt.Sprint(action.amount)+`stake`, + fmt.Sprint(action.Amount)+`stake`, - `--from`, `validator`+fmt.Sprint(action.sender), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), - `--home`, tr.getValidatorHome(action.chain, action.sender), - `--node`, tr.getValidatorNode(action.chain, action.sender), + `--from`, `validator`+fmt.Sprint(action.Sender), + `--chain-id`, string(tr.chainConfigs[action.Chain].ChainId), + `--home`, tr.getValidatorHome(action.Chain, action.Sender), + `--node`, tr.getValidatorNode(action.Chain, action.Sender), `--gas`, "900000", `--keyring-backend`, `test`, `-y`, @@ -1443,33 +1448,33 @@ func (tr TestRun) unbondTokens( } // wait for inclusion in a block -> '--broadcast-mode block' is deprecated - tr.waitBlocks(action.chain, 2, 20*time.Second) + tr.waitBlocks(action.Chain, 2, 20*time.Second) } type cancelUnbondTokensAction struct { - chain chainID - delegator validatorID - validator validatorID - amount uint + Chain ChainID + Delegator ValidatorID + Validator ValidatorID + Amount uint } func (tr TestRun) cancelUnbondTokens( action cancelUnbondTokensAction, verbose bool, ) { - validator := tr.validatorConfigs[action.validator].valoperAddress - if tr.validatorConfigs[action.validator].useConsumerKey { - validator = tr.validatorConfigs[action.validator].consumerValoperAddress + validator := tr.validatorConfigs[action.Validator].ValoperAddress + if tr.validatorConfigs[action.Validator].UseConsumerKey { + validator = tr.validatorConfigs[action.Validator].ConsumerValoperAddress } // get creation-height from state //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.Chain].BinaryName, "q", "staking", "unbonding-delegation", - tr.validatorConfigs[action.delegator].delAddress, + tr.validatorConfigs[action.Delegator].DelAddress, validator, - `--home`, tr.getValidatorHome(action.chain, action.delegator), - `--node`, tr.getValidatorNode(action.chain, action.delegator), + `--home`, tr.getValidatorHome(action.Chain, action.Delegator), + `--node`, tr.getValidatorNode(action.Chain, action.Delegator), `-o`, `json`, ) if verbose { @@ -1486,15 +1491,15 @@ func (tr TestRun) cancelUnbondTokens( } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd = exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, + cmd = exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.Chain].BinaryName, "tx", "staking", "cancel-unbond", validator, - fmt.Sprint(action.amount)+`stake`, + fmt.Sprint(action.Amount)+`stake`, fmt.Sprint(creationHeight), - `--from`, `validator`+fmt.Sprint(action.delegator), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), - `--home`, tr.getValidatorHome(action.chain, action.delegator), - `--node`, tr.getValidatorNode(action.chain, action.delegator), + `--from`, `validator`+fmt.Sprint(action.Delegator), + `--chain-id`, string(tr.chainConfigs[action.Chain].ChainId), + `--home`, tr.getValidatorHome(action.Chain, action.Delegator), + `--node`, tr.getValidatorNode(action.Chain, action.Delegator), `--gas`, "900000", `--keyring-backend`, `test`, `-o`, `json`, @@ -1511,43 +1516,43 @@ func (tr TestRun) cancelUnbondTokens( } // wait for inclusion in a block -> '--broadcast-mode block' is deprecated - tr.waitBlocks(action.chain, 2, 20*time.Second) + tr.waitBlocks(action.Chain, 2, 20*time.Second) } type redelegateTokensAction struct { - chain chainID - src validatorID - dst validatorID - txSender validatorID - amount uint + Chain ChainID + Src ValidatorID + Dst ValidatorID + TxSender ValidatorID + Amount uint } func (tr TestRun) redelegateTokens(action redelegateTokensAction, verbose bool) { - srcCfg := tr.validatorConfigs[action.src] - dstCfg := tr.validatorConfigs[action.dst] + srcCfg := tr.validatorConfigs[action.Src] + dstCfg := tr.validatorConfigs[action.Dst] - redelegateSrc := srcCfg.valoperAddress - if action.chain != chainID("provi") && srcCfg.useConsumerKey { - redelegateSrc = srcCfg.consumerValoperAddress + redelegateSrc := srcCfg.ValoperAddress + if action.Chain != ChainID("provi") && srcCfg.UseConsumerKey { + redelegateSrc = srcCfg.ConsumerValoperAddress } - redelegateDst := dstCfg.valoperAddress - if action.chain != chainID("provi") && dstCfg.useConsumerKey { - redelegateDst = dstCfg.consumerValoperAddress + redelegateDst := dstCfg.ValoperAddress + if action.Chain != ChainID("provi") && dstCfg.UseConsumerKey { + redelegateDst = dstCfg.ConsumerValoperAddress } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", - tr.containerConfig.instanceName, - tr.chainConfigs[action.chain].binaryName, + tr.containerConfig.InstanceName, + tr.chainConfigs[action.Chain].BinaryName, "tx", "staking", "redelegate", redelegateSrc, redelegateDst, - fmt.Sprint(action.amount)+`stake`, - `--from`, `validator`+fmt.Sprint(action.txSender), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), - `--home`, tr.getValidatorHome(action.chain, action.txSender), - `--node`, tr.getValidatorNode(action.chain, action.txSender), + fmt.Sprint(action.Amount)+`stake`, + `--from`, `validator`+fmt.Sprint(action.TxSender), + `--chain-id`, string(tr.chainConfigs[action.Chain].ChainId), + `--home`, tr.getValidatorHome(action.Chain, action.TxSender), + `--node`, tr.getValidatorNode(action.Chain, action.TxSender), // Need to manually set gas limit past default (200000), since redelegate has a lot of operations `--gas`, "900000", `--keyring-backend`, `test`, @@ -1564,12 +1569,12 @@ func (tr TestRun) redelegateTokens(action redelegateTokensAction, verbose bool) } // wait for inclusion in a block -> '--broadcast-mode block' is deprecated - tr.waitBlocks(action.chain, 2, 10*time.Second) + tr.waitBlocks(action.Chain, 2, 10*time.Second) } type downtimeSlashAction struct { - chain chainID - validator validatorID + Chain ChainID + Validator ValidatorID } // takes a string representation of the private key like @@ -1588,15 +1593,15 @@ func (tr TestRun) getValidatorKeyAddressFromString(keystring string) string { func (tr TestRun) invokeDowntimeSlash(action downtimeSlashAction, verbose bool) { // Bring validator down - tr.setValidatorDowntime(action.chain, action.validator, true, verbose) + tr.setValidatorDowntime(action.Chain, action.Validator, true, verbose) // Wait appropriate amount of blocks for validator to be slashed - tr.waitBlocks(action.chain, 10, 3*time.Minute) + tr.waitBlocks(action.Chain, 10, 3*time.Minute) // Bring validator back up - tr.setValidatorDowntime(action.chain, action.validator, false, verbose) + tr.setValidatorDowntime(action.Chain, action.Validator, false, verbose) } // Sets validator downtime by setting the virtual ethernet interface of a node to "up" or "down" -func (tr TestRun) setValidatorDowntime(chain chainID, validator validatorID, down, verbose bool) { +func (tr TestRun) setValidatorDowntime(chain ChainID, validator ValidatorID, down, verbose bool) { var lastArg string if down { lastArg = "down" @@ -1621,7 +1626,7 @@ func (tr TestRun) setValidatorDowntime(chain chainID, validator validatorID, dow cmd := exec.Command( "docker", "exec", - tr.containerConfig.instanceName, + tr.containerConfig.InstanceName, "ip", "link", "set", @@ -1639,16 +1644,16 @@ func (tr TestRun) setValidatorDowntime(chain chainID, validator validatorID, dow } } -func (tr TestRun) GetValidatorPrivateKeyAddress(chain chainID, validator validatorID) string { +func (tr TestRun) GetValidatorPrivateKeyAddress(chain ChainID, validator ValidatorID) string { var validatorPrivateKeyAddress string - if chain == chainID("provi") { - validatorPrivateKeyAddress = tr.getValidatorKeyAddressFromString(tr.validatorConfigs[validator].privValidatorKey) + if chain == ChainID("provi") { + validatorPrivateKeyAddress = tr.getValidatorKeyAddressFromString(tr.validatorConfigs[validator].PrivValidatorKey) } else { var valAddressString string - if tr.validatorConfigs[validator].useConsumerKey { - valAddressString = tr.validatorConfigs[validator].consumerPrivValidatorKey + if tr.validatorConfigs[validator].UseConsumerKey { + valAddressString = tr.validatorConfigs[validator].ConsumerPrivValidatorKey } else { - valAddressString = tr.validatorConfigs[validator].privValidatorKey + valAddressString = tr.validatorConfigs[validator].PrivValidatorKey } validatorPrivateKeyAddress = tr.getValidatorKeyAddressFromString(valAddressString) } @@ -1656,8 +1661,8 @@ func (tr TestRun) GetValidatorPrivateKeyAddress(chain chainID, validator validat } type unjailValidatorAction struct { - provider chainID - validator validatorID + Provider ChainID + Validator ValidatorID } // Sends an unjail transaction to the provider chain @@ -1667,14 +1672,14 @@ func (tr TestRun) unjailValidator(action unjailValidatorAction, verbose bool) { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", - tr.containerConfig.instanceName, - tr.chainConfigs[action.provider].binaryName, + tr.containerConfig.InstanceName, + tr.chainConfigs[action.Provider].BinaryName, "tx", "slashing", "unjail", // Validator is sender here - `--from`, `validator`+fmt.Sprint(action.validator), - `--chain-id`, string(tr.chainConfigs[action.provider].chainId), - `--home`, tr.getValidatorHome(action.provider, action.validator), - `--node`, tr.getValidatorNode(action.provider, action.validator), + `--from`, `validator`+fmt.Sprint(action.Validator), + `--chain-id`, string(tr.chainConfigs[action.Provider].ChainId), + `--home`, tr.getValidatorHome(action.Provider, action.Validator), + `--node`, tr.getValidatorNode(action.Provider, action.Validator), `--gas`, "900000", `--keyring-backend`, `test`, `-y`, @@ -1691,13 +1696,13 @@ func (tr TestRun) unjailValidator(action unjailValidatorAction, verbose bool) { // wait for 1 blocks to make sure that tx got included // in a block and packets committed before proceeding - tr.waitBlocks(action.provider, 2, time.Minute) + tr.waitBlocks(action.Provider, 2, time.Minute) } type registerRepresentativeAction struct { - chain chainID - representatives []validatorID - stakes []uint + Chain ChainID + Representatives []ValidatorID + Stakes []uint } func (tr TestRun) registerRepresentative( @@ -1705,16 +1710,16 @@ func (tr TestRun) registerRepresentative( verbose bool, ) { var wg sync.WaitGroup - for i, val := range action.representatives { + for i, val := range action.Representatives { wg.Add(1) - stake := action.stakes[i] - go func(val validatorID, stake uint) { + stake := action.Stakes[i] + go func(val ValidatorID, stake uint) { defer wg.Done() //#nosec G204 -- Bypass linter warning for spawning subprocess with pubKeycmd arguments. - pubKeycmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, + pubKeycmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.Chain].BinaryName, "tendermint", "show-validator", - `--home`, tr.getValidatorHome(action.chain, val), + `--home`, tr.getValidatorHome(action.Chain, val), ) bzPubKey, err := pubKeycmd.CombinedOutput() @@ -1723,7 +1728,7 @@ func (tr TestRun) registerRepresentative( } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[action.chain].binaryName, + bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[action.Chain].BinaryName, "tx", "staking", "create-validator", `--amount`, fmt.Sprint(stake)+"stake", `--pubkey`, string(bzPubKey), @@ -1733,9 +1738,9 @@ func (tr TestRun) registerRepresentative( `--commission-max-change-rate`, "0.01", `--min-self-delegation`, "1", `--from`, `validator`+fmt.Sprint(val), - `--chain-id`, string(tr.chainConfigs[action.chain].chainId), - `--home`, tr.getValidatorHome(action.chain, val), - `--node`, tr.getValidatorNode(action.chain, val), + `--chain-id`, string(tr.chainConfigs[action.Chain].ChainId), + `--home`, tr.getValidatorHome(action.Chain, val), + `--node`, tr.getValidatorNode(action.Chain, val), `--keyring-backend`, `test`, `-y`, ).CombinedOutput() @@ -1744,7 +1749,7 @@ func (tr TestRun) registerRepresentative( } // wait for inclusion in a block -> '--broadcast-mode block' is deprecated - tr.waitBlocks(action.chain, 1, 10*time.Second) + tr.waitBlocks(action.Chain, 1, 10*time.Second) }(val, stake) } @@ -1752,23 +1757,23 @@ func (tr TestRun) registerRepresentative( } type submitChangeRewardDenomsProposalAction struct { - denom string - deposit uint - from validatorID + Denom string + Deposit uint + From ValidatorID } func (tr TestRun) submitChangeRewardDenomsProposal(action submitChangeRewardDenomsProposalAction, verbose bool) { - providerChain := tr.chainConfigs[chainID("provi")] + providerChain := tr.chainConfigs[ChainID("provi")] prop := client.ChangeRewardDenomsProposalJSON{ Summary: "Change reward denoms", ChangeRewardDenomsProposal: types.ChangeRewardDenomsProposal{ Title: "Change reward denoms", Description: "Change reward denoms", - DenomsToAdd: []string{action.denom}, + DenomsToAdd: []string{action.Denom}, DenomsToRemove: []string{"stake"}, }, - Deposit: fmt.Sprint(action.deposit) + `stake`, + Deposit: fmt.Sprint(action.Deposit) + `stake`, } bz, err := json.Marshal(prop) @@ -1782,7 +1787,7 @@ func (tr TestRun) submitChangeRewardDenomsProposal(action submitChangeRewardDeno } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, + bz, err = exec.Command("docker", "exec", tr.containerConfig.InstanceName, "/bin/bash", "-c", fmt.Sprintf(`echo '%s' > %s`, jsonStr, "/change-reward-denoms-proposal.json")).CombinedOutput() if err != nil { @@ -1791,12 +1796,12 @@ func (tr TestRun) submitChangeRewardDenomsProposal(action submitChangeRewardDeno //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. // CHANGE REWARDS DENOM PROPOSAL - bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName, providerChain.binaryName, + bz, err = exec.Command("docker", "exec", tr.containerConfig.InstanceName, providerChain.BinaryName, "tx", "gov", "submit-legacy-proposal", "change-reward-denoms", "/change-reward-denoms-proposal.json", - `--from`, `validator`+fmt.Sprint(action.from), - `--chain-id`, string(providerChain.chainId), - `--home`, tr.getValidatorHome(providerChain.chainId, action.from), - `--node`, tr.getValidatorNode(providerChain.chainId, action.from), + `--from`, `validator`+fmt.Sprint(action.From), + `--chain-id`, string(providerChain.ChainId), + `--home`, tr.getValidatorHome(providerChain.ChainId, action.From), + `--node`, tr.getValidatorNode(providerChain.ChainId, action.From), `--gas`, "9000000", `--keyring-backend`, `test`, `-y`, @@ -1807,7 +1812,7 @@ func (tr TestRun) submitChangeRewardDenomsProposal(action submitChangeRewardDeno } // wait for inclusion in a block -> '--broadcast-mode block' is deprecated - tr.waitBlocks(chainID("provi"), 2, 30*time.Second) + tr.waitBlocks(ChainID("provi"), 2, 30*time.Second) } // Creates an additional node on selected chain @@ -1821,9 +1826,9 @@ func (tr TestRun) submitChangeRewardDenomsProposal(action submitChangeRewardDeno // - start the new node // Double sign should be registered within couple blocks. type doublesignSlashAction struct { - // start another node for this validator - validator validatorID - chain chainID + // start another node for this Validator + Validator ValidatorID + Chain ChainID } func (tr TestRun) invokeDoublesignSlash( @@ -1831,25 +1836,25 @@ func (tr TestRun) invokeDoublesignSlash( verbose bool, ) { if !tr.useCometmock { - chainConfig := tr.chainConfigs[action.chain] + chainConfig := tr.chainConfigs[action.Chain] //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, "/bin/bash", - "/testnet-scripts/cause-doublesign.sh", chainConfig.binaryName, string(action.validator), - string(chainConfig.chainId), chainConfig.ipPrefix).CombinedOutput() + bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "/bin/bash", + "/testnet-scripts/cause-doublesign.sh", chainConfig.BinaryName, string(action.Validator), + string(chainConfig.ChainId), chainConfig.IpPrefix).CombinedOutput() if err != nil { log.Fatal(err, "\n", string(bz)) } tr.waitBlocks("provi", 10, 2*time.Minute) } else { // tr.useCometMock - validatorPrivateKeyAddress := tr.GetValidatorPrivateKeyAddress(action.chain, action.validator) + validatorPrivateKeyAddress := tr.GetValidatorPrivateKeyAddress(action.Chain, action.Validator) method := "cause_double_sign" params := fmt.Sprintf(`{"private_key_address":"%s"}`, validatorPrivateKeyAddress) - address := tr.getQueryNodeRPCAddress(action.chain) + address := tr.getQueryNodeRPCAddress(action.Chain) tr.curlJsonRPCRequest(method, params, address) - tr.waitBlocks(action.chain, 1, 10*time.Second) + tr.waitBlocks(action.Chain, 1, 10*time.Second) return } } @@ -1859,15 +1864,15 @@ func (tr TestRun) invokeDoublesignSlash( // See https://github.com/cometbft/cometbft/tree/main/spec/light-client/accountability // for more information about light client attacks. type lightClientEquivocationAttackAction struct { - validator validatorID - chain chainID + Validator ValidatorID + Chain ChainID } func (tr TestRun) lightClientEquivocationAttack( action lightClientEquivocationAttackAction, verbose bool, ) { - tr.lightClientAttack(action.validator, action.chain, LightClientEquivocationAttack) + tr.lightClientAttack(action.Validator, action.Chain, LightClientEquivocationAttack) } // Cause light client attack evidence for a certain validator to appear on the given chain. @@ -1875,15 +1880,15 @@ func (tr TestRun) lightClientEquivocationAttack( // See https://github.com/cometbft/cometbft/tree/main/spec/light-client/accountability // for more information about light client attacks. type lightClientAmnesiaAttackAction struct { - validator validatorID - chain chainID + Validator ValidatorID + Chain ChainID } func (tr TestRun) lightClientAmnesiaAttack( action lightClientAmnesiaAttackAction, verbose bool, ) { - tr.lightClientAttack(action.validator, action.chain, LightClientAmnesiaAttack) + tr.lightClientAttack(action.Validator, action.Chain, LightClientAmnesiaAttack) } // Cause light client attack evidence for a certain validator to appear on the given chain. @@ -1891,15 +1896,15 @@ func (tr TestRun) lightClientAmnesiaAttack( // See https://github.com/cometbft/cometbft/tree/main/spec/light-client/accountability // for more information about light client attacks. type lightClientLunaticAttackAction struct { - validator validatorID - chain chainID + Validator ValidatorID + Chain ChainID } func (tr TestRun) lightClientLunaticAttack( action lightClientLunaticAttackAction, verbose bool, ) { - tr.lightClientAttack(action.validator, action.chain, LightClientLunaticAttack) + tr.lightClientAttack(action.Validator, action.Chain, LightClientLunaticAttack) } type LightClientAttackType string @@ -1911,8 +1916,8 @@ const ( ) func (tr TestRun) lightClientAttack( - validator validatorID, - chain chainID, + validator ValidatorID, + chain ChainID, attackType LightClientAttackType, ) { if !tr.useCometmock { @@ -1930,18 +1935,18 @@ func (tr TestRun) lightClientAttack( } type assignConsumerPubKeyAction struct { - chain chainID - validator validatorID - consumerPubkey string - // reconfigureNode will change keys the node uses and restart - reconfigureNode bool + Chain ChainID + Validator ValidatorID + ConsumerPubkey string + // ReconfigureNode will change keys the node uses and restart + ReconfigureNode bool // executing the action should raise an error - expectError bool - expectedError string + ExpectError bool + ExpectedError string } func (tr TestRun) assignConsumerPubKey(action assignConsumerPubKeyAction, verbose bool) { - valCfg := tr.validatorConfigs[action.validator] + valCfg := tr.validatorConfigs[action.Validator] // Note: to get error response reported back from this command '--gas auto' needs to be set. gas := "auto" @@ -1951,19 +1956,19 @@ func (tr TestRun) assignConsumerPubKey(action assignConsumerPubKeyAction, verbos } assignKey := fmt.Sprintf( `%s tx provider assign-consensus-key %s '%s' --from validator%s --chain-id %s --home %s --node %s --gas %s --keyring-backend test -y -o json`, - tr.chainConfigs[chainID("provi")].binaryName, - string(tr.chainConfigs[action.chain].chainId), - action.consumerPubkey, - action.validator, - tr.chainConfigs[chainID("provi")].chainId, - tr.getValidatorHome(chainID("provi"), action.validator), - tr.getValidatorNode(chainID("provi"), action.validator), + tr.chainConfigs[ChainID("provi")].BinaryName, + string(tr.chainConfigs[action.Chain].ChainId), + action.ConsumerPubkey, + action.Validator, + tr.chainConfigs[ChainID("provi")].ChainId, + tr.getValidatorHome(ChainID("provi"), action.Validator), + tr.getValidatorNode(ChainID("provi"), action.Validator), gas, ) //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", - tr.containerConfig.instanceName, + tr.containerConfig.InstanceName, "/bin/bash", "-c", assignKey, ) @@ -1973,13 +1978,13 @@ func (tr TestRun) assignConsumerPubKey(action assignConsumerPubKeyAction, verbos } bz, err := cmd.CombinedOutput() - if err != nil && !action.expectError { + if err != nil && !action.ExpectError { log.Fatalf("unexpected error during key assignment - output: %s, err: %s", string(bz), err) } - if action.expectError && !tr.useCometmock { // error report ony works with --gas auto, which does not work with CometMock, so ignore - if err == nil || !strings.Contains(string(bz), action.expectedError) { - log.Fatalf("expected error not raised: expected: '%s', got '%s'", action.expectedError, (bz)) + if action.ExpectError && !tr.useCometmock { // error report ony works with --gas auto, which does not work with CometMock, so ignore + if err == nil || !strings.Contains(string(bz), action.ExpectedError) { + log.Fatalf("expected error not raised: expected: '%s', got '%s'", action.ExpectedError, (bz)) } if verbose { @@ -1989,14 +1994,14 @@ func (tr TestRun) assignConsumerPubKey(action assignConsumerPubKeyAction, verbos // node was started with provider key // we swap the nodes's keys for consumer keys and restart it - if action.reconfigureNode { + if action.ReconfigureNode { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - configureNodeCmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "/bin/bash", - "/testnet-scripts/reconfigure-node.sh", tr.chainConfigs[action.chain].binaryName, - string(action.validator), string(action.chain), - tr.chainConfigs[action.chain].ipPrefix, valCfg.ipSuffix, - valCfg.consumerMnemonic, valCfg.consumerPrivValidatorKey, - valCfg.consumerNodeKey, + configureNodeCmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "/bin/bash", + "/testnet-scripts/reconfigure-node.sh", tr.chainConfigs[action.Chain].BinaryName, + string(action.Validator), string(action.Chain), + tr.chainConfigs[action.Chain].IpPrefix, valCfg.IpSuffix, + valCfg.ConsumerMnemonic, valCfg.ConsumerPrivValidatorKey, + valCfg.ConsumerNodeKey, ) if verbose { @@ -2032,54 +2037,54 @@ func (tr TestRun) assignConsumerPubKey(action assignConsumerPubKeyAction, verbos // make the validator use consumer key // @POfftermatt I am currently using this for downtime slashing with cometmock // (I need to find the currently used validator key address)Í - valCfg.useConsumerKey = true - tr.validatorConfigs[action.validator] = valCfg + valCfg.UseConsumerKey = true + tr.validatorConfigs[action.Validator] = valCfg } // wait for inclusion in a block -> '--broadcast-mode block' is deprecated - tr.waitBlocks(chainID("provi"), 2, 30*time.Second) + tr.waitBlocks(ChainID("provi"), 2, 30*time.Second) } // slashThrottleDequeue polls slash queue sizes until nextQueueSize is achieved type slashThrottleDequeue struct { - chain chainID - currentQueueSize int - nextQueueSize int - // panic if timeout is exceeded - timeout time.Duration + Chain ChainID + CurrentQueueSize int + NextQueueSize int + // panic if Timeout is exceeded + Timeout time.Duration } func (tr TestRun) waitForSlashThrottleDequeue( action slashThrottleDequeue, verbose bool, ) { - timeout := time.Now().Add(action.timeout) + timeout := time.Now().Add(action.Timeout) initialGlobalQueueSize := int(tr.getGlobalSlashQueueSize()) - if initialGlobalQueueSize != action.currentQueueSize { - panic(fmt.Sprintf("wrong initial queue size: %d - expected global queue: %d\n", initialGlobalQueueSize, action.currentQueueSize)) + if initialGlobalQueueSize != action.CurrentQueueSize { + panic(fmt.Sprintf("wrong initial queue size: %d - expected global queue: %d\n", initialGlobalQueueSize, action.CurrentQueueSize)) } for { globalQueueSize := int(tr.getGlobalSlashQueueSize()) - chainQueueSize := int(tr.getConsumerChainPacketQueueSize(action.chain)) + chainQueueSize := int(tr.getConsumerChainPacketQueueSize(action.Chain)) if verbose { - fmt.Printf("waiting for packed queue size to reach: %d - current: %d\n", action.nextQueueSize, globalQueueSize) + fmt.Printf("waiting for packed queue size to reach: %d - current: %d\n", action.NextQueueSize, globalQueueSize) } // check if global queue size is equal to chain queue size - if globalQueueSize == chainQueueSize && globalQueueSize == action.nextQueueSize { //nolint:gocritic // this is the comparison that we want here. + if globalQueueSize == chainQueueSize && globalQueueSize == action.NextQueueSize { //nolint:gocritic // this is the comparison that we want here. break } if time.Now().After(timeout) { - panic(fmt.Sprintf("\n\n\nwaitForSlashThrottleDequeuemethod has timed out after: %s\n\n", action.timeout)) + panic(fmt.Sprintf("\n\n\nwaitForSlashThrottleDequeuemethod has timed out after: %s\n\n", action.Timeout)) } time.Sleep(500 * time.Millisecond) } // wair for 2 blocks to be created // allowing the jailing to be incorporated into voting power - tr.waitBlocks(action.chain, 2, time.Minute) + tr.waitBlocks(action.Chain, 2, time.Minute) } func uintPointer(i uint) *uint { @@ -2089,7 +2094,7 @@ func uintPointer(i uint) *uint { // GetPathNameForGorelayer returns the name of the path between two given chains used by Gorelayer. // Since paths are bidirectional, we need either chain to be able to be provided as first or second argument // and still return the same name, so we sort the chain names alphabetically. -func (tr TestRun) GetPathNameForGorelayer(chainA, chainB chainID) string { +func (tr TestRun) GetPathNameForGorelayer(chainA, chainB ChainID) string { var pathName string if string(chainA) < string(chainB) { pathName = string(chainA) + "-" + string(chainB) @@ -2121,7 +2126,7 @@ func (tr *TestRun) WaitTime(duration time.Duration) { } } -func (tr TestRun) AdvanceTimeForChain(chain chainID, duration time.Duration) { +func (tr TestRun) AdvanceTimeForChain(chain ChainID, duration time.Duration) { // cometmock avoids sleeping, and instead advances time for all chains method := "advance_time" params := fmt.Sprintf(`{"duration_in_seconds": "%d"}`, int(math.Ceil(duration.Seconds()))) diff --git a/tests/e2e/actions_sovereign_chain.go b/tests/e2e/actions_sovereign_chain.go index cf2d6288e8..88aa8bf03d 100644 --- a/tests/e2e/actions_sovereign_chain.go +++ b/tests/e2e/actions_sovereign_chain.go @@ -10,10 +10,10 @@ import ( ) type StartSovereignChainAction struct { - chain chainID - validators []StartChainValidator + Chain ChainID + Validators []StartChainValidator // Genesis changes specific to this action, appended to genesis changes defined in chain config - genesisChanges string + GenesisChanges string } // calls a simplified startup script (start-sovereign.sh) and runs a validator node @@ -38,20 +38,20 @@ func (tr TestRun) startSovereignChain( } var validators []jsonValAttrs - for _, val := range action.validators { + for _, val := range action.Validators { validators = append(validators, jsonValAttrs{ - Mnemonic: tr.validatorConfigs[val.id].mnemonic, - NodeKey: tr.validatorConfigs[val.id].nodeKey, - ValId: fmt.Sprint(val.id), - PrivValidatorKey: tr.validatorConfigs[val.id].privValidatorKey, - Allocation: fmt.Sprint(val.allocation) + "stake", - Stake: fmt.Sprint(val.stake) + "stake", - IpSuffix: tr.validatorConfigs[val.id].ipSuffix, - - ConsumerMnemonic: tr.validatorConfigs[val.id].consumerMnemonic, - ConsumerPrivValidatorKey: tr.validatorConfigs[val.id].consumerPrivValidatorKey, + Mnemonic: tr.validatorConfigs[val.Id].Mnemonic, + NodeKey: tr.validatorConfigs[val.Id].NodeKey, + ValId: fmt.Sprint(val.Id), + PrivValidatorKey: tr.validatorConfigs[val.Id].PrivValidatorKey, + Allocation: fmt.Sprint(val.Allocation) + "stake", + Stake: fmt.Sprint(val.Stake) + "stake", + IpSuffix: tr.validatorConfigs[val.Id].IpSuffix, + + ConsumerMnemonic: tr.validatorConfigs[val.Id].ConsumerMnemonic, + ConsumerPrivValidatorKey: tr.validatorConfigs[val.Id].ConsumerPrivValidatorKey, // if true node will be started with consumer key for each consumer chain - StartWithConsumerKey: tr.validatorConfigs[val.id].useConsumerKey, + StartWithConsumerKey: tr.validatorConfigs[val.Id].UseConsumerKey, }) } @@ -62,16 +62,16 @@ func (tr TestRun) startSovereignChain( // Concat genesis changes defined in chain config, with any custom genesis changes for this chain instantiation var genesisChanges string - if action.genesisChanges != "" { - genesisChanges = chainConfig.genesisChanges + " | " + action.genesisChanges + if action.GenesisChanges != "" { + genesisChanges = chainConfig.GenesisChanges + " | " + action.GenesisChanges } else { - genesisChanges = chainConfig.genesisChanges + genesisChanges = chainConfig.GenesisChanges } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "/bin/bash", - "/testnet-scripts/start-sovereign.sh", chainConfig.binaryName, string(vals), - string(chainConfig.chainId), chainConfig.ipPrefix, genesisChanges, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "/bin/bash", + "/testnet-scripts/start-sovereign.sh", chainConfig.BinaryName, string(vals), + string(chainConfig.ChainId), chainConfig.IpPrefix, genesisChanges, tr.tendermintConfigOverride, ) @@ -100,16 +100,16 @@ func (tr TestRun) startSovereignChain( log.Fatal(err) } tr.addChainToRelayer(addChainToRelayerAction{ - chain: action.chain, - validator: action.validators[0].id, + Chain: action.Chain, + Validator: action.Validators[0].Id, }, verbose) } type LegacyUpgradeProposalAction struct { - chainID chainID - upgradeTitle string - proposer validatorID - upgradeHeight uint64 + ChainID ChainID + UpgradeTitle string + Proposer ValidatorID + UpgradeHeight uint64 } func (tr *TestRun) submitLegacyUpgradeProposal(action LegacyUpgradeProposalAction, verbose bool) { @@ -128,18 +128,18 @@ func (tr *TestRun) submitLegacyUpgradeProposal(action LegacyUpgradeProposalActio --node %s \ --no-validate \ -y`, - tr.chainConfigs[chainID("sover")].binaryName, - action.upgradeTitle, - action.upgradeTitle, - fmt.Sprint(action.upgradeHeight), - action.proposer, - tr.chainConfigs[chainID("sover")].chainId, - tr.getValidatorHome(chainID("sover"), action.proposer), - tr.getValidatorNode(chainID("sover"), action.proposer), + tr.chainConfigs[ChainID("sover")].BinaryName, + action.UpgradeTitle, + action.UpgradeTitle, + fmt.Sprint(action.UpgradeHeight), + action.Proposer, + tr.chainConfigs[ChainID("sover")].ChainId, + tr.getValidatorHome(ChainID("sover"), action.Proposer), + tr.getValidatorNode(ChainID("sover"), action.Proposer), ) //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", - tr.containerConfig.instanceName, + tr.containerConfig.InstanceName, "/bin/bash", "-c", submit, ) @@ -153,16 +153,16 @@ func (tr *TestRun) submitLegacyUpgradeProposal(action LegacyUpgradeProposalActio log.Fatal(err, "\n", string(bz)) } - tr.waitBlocks(action.chainID, 1, 15*time.Second) + tr.waitBlocks(action.ChainID, 1, 15*time.Second) } type waitUntilBlockAction struct { - block uint - chain chainID + Block uint + Chain ChainID } func (tr *TestRun) waitUntilBlockOnChain(action waitUntilBlockAction) { - fmt.Println("waitUntilBlockOnChain is waiting for block:", action.block) - tr.waitUntilBlock(action.chain, action.block, 120*time.Second) - fmt.Println("waitUntilBlockOnChain done waiting for block:", action.block) + fmt.Println("waitUntilBlockOnChain is waiting for block:", action.Block) + tr.waitUntilBlock(action.Chain, action.Block, 120*time.Second) + fmt.Println("waitUntilBlockOnChain done waiting for block:", action.Block) } diff --git a/tests/e2e/config.go b/tests/e2e/config.go index 373281162d..6726ab2304 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -8,55 +8,55 @@ import ( // TODO: Determine if user defined type (wrapping a primitive string) is desired in long run type ( - chainID string - validatorID string + ChainID string + ValidatorID string ) // Attributes that are unique to a validator. Allows us to map (part of) // the set of strings defined above to a set of viable validators type ValidatorConfig struct { - mnemonic string - delAddress string - valoperAddress string - valconsAddress string - privValidatorKey string - nodeKey string + Mnemonic string + DelAddress string + ValoperAddress string + ValconsAddress string + PrivValidatorKey string + NodeKey string // Must be an integer greater than 0 and less than 253 - ipSuffix string + IpSuffix string // consumer chain key assignment data // keys are used on a new node - consumerMnemonic string - consumerDelAddress string - consumerValoperAddress string - consumerValconsAddress string - consumerValPubKey string - consumerPrivValidatorKey string - consumerNodeKey string - useConsumerKey bool // if true the validator node will start with consumer key + ConsumerMnemonic string + ConsumerDelAddress string + ConsumerValoperAddress string + ConsumerValconsAddress string + ConsumerValPubKey string + ConsumerPrivValidatorKey string + ConsumerNodeKey string + UseConsumerKey bool // if true the validator node will start with consumer key } // Attributes that are unique to a chain. Allows us to map (part of) // the set of strings defined above to a set of viable chains type ChainConfig struct { - chainId chainID + ChainId ChainID // Must be unique per chain - ipPrefix string - votingWaitTime uint + IpPrefix string + VotingWaitTime uint // Any transformations to apply to the genesis file of all chains instantiated with this chain config, as a jq string. // Example: ".app_state.gov.params.voting_period = \"5s\" | .app_state.slashing.params.signed_blocks_window = \"2\" | .app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\"" - genesisChanges string - binaryName string + GenesisChanges string + BinaryName string // binary to use after upgrade height - upgradeBinary string + UpgradeBinary string } type ContainerConfig struct { - containerName string - instanceName string - ccvVersion string - now time.Time + ContainerName string + InstanceName string + CcvVersion string + Now time.Time } // TODO: Split out TestRun and system wide config like localsdkpath @@ -64,8 +64,8 @@ type TestRun struct { // These are the non altered values during a typical test run, where multiple test runs can exist // to validate different action sequences and corresponding state checks. containerConfig ContainerConfig - validatorConfigs map[validatorID]ValidatorConfig - chainConfigs map[chainID]ChainConfig + validatorConfigs map[ValidatorID]ValidatorConfig + chainConfigs map[ChainID]ChainConfig // override config.toml parameters // usually used to override timeout_commit // having shorter timeout_commit reduces the test runtime because blocks are produced faster @@ -77,7 +77,7 @@ type TestRun struct { useGorelayer bool // if false, Hermes is used as the relayer gaiaTag string // chains which are running, i.e. producing blocks, at the moment - runningChains map[chainID]bool + runningChains map[ChainID]bool // Used with CometMock. The time by which chains have been advanced. Used to keep chains in sync: when a new chain is started, advance its time by this value to keep chains in sync. timeOffset time.Duration @@ -86,67 +86,67 @@ type TestRun struct { // Initialize initializes the TestRun instance by setting the runningChains field to an empty map. func (tr *TestRun) Initialize() { - tr.runningChains = make(map[chainID]bool) + tr.runningChains = make(map[ChainID]bool) } -func getDefaultValidators() map[validatorID]ValidatorConfig { - return map[validatorID]ValidatorConfig{ - validatorID("alice"): { - mnemonic: "pave immune ethics wrap gain ceiling always holiday employ earth tumble real ice engage false unable carbon equal fresh sick tattoo nature pupil nuclear", - delAddress: "cosmos19pe9pg5dv9k5fzgzmsrgnw9rl9asf7ddwhu7lm", - valoperAddress: "cosmosvaloper19pe9pg5dv9k5fzgzmsrgnw9rl9asf7ddtrgtng", - valconsAddress: "cosmosvalcons1qmq08eruchr5sf5s3rwz7djpr5a25f7xw4mceq", - privValidatorKey: `{"address":"06C0F3E47CC5C748269088DC2F36411D3AAA27C6","pub_key":{"type":"tendermint/PubKeyEd25519","value":"RrclQz9bIhkIy/gfL485g3PYMeiIku4qeo495787X10="},"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"uX+ZpDMg89a6gtqs/+MQpCTSqlkZ0nJQJOhLlCJvwvdGtyVDP1siGQjL+B8vjzmDc9gx6IiS7ip6jj3nvztfXQ=="}}`, - nodeKey: `{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"fjw4/DAhyRPnwKgXns5SV7QfswRSXMWJpHS7TyULDmJ8ofUc5poQP8dgr8bZRbCV5RV8cPqDq3FPdqwpmUbmdA=="}}`, - ipSuffix: "4", +func getDefaultValidators() map[ValidatorID]ValidatorConfig { + return map[ValidatorID]ValidatorConfig{ + ValidatorID("alice"): { + Mnemonic: "pave immune ethics wrap gain ceiling always holiday employ earth tumble real ice engage false unable carbon equal fresh sick tattoo nature pupil nuclear", + DelAddress: "cosmos19pe9pg5dv9k5fzgzmsrgnw9rl9asf7ddwhu7lm", + ValoperAddress: "cosmosvaloper19pe9pg5dv9k5fzgzmsrgnw9rl9asf7ddtrgtng", + ValconsAddress: "cosmosvalcons1qmq08eruchr5sf5s3rwz7djpr5a25f7xw4mceq", + PrivValidatorKey: `{"address":"06C0F3E47CC5C748269088DC2F36411D3AAA27C6","pub_key":{"type":"tendermint/PubKeyEd25519","value":"RrclQz9bIhkIy/gfL485g3PYMeiIku4qeo495787X10="},"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"uX+ZpDMg89a6gtqs/+MQpCTSqlkZ0nJQJOhLlCJvwvdGtyVDP1siGQjL+B8vjzmDc9gx6IiS7ip6jj3nvztfXQ=="}}`, + NodeKey: `{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"fjw4/DAhyRPnwKgXns5SV7QfswRSXMWJpHS7TyULDmJ8ofUc5poQP8dgr8bZRbCV5RV8cPqDq3FPdqwpmUbmdA=="}}`, + IpSuffix: "4", // consumer chain assigned key - consumerMnemonic: "exile install vapor thing little toss immune notable lounge december final easy strike title end program interest quote cloth forget forward job october twenty", - consumerDelAddress: "cosmos1eeeggku6dzk3mv7wph3zq035rhtd890sjswszd", - consumerValoperAddress: "cosmosvaloper1eeeggku6dzk3mv7wph3zq035rhtd890shy69w7", - consumerValconsAddress: "cosmosvalcons1muys5jyqk4xd27e208nym85kn0t4zjcfeu63fe", - consumerValPubKey: `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"ujY14AgopV907IYgPAk/5x8c9267S4fQf89nyeCPTes="}`, - consumerPrivValidatorKey: `{"address":"DF090A4880B54CD57B2A79E64D9E969BD7514B09","pub_key":{"type":"tendermint/PubKeyEd25519","value":"ujY14AgopV907IYgPAk/5x8c9267S4fQf89nyeCPTes="},"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"TRJgf7lkTjs/sj43pyweEOanyV7H7fhnVivOi0A4yjW6NjXgCCilX3TshiA8CT/nHxz3brtLh9B/z2fJ4I9N6w=="}}`, - consumerNodeKey: `{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"F966RL9pi20aXRzEBe4D0xRQJtZt696Xxz44XUON52cFc83FMn1WXJbP6arvA2JPyn2LA3DLKCFHSgALrCGXGA=="}}`, - useConsumerKey: false, + ConsumerMnemonic: "exile install vapor thing little toss immune notable lounge december final easy strike title end program interest quote cloth forget forward job october twenty", + ConsumerDelAddress: "cosmos1eeeggku6dzk3mv7wph3zq035rhtd890sjswszd", + ConsumerValoperAddress: "cosmosvaloper1eeeggku6dzk3mv7wph3zq035rhtd890shy69w7", + ConsumerValconsAddress: "cosmosvalcons1muys5jyqk4xd27e208nym85kn0t4zjcfeu63fe", + ConsumerValPubKey: `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"ujY14AgopV907IYgPAk/5x8c9267S4fQf89nyeCPTes="}`, + ConsumerPrivValidatorKey: `{"address":"DF090A4880B54CD57B2A79E64D9E969BD7514B09","pub_key":{"type":"tendermint/PubKeyEd25519","value":"ujY14AgopV907IYgPAk/5x8c9267S4fQf89nyeCPTes="},"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"TRJgf7lkTjs/sj43pyweEOanyV7H7fhnVivOi0A4yjW6NjXgCCilX3TshiA8CT/nHxz3brtLh9B/z2fJ4I9N6w=="}}`, + ConsumerNodeKey: `{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"F966RL9pi20aXRzEBe4D0xRQJtZt696Xxz44XUON52cFc83FMn1WXJbP6arvA2JPyn2LA3DLKCFHSgALrCGXGA=="}}`, + UseConsumerKey: false, }, - validatorID("bob"): { - mnemonic: "glass trip produce surprise diamond spin excess gaze wash drum human solve dress minor artefact canoe hard ivory orange dinner hybrid moral potato jewel", - delAddress: "cosmos1dkas8mu4kyhl5jrh4nzvm65qz588hy9qcz08la", - valoperAddress: "cosmosvaloper1dkas8mu4kyhl5jrh4nzvm65qz588hy9qakmjnw", - valconsAddress: "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", - privValidatorKey: `{"address":"99BD3A72EF12CD024E7584B3AC900AE3743C6ADF","pub_key":{"type":"tendermint/PubKeyEd25519","value":"mAN6RXYxSM4MNGSIriYiS7pHuwAcOHDQAy9/wnlSzOI="},"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"QePcwfWtOavNK7pBJrtoLMzarHKn6iBWfWPFeyV+IdmYA3pFdjFIzgw0ZIiuJiJLuke7ABw4cNADL3/CeVLM4g=="}}`, - nodeKey: `{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"TQ4vHcO/vKdzGtWpelkX53WdMQd4kTsWGFrdcatdXFvWyO215Rewn5IRP0FszPLWr2DqPzmuH8WvxYGk5aeOXw=="}}`, - ipSuffix: "5", + ValidatorID("bob"): { + Mnemonic: "glass trip produce surprise diamond spin excess gaze wash drum human solve dress minor artefact canoe hard ivory orange dinner hybrid moral potato jewel", + DelAddress: "cosmos1dkas8mu4kyhl5jrh4nzvm65qz588hy9qcz08la", + ValoperAddress: "cosmosvaloper1dkas8mu4kyhl5jrh4nzvm65qz588hy9qakmjnw", + ValconsAddress: "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", + PrivValidatorKey: `{"address":"99BD3A72EF12CD024E7584B3AC900AE3743C6ADF","pub_key":{"type":"tendermint/PubKeyEd25519","value":"mAN6RXYxSM4MNGSIriYiS7pHuwAcOHDQAy9/wnlSzOI="},"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"QePcwfWtOavNK7pBJrtoLMzarHKn6iBWfWPFeyV+IdmYA3pFdjFIzgw0ZIiuJiJLuke7ABw4cNADL3/CeVLM4g=="}}`, + NodeKey: `{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"TQ4vHcO/vKdzGtWpelkX53WdMQd4kTsWGFrdcatdXFvWyO215Rewn5IRP0FszPLWr2DqPzmuH8WvxYGk5aeOXw=="}}`, + IpSuffix: "5", // consumer chain assigned key - consumerMnemonic: "grunt list hour endless observe better spoil penalty lab duck only layer vague fantasy satoshi record demise topple space shaft solar practice donor sphere", - consumerDelAddress: "cosmos1q90l6j6lzzgt460ehjj56azknlt5yrd4s38n97", - consumerValoperAddress: "cosmosvaloper1q90l6j6lzzgt460ehjj56azknlt5yrd449nxfd", - consumerValconsAddress: "cosmosvalcons1uuec3cjxajv5te08p220usrjhkfhg9wyvqn0tm", - consumerValPubKey: `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"QlG+iYe6AyYpvY1z9RNJKCVlH14Q/qSz4EjGdGCru3o="}`, - consumerPrivValidatorKey: `{"address":"E73388E246EC9945E5E70A94FE4072BD937415C4","pub_key":{"type":"tendermint/PubKeyEd25519","value":"QlG+iYe6AyYpvY1z9RNJKCVlH14Q/qSz4EjGdGCru3o="},"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"OFR4w+FC6EMw5fAGTrHVexyPrjzQ7QfqgZOMgVf0izlCUb6Jh7oDJim9jXP1E0koJWUfXhD+pLPgSMZ0YKu7eg=="}}`, - consumerNodeKey: `{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"uhPCqnL2KE8m/8OFNLQ5bN3CJr6mds+xfBi0E4umT/s2uWiJhet+vbYx88DHSdof3gGFNTIzAIxSppscBKX96w=="}}`, - useConsumerKey: false, + ConsumerMnemonic: "grunt list hour endless observe better spoil penalty lab duck only layer vague fantasy satoshi record demise topple space shaft solar practice donor sphere", + ConsumerDelAddress: "cosmos1q90l6j6lzzgt460ehjj56azknlt5yrd4s38n97", + ConsumerValoperAddress: "cosmosvaloper1q90l6j6lzzgt460ehjj56azknlt5yrd449nxfd", + ConsumerValconsAddress: "cosmosvalcons1uuec3cjxajv5te08p220usrjhkfhg9wyvqn0tm", + ConsumerValPubKey: `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"QlG+iYe6AyYpvY1z9RNJKCVlH14Q/qSz4EjGdGCru3o="}`, + ConsumerPrivValidatorKey: `{"address":"E73388E246EC9945E5E70A94FE4072BD937415C4","pub_key":{"type":"tendermint/PubKeyEd25519","value":"QlG+iYe6AyYpvY1z9RNJKCVlH14Q/qSz4EjGdGCru3o="},"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"OFR4w+FC6EMw5fAGTrHVexyPrjzQ7QfqgZOMgVf0izlCUb6Jh7oDJim9jXP1E0koJWUfXhD+pLPgSMZ0YKu7eg=="}}`, + ConsumerNodeKey: `{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"uhPCqnL2KE8m/8OFNLQ5bN3CJr6mds+xfBi0E4umT/s2uWiJhet+vbYx88DHSdof3gGFNTIzAIxSppscBKX96w=="}}`, + UseConsumerKey: false, }, - validatorID("carol"): { - mnemonic: "sight similar better jar bitter laptop solve fashion father jelly scissors chest uniform play unhappy convince silly clump another conduct behave reunion marble animal", - delAddress: "cosmos19hz4m226ztankqramvt4a7t0shejv4dc79gp9u", - valoperAddress: "cosmosvaloper19hz4m226ztankqramvt4a7t0shejv4dcm3u5f0", - valconsAddress: "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6", - privValidatorKey: `{"address":"C888306A908A217B9A943D1DAD8790044D0947A4","pub_key":{"type":"tendermint/PubKeyEd25519","value":"IHo4QEikWZfIKmM0X+N+BjKttz8HOzGs2npyjiba3Xk="},"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"z08bmSB91uFVpVmR3t2ewd/bDjZ/AzwQpe5rKjWiPG0gejhASKRZl8gqYzRf434GMq23Pwc7MazaenKOJtrdeQ=="}}`, - nodeKey: `{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"WLTcHEjbwB24Wp3z5oBSYTvtGQonz/7IQabOFw85BN0UkkyY5HDf38o8oHlFxVI26f+DFVeICuLbe9aXKGnUeg=="}}`, - ipSuffix: "6", + ValidatorID("carol"): { + Mnemonic: "sight similar better jar bitter laptop solve fashion father jelly scissors chest uniform play unhappy convince silly clump another conduct behave reunion marble animal", + DelAddress: "cosmos19hz4m226ztankqramvt4a7t0shejv4dc79gp9u", + ValoperAddress: "cosmosvaloper19hz4m226ztankqramvt4a7t0shejv4dcm3u5f0", + ValconsAddress: "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6", + PrivValidatorKey: `{"address":"C888306A908A217B9A943D1DAD8790044D0947A4","pub_key":{"type":"tendermint/PubKeyEd25519","value":"IHo4QEikWZfIKmM0X+N+BjKttz8HOzGs2npyjiba3Xk="},"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"z08bmSB91uFVpVmR3t2ewd/bDjZ/AzwQpe5rKjWiPG0gejhASKRZl8gqYzRf434GMq23Pwc7MazaenKOJtrdeQ=="}}`, + NodeKey: `{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"WLTcHEjbwB24Wp3z5oBSYTvtGQonz/7IQabOFw85BN0UkkyY5HDf38o8oHlFxVI26f+DFVeICuLbe9aXKGnUeg=="}}`, + IpSuffix: "6", // consumer chain assigned key - consumerMnemonic: "clip choose cake west range gun slam cry village receive juice galaxy lend ritual range provide ritual can since verify breeze vacant play dragon", - consumerDelAddress: "cosmos1sx6j9g2rh324a342a5f0rnx7me34r9nwgf0mc7", - consumerValoperAddress: "cosmosvaloper1sx6j9g2rh324a342a5f0rnx7me34r9nwdamw5d", - consumerValconsAddress: "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk", - consumerValPubKey: `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="}`, - consumerPrivValidatorKey: `{"address":"B41C3A40142963AA5B12DDD1C4E5890C0B3926B1","pub_key":{"type":"tendermint/PubKeyEd25519","value":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="},"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"3YaBAZLA+sl/E73lLfbFbG0u6DYm33ayr/0UpCt/vFBSLkZ/X6a1ZR0fy7fGWbN0ogP4Xc8rSx9dnvcZnqrqKw=="}}`, - consumerNodeKey: `{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"rxBzFedtD3pqgfJQblbxGusKOr47oBfr8ba0Iz14gobtDRZQZlSZ/UGP4pSHkVf+4vtkrkO1vRHBYJobuiP+7A=="}}`, - useConsumerKey: true, + ConsumerMnemonic: "clip choose cake west range gun slam cry village receive juice galaxy lend ritual range provide ritual can since verify breeze vacant play dragon", + ConsumerDelAddress: "cosmos1sx6j9g2rh324a342a5f0rnx7me34r9nwgf0mc7", + ConsumerValoperAddress: "cosmosvaloper1sx6j9g2rh324a342a5f0rnx7me34r9nwdamw5d", + ConsumerValconsAddress: "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk", + ConsumerValPubKey: `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="}`, + ConsumerPrivValidatorKey: `{"address":"B41C3A40142963AA5B12DDD1C4E5890C0B3926B1","pub_key":{"type":"tendermint/PubKeyEd25519","value":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="},"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"3YaBAZLA+sl/E73lLfbFbG0u6DYm33ayr/0UpCt/vFBSLkZ/X6a1ZR0fy7fGWbN0ogP4Xc8rSx9dnvcZnqrqKw=="}}`, + ConsumerNodeKey: `{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"rxBzFedtD3pqgfJQblbxGusKOr47oBfr8ba0Iz14gobtDRZQZlSZ/UGP4pSHkVf+4vtkrkO1vRHBYJobuiP+7A=="}}`, + UseConsumerKey: true, }, } } @@ -155,19 +155,19 @@ func SlashThrottleTestRun() TestRun { tr := TestRun{ name: "slash-throttling", containerConfig: ContainerConfig{ - containerName: "interchain-security-slash-container", - instanceName: "interchain-security-slash-instance", - ccvVersion: "1", - now: time.Now(), + ContainerName: "interchain-security-slash-container", + InstanceName: "interchain-security-slash-instance", + CcvVersion: "1", + Now: time.Now(), }, validatorConfigs: getDefaultValidators(), - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "interchain-security-pd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + + chainConfigs: map[ChainID]ChainConfig{ + ChainID("provi"): { + ChainId: ChainID("provi"), + BinaryName: "interchain-security-pd", + IpPrefix: "7.7.7", + VotingWaitTime: 20, + GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -177,12 +177,12 @@ func SlashThrottleTestRun() TestRun { ".app_state.provider.params.slash_meter_replenish_fraction = \"0.10\" | " + ".app_state.provider.params.slash_meter_replenish_period = \"20s\"", }, - chainID("consu"): { - chainId: chainID("consu"), - binaryName: "interchain-security-cd", - ipPrefix: "7.7.8", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + + ChainID("consu"): { + ChainId: ChainID("consu"), + BinaryName: "interchain-security-cd", + IpPrefix: "7.7.8", + VotingWaitTime: 20, + GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ".app_state.slashing.params.signed_blocks_window = \"15\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -200,19 +200,19 @@ func DefaultTestRun() TestRun { tr := TestRun{ name: "default", containerConfig: ContainerConfig{ - containerName: "interchain-security-container", - instanceName: "interchain-security-instance", - ccvVersion: "1", - now: time.Now(), + ContainerName: "interchain-security-container", + InstanceName: "interchain-security-instance", + CcvVersion: "1", + Now: time.Now(), }, validatorConfigs: getDefaultValidators(), - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "interchain-security-pd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + + chainConfigs: map[ChainID]ChainConfig{ + ChainID("provi"): { + ChainId: ChainID("provi"), + BinaryName: "interchain-security-pd", + IpPrefix: "7.7.7", + VotingWaitTime: 20, + GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -222,12 +222,12 @@ func DefaultTestRun() TestRun { ".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\" | " + // This disables slash packet throttling ".app_state.provider.params.slash_meter_replenish_period = \"3s\"", }, - chainID("consu"): { - chainId: chainID("consu"), - binaryName: "interchain-security-cd", - ipPrefix: "7.7.8", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + + ChainID("consu"): { + ChainId: ChainID("consu"), + BinaryName: "interchain-security-cd", + IpPrefix: "7.7.8", + VotingWaitTime: 20, + GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ".app_state.slashing.params.signed_blocks_window = \"15\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -257,19 +257,19 @@ func DemocracyTestRun(allowReward bool) TestRun { tr := TestRun{ name: "democracy", containerConfig: ContainerConfig{ - containerName: "interchain-security-democ-container", - instanceName: "interchain-security-democ-instance", - ccvVersion: "1", - now: time.Now(), + ContainerName: "interchain-security-democ-container", + InstanceName: "interchain-security-democ-instance", + CcvVersion: "1", + Now: time.Now(), }, validatorConfigs: getDefaultValidators(), - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "interchain-security-pd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + + chainConfigs: map[ChainID]ChainConfig{ + ChainID("provi"): { + ChainId: ChainID("provi"), + BinaryName: "interchain-security-pd", + IpPrefix: "7.7.7", + VotingWaitTime: 20, + GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -278,12 +278,12 @@ func DemocracyTestRun(allowReward bool) TestRun { ".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\" | " + ".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\"", // This disables slash packet throttling }, - chainID("democ"): { - chainId: chainID("democ"), - binaryName: "interchain-security-cdd", - ipPrefix: "7.7.9", - votingWaitTime: 20, - genesisChanges: consumerGenChanges, + ChainID("democ"): { + ChainId: ChainID("democ"), + BinaryName: "interchain-security-cdd", + IpPrefix: "7.7.9", + VotingWaitTime: 20, + GenesisChanges: consumerGenChanges, }, }, tendermintConfigOverride: `s/timeout_commit = "5s"/timeout_commit = "1s"/;` + @@ -297,19 +297,19 @@ func MultiConsumerTestRun() TestRun { tr := TestRun{ name: "multi-consumer", containerConfig: ContainerConfig{ - containerName: "interchain-security-multic-container", - instanceName: "interchain-security-multic-instance", - ccvVersion: "1", - now: time.Now(), + ContainerName: "interchain-security-multic-container", + InstanceName: "interchain-security-multic-instance", + CcvVersion: "1", + Now: time.Now(), }, validatorConfigs: getDefaultValidators(), - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "interchain-security-pd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"30s\" | " + + chainConfigs: map[ChainID]ChainConfig{ + ChainID("provi"): { + ChainId: ChainID("provi"), + BinaryName: "interchain-security-pd", + IpPrefix: "7.7.7", + VotingWaitTime: 20, + GenesisChanges: ".app_state.gov.params.voting_period = \"30s\" | " + // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -318,23 +318,23 @@ func MultiConsumerTestRun() TestRun { ".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\" | " + ".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\"", // This disables slash packet throttling }, - chainID("consu"): { - chainId: chainID("consu"), - binaryName: "interchain-security-cd", - ipPrefix: "7.7.8", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + + ChainID("consu"): { + ChainId: ChainID("consu"), + BinaryName: "interchain-security-cd", + IpPrefix: "7.7.8", + VotingWaitTime: 20, + GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ".app_state.slashing.params.signed_blocks_window = \"10\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + ".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\"", }, - chainID("densu"): { - chainId: chainID("densu"), - binaryName: "interchain-security-cd", - ipPrefix: "7.7.9", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + + ChainID("densu"): { + ChainId: ChainID("densu"), + BinaryName: "interchain-security-cd", + IpPrefix: "7.7.9", + VotingWaitTime: 20, + GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ".app_state.slashing.params.signed_blocks_window = \"10\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -352,19 +352,19 @@ func ChangeoverTestRun() TestRun { tr := TestRun{ name: "changeover", containerConfig: ContainerConfig{ - containerName: "interchain-security-changeover-container", - instanceName: "interchain-security-changeover-instance", - ccvVersion: "1", - now: time.Now(), + ContainerName: "interchain-security-changeover-container", + InstanceName: "interchain-security-changeover-instance", + CcvVersion: "1", + Now: time.Now(), }, validatorConfigs: getDefaultValidators(), - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "interchain-security-pd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + + chainConfigs: map[ChainID]ChainConfig{ + ChainID("provi"): { + ChainId: ChainID("provi"), + BinaryName: "interchain-security-pd", + IpPrefix: "7.7.7", + VotingWaitTime: 20, + GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -374,13 +374,13 @@ func ChangeoverTestRun() TestRun { ".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\" | " + // This disables slash packet throttling ".app_state.provider.params.slash_meter_replenish_period = \"3s\"", }, - chainID("sover"): { - chainId: chainID("sover"), - binaryName: "interchain-security-sd", - upgradeBinary: "interchain-security-cdd", - ipPrefix: "7.7.8", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + + ChainID("sover"): { + ChainId: ChainID("sover"), + BinaryName: "interchain-security-sd", + UpgradeBinary: "interchain-security-cdd", + IpPrefix: "7.7.8", + VotingWaitTime: 20, + GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ".app_state.slashing.params.signed_blocks_window = \"15\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -430,7 +430,7 @@ func (s *TestRun) validateStringLiterals() { panic("validator id string literal must be 5 char or less") } - ipSuffix, err := strconv.Atoi(valConfig.ipSuffix) + ipSuffix, err := strconv.Atoi(valConfig.IpSuffix) if err != nil { panic(fmt.Sprintf("ip suffix must be an int: %v\n", err)) } @@ -453,7 +453,7 @@ func (s *TestRun) validateStringLiterals() { panic("chain id string literal must be 5 char or less") } - if chainID != chainConfig.chainId { + if chainID != chainConfig.ChainId { panic("chain config is mapped to a chain id that is different than what's stored in the config") } } diff --git a/tests/e2e/main.go b/tests/e2e/main.go index baf2db05da..0a376664a0 100644 --- a/tests/e2e/main.go +++ b/tests/e2e/main.go @@ -65,8 +65,8 @@ since causing light client attacks is not implemented.`, }, "happy-path": {testRun: DefaultTestRun(), steps: happyPathSteps, description: "happy path tests"}, "changeover": {testRun: ChangeoverTestRun(), steps: changeoverSteps, description: "changeover tests"}, - "democracy-reward": {testRun: DemocracyTestRun(true), steps: democracySteps, description: "democracy tests allowing rewards"}, - "democracy": {testRun: DemocracyTestRun(false), steps: rewardDenomConsumerSteps, description: "democracy tests"}, + "democracy-reward": {testRun: DemocracyTestRun(true), steps: democracyRewardsSteps, description: "democracy tests allowing rewards"}, + "democracy": {testRun: DemocracyTestRun(false), steps: democracySteps, description: "democracy tests"}, "slash-throttle": {testRun: SlashThrottleTestRun(), steps: slashThrottleSteps, description: "slash throttle tests"}, "multiconsumer": {testRun: MultiConsumerTestRun(), steps: multipleConsumers, description: "multi consumer tests"}, } @@ -189,7 +189,7 @@ type testRunWithSteps struct { } func (tr *TestRun) runStep(step Step, verbose bool) { - switch action := step.action.(type) { + switch action := step.Action.(type) { case StartChainAction: tr.startChain(action, verbose) case StartSovereignChainAction: @@ -264,13 +264,13 @@ func (tr *TestRun) runStep(step Step, verbose bool) { log.Fatalf("unknown action in testRun %s: %#v", tr.name, action) } - modelState := step.state - actualState := tr.getState(step.state) + modelState := step.State + actualState := tr.getState(step.State) // Check state if !reflect.DeepEqual(actualState, modelState) { fmt.Printf("=============== %s FAILED ===============\n", tr.name) - fmt.Println("FAILED action", reflect.TypeOf(step.action).Name()) + fmt.Println("FAILED action", reflect.TypeOf(step.Action).Name()) pretty.Print("actual state", actualState) pretty.Print("model state", modelState) log.Fatal(`actual state (-) not equal to model state (+): ` + pretty.Compare(actualState, modelState)) @@ -285,7 +285,7 @@ func (tr *TestRun) executeSteps(steps []Step) { for i, step := range steps { // print something the show the test is alive fmt.Printf("running %s: step %d == %s \n", - tr.name, i+1, reflect.TypeOf(step.action).Name()) + tr.name, i+1, reflect.TypeOf(step.Action).Name()) tr.runStep(step, *verbose) } @@ -315,8 +315,8 @@ func (tr *TestRun) startDocker() { } scriptStr := fmt.Sprintf( "tests/e2e/testnet-scripts/start-docker.sh %s %s %s %s %s", - tr.containerConfig.containerName, - tr.containerConfig.instanceName, + tr.containerConfig.ContainerName, + tr.containerConfig.InstanceName, localSdk, useGaia, gaiaTag, @@ -359,7 +359,7 @@ func (tr *TestRun) startDocker() { func (tr *TestRun) teardownDocker() { fmt.Printf("=============== tearing down %s testRun ===============\n", tr.name) //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "kill", tr.containerConfig.instanceName) + cmd := exec.Command("docker", "kill", tr.containerConfig.InstanceName) bz, err := cmd.CombinedOutput() if err != nil { diff --git a/tests/e2e/state.go b/tests/e2e/state.go index 8cc343ef00..f6beb3445c 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -14,19 +14,19 @@ import ( "gopkg.in/yaml.v2" ) -type State map[chainID]ChainState +type State map[ChainID]ChainState type ChainState struct { - ValBalances *map[validatorID]uint + ValBalances *map[ValidatorID]uint Proposals *map[uint]Proposal - ValPowers *map[validatorID]uint - RepresentativePowers *map[validatorID]uint + ValPowers *map[ValidatorID]uint + RepresentativePowers *map[ValidatorID]uint Params *[]Param Rewards *Rewards - ConsumerChains *map[chainID]bool - AssignedKeys *map[validatorID]string - ProviderKeys *map[validatorID]string // validatorID: validator provider key - ConsumerChainQueueSizes *map[chainID]uint + ConsumerChains *map[ChainID]bool + AssignedKeys *map[ValidatorID]string + ProviderKeys *map[ValidatorID]string // validatorID: validator provider key + ConsumerChainQueueSizes *map[ChainID]uint GlobalSlashQueueSize *uint RegisteredConsumerRewardDenoms *[]string } @@ -45,7 +45,7 @@ func (p TextProposal) isProposal() {} type ConsumerAdditionProposal struct { Deposit uint - Chain chainID + Chain ChainID SpawnTime int InitialHeight clienttypes.Height Status string @@ -66,7 +66,7 @@ func (p ConsumerAdditionProposal) isProposal() {} type ConsumerRemovalProposal struct { Deposit uint - Chain chainID + Chain ChainID StopTime int Status string } @@ -84,7 +84,7 @@ type EquivocationProposal struct { func (p EquivocationProposal) isProposal() {} type Rewards struct { - IsRewarded map[validatorID]bool + IsRewarded map[ValidatorID]bool // if true it will calculate if the validator/delegator is rewarded between 2 successive blocks, // otherwise it will calculate if it received any rewards since the 1st block IsIncrementalReward bool @@ -119,7 +119,7 @@ func (tr TestRun) getState(modelState State) State { return systemState } -func (tr TestRun) getChainState(chain chainID, modelState ChainState) ChainState { +func (tr TestRun) getChainState(chain ChainID, modelState ChainState) ChainState { chainState := ChainState{} if modelState.ValBalances != nil { @@ -174,7 +174,7 @@ func (tr TestRun) getChainState(chain chainID, modelState ChainState) ChainState } if modelState.ConsumerChainQueueSizes != nil { - consumerChainQueueSizes := map[chainID]uint{} + consumerChainQueueSizes := map[ChainID]uint{} for c := range *modelState.ConsumerChainQueueSizes { consumerChainQueueSizes[c] = tr.getConsumerChainPacketQueueSize(c) } @@ -195,9 +195,9 @@ func (tr TestRun) getChainState(chain chainID, modelState ChainState) ChainState var blockHeightRegex = regexp.MustCompile(`block_height: "(\d+)"`) -func (tr TestRun) getBlockHeight(chain chainID) uint { +func (tr TestRun) getBlockHeight(chain ChainID) uint { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName, + bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, "query", "tendermint-validator-set", @@ -215,7 +215,7 @@ func (tr TestRun) getBlockHeight(chain chainID) uint { return uint(blockHeight) } -func (tr TestRun) waitBlocks(chain chainID, blocks uint, timeout time.Duration) { +func (tr TestRun) waitBlocks(chain ChainID, blocks uint, timeout time.Duration) { if tr.useCometmock { // call advance_blocks method on cometmock // curl -H 'Content-Type: application/json' -H 'Accept:application/json' --data '{"jsonrpc":"2.0","method":"advance_blocks","params":{"num_blocks": "36000000"},"id":1}' 127.0.0.1:22331 @@ -241,7 +241,7 @@ func (tr TestRun) waitBlocks(chain chainID, blocks uint, timeout time.Duration) } } -func (tr TestRun) waitUntilBlock(chain chainID, block uint, timeout time.Duration) { +func (tr TestRun) waitUntilBlock(chain ChainID, block uint, timeout time.Duration) { start := time.Now() for { thisBlock := tr.getBlockHeight(chain) @@ -255,8 +255,8 @@ func (tr TestRun) waitUntilBlock(chain chainID, block uint, timeout time.Duratio } } -func (tr TestRun) getBalances(chain chainID, modelState map[validatorID]uint) map[validatorID]uint { - actualState := map[validatorID]uint{} +func (tr TestRun) getBalances(chain ChainID, modelState map[ValidatorID]uint) map[ValidatorID]uint { + actualState := map[ValidatorID]uint{} for k := range modelState { actualState[k] = tr.getBalance(chain, k) } @@ -264,7 +264,7 @@ func (tr TestRun) getBalances(chain chainID, modelState map[validatorID]uint) ma return actualState } -func (tr TestRun) getProposals(chain chainID, modelState map[uint]Proposal) map[uint]Proposal { +func (tr TestRun) getProposals(chain ChainID, modelState map[uint]Proposal) map[uint]Proposal { actualState := map[uint]Proposal{} for k := range modelState { actualState[k] = tr.getProposal(chain, k) @@ -273,8 +273,8 @@ func (tr TestRun) getProposals(chain chainID, modelState map[uint]Proposal) map[ return actualState } -func (tr TestRun) getValPowers(chain chainID, modelState map[validatorID]uint) map[validatorID]uint { - actualState := map[validatorID]uint{} +func (tr TestRun) getValPowers(chain ChainID, modelState map[ValidatorID]uint) map[ValidatorID]uint { + actualState := map[ValidatorID]uint{} for k := range modelState { actualState[k] = tr.getValPower(chain, k) } @@ -282,8 +282,8 @@ func (tr TestRun) getValPowers(chain chainID, modelState map[validatorID]uint) m return actualState } -func (tr TestRun) getRepresentativePowers(chain chainID, modelState map[validatorID]uint) map[validatorID]uint { - actualState := map[validatorID]uint{} +func (tr TestRun) getRepresentativePowers(chain ChainID, modelState map[ValidatorID]uint) map[ValidatorID]uint { + actualState := map[ValidatorID]uint{} for k := range modelState { actualState[k] = tr.getRepresentativePower(chain, k) } @@ -291,7 +291,7 @@ func (tr TestRun) getRepresentativePowers(chain chainID, modelState map[validato return actualState } -func (tr TestRun) getParams(chain chainID, modelState []Param) []Param { +func (tr TestRun) getParams(chain ChainID, modelState []Param) []Param { actualState := []Param{} for _, p := range modelState { actualState = append(actualState, Param{Subspace: p.Subspace, Key: p.Key, Value: tr.getParam(chain, p)}) @@ -300,8 +300,8 @@ func (tr TestRun) getParams(chain chainID, modelState []Param) []Param { return actualState } -func (tr TestRun) getRewards(chain chainID, modelState Rewards) Rewards { - receivedRewards := map[validatorID]bool{} +func (tr TestRun) getRewards(chain ChainID, modelState Rewards) Rewards { + receivedRewards := map[ValidatorID]bool{} currentBlock := tr.getBlockHeight(chain) tr.waitBlocks(chain, 1, 10*time.Second) @@ -318,13 +318,13 @@ func (tr TestRun) getRewards(chain chainID, modelState Rewards) Rewards { return Rewards{IsRewarded: receivedRewards, IsIncrementalReward: modelState.IsIncrementalReward, IsNativeDenom: modelState.IsNativeDenom} } -func (tr TestRun) getReward(chain chainID, validator validatorID, blockHeight uint, isNativeDenom bool) float64 { - delAddresss := tr.validatorConfigs[validator].delAddress - if chain != chainID("provi") && tr.validatorConfigs[validator].useConsumerKey { - delAddresss = tr.validatorConfigs[validator].consumerDelAddress +func (tr TestRun) getReward(chain ChainID, validator ValidatorID, blockHeight uint, isNativeDenom bool) float64 { + delAddresss := tr.validatorConfigs[validator].DelAddress + if chain != ChainID("provi") && tr.validatorConfigs[validator].UseConsumerKey { + delAddresss = tr.validatorConfigs[validator].ConsumerDelAddress } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName, + bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, "query", "distribution", "rewards", delAddresss, @@ -345,15 +345,15 @@ func (tr TestRun) getReward(chain chainID, validator validatorID, blockHeight ui return gjson.Get(string(bz), denomCondition).Float() } -func (tr TestRun) getBalance(chain chainID, validator validatorID) uint { +func (tr TestRun) getBalance(chain ChainID, validator ValidatorID) uint { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - valDelAddress := tr.validatorConfigs[validator].delAddress - if chain != chainID("provi") && tr.validatorConfigs[validator].useConsumerKey { - valDelAddress = tr.validatorConfigs[validator].consumerDelAddress + valDelAddress := tr.validatorConfigs[validator].DelAddress + if chain != ChainID("provi") && tr.validatorConfigs[validator].UseConsumerKey { + valDelAddress = tr.validatorConfigs[validator].ConsumerDelAddress } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName, + bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, "query", "bank", "balances", valDelAddress, @@ -373,9 +373,9 @@ func (tr TestRun) getBalance(chain chainID, validator validatorID) uint { var noProposalRegex = regexp.MustCompile(`doesn't exist: key not found`) // interchain-securityd query gov proposals -func (tr TestRun) getProposal(chain chainID, proposal uint) Proposal { +func (tr TestRun) getProposal(chain ChainID, proposal uint) Proposal { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName, + bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, "query", "gov", "proposal", fmt.Sprint(proposal), @@ -411,11 +411,11 @@ func (tr TestRun) getProposal(chain chainID, proposal uint) Proposal { } case "/interchain_security.ccv.provider.v1.ConsumerAdditionProposal": chainId := gjson.Get(string(bz), `messages.0.content.chain_id`).String() - spawnTime := gjson.Get(string(bz), `messages.0.content.spawn_time`).Time().Sub(tr.containerConfig.now) + spawnTime := gjson.Get(string(bz), `messages.0.content.spawn_time`).Time().Sub(tr.containerConfig.Now) - var chain chainID + var chain ChainID for i, conf := range tr.chainConfigs { - if string(conf.chainId) == chainId { + if string(conf.ChainId) == chainId { chain = i break } @@ -443,11 +443,11 @@ func (tr TestRun) getProposal(chain chainID, proposal uint) Proposal { } case "/interchain_security.ccv.provider.v1.ConsumerRemovalProposal": chainId := gjson.Get(string(bz), `messages.0.content.chain_id`).String() - stopTime := gjson.Get(string(bz), `messages.0.content.stop_time`).Time().Sub(tr.containerConfig.now) + stopTime := gjson.Get(string(bz), `messages.0.content.stop_time`).Time().Sub(tr.containerConfig.Now) - var chain chainID + var chain ChainID for i, conf := range tr.chainConfigs { - if string(conf.chainId) == chainId { + if string(conf.ChainId) == chainId { chain = i break } @@ -497,12 +497,12 @@ type ValPubKey struct { Value string `yaml:"value"` } -func (tr TestRun) getValPower(chain chainID, validator validatorID) uint { +func (tr TestRun) getValPower(chain ChainID, validator ValidatorID) uint { if *verbose { log.Println("getting validator power for chain: ", chain, " validator: ", validator) } //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - command := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName, + command := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, "query", "tendermint-validator-set", @@ -531,8 +531,8 @@ func (tr TestRun) getValPower(chain chainID, validator validatorID) uint { } for _, val := range valset.Validators { - if val.Address == tr.validatorConfigs[validator].valconsAddress || - val.Address == tr.validatorConfigs[validator].consumerValconsAddress { + if val.Address == tr.validatorConfigs[validator].ValconsAddress || + val.Address == tr.validatorConfigs[validator].ConsumerValconsAddress { votingPower, err := strconv.Atoi(val.VotingPower) if err != nil { @@ -547,12 +547,12 @@ func (tr TestRun) getValPower(chain chainID, validator validatorID) uint { return 0 } -func (tr TestRun) getRepresentativePower(chain chainID, validator validatorID) uint { +func (tr TestRun) getRepresentativePower(chain ChainID, validator ValidatorID) uint { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName, + bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, "query", "staking", "validator", - tr.validatorConfigs[validator].valoperAddress, + tr.validatorConfigs[validator].ValoperAddress, `--node`, tr.getQueryNode(chain), `-o`, `json`, @@ -566,9 +566,9 @@ func (tr TestRun) getRepresentativePower(chain chainID, validator validatorID) u return uint(amount.Uint()) } -func (tr TestRun) getParam(chain chainID, param Param) string { +func (tr TestRun) getParam(chain ChainID, param Param) string { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - bz, err := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName, + bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, "query", "params", "subspace", param.Subspace, @@ -588,9 +588,9 @@ func (tr TestRun) getParam(chain chainID, param Param) string { // getConsumerChains returns a list of consumer chains that're being secured by the provider chain, // determined by querying the provider chain. -func (tr TestRun) getConsumerChains(chain chainID) map[chainID]bool { +func (tr TestRun) getConsumerChains(chain ChainID) map[ChainID]bool { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, "query", "provider", "list-consumer-chains", `--node`, tr.getQueryNode(chain), @@ -603,17 +603,17 @@ func (tr TestRun) getConsumerChains(chain chainID) map[chainID]bool { } arr := gjson.Get(string(bz), "chains").Array() - chains := make(map[chainID]bool) + chains := make(map[ChainID]bool) for _, c := range arr { id := c.Get("chain_id").String() - chains[chainID(id)] = true + chains[ChainID(id)] = true } return chains } -func (tr TestRun) getConsumerAddresses(chain chainID, modelState map[validatorID]string) map[validatorID]string { - actualState := map[validatorID]string{} +func (tr TestRun) getConsumerAddresses(chain ChainID, modelState map[ValidatorID]string) map[ValidatorID]string { + actualState := map[ValidatorID]string{} for k := range modelState { actualState[k] = tr.getConsumerAddress(chain, k) } @@ -621,8 +621,8 @@ func (tr TestRun) getConsumerAddresses(chain chainID, modelState map[validatorID return actualState } -func (tr TestRun) getProviderAddresses(chain chainID, modelState map[validatorID]string) map[validatorID]string { - actualState := map[validatorID]string{} +func (tr TestRun) getProviderAddresses(chain ChainID, modelState map[ValidatorID]string) map[ValidatorID]string { + actualState := map[ValidatorID]string{} for k := range modelState { actualState[k] = tr.getProviderAddressFromConsumer(chain, k) } @@ -630,13 +630,13 @@ func (tr TestRun) getProviderAddresses(chain chainID, modelState map[validatorID return actualState } -func (tr TestRun) getConsumerAddress(consumerChain chainID, validator validatorID) string { +func (tr TestRun) getConsumerAddress(consumerChain ChainID, validator ValidatorID) string { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chainID("provi")].binaryName, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[ChainID("provi")].BinaryName, "query", "provider", "validator-consumer-key", - string(consumerChain), tr.validatorConfigs[validator].valconsAddress, - `--node`, tr.getQueryNode(chainID("provi")), + string(consumerChain), tr.validatorConfigs[validator].ValconsAddress, + `--node`, tr.getQueryNode(ChainID("provi")), `-o`, `json`, ) bz, err := cmd.CombinedOutput() @@ -648,13 +648,13 @@ func (tr TestRun) getConsumerAddress(consumerChain chainID, validator validatorI return addr } -func (tr TestRun) getProviderAddressFromConsumer(consumerChain chainID, validator validatorID) string { +func (tr TestRun) getProviderAddressFromConsumer(consumerChain ChainID, validator ValidatorID) string { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chainID("provi")].binaryName, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[ChainID("provi")].BinaryName, "query", "provider", "validator-provider-key", - string(consumerChain), tr.validatorConfigs[validator].consumerValconsAddress, - `--node`, tr.getQueryNode(chainID("provi")), + string(consumerChain), tr.validatorConfigs[validator].ConsumerValconsAddress, + `--node`, tr.getQueryNode(ChainID("provi")), `-o`, `json`, ) @@ -669,10 +669,10 @@ func (tr TestRun) getProviderAddressFromConsumer(consumerChain chainID, validato func (tr TestRun) getGlobalSlashQueueSize() uint { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chainID("provi")].binaryName, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[ChainID("provi")].BinaryName, "query", "provider", "throttle-state", - `--node`, tr.getQueryNode(chainID("provi")), + `--node`, tr.getQueryNode(ChainID("provi")), `-o`, `json`, ) bz, err := cmd.CombinedOutput() @@ -684,13 +684,13 @@ func (tr TestRun) getGlobalSlashQueueSize() uint { return uint(len(packets)) } -func (tr TestRun) getConsumerChainPacketQueueSize(consumerChain chainID) uint { +func (tr TestRun) getConsumerChainPacketQueueSize(consumerChain ChainID) uint { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chainID("provi")].binaryName, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[ChainID("provi")].BinaryName, "query", "provider", "throttled-consumer-packet-data", string(consumerChain), - `--node`, tr.getQueryNode(chainID("provi")), + `--node`, tr.getQueryNode(ChainID("provi")), `-o`, `json`, ) bz, err := cmd.CombinedOutput() @@ -702,9 +702,9 @@ func (tr TestRun) getConsumerChainPacketQueueSize(consumerChain chainID) uint { return uint(size) } -func (tr TestRun) getRegisteredConsumerRewardDenoms(chain chainID) []string { +func (tr TestRun) getRegisteredConsumerRewardDenoms(chain ChainID) []string { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, "query", "provider", "registered-consumer-reward-denoms", `--node`, tr.getQueryNode(chain), @@ -724,7 +724,7 @@ func (tr TestRun) getRegisteredConsumerRewardDenoms(chain chainID) []string { return rewardDenoms } -func (tr TestRun) getValidatorNode(chain chainID, validator validatorID) string { +func (tr TestRun) getValidatorNode(chain ChainID, validator ValidatorID) string { // for CometMock, validatorNodes are all the same address as the query node (which is CometMocks address) if tr.useCometmock { return tr.getQueryNode(chain) @@ -733,41 +733,41 @@ func (tr TestRun) getValidatorNode(chain chainID, validator validatorID) string return "tcp://" + tr.getValidatorIP(chain, validator) + ":26658" } -func (tr TestRun) getValidatorIP(chain chainID, validator validatorID) string { - return tr.chainConfigs[chain].ipPrefix + "." + tr.validatorConfigs[validator].ipSuffix +func (tr TestRun) getValidatorIP(chain ChainID, validator ValidatorID) string { + return tr.chainConfigs[chain].IpPrefix + "." + tr.validatorConfigs[validator].IpSuffix } -func (tr TestRun) getValidatorHome(chain chainID, validator validatorID) string { - return `/` + string(tr.chainConfigs[chain].chainId) + `/validator` + fmt.Sprint(validator) +func (tr TestRun) getValidatorHome(chain ChainID, validator ValidatorID) string { + return `/` + string(tr.chainConfigs[chain].ChainId) + `/validator` + fmt.Sprint(validator) } // getQueryNode returns query node tcp address on chain. -func (tr TestRun) getQueryNode(chain chainID) string { +func (tr TestRun) getQueryNode(chain ChainID) string { return fmt.Sprintf("tcp://%s", tr.getQueryNodeRPCAddress(chain)) } -func (tr TestRun) getQueryNodeRPCAddress(chain chainID) string { +func (tr TestRun) getQueryNodeRPCAddress(chain ChainID) string { return fmt.Sprintf("%s:26658", tr.getQueryNodeIP(chain)) } // getQueryNodeIP returns query node IP for chain, // ipSuffix is hardcoded to be 253 on all query nodes // except for "sover" chain where there's only one node -func (tr TestRun) getQueryNodeIP(chain chainID) string { - if chain == chainID("sover") { +func (tr TestRun) getQueryNodeIP(chain ChainID) string { + if chain == ChainID("sover") { // return address of first and only validator return fmt.Sprintf("%s.%s", - tr.chainConfigs[chain].ipPrefix, - tr.validatorConfigs[validatorID("alice")].ipSuffix) + tr.chainConfigs[chain].IpPrefix, + tr.validatorConfigs[ValidatorID("alice")].IpSuffix) } - return fmt.Sprintf("%s.253", tr.chainConfigs[chain].ipPrefix) + return fmt.Sprintf("%s.253", tr.chainConfigs[chain].IpPrefix) } func (tr TestRun) curlJsonRPCRequest(method, params, address string) { cmd_template := `curl -H 'Content-Type: application/json' -H 'Accept:application/json' --data '{"jsonrpc":"2.0","method":"%s","params":%s,"id":1}' %s` //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, "bash", "-c", fmt.Sprintf(cmd_template, method, params, address)) + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, "bash", "-c", fmt.Sprintf(cmd_template, method, params, address)) verbosity := false executeCommandWithVerbosity(cmd, "curlJsonRPCRequest", verbosity) diff --git a/tests/e2e/step_delegation.go b/tests/e2e/step_delegation.go index b6e7c8ad76..fc3208dbac 100644 --- a/tests/e2e/step_delegation.go +++ b/tests/e2e/step_delegation.go @@ -4,76 +4,76 @@ package main func stepsDelegate(consumerName string) []Step { return []Step{ { - action: delegateTokensAction{ - chain: chainID("provi"), - from: validatorID("alice"), - to: validatorID("alice"), - amount: 11000000, - }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + Action: delegateTokensAction{ + Chain: ChainID("provi"), + From: ValidatorID("alice"), + To: ValidatorID("alice"), + Amount: 11000000, + }, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 500, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 500, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: SendTokensAction{ - chain: chainID(consumerName), - from: validatorID("alice"), - to: validatorID("bob"), - amount: 1, - }, - state: State{ - chainID(consumerName): ChainState{ + Action: SendTokensAction{ + Chain: ChainID(consumerName), + From: ValidatorID("alice"), + To: ValidatorID("bob"), + Amount: 1, + }, + State: State{ + ChainID(consumerName): ChainState{ // Tx should not go through, ICS channel is not setup until first VSC packet has been relayed to consumer - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 10000000000, - validatorID("bob"): 10000000000, + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 10000000000, + ValidatorID("bob"): 10000000000, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: SendTokensAction{ - chain: chainID(consumerName), - from: validatorID("alice"), - to: validatorID("bob"), - amount: 1, - }, - state: State{ - chainID(consumerName): ChainState{ + Action: SendTokensAction{ + Chain: ChainID(consumerName), + From: ValidatorID("alice"), + To: ValidatorID("bob"), + Amount: 1, + }, + State: State{ + ChainID(consumerName): ChainState{ // Now tx should execute - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 9999999999, - validatorID("bob"): 10000000001, + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9999999999, + ValidatorID("bob"): 10000000001, }, }, }, @@ -85,43 +85,43 @@ func stepsDelegate(consumerName string) []Step { func stepsUnbond(consumerName string) []Step { return []Step{ { - action: unbondTokensAction{ - chain: chainID("provi"), - unbondFrom: validatorID("alice"), - sender: validatorID("alice"), - amount: 1000000, - }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, - validatorID("bob"): 500, - validatorID("carol"): 500, + Action: unbondTokensAction{ + Chain: ChainID("provi"), + UnbondFrom: ValidatorID("alice"), + Sender: ValidatorID("alice"), + Amount: 1000000, + }, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID("consu"): ChainState{ - ValPowers: &map[validatorID]uint{ + ChainID("consu"): ChainState{ + ValPowers: &map[ValidatorID]uint{ // Voting power on consumer should not be affected yet - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID("consu"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, - validatorID("bob"): 500, - validatorID("carol"): 500, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID("consu"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, @@ -134,85 +134,85 @@ func stepsUnbond(consumerName string) []Step { func stepsCancelUnbond(consumerName string) []Step { return []Step{ { - action: unbondTokensAction{ - chain: chainID("provi"), - unbondFrom: validatorID("alice"), - sender: validatorID("alice"), - amount: 1000000, - }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 500, + Action: unbondTokensAction{ + Chain: ChainID("provi"), + UnbondFrom: ValidatorID("alice"), + Sender: ValidatorID("alice"), + Amount: 1000000, + }, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID("consu"): ChainState{ - ValPowers: &map[validatorID]uint{ + ChainID("consu"): ChainState{ + ValPowers: &map[ValidatorID]uint{ // Voting power on consumer should not be affected yet - validatorID("alice"): 510, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValidatorID("alice"): 510, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID("consu"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 500, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID("consu"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: cancelUnbondTokensAction{ - chain: chainID("provi"), - delegator: validatorID("alice"), - validator: validatorID("alice"), - amount: 1000000, // cancel unbonding the full amount - }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, // power restored - validatorID("bob"): 500, - validatorID("carol"): 500, + Action: cancelUnbondTokensAction{ + Chain: ChainID("provi"), + Delegator: ValidatorID("alice"), + Validator: ValidatorID("alice"), + Amount: 1000000, // cancel unbonding the full amount + }, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, // power restored + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID("consu"): ChainState{ - ValPowers: &map[validatorID]uint{ + ChainID("consu"): ChainState{ + ValPowers: &map[ValidatorID]uint{ // Voting power on consumer should not be affected yet - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID("consu"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, // power restored on consumer - validatorID("bob"): 500, - validatorID("carol"): 500, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID("consu"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, // power restored on consumer + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, @@ -226,45 +226,45 @@ func stepsCancelUnbond(consumerName string) []Step { func stepsRedelegateForOptOut(consumerName string) []Step { return []Step{ { - action: redelegateTokensAction{ - chain: chainID("provi"), - src: validatorID("alice"), - dst: validatorID("carol"), - txSender: validatorID("alice"), - amount: 450000000, - }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 60, - validatorID("bob"): 500, - validatorID("carol"): 950, + Action: redelegateTokensAction{ + Chain: ChainID("provi"), + Src: ValidatorID("alice"), + Dst: ValidatorID("carol"), + TxSender: ValidatorID("alice"), + Amount: 450000000, + }, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 60, + ValidatorID("bob"): 500, + ValidatorID("carol"): 950, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ // Voting power changes not seen by consumer yet - validatorID("alice"): 510, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValidatorID("alice"): 510, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ // Now power changes are seen by consumer - validatorID("alice"): 60, - validatorID("bob"): 500, - validatorID("carol"): 950, + ValidatorID("alice"): 60, + ValidatorID("bob"): 500, + ValidatorID("carol"): 950, }, }, }, @@ -276,48 +276,48 @@ func stepsRedelegateForOptOut(consumerName string) []Step { func stepsRedelegate(consumerName string) []Step { return []Step{ { - action: redelegateTokensAction{ - chain: chainID("provi"), - src: validatorID("carol"), - dst: validatorID("alice"), - txSender: validatorID("carol"), + Action: redelegateTokensAction{ + Chain: ChainID("provi"), + Src: ValidatorID("carol"), + Dst: ValidatorID("alice"), + TxSender: ValidatorID("carol"), // redelegate s.t. alice has majority stake so non-faulty validators maintain more than // 2/3 voting power during downtime tests below, avoiding chain halt - amount: 449000000, + Amount: 449000000, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // carol always uses a consumer assigned key - validatorID("carol"): 501, + ValidatorID("carol"): 501, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ // Voting power changes not seen by consumer yet - validatorID("alice"): 60, - validatorID("bob"): 500, - validatorID("carol"): 950, + ValidatorID("alice"): 60, + ValidatorID("bob"): 500, + ValidatorID("carol"): 950, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ // Now power changes are seen by consumer - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, }, @@ -329,48 +329,48 @@ func stepsRedelegate(consumerName string) []Step { func stepsRedelegateShort(consumerName string) []Step { return []Step{ { - action: redelegateTokensAction{ - chain: chainID("provi"), - src: validatorID("alice"), - dst: validatorID("carol"), - txSender: validatorID("alice"), + Action: redelegateTokensAction{ + Chain: ChainID("provi"), + Src: ValidatorID("alice"), + Dst: ValidatorID("carol"), + TxSender: ValidatorID("alice"), // Leave alice with majority stake so non-faulty validators maintain more than // 2/3 voting power during downtime tests below, avoiding chain halt - amount: 1000000, + Amount: 1000000, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // carol always uses a consumer assigned key - validatorID("carol"): 501, + ValidatorID("carol"): 501, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ // Voting power changes not seen by consumer yet - validatorID("alice"): 510, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValidatorID("alice"): 510, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ // Now power changes are seen by consumer - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, }, diff --git a/tests/e2e/steps.go b/tests/e2e/steps.go index 6fb284c07a..21db55e3b7 100644 --- a/tests/e2e/steps.go +++ b/tests/e2e/steps.go @@ -1,8 +1,8 @@ package main type Step struct { - action interface{} - state State + Action interface{} + State State } func concatSteps(steps ...[]Step) []Step { @@ -66,7 +66,7 @@ var slashThrottleSteps = concatSteps( stepsStopChain("consu", 2), ) -var democracySteps = concatSteps( +var democracyRewardsSteps = concatSteps( // democracySteps requires a transfer channel stepsStartChains([]string{"democ"}, true), // delegation needs to happen so the first VSC packet can be delivered @@ -74,7 +74,7 @@ var democracySteps = concatSteps( stepsDemocracy("democ"), ) -var rewardDenomConsumerSteps = concatSteps( +var democracySteps = concatSteps( // democracySteps requires a transfer channel stepsStartChains([]string{"democ"}, true), // delegation needs to happen so the first VSC packet can be delivered diff --git a/tests/e2e/steps_democracy.go b/tests/e2e/steps_democracy.go index 85e9e8cbd7..9779ce45bc 100644 --- a/tests/e2e/steps_democracy.go +++ b/tests/e2e/steps_democracy.go @@ -5,22 +5,22 @@ const consumerRewardDenom = "ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821 func stepsDemocracy(consumerName string) []Step { return []Step{ { - action: registerRepresentativeAction{ - chain: chainID(consumerName), - representatives: []validatorID{validatorID("alice"), validatorID("bob")}, - stakes: []uint{100000000, 40000000}, + Action: registerRepresentativeAction{ + Chain: ChainID(consumerName), + Representatives: []ValidatorID{ValidatorID("alice"), ValidatorID("bob")}, + Stakes: []uint{100000000, 40000000}, }, - state: State{ - chainID(consumerName): ChainState{ - RepresentativePowers: &map[validatorID]uint{ - validatorID("alice"): 100000000, - validatorID("bob"): 40000000, + State: State{ + ChainID(consumerName): ChainState{ + RepresentativePowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 100000000, + ValidatorID("bob"): 40000000, }, Rewards: &Rewards{ - IsRewarded: map[validatorID]bool{ - validatorID("alice"): true, - validatorID("bob"): true, - validatorID("carol"): false, + IsRewarded: map[ValidatorID]bool{ + ValidatorID("alice"): true, + ValidatorID("bob"): true, + ValidatorID("carol"): false, }, IsIncrementalReward: true, IsNativeDenom: true, @@ -29,31 +29,31 @@ func stepsDemocracy(consumerName string) []Step { }, }, { - action: delegateTokensAction{ - chain: chainID(consumerName), - from: validatorID("carol"), - to: validatorID("alice"), - amount: 500000, + Action: delegateTokensAction{ + Chain: ChainID(consumerName), + From: ValidatorID("carol"), + To: ValidatorID("alice"), + Amount: 500000, }, - state: State{ - chainID(consumerName): ChainState{ + State: State{ + ChainID(consumerName): ChainState{ // Check that delegators on gov-consumer chain can change representative powers - RepresentativePowers: &map[validatorID]uint{ - validatorID("alice"): 100500000, - validatorID("bob"): 40000000, + RepresentativePowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 100500000, + ValidatorID("bob"): 40000000, }, // Check that delegating on gov-consumer does not change validator powers - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, // Check that tokens are minted and distributed to representatives and their delegators Rewards: &Rewards{ - IsRewarded: map[validatorID]bool{ - validatorID("alice"): true, - validatorID("bob"): true, - validatorID("carol"): true, + IsRewarded: map[ValidatorID]bool{ + ValidatorID("alice"): true, + ValidatorID("bob"): true, + ValidatorID("carol"): true, }, IsIncrementalReward: true, IsNativeDenom: true, @@ -63,19 +63,19 @@ func stepsDemocracy(consumerName string) []Step { }, { // whitelisted legacy proposal can only handle ibctransfer.SendEnabled/ReceiveEnabled - action: submitParamChangeLegacyProposalAction{ - chain: chainID(consumerName), - from: validatorID("alice"), - deposit: 10000001, - subspace: "transfer", - key: "SendEnabled", - value: true, + Action: submitParamChangeLegacyProposalAction{ + Chain: ChainID(consumerName), + From: ValidatorID("alice"), + Deposit: 10000001, + Subspace: "transfer", + Key: "SendEnabled", + Value: true, }, - state: State{ - chainID(consumerName): ChainState{ - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 9889999998, - validatorID("bob"): 9960000001, + State: State{ + ChainID(consumerName): ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9889999998, + ValidatorID("bob"): 9960000001, }, Proposals: &map[uint]Proposal{ 1: ParamsProposal{ @@ -91,17 +91,17 @@ func stepsDemocracy(consumerName string) []Step { }, { // Have accounts vote on something on the gov-consumer chain - action: voteGovProposalAction{ - chain: chainID(consumerName), - from: []validatorID{validatorID("alice"), validatorID("bob")}, - vote: []string{"yes", "no"}, - propNumber: 1, + Action: voteGovProposalAction{ + Chain: ChainID(consumerName), + From: []ValidatorID{ValidatorID("alice"), ValidatorID("bob")}, + Vote: []string{"yes", "no"}, + PropNumber: 1, }, - state: State{ - chainID(consumerName): ChainState{ - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 9889999998, - validatorID("bob"): 9960000001, + State: State{ + ChainID(consumerName): ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9889999998, + ValidatorID("bob"): 9960000001, }, // Check that the parameter is changed on gov-consumer chain Params: &([]Param{{Subspace: "transfer", Key: "SendEnabled", Value: "true"}}), @@ -109,20 +109,20 @@ func stepsDemocracy(consumerName string) []Step { }, }, { - action: relayRewardPacketsToProviderAction{ - consumerChain: chainID(consumerName), - providerChain: chainID("provi"), - port: "transfer", - channel: 1, + Action: relayRewardPacketsToProviderAction{ + ConsumerChain: ChainID(consumerName), + ProviderChain: ChainID("provi"), + Port: "transfer", + Channel: 1, }, - state: State{ - chainID("provi"): ChainState{ + State: State{ + ChainID("provi"): ChainState{ // Check that tokens are not distributed before the denom has been registered Rewards: &Rewards{ - IsRewarded: map[validatorID]bool{ - validatorID("alice"): false, - validatorID("bob"): false, - validatorID("carol"): false, + IsRewarded: map[ValidatorID]bool{ + ValidatorID("alice"): false, + ValidatorID("bob"): false, + ValidatorID("carol"): false, }, IsIncrementalReward: false, IsNativeDenom: false, @@ -133,47 +133,47 @@ func stepsDemocracy(consumerName string) []Step { }, }, { - action: submitChangeRewardDenomsProposalAction{ - denom: consumerRewardDenom, - deposit: 10000001, - from: validatorID("bob"), + Action: submitChangeRewardDenomsProposalAction{ + Denom: consumerRewardDenom, + Deposit: 10000001, + From: ValidatorID("bob"), }, - state: State{ - chainID("provi"): ChainState{ + State: State{ + ChainID("provi"): ChainState{ // Denom not yet registered, gov prop needs to pass first RegisteredConsumerRewardDenoms: &[]string{}, }, }, }, { - action: voteGovProposalAction{ - chain: chainID("provi"), - from: []validatorID{validatorID("alice"), validatorID("bob"), validatorID("carol")}, - vote: []string{"yes", "yes", "yes"}, - propNumber: 2, + Action: voteGovProposalAction{ + Chain: ChainID("provi"), + From: []ValidatorID{ValidatorID("alice"), ValidatorID("bob"), ValidatorID("carol")}, + Vote: []string{"yes", "yes", "yes"}, + PropNumber: 2, }, - state: State{ - chainID("provi"): ChainState{ + State: State{ + ChainID("provi"): ChainState{ // Check that the denom is registered on provider chain RegisteredConsumerRewardDenoms: &[]string{consumerRewardDenom}, }, }, }, { - action: relayRewardPacketsToProviderAction{ - consumerChain: chainID(consumerName), - providerChain: chainID("provi"), - port: "transfer", - channel: 1, + Action: relayRewardPacketsToProviderAction{ + ConsumerChain: ChainID(consumerName), + ProviderChain: ChainID("provi"), + Port: "transfer", + Channel: 1, }, - state: State{ - chainID("provi"): ChainState{ + State: State{ + ChainID("provi"): ChainState{ // Check that tokens are minted and sent to provider chain and distributed to validators and their delegators on provider chain Rewards: &Rewards{ - IsRewarded: map[validatorID]bool{ - validatorID("alice"): true, - validatorID("bob"): true, - validatorID("carol"): true, + IsRewarded: map[ValidatorID]bool{ + ValidatorID("alice"): true, + ValidatorID("bob"): true, + ValidatorID("carol"): true, }, IsIncrementalReward: false, IsNativeDenom: false, @@ -182,49 +182,49 @@ func stepsDemocracy(consumerName string) []Step { }, }, { - action: downtimeSlashAction{ - chain: chainID(consumerName), - validator: validatorID("bob"), + Action: downtimeSlashAction{ + Chain: ChainID(consumerName), + Validator: ValidatorID("bob"), }, - state: State{ + State: State{ // validator should be slashed on consumer, powers not affected on either chain yet - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, // Downtime jailing and corresponding voting power change are processed by provider - validatorID("bob"): 0, - validatorID("carol"): 500, + ValidatorID("bob"): 0, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, @@ -232,63 +232,63 @@ func stepsDemocracy(consumerName string) []Step { // A block is incremented each action, hence why VSC is committed on provider, // and can now be relayed as packet to consumer { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, }, - state: State{ - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, + State: State{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, // VSC now seen on consumer - validatorID("bob"): 0, - validatorID("carol"): 500, + ValidatorID("bob"): 0, + ValidatorID("carol"): 500, }, }, }, }, { - action: unjailValidatorAction{ - provider: chainID("provi"), - validator: validatorID("bob"), + Action: unjailValidatorAction{ + Provider: ChainID("provi"), + Validator: ValidatorID("bob"), }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, - validatorID("carol"): 500, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, + ValidatorID("carol"): 500, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, }, - state: State{ - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, // Check that slashing on the gov-consumer chain does not result in slashing for the representatives or their delegators - RepresentativePowers: &map[validatorID]uint{ - validatorID("alice"): 100500000, - validatorID("bob"): 40000000, + RepresentativePowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 100500000, + ValidatorID("bob"): 40000000, }, }, }, diff --git a/tests/e2e/steps_double_sign.go b/tests/e2e/steps_double_sign.go index c007fa5c1c..4d69569b29 100644 --- a/tests/e2e/steps_double_sign.go +++ b/tests/e2e/steps_double_sign.go @@ -5,49 +5,49 @@ func stepsDoubleSignOnProviderAndConsumer(consumerName string) []Step { return []Step{ { // provider double sign - action: doublesignSlashAction{ - chain: chainID("provi"), - validator: validatorID("carol"), + Action: doublesignSlashAction{ + Chain: ChainID("provi"), + Validator: ValidatorID("carol"), }, - state: State{ + State: State{ // slash on provider - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, // from 500 to 0 + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, // from 500 to 0 }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, // not tombstoned on consumerName yet + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, // not tombstoned on consumerName yet }, }, }, }, { // relay power change to consumerName - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, // consumerName channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, // consumerName channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, // tombstoning visible on consumerName + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, // tombstoning visible on consumerName }, }, }, @@ -56,72 +56,72 @@ func stepsDoubleSignOnProviderAndConsumer(consumerName string) []Step { // consumer double sign // provider will only log the double sign slash // stepsSubmitEquivocationProposal will cause the double sign slash to be executed - action: doublesignSlashAction{ - chain: chainID("consu"), - validator: validatorID("bob"), + Action: doublesignSlashAction{ + Chain: ChainID("consu"), + Validator: ValidatorID("bob"), }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // not tombstoned - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // not tombstoned + ValidatorID("carol"): 0, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // not tombstoned - validatorID("carol"): 0, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // not tombstoned + ValidatorID("carol"): 0, }, }, }, }, { // consumer learns about the double sign - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // not tombstoned - validatorID("carol"): 0, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // not tombstoned + ValidatorID("carol"): 0, }, }, }, diff --git a/tests/e2e/steps_downtime.go b/tests/e2e/steps_downtime.go index e6d320bec1..08054f9089 100644 --- a/tests/e2e/steps_downtime.go +++ b/tests/e2e/steps_downtime.go @@ -15,49 +15,49 @@ import "time" func stepsDowntime(consumerName string) []Step { return []Step{ { - action: downtimeSlashAction{ - chain: chainID(consumerName), - validator: validatorID("bob"), + Action: downtimeSlashAction{ + Chain: ChainID(consumerName), + Validator: ValidatorID("bob"), }, - state: State{ + State: State{ // validator should be slashed on consumer, powers not affected on either chain yet - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, // Downtime jailing and corresponding voting power change are processed by provider - validatorID("bob"): 0, - validatorID("carol"): 501, + ValidatorID("bob"): 0, + ValidatorID("carol"): 501, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, }, @@ -65,144 +65,144 @@ func stepsDowntime(consumerName string) []Step { // A block is incremented each action, hence why VSC is committed on provider, // and can now be relayed as packet to consumer { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, // VSC now seen on consumer - validatorID("bob"): 0, - validatorID("carol"): 501, + ValidatorID("bob"): 0, + ValidatorID("carol"): 501, }, }, }, }, { - action: unjailValidatorAction{ - provider: chainID("provi"), - validator: validatorID("bob"), - }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, + Action: unjailValidatorAction{ + Provider: ChainID("provi"), + Validator: ValidatorID("bob"), + }, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, // bob's stake should not be slashed // since the slash was initiated from consumer - validatorID("bob"): 500, - validatorID("carol"): 501, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 0, - validatorID("carol"): 501, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 0, + ValidatorID("carol"): 501, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, // bob's stake should not be slashed // since the slash was initiated from consumer - validatorID("bob"): 500, - validatorID("carol"): 501, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, }, }, // Now we test provider initiated downtime/slashing { - action: downtimeSlashAction{ - chain: chainID("provi"), - validator: validatorID("carol"), + Action: downtimeSlashAction{ + Chain: ChainID("provi"), + Validator: ValidatorID("carol"), }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ // Non faulty validators still maintain just above 2/3 power here - validatorID("alice"): 509, - validatorID("bob"): 500, + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // Carol's stake should be slashed and jailed // downtime slash was initiated from provider - validatorID("carol"): 0, + ValidatorID("carol"): 0, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, }, }, { - action: unjailValidatorAction{ - provider: chainID("provi"), - validator: validatorID("carol"), + Action: unjailValidatorAction{ + Provider: ChainID("provi"), + Validator: ValidatorID("carol"), }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, }, }, }, @@ -217,49 +217,49 @@ func stepsDowntime(consumerName string) []Step { func stepsDowntimeWithOptOut(consumerName string) []Step { return []Step{ { - action: downtimeSlashAction{ - chain: chainID(consumerName), - validator: validatorID("alice"), + Action: downtimeSlashAction{ + Chain: ChainID(consumerName), + Validator: ValidatorID("alice"), }, - state: State{ + State: State{ // powers not affected on either chain - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 60, - validatorID("bob"): 500, - validatorID("carol"): 950, + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 60, + ValidatorID("bob"): 500, + ValidatorID("carol"): 950, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 60, - validatorID("bob"): 500, - validatorID("carol"): 950, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 60, + ValidatorID("bob"): 500, + ValidatorID("carol"): 950, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ // alice is not slashed or jailed due to soft opt out - validatorID("alice"): 60, - validatorID("bob"): 500, - validatorID("carol"): 950, + ValidatorID("alice"): 60, + ValidatorID("bob"): 500, + ValidatorID("carol"): 950, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 60, - validatorID("bob"): 500, - validatorID("carol"): 950, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 60, + ValidatorID("bob"): 500, + ValidatorID("carol"): 950, }, }, }, @@ -273,24 +273,24 @@ func stepsDowntimeWithOptOut(consumerName string) []Step { func stepsThrottledDowntime(consumerName string) []Step { return []Step{ { - action: downtimeSlashAction{ - chain: chainID(consumerName), - validator: validatorID("bob"), + Action: downtimeSlashAction{ + Chain: ChainID(consumerName), + Validator: ValidatorID("bob"), }, - state: State{ + State: State{ // slash packet queued on consumer, but powers not affected on either chain yet - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, @@ -299,115 +299,115 @@ func stepsThrottledDowntime(consumerName string) []Step { // and consumer receives ack that provider recv the downtime slash. // The latter is necessary for the consumer to send the second downtime slash. { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, // bob is jailed - validatorID("carol"): 500, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, // bob is jailed + ValidatorID("carol"): 500, }, // no provider throttling engaged yet GlobalSlashQueueSize: uintPointer(0), - ConsumerChainQueueSizes: &map[chainID]uint{ - chainID(consumerName): uint(0), + ConsumerChainQueueSizes: &map[ChainID]uint{ + ChainID(consumerName): uint(0), }, }, - chainID(consumerName): ChainState{ + ChainID(consumerName): ChainState{ // VSC packet applying jailing is not yet relayed to consumer - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: downtimeSlashAction{ - chain: chainID(consumerName), - validator: validatorID("carol"), + Action: downtimeSlashAction{ + Chain: ChainID(consumerName), + Validator: ValidatorID("carol"), }, - state: State{ + State: State{ // powers not affected on either chain yet - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, - validatorID("carol"): 500, + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ + ChainID(consumerName): ChainState{ // VSC packet applying jailing is not yet relayed to consumer - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, - validatorID("carol"): 500, // not slashed due to throttling + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, + ValidatorID("carol"): 500, // not slashed due to throttling }, GlobalSlashQueueSize: uintPointer(1), // carol's slash request is throttled - ConsumerChainQueueSizes: &map[chainID]uint{ - chainID(consumerName): uint(1), + ConsumerChainQueueSizes: &map[ChainID]uint{ + ChainID(consumerName): uint(1), }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, - validatorID("carol"): 500, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, + ValidatorID("carol"): 500, }, }, }, }, { - action: slashThrottleDequeue{ - chain: chainID(consumerName), - currentQueueSize: 1, - nextQueueSize: 0, + Action: slashThrottleDequeue{ + Chain: ChainID(consumerName), + CurrentQueueSize: 1, + NextQueueSize: 0, // Slash meter replenish fraction is set to 10%, replenish period is 20 seconds, see config.go // Meter is initially at 10%, decremented to -23% from bob being jailed. It'll then take three replenishments // for meter to become positive again. 3*20 = 60 seconds + buffer = 80 seconds - timeout: 80 * time.Second, + Timeout: 80 * time.Second, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, - validatorID("carol"): 0, // Carol is jailed upon packet being handled on provider + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, + ValidatorID("carol"): 0, // Carol is jailed upon packet being handled on provider }, GlobalSlashQueueSize: uintPointer(0), // slash packets dequeued - ConsumerChainQueueSizes: &map[chainID]uint{ - chainID(consumerName): 0, + ConsumerChainQueueSizes: &map[ChainID]uint{ + ChainID(consumerName): 0, }, }, - chainID(consumerName): ChainState{ + ChainID(consumerName): ChainState{ // no updates received on consumer - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, - validatorID("carol"): 500, + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, + ValidatorID("carol"): 500, }, }, }, @@ -415,30 +415,30 @@ func stepsThrottledDowntime(consumerName string) []Step { // A block is incremented each action, hence why VSC is committed on provider, // and can now be relayed as packet to consumer { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, - validatorID("carol"): 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, + }, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, + ValidatorID("carol"): 0, }, GlobalSlashQueueSize: uintPointer(0), - ConsumerChainQueueSizes: &map[chainID]uint{ - chainID(consumerName): 0, + ConsumerChainQueueSizes: &map[ChainID]uint{ + ChainID(consumerName): 0, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, // throttled update gets to consumer - validatorID("bob"): 0, - validatorID("carol"): 0, + ValidatorID("bob"): 0, + ValidatorID("carol"): 0, }, }, }, diff --git a/tests/e2e/steps_light_client_attack.go b/tests/e2e/steps_light_client_attack.go index f00d5f5bd6..284b3fafea 100644 --- a/tests/e2e/steps_light_client_attack.go +++ b/tests/e2e/steps_light_client_attack.go @@ -4,124 +4,124 @@ package main func stepsLightClientAttackOnProviderAndConsumer(consumerName string) []Step { return []Step{ { - // provider double sign - action: lightClientEquivocationAttackAction{ - chain: chainID("provi"), - validator: validatorID("carol"), + // Provider double sign + Action: lightClientEquivocationAttackAction{ + Chain: ChainID("provi"), + Validator: ValidatorID("carol"), }, - state: State{ - // slash on provider - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, // from 500 to 0 + State: State{ + // Slash on provider + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, // from 500 to 0 }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, // not tombstoned on consumerName yet + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, // not tombstoned on consumerName yet }, }, }, }, { - // relay power change to consumerName - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, // consumerName channel + // Relay power change to consumerName + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, // consumerName channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, // tombstoning visible on consumerName + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, // tombstoning visible on consumerName }, }, }, }, { - // consumer double sign - // provider will only log the double sign slash + // Consumer double sign + // Provider will only log the double sign slash // stepsSubmitEquivocationProposal will cause the double sign slash to be executed - action: lightClientEquivocationAttackAction{ - chain: chainID(consumerName), - validator: validatorID("bob"), + Action: lightClientEquivocationAttackAction{ + Chain: ChainID(consumerName), + Validator: ValidatorID("bob"), }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // not tombstoned - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // not tombstoned + ValidatorID("carol"): 0, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // not tombstoned - validatorID("carol"): 0, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // not tombstoned + ValidatorID("carol"): 0, }, }, }, }, { - // consumer learns about the double sign - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, + // Consumer learns about the double sign + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // not tombstoned - validatorID("carol"): 0, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // not tombstoned + ValidatorID("carol"): 0, }, }, }, diff --git a/tests/e2e/steps_multi_consumer_delegation.go b/tests/e2e/steps_multi_consumer_delegation.go index 45536c0679..67368e277c 100644 --- a/tests/e2e/steps_multi_consumer_delegation.go +++ b/tests/e2e/steps_multi_consumer_delegation.go @@ -5,96 +5,96 @@ func stepsMultiConsumerDelegate(consumer1, consumer2 string) []Step { return []Step{ { // changes not visible on any consumer - action: delegateTokensAction{ - chain: chainID("provi"), - from: validatorID("alice"), - to: validatorID("alice"), - amount: 11000000, + Action: delegateTokensAction{ + Chain: ChainID("provi"), + From: ValidatorID("alice"), + To: ValidatorID("alice"), + Amount: 11000000, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, // this changes from 500 - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, // this changes from 500 + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 500, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 500, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 500, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 500, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { // relay changes to consumer1 - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer1), - port: "provider", - channel: 0, // consumer1 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer1), + Port: "provider", + Channel: 0, // consumer1 Channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, // changed - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, // changed + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 500, // unchanged - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 500, // unchanged + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { // relay changes to consumer2 - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer2), - port: "provider", - channel: 1, // consumer2 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer2), + Port: "provider", + Channel: 1, // consumer2 Channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, // changed - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, // changed + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, @@ -107,96 +107,96 @@ func stepsMultiConsumerDelegate(consumer1, consumer2 string) []Step { func stepsMultiConsumerUnbond(consumer1, consumer2 string) []Step { return []Step{ { - action: unbondTokensAction{ - chain: chainID("provi"), - unbondFrom: validatorID("alice"), - sender: validatorID("alice"), - amount: 1000000, + Action: unbondTokensAction{ + Chain: ChainID("provi"), + UnbondFrom: ValidatorID("alice"), + Sender: ValidatorID("alice"), + Amount: 1000000, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, // change from 511 - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, // change from 511 + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, // no change - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, // no change + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, // no change - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, // no change + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { // relay to consumer1 - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer1), - port: "provider", - channel: 0, // consumer1 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer1), + Port: "provider", + Channel: 0, // consumer1 Channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, // change from 511 - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, // change from 511 + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, // no change - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, // no change + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { // relay to consumer2 - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer2), - port: "provider", - channel: 1, // consumer2 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer2), + Port: "provider", + Channel: 1, // consumer2 Channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, // change from 511 - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, // change from 511 + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, @@ -209,35 +209,35 @@ func stepsMultiConsumerUnbond(consumer1, consumer2 string) []Step { func stepsMultiConsumerRedelegate(consumer1, consumer2 string) []Step { return []Step{ { - action: redelegateTokensAction{ - chain: chainID("provi"), - src: validatorID("alice"), - dst: validatorID("carol"), - txSender: validatorID("alice"), + Action: redelegateTokensAction{ + Chain: ChainID("provi"), + Src: ValidatorID("alice"), + Dst: ValidatorID("carol"), + TxSender: ValidatorID("alice"), // Leave alice with majority stake so non-faulty validators maintain more than // 2/3 voting power during downtime tests below, avoiding chain halt - amount: 1000000, + Amount: 1000000, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, // no change - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, // no change + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, // no change - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, // no change + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, @@ -245,64 +245,64 @@ func stepsMultiConsumerRedelegate(consumer1, consumer2 string) []Step { { // relay to consumer1 - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer1), - port: "provider", - channel: 0, // consumer1 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer1), + Port: "provider", + Channel: 0, // consumer1 Channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, // change from 510 - validatorID("bob"): 500, - validatorID("carol"): 501, // change from 500 + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, // change from 510 + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, // change from 500 }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, // no change - validatorID("bob"): 500, - validatorID("carol"): 500, // no change + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, // no change + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, // no change }, }, }, }, { // relay to consumer2 - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer2), - port: "provider", - channel: 1, // consumer1 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer2), + Port: "provider", + Channel: 1, // consumer1 Channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, // change from 510 - validatorID("bob"): 500, - validatorID("carol"): 501, // change from 500 + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, // change from 510 + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, // change from 500 }, }, }, diff --git a/tests/e2e/steps_multi_consumer_double_sign.go b/tests/e2e/steps_multi_consumer_double_sign.go index d12eb37eff..5388ea5c75 100644 --- a/tests/e2e/steps_multi_consumer_double_sign.go +++ b/tests/e2e/steps_multi_consumer_double_sign.go @@ -13,95 +13,95 @@ func stepsMultiConsumerDoubleSign(consumer1, consumer2 string) []Step { return []Step{ { // provider double sign - action: doublesignSlashAction{ - chain: chainID("provi"), - validator: validatorID("carol"), + Action: doublesignSlashAction{ + Chain: ChainID("provi"), + Validator: ValidatorID("carol"), }, - state: State{ + State: State{ // slash on provider - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, // from 500 to 0 + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, // from 500 to 0 }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, // not tombstoned on consumer1 yet + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, // not tombstoned on consumer1 yet }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, // not tombstoned on consumer2 yet + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, // not tombstoned on consumer2 yet }, }, }, }, { // relay power change to consumer1 - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer1), - port: "provider", - channel: 0, // consumer1 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer1), + Port: "provider", + Channel: 0, // consumer1 channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, // tombstoning visible on consumer1 + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, // tombstoning visible on consumer1 }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, // tombstoning NOT YET visible on consumer2 + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, // tombstoning NOT YET visible on consumer2 }, }, }, }, { // relay power change to consumer2 - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer2), - port: "provider", - channel: 1, // consumer2 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer2), + Port: "provider", + Channel: 1, // consumer2 channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, // tombstoned on consumer2 + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, // tombstoned on consumer2 }, }, }, @@ -109,118 +109,118 @@ func stepsMultiConsumerDoubleSign(consumer1, consumer2 string) []Step { { // consumer double sign // nothing should happen - double sign from consumer is dropped - action: doublesignSlashAction{ - chain: chainID("consu"), - validator: validatorID("bob"), + Action: doublesignSlashAction{ + Chain: ChainID("consu"), + Validator: ValidatorID("bob"), }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer1), - port: "provider", - channel: 0, // consumer1 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer1), + Port: "provider", + Channel: 0, // consumer1 channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // not tombstoned - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // not tombstoned + ValidatorID("carol"): 0, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // not tombstoned - validatorID("carol"): 0, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // not tombstoned + ValidatorID("carol"): 0, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // not tombstoned - validatorID("carol"): 0, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // not tombstoned + ValidatorID("carol"): 0, }, }, }, }, { // consumer1 learns about the double sign - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer1), - port: "provider", - channel: 0, // consumer1 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer1), + Port: "provider", + Channel: 0, // consumer1 channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // not tombstoned - validatorID("carol"): 0, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // not tombstoned + ValidatorID("carol"): 0, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // not tombstoned - validatorID("carol"): 0, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // not tombstoned + ValidatorID("carol"): 0, }, }, }, }, { // consumer2 learns about the double sign - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer2), - port: "provider", - channel: 1, // consumer2 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer2), + Port: "provider", + Channel: 1, // consumer2 channel }, - state: State{ - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, - }, - }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + State: State{ + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, + }, + }, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, }, diff --git a/tests/e2e/steps_multi_consumer_downtime.go b/tests/e2e/steps_multi_consumer_downtime.go index ce6cbdff59..eba44ed361 100644 --- a/tests/e2e/steps_multi_consumer_downtime.go +++ b/tests/e2e/steps_multi_consumer_downtime.go @@ -7,31 +7,31 @@ package main func stepsMultiConsumerDowntimeFromConsumer(consumer1, consumer2 string) []Step { return []Step{ { - action: downtimeSlashAction{ - chain: chainID(consumer1), - validator: validatorID("bob"), + Action: downtimeSlashAction{ + Chain: ChainID(consumer1), + Validator: ValidatorID("bob"), }, - state: State{ + State: State{ // validator should be slashed on consumer, powers not affected on either chain yet - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, }, @@ -39,32 +39,32 @@ func stepsMultiConsumerDowntimeFromConsumer(consumer1, consumer2 string) []Step { // Downtime jailing and corresponding voting power change are processed by provider // Validator powers are unchanged on consumer chains - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer1), - port: "provider", - channel: 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer1), + Port: "provider", + Channel: 0, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 0, - validatorID("carol"): 501, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 0, + ValidatorID("carol"): 501, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, }, @@ -73,149 +73,149 @@ func stepsMultiConsumerDowntimeFromConsumer(consumer1, consumer2 string) []Step // A block is incremented each action, hence why VSC is committed on provider, // and can now be relayed as packet to consumer // consumer1 will now see the validator power changes - consumer2 will not (had not been relayed) - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer1), - port: "provider", - channel: 0, // consumer1 chan + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer1), + Port: "provider", + Channel: 0, // consumer1 chan }, - state: State{ + State: State{ // change propagated to consumer1 - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, // VSC now seen on consumer1 - validatorID("bob"): 0, - validatorID("carol"): 501, + ValidatorID("bob"): 0, + ValidatorID("carol"): 501, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, // VSC has not arrived to on consumer2 - validatorID("bob"): 500, - validatorID("carol"): 501, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, }, }, { // both consumer1 and consumer will now see the validator power changes - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer2), - port: "provider", - channel: 1, // consumer2 chan + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer2), + Port: "provider", + Channel: 1, // consumer2 chan }, - state: State{ - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 0, // both consumers see the change - validatorID("carol"): 501, + State: State{ + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 0, // both consumers see the change + ValidatorID("carol"): 501, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 0, // both consumers see the change - validatorID("carol"): 501, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 0, // both consumers see the change + ValidatorID("carol"): 501, }, }, }, }, { - action: unjailValidatorAction{ - provider: chainID("provi"), - validator: validatorID("bob"), + Action: unjailValidatorAction{ + Provider: ChainID("provi"), + Validator: ValidatorID("bob"), }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, // bob's stake should not be slashed since slash comes from consumer1 - validatorID("bob"): 500, - validatorID("carol"): 501, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, // change is not visible on consumer1 - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 0, - validatorID("carol"): 501, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 0, + ValidatorID("carol"): 501, }, }, // change is not visible on consumer2 - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 0, - validatorID("carol"): 501, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 0, + ValidatorID("carol"): 501, }, }, }, }, { // relay to consumer 1 - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer1), - port: "provider", - channel: 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer1), + Port: "provider", + Channel: 0, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // change has arrived to consumer1 (no slashing) - validatorID("carol"): 501, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // change has arrived to consumer1 (no slashing) + ValidatorID("carol"): 501, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 0, // change has not arrived to consumer2 - validatorID("carol"): 501, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 0, // change has not arrived to consumer2 + ValidatorID("carol"): 501, }, }, }, }, { // relay to consumer2 - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer2), - port: "provider", - channel: 1, // consumer2 chan + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer2), + Port: "provider", + Channel: 1, // consumer2 chan }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // change has arrived to consumer1 (no slashing) - validatorID("carol"): 501, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // change has arrived to consumer1 (no slashing) + ValidatorID("carol"): 501, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // change has arrived to consumer2 (no slashing) - validatorID("carol"): 501, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // change has arrived to consumer2 (no slashing) + ValidatorID("carol"): 501, }, }, }, @@ -229,190 +229,190 @@ func stepsMultiConsumerDowntimeFromProvider(consumer1, consumer2 string) []Step return []Step{ // Now we test provider initiated downtime/slashing { - action: downtimeSlashAction{ - chain: chainID("provi"), - validator: validatorID("carol"), + Action: downtimeSlashAction{ + Chain: ChainID("provi"), + Validator: ValidatorID("carol"), }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ // Non faulty validators still maintain just above 2/3 power here - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer1), - port: "provider", - channel: 0, // consumer 1 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer1), + Port: "provider", + Channel: 0, // consumer 1 channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ // Non faulty validators still maintain just above 2/3 power here - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, // powers now changed - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, // not relayed yet - powers unchanged - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 501, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 501, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer2), - port: "provider", - channel: 1, // consumer2 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer2), + Port: "provider", + Channel: 1, // consumer2 channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ // Non faulty validators still maintain just above 2/3 power here - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, // powers now changed - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, }, }, { - action: unjailValidatorAction{ - provider: chainID("provi"), - validator: validatorID("carol"), + Action: unjailValidatorAction{ + Provider: ChainID("provi"), + Validator: ValidatorID("carol"), }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, // slashed because infraction was committed on provider + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, // slashed because infraction was committed on provider }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer1), - port: "provider", - channel: 0, // consumer1 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer1), + Port: "provider", + Channel: 0, // consumer1 channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, }, }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, }, }, // not relayed yet - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumer2), - port: "provider", - channel: 1, // consumer2 channel + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumer2), + Port: "provider", + Channel: 1, // consumer2 channel }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, - }, - }, - chainID(consumer1): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, - }, - }, - chainID(consumer2): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, + }, + }, + ChainID(consumer1): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, + }, + }, + ChainID(consumer2): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, }, }, }, diff --git a/tests/e2e/steps_reward_denom.go b/tests/e2e/steps_reward_denom.go index cc9934f3f8..125f3dd401 100644 --- a/tests/e2e/steps_reward_denom.go +++ b/tests/e2e/steps_reward_denom.go @@ -3,22 +3,22 @@ package main func stepsRewardDenomConsumer(consumerName string) []Step { return []Step{ { - action: registerRepresentativeAction{ - chain: chainID(consumerName), - representatives: []validatorID{validatorID("alice"), validatorID("bob")}, - stakes: []uint{100000000, 40000000}, + Action: registerRepresentativeAction{ + Chain: ChainID(consumerName), + Representatives: []ValidatorID{ValidatorID("alice"), ValidatorID("bob")}, + Stakes: []uint{100000000, 40000000}, }, - state: State{ - chainID(consumerName): ChainState{ - RepresentativePowers: &map[validatorID]uint{ - validatorID("alice"): 100000000, - validatorID("bob"): 40000000, + State: State{ + ChainID(consumerName): ChainState{ + RepresentativePowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 100000000, + ValidatorID("bob"): 40000000, }, Rewards: &Rewards{ - IsRewarded: map[validatorID]bool{ - validatorID("alice"): true, - validatorID("bob"): true, - validatorID("carol"): false, + IsRewarded: map[ValidatorID]bool{ + ValidatorID("alice"): true, + ValidatorID("bob"): true, + ValidatorID("carol"): false, }, IsIncrementalReward: true, IsNativeDenom: true, @@ -27,31 +27,31 @@ func stepsRewardDenomConsumer(consumerName string) []Step { }, }, { - action: delegateTokensAction{ - chain: chainID(consumerName), - from: validatorID("carol"), - to: validatorID("alice"), - amount: 500000, + Action: delegateTokensAction{ + Chain: ChainID(consumerName), + From: ValidatorID("carol"), + To: ValidatorID("alice"), + Amount: 500000, }, - state: State{ - chainID(consumerName): ChainState{ + State: State{ + ChainID(consumerName): ChainState{ // Check that delegators on gov-consumer chain can change representative powers - RepresentativePowers: &map[validatorID]uint{ - validatorID("alice"): 100500000, - validatorID("bob"): 40000000, + RepresentativePowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 100500000, + ValidatorID("bob"): 40000000, }, // Check that delegating on gov-consumer does not change validator powers - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, // Check that tokens are minted and distributed to representatives and their delegators Rewards: &Rewards{ - IsRewarded: map[validatorID]bool{ - validatorID("alice"): true, - validatorID("bob"): true, - validatorID("carol"): true, + IsRewarded: map[ValidatorID]bool{ + ValidatorID("alice"): true, + ValidatorID("bob"): true, + ValidatorID("carol"): true, }, IsIncrementalReward: true, IsNativeDenom: true, @@ -61,19 +61,19 @@ func stepsRewardDenomConsumer(consumerName string) []Step { }, { // whitelisted legacy proposal can only handle ibctransfer.SendEnabled/ReceiveEnabled - action: submitParamChangeLegacyProposalAction{ - chain: chainID(consumerName), - from: validatorID("alice"), - deposit: 10000001, - subspace: "transfer", - key: "SendEnabled", - value: true, + Action: submitParamChangeLegacyProposalAction{ + Chain: ChainID(consumerName), + From: ValidatorID("alice"), + Deposit: 10000001, + Subspace: "transfer", + Key: "SendEnabled", + Value: true, }, - state: State{ - chainID(consumerName): ChainState{ - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 9889999998, - validatorID("bob"): 9960000001, + State: State{ + ChainID(consumerName): ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9889999998, + ValidatorID("bob"): 9960000001, }, Proposals: &map[uint]Proposal{ 1: ParamsProposal{ @@ -89,17 +89,17 @@ func stepsRewardDenomConsumer(consumerName string) []Step { }, { // Have accounts vote on something on the gov-consumer chain - action: voteGovProposalAction{ - chain: chainID(consumerName), - from: []validatorID{validatorID("alice"), validatorID("bob")}, - vote: []string{"yes", "no"}, - propNumber: 1, + Action: voteGovProposalAction{ + Chain: ChainID(consumerName), + From: []ValidatorID{ValidatorID("alice"), ValidatorID("bob")}, + Vote: []string{"yes", "no"}, + PropNumber: 1, }, - state: State{ - chainID(consumerName): ChainState{ - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 9889999998, - validatorID("bob"): 9960000001, + State: State{ + ChainID(consumerName): ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9889999998, + ValidatorID("bob"): 9960000001, }, // Check that the parameter is changed on gov-consumer chain Params: &([]Param{{Subspace: "transfer", Key: "SendEnabled", Value: "true"}}), @@ -107,20 +107,20 @@ func stepsRewardDenomConsumer(consumerName string) []Step { }, }, { - action: relayRewardPacketsToProviderAction{ - consumerChain: chainID(consumerName), - providerChain: chainID("provi"), - port: "transfer", - channel: 1, + Action: relayRewardPacketsToProviderAction{ + ConsumerChain: ChainID(consumerName), + ProviderChain: ChainID("provi"), + Port: "transfer", + Channel: 1, }, - state: State{ - chainID("provi"): ChainState{ + State: State{ + ChainID("provi"): ChainState{ // Check that tokens are not distributed before the denom has been registered Rewards: &Rewards{ - IsRewarded: map[validatorID]bool{ - validatorID("alice"): false, - validatorID("bob"): false, - validatorID("carol"): false, + IsRewarded: map[ValidatorID]bool{ + ValidatorID("alice"): false, + ValidatorID("bob"): false, + ValidatorID("carol"): false, }, IsIncrementalReward: false, IsNativeDenom: false, @@ -131,47 +131,47 @@ func stepsRewardDenomConsumer(consumerName string) []Step { }, }, { - action: submitChangeRewardDenomsProposalAction{ - denom: "ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9", - deposit: 10000001, - from: validatorID("bob"), + Action: submitChangeRewardDenomsProposalAction{ + Denom: "ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9", + Deposit: 10000001, + From: ValidatorID("bob"), }, - state: State{ - chainID("provi"): ChainState{ + State: State{ + ChainID("provi"): ChainState{ // Denom not yet registered, gov prop needs to pass first RegisteredConsumerRewardDenoms: &[]string{}, }, }, }, { - action: voteGovProposalAction{ - chain: chainID("provi"), - from: []validatorID{validatorID("alice"), validatorID("bob"), validatorID("carol")}, - vote: []string{"yes", "yes", "yes"}, - propNumber: 2, + Action: voteGovProposalAction{ + Chain: ChainID("provi"), + From: []ValidatorID{ValidatorID("alice"), ValidatorID("bob"), ValidatorID("carol")}, + Vote: []string{"yes", "yes", "yes"}, + PropNumber: 2, }, - state: State{ - chainID("provi"): ChainState{ + State: State{ + ChainID("provi"): ChainState{ // Check that the denom is registered on provider chain RegisteredConsumerRewardDenoms: &[]string{"ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9"}, }, }, }, { - action: relayRewardPacketsToProviderAction{ - consumerChain: chainID(consumerName), - providerChain: chainID("provi"), - port: "transfer", - channel: 1, + Action: relayRewardPacketsToProviderAction{ + ConsumerChain: ChainID(consumerName), + ProviderChain: ChainID("provi"), + Port: "transfer", + Channel: 1, }, - state: State{ - chainID("provi"): ChainState{ + State: State{ + ChainID("provi"): ChainState{ // Check that tokens are not minted and sent to provider chain and distributed to validators and their delegators on provider chain Rewards: &Rewards{ - IsRewarded: map[validatorID]bool{ - validatorID("alice"): false, - validatorID("bob"): false, - validatorID("carol"): false, + IsRewarded: map[ValidatorID]bool{ + ValidatorID("alice"): false, + ValidatorID("bob"): false, + ValidatorID("carol"): false, }, IsIncrementalReward: false, IsNativeDenom: false, @@ -180,113 +180,113 @@ func stepsRewardDenomConsumer(consumerName string) []Step { }, }, { - action: downtimeSlashAction{ - chain: chainID(consumerName), - validator: validatorID("bob"), + Action: downtimeSlashAction{ + Chain: ChainID(consumerName), + Validator: ValidatorID("bob"), }, - state: State{ + State: State{ // validator should be slashed on consumer, powers not affected on either chain yet - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, // Downtime jailing and corresponding voting power change are processed by provider - validatorID("bob"): 0, - validatorID("carol"): 500, + ValidatorID("bob"): 0, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, - // A block is incremented each action, hence why VSC is committed on provider, + // A block is incremented each Action, hence why VSC is committed on provider, // and can now be relayed as packet to consumer { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, }, - state: State{ - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, + State: State{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, // VSC now seen on consumer - validatorID("bob"): 0, - validatorID("carol"): 500, + ValidatorID("bob"): 0, + ValidatorID("carol"): 500, }, }, }, }, { - action: unjailValidatorAction{ - provider: chainID("provi"), - validator: validatorID("bob"), + Action: unjailValidatorAction{ + Provider: ChainID("provi"), + Validator: ValidatorID("bob"), }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, - validatorID("carol"): 500, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, + ValidatorID("carol"): 500, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, }, - state: State{ - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, // Check that slashing on the gov-consumer chain does not result in slashing for the representatives or their delegators - RepresentativePowers: &map[validatorID]uint{ - validatorID("alice"): 100500000, - validatorID("bob"): 40000000, + RepresentativePowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 100500000, + ValidatorID("bob"): 40000000, }, }, }, diff --git a/tests/e2e/steps_sovereign_changeover.go b/tests/e2e/steps_sovereign_changeover.go index c02b2c4d43..8c053299cc 100644 --- a/tests/e2e/steps_sovereign_changeover.go +++ b/tests/e2e/steps_sovereign_changeover.go @@ -10,24 +10,24 @@ import clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" func stepsSovereignTransferChan() []Step { return []Step{ { - action: createIbcClientsAction{ - chainA: chainID("sover"), - chainB: chainID("provi"), + Action: createIbcClientsAction{ + ChainA: ChainID("sover"), + ChainB: ChainID("provi"), }, - state: State{}, + State: State{}, }, { // this will create channel-0 connection end on both chain - action: addIbcChannelAction{ - chainA: chainID("sover"), - chainB: chainID("provi"), - connectionA: 0, - portA: "transfer", - portB: "transfer", - order: "unordered", - version: "ics20-1", + Action: addIbcChannelAction{ + ChainA: ChainID("sover"), + ChainB: ChainID("provi"), + ConnectionA: 0, + PortA: "transfer", + PortB: "transfer", + Order: "unordered", + Version: "ics20-1", }, - state: State{}, + State: State{}, }, } } @@ -36,29 +36,29 @@ func stepsSovereignTransferChan() []Step { func stepsChangeoverToConsumer(consumerName string) []Step { s := []Step{ { - action: submitConsumerAdditionProposalAction{ - preCCV: true, - chain: chainID("provi"), - from: validatorID("alice"), - deposit: 10000001, - consumerChain: chainID(consumerName), + Action: submitConsumerAdditionProposalAction{ + PreCCV: true, + Chain: ChainID("provi"), + From: ValidatorID("alice"), + Deposit: 10000001, + ConsumerChain: ChainID(consumerName), // chain-0 is the transfer channelID that gets created in stepsSovereignTransferChan // the consumer chain will use this channel to send rewards to the provider chain // there is no need to create a new channel for rewards distribution - distributionChannel: "channel-0", - spawnTime: 0, - initialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 111}, // 1 block after upgrade !important + DistributionChannel: "channel-0", + SpawnTime: 0, + InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 111}, // 1 block after upgrade !important }, - state: State{ - chainID("provi"): ChainState{ - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 9489999999, - validatorID("bob"): 9500000000, + State: State{ + ChainID("provi"): ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9489999999, + ValidatorID("bob"): 9500000000, }, Proposals: &map[uint]Proposal{ 1: ConsumerAdditionProposal{ Deposit: 10000001, - Chain: chainID(consumerName), + Chain: ChainID(consumerName), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 111}, Status: "PROPOSAL_STATUS_VOTING_PERIOD", @@ -68,78 +68,78 @@ func stepsChangeoverToConsumer(consumerName string) []Step { }, }, { - action: voteGovProposalAction{ - chain: chainID("provi"), - from: []validatorID{validatorID("alice"), validatorID("bob"), validatorID("carol")}, - vote: []string{"yes", "yes", "yes"}, - propNumber: 1, + Action: voteGovProposalAction{ + Chain: ChainID("provi"), + From: []ValidatorID{ValidatorID("alice"), ValidatorID("bob"), ValidatorID("carol")}, + Vote: []string{"yes", "yes", "yes"}, + PropNumber: 1, }, - state: State{ - chainID("provi"): ChainState{ + State: State{ + ChainID("provi"): ChainState{ Proposals: &map[uint]Proposal{ 1: ConsumerAdditionProposal{ Deposit: 10000001, - Chain: chainID(consumerName), + Chain: ChainID(consumerName), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 111}, Status: "PROPOSAL_STATUS_PASSED", }, }, - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 9500000000, - validatorID("bob"): 9500000000, + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9500000000, + ValidatorID("bob"): 9500000000, }, }, }, }, { - action: ChangeoverChainAction{ - sovereignChain: chainID(consumerName), - providerChain: chainID("provi"), - validators: []StartChainValidator{ - {id: validatorID("alice"), stake: 500000000, allocation: 10000000000}, - {id: validatorID("bob"), stake: 500000000, allocation: 10000000000}, - {id: validatorID("carol"), stake: 500000000, allocation: 10000000000}, + Action: ChangeoverChainAction{ + SovereignChain: ChainID(consumerName), + ProviderChain: ChainID("provi"), + Validators: []StartChainValidator{ + {Id: ValidatorID("alice"), Stake: 500000000, Allocation: 10000000000}, + {Id: ValidatorID("bob"), Stake: 500000000, Allocation: 10000000000}, + {Id: ValidatorID("carol"), Stake: 500000000, Allocation: 10000000000}, }, - genesisChanges: ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"", + GenesisChanges: ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"", }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 500, - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 500, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ // uses val powers from consumer - validatorID("alice"): 500, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValidatorID("alice"): 500, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: addIbcConnectionAction{ - chainA: chainID(consumerName), - chainB: chainID("provi"), - clientA: 1, - clientB: 1, + Action: addIbcConnectionAction{ + ChainA: ChainID(consumerName), + ChainB: ChainID("provi"), + ClientA: 1, + ClientB: 1, }, - state: State{}, + State: State{}, }, { - action: addIbcChannelAction{ - chainA: chainID(consumerName), - chainB: chainID("provi"), - connectionA: 1, - portA: "consumer", - portB: "provider", - order: "ordered", + Action: addIbcChannelAction{ + ChainA: ChainID(consumerName), + ChainB: ChainID("provi"), + ConnectionA: 1, + PortA: "consumer", + PortB: "provider", + Order: "ordered", }, - state: State{}, + State: State{}, }, } @@ -154,33 +154,33 @@ func stepsChangeoverToConsumer(consumerName string) []Step { func stepRunSovereignChain() []Step { return []Step{ { - action: StartSovereignChainAction{ - chain: chainID("sover"), - validators: []StartChainValidator{ - {id: validatorID("alice"), stake: 500000000, allocation: 10000000000}, + Action: StartSovereignChainAction{ + Chain: ChainID("sover"), + Validators: []StartChainValidator{ + {Id: ValidatorID("alice"), Stake: 500000000, Allocation: 10000000000}, }, }, - state: State{ - chainID("sover"): ChainState{ - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 9500000000, + State: State{ + ChainID("sover"): ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9500000000, }, }, }, }, { - action: delegateTokensAction{ - chain: chainID("sover"), - from: validatorID("alice"), - to: validatorID("alice"), - amount: 11000000, + Action: delegateTokensAction{ + Chain: ChainID("sover"), + From: ValidatorID("alice"), + To: ValidatorID("alice"), + Amount: 11000000, }, - state: State{ - chainID("sover"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, // does not exist on pre-ccv sover - validatorID("carol"): 0, // does not exist on pre-ccv sover + State: State{ + ChainID("sover"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, // does not exist on pre-ccv sover + ValidatorID("carol"): 0, // does not exist on pre-ccv sover }, }, }, @@ -192,14 +192,14 @@ func stepRunSovereignChain() []Step { func stepsUpgradeChain() []Step { return []Step{ { - action: LegacyUpgradeProposalAction{ - chainID: chainID("sover"), - upgradeTitle: "sovereign-changeover", - proposer: validatorID("alice"), - upgradeHeight: 110, + Action: LegacyUpgradeProposalAction{ + ChainID: ChainID("sover"), + UpgradeTitle: "sovereign-changeover", + Proposer: ValidatorID("alice"), + UpgradeHeight: 110, }, - state: State{ - chainID("sover"): ChainState{ + State: State{ + ChainID("sover"): ChainState{ Proposals: &map[uint]Proposal{ 1: UpgradeProposal{ Title: "sovereign-changeover", @@ -213,14 +213,14 @@ func stepsUpgradeChain() []Step { }, }, { - action: voteGovProposalAction{ - chain: chainID("sover"), - from: []validatorID{validatorID("alice")}, - vote: []string{"yes"}, - propNumber: 1, + Action: voteGovProposalAction{ + Chain: ChainID("sover"), + From: []ValidatorID{ValidatorID("alice")}, + Vote: []string{"yes"}, + PropNumber: 1, }, - state: State{ - chainID("sover"): ChainState{ + State: State{ + ChainID("sover"): ChainState{ Proposals: &map[uint]Proposal{ 1: UpgradeProposal{ Deposit: 10000000, @@ -234,11 +234,11 @@ func stepsUpgradeChain() []Step { }, }, { - action: waitUntilBlockAction{ - chain: chainID("sover"), - block: 110, + Action: waitUntilBlockAction{ + Chain: ChainID("sover"), + Block: 110, }, - state: State{}, + State: State{}, }, } } @@ -249,116 +249,116 @@ func stepsUpgradeChain() []Step { func stepsPostChangeoverDelegate(consumerName string) []Step { return []Step{ { - action: SendTokensAction{ - chain: chainID(consumerName), - from: validatorID("alice"), - to: validatorID("bob"), - amount: 100, + Action: SendTokensAction{ + Chain: ChainID(consumerName), + From: ValidatorID("alice"), + To: ValidatorID("bob"), + Amount: 100, }, - state: State{ - chainID(consumerName): ChainState{ + State: State{ + ChainID(consumerName): ChainState{ // Tx should not go through, ICS channel is not setup until first VSC packet has been relayed to consumer - ValBalances: &map[validatorID]uint{ - validatorID("bob"): 0, + ValBalances: &map[ValidatorID]uint{ + ValidatorID("bob"): 0, }, }, }, }, { - action: delegateTokensAction{ - chain: chainID("provi"), - from: validatorID("alice"), - to: validatorID("alice"), - amount: 11000000, + Action: delegateTokensAction{ + Chain: ChainID("provi"), + From: ValidatorID("alice"), + To: ValidatorID("alice"), + Amount: 11000000, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 500, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 500, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 1, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 1, }, - state: State{ - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: SendTokensAction{ - chain: chainID(consumerName), - from: validatorID("alice"), - to: validatorID("bob"), - amount: 100, + Action: SendTokensAction{ + Chain: ChainID(consumerName), + From: ValidatorID("alice"), + To: ValidatorID("bob"), + Amount: 100, }, - state: State{ - chainID(consumerName): ChainState{ + State: State{ + ChainID(consumerName): ChainState{ // Tx should go through, ICS channel is setup - ValBalances: &map[validatorID]uint{ - validatorID("bob"): 100, + ValBalances: &map[ValidatorID]uint{ + ValidatorID("bob"): 100, }, }, }, }, { - action: unbondTokensAction{ - chain: chainID("provi"), - unbondFrom: validatorID("alice"), - sender: validatorID("alice"), - amount: 1000000, + Action: unbondTokensAction{ + Chain: ChainID("provi"), + UnbondFrom: ValidatorID("alice"), + Sender: ValidatorID("alice"), + Amount: 1000000, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ // Voting power on consumer should not be affected yet - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 1, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 1, }, - state: State{ - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 510, - validatorID("bob"): 500, - validatorID("carol"): 500, + State: State{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 510, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, }, diff --git a/tests/e2e/steps_start_chains.go b/tests/e2e/steps_start_chains.go index 6017a22641..ace3d6c255 100644 --- a/tests/e2e/steps_start_chains.go +++ b/tests/e2e/steps_start_chains.go @@ -7,20 +7,20 @@ import ( func stepStartProviderChain() []Step { return []Step{ { - action: StartChainAction{ - chain: chainID("provi"), - validators: []StartChainValidator{ - {id: validatorID("bob"), stake: 500000000, allocation: 10000000000}, - {id: validatorID("alice"), stake: 500000000, allocation: 10000000000}, - {id: validatorID("carol"), stake: 500000000, allocation: 10000000000}, + Action: StartChainAction{ + Chain: ChainID("provi"), + Validators: []StartChainValidator{ + {Id: ValidatorID("bob"), Stake: 500000000, Allocation: 10000000000}, + {Id: ValidatorID("alice"), Stake: 500000000, Allocation: 10000000000}, + {Id: ValidatorID("carol"), Stake: 500000000, Allocation: 10000000000}, }, }, - state: State{ - chainID("provi"): ChainState{ - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 9500000000, - validatorID("bob"): 9500000000, - validatorID("carol"): 9500000000, + State: State{ + ChainID("provi"): ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9500000000, + ValidatorID("bob"): 9500000000, + ValidatorID("carol"): 9500000000, }, }, }, @@ -31,24 +31,24 @@ func stepStartProviderChain() []Step { func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint, setupTransferChans bool) []Step { s := []Step{ { - action: submitConsumerAdditionProposalAction{ - chain: chainID("provi"), - from: validatorID("alice"), - deposit: 10000001, - consumerChain: chainID(consumerName), - spawnTime: 0, - initialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, + Action: submitConsumerAdditionProposalAction{ + Chain: ChainID("provi"), + From: ValidatorID("alice"), + Deposit: 10000001, + ConsumerChain: ChainID(consumerName), + SpawnTime: 0, + InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, }, - state: State{ - chainID("provi"): ChainState{ - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 9489999999, - validatorID("bob"): 9500000000, + State: State{ + ChainID("provi"): ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9489999999, + ValidatorID("bob"): 9500000000, }, Proposals: &map[uint]Proposal{ proposalIndex: ConsumerAdditionProposal{ Deposit: 10000001, - Chain: chainID(consumerName), + Chain: ChainID(consumerName), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, Status: "PROPOSAL_STATUS_VOTING_PERIOD", @@ -60,155 +60,155 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint // add a consumer key before the chain starts // the key will be present in consumer genesis initial_val_set { - action: assignConsumerPubKeyAction{ - chain: chainID(consumerName), - validator: validatorID("carol"), - consumerPubkey: `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="}`, + Action: assignConsumerPubKeyAction{ + Chain: ChainID(consumerName), + Validator: ValidatorID("carol"), + ConsumerPubkey: `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="}`, // consumer chain has not started // we don't need to reconfigure the node // since it will start with consumer key - reconfigureNode: false, + ReconfigureNode: false, }, - state: State{ - chainID(consumerName): ChainState{ - AssignedKeys: &map[validatorID]string{ - validatorID("carol"): "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk", + State: State{ + ChainID(consumerName): ChainState{ + AssignedKeys: &map[ValidatorID]string{ + ValidatorID("carol"): "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk", }, - ProviderKeys: &map[validatorID]string{ - validatorID("carol"): "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6", + ProviderKeys: &map[ValidatorID]string{ + ValidatorID("carol"): "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6", }, }, }, }, { // op should fail - key already assigned by the same validator - action: assignConsumerPubKeyAction{ - chain: chainID(consumerName), - validator: validatorID("carol"), - consumerPubkey: `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="}`, - reconfigureNode: false, - expectError: true, - expectedError: "a validator has assigned the consumer key already: consumer key is already in use by a validator", + Action: assignConsumerPubKeyAction{ + Chain: ChainID(consumerName), + Validator: ValidatorID("carol"), + ConsumerPubkey: `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="}`, + ReconfigureNode: false, + ExpectError: true, + ExpectedError: "a validator has assigned the consumer key already: consumer key is already in use by a validator", }, - state: State{}, + State: State{}, }, { // op should fail - key already assigned by another validator - action: assignConsumerPubKeyAction{ - chain: chainID(consumerName), - validator: validatorID("bob"), + Action: assignConsumerPubKeyAction{ + Chain: ChainID(consumerName), + Validator: ValidatorID("bob"), // same pub key as carol - consumerPubkey: `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="}`, - reconfigureNode: false, - expectError: true, - expectedError: "a validator has assigned the consumer key already: consumer key is already in use by a validator", + ConsumerPubkey: `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="}`, + ReconfigureNode: false, + ExpectError: true, + ExpectedError: "a validator has assigned the consumer key already: consumer key is already in use by a validator", }, - state: State{ - chainID(consumerName): ChainState{ - AssignedKeys: &map[validatorID]string{ - validatorID("carol"): "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk", - validatorID("bob"): "", + State: State{ + ChainID(consumerName): ChainState{ + AssignedKeys: &map[ValidatorID]string{ + ValidatorID("carol"): "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk", + ValidatorID("bob"): "", }, - ProviderKeys: &map[validatorID]string{ - validatorID("carol"): "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6", + ProviderKeys: &map[ValidatorID]string{ + ValidatorID("carol"): "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6", }, }, }, }, { - action: voteGovProposalAction{ - chain: chainID("provi"), - from: []validatorID{validatorID("alice"), validatorID("bob"), validatorID("carol")}, - vote: []string{"yes", "yes", "yes"}, - propNumber: proposalIndex, + Action: voteGovProposalAction{ + Chain: ChainID("provi"), + From: []ValidatorID{ValidatorID("alice"), ValidatorID("bob"), ValidatorID("carol")}, + Vote: []string{"yes", "yes", "yes"}, + PropNumber: proposalIndex, }, - state: State{ - chainID("provi"): ChainState{ + State: State{ + ChainID("provi"): ChainState{ Proposals: &map[uint]Proposal{ proposalIndex: ConsumerAdditionProposal{ Deposit: 10000001, - Chain: chainID(consumerName), + Chain: ChainID(consumerName), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, Status: "PROPOSAL_STATUS_PASSED", }, }, - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 9500000000, - validatorID("bob"): 9500000000, + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9500000000, + ValidatorID("bob"): 9500000000, }, }, }, }, { - action: startConsumerChainAction{ - consumerChain: chainID(consumerName), - providerChain: chainID("provi"), - validators: []StartChainValidator{ - {id: validatorID("bob"), stake: 500000000, allocation: 10000000000}, - {id: validatorID("alice"), stake: 500000000, allocation: 10000000000}, - {id: validatorID("carol"), stake: 500000000, allocation: 10000000000}, + Action: startConsumerChainAction{ + ConsumerChain: ChainID(consumerName), + ProviderChain: ChainID("provi"), + Validators: []StartChainValidator{ + {Id: ValidatorID("bob"), Stake: 500000000, Allocation: 10000000000}, + {Id: ValidatorID("alice"), Stake: 500000000, Allocation: 10000000000}, + {Id: ValidatorID("carol"), Stake: 500000000, Allocation: 10000000000}, }, // For consumers that're launching with the provider being on an earlier version // of ICS before the soft opt-out threshold was introduced, we need to set the // soft opt-out threshold to 0.05 in the consumer genesis to ensure that the // consumer binary doesn't panic. Sdk requires that all params are set to valid // values from the genesis file. - genesisChanges: ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"", + GenesisChanges: ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"", }, - state: State{ - chainID("provi"): ChainState{ - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 9500000000, - validatorID("bob"): 9500000000, - validatorID("carol"): 9500000000, + State: State{ + ChainID("provi"): ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9500000000, + ValidatorID("bob"): 9500000000, + ValidatorID("carol"): 9500000000, }, }, - chainID(consumerName): ChainState{ - ValBalances: &map[validatorID]uint{ - validatorID("alice"): 10000000000, - validatorID("bob"): 10000000000, - validatorID("carol"): 10000000000, + ChainID(consumerName): ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 10000000000, + ValidatorID("bob"): 10000000000, + ValidatorID("carol"): 10000000000, }, }, }, }, { - action: addIbcConnectionAction{ - chainA: chainID(consumerName), - chainB: chainID("provi"), - clientA: 0, - clientB: chainIndex, + Action: addIbcConnectionAction{ + ChainA: ChainID(consumerName), + ChainB: ChainID("provi"), + ClientA: 0, + ClientB: chainIndex, }, - state: State{}, + State: State{}, }, { - action: addIbcChannelAction{ - chainA: chainID(consumerName), - chainB: chainID("provi"), - connectionA: 0, - portA: "consumer", // TODO: check port mapping - portB: "provider", - order: "ordered", + Action: addIbcChannelAction{ + ChainA: ChainID(consumerName), + ChainB: ChainID("provi"), + ConnectionA: 0, + PortA: "consumer", // TODO: check port mapping + PortB: "provider", + Order: "ordered", }, - state: State{}, + State: State{}, }, } // currently only used in democracy tests if setupTransferChans { s = append(s, Step{ - action: transferChannelCompleteAction{ - chainA: chainID(consumerName), - chainB: chainID("provi"), - connectionA: 0, - portA: "transfer", - portB: "transfer", - order: "unordered", - channelA: 1, - channelB: 1, + Action: transferChannelCompleteAction{ + ChainA: ChainID(consumerName), + ChainB: ChainID("provi"), + ConnectionA: 0, + PortA: "transfer", + PortB: "transfer", + Order: "unordered", + ChannelA: 1, + ChannelB: 1, }, - state: State{}, + State: State{}, }) } return s @@ -228,75 +228,75 @@ func stepsStartChains(consumerNames []string, setupTransferChans bool) []Step { func stepsAssignConsumerKeyOnStartedChain(consumerName, validator string) []Step { return []Step{ { - action: assignConsumerPubKeyAction{ - chain: chainID(consumerName), - validator: validatorID("bob"), + Action: assignConsumerPubKeyAction{ + Chain: ChainID(consumerName), + Validator: ValidatorID("bob"), // reconfigure the node -> validator was using provider key // until this point -> key matches config.consumerValPubKey for "bob" - consumerPubkey: `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"QlG+iYe6AyYpvY1z9RNJKCVlH14Q/qSz4EjGdGCru3o="}`, - reconfigureNode: true, + ConsumerPubkey: `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"QlG+iYe6AyYpvY1z9RNJKCVlH14Q/qSz4EjGdGCru3o="}`, + ReconfigureNode: true, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ // this happens after some delegations // so that the chain does not halt if 1/3 of power is offline - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ // this happens after some delegations // so that the chain does not halt if 1/3 of power is offline - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, - AssignedKeys: &map[validatorID]string{ - validatorID("bob"): "cosmosvalcons1uuec3cjxajv5te08p220usrjhkfhg9wyvqn0tm", - validatorID("carol"): "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk", + AssignedKeys: &map[ValidatorID]string{ + ValidatorID("bob"): "cosmosvalcons1uuec3cjxajv5te08p220usrjhkfhg9wyvqn0tm", + ValidatorID("carol"): "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk", }, - ProviderKeys: &map[validatorID]string{ - validatorID("bob"): "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", - validatorID("carol"): "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6", + ProviderKeys: &map[ValidatorID]string{ + ValidatorID("bob"): "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", + ValidatorID("carol"): "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6", }, }, }, }, { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ // this happens after some delegations // so that the chain does not halt if 1/3 of power is offline - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ // this happens after some delegations // so that the chain does not halt if 1/3 of power is offline - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, - AssignedKeys: &map[validatorID]string{ - validatorID("bob"): "cosmosvalcons1uuec3cjxajv5te08p220usrjhkfhg9wyvqn0tm", - validatorID("carol"): "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk", + AssignedKeys: &map[ValidatorID]string{ + ValidatorID("bob"): "cosmosvalcons1uuec3cjxajv5te08p220usrjhkfhg9wyvqn0tm", + ValidatorID("carol"): "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk", }, - ProviderKeys: &map[validatorID]string{ - validatorID("bob"): "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", - validatorID("carol"): "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6", + ProviderKeys: &map[ValidatorID]string{ + ValidatorID("bob"): "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", + ValidatorID("carol"): "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6", }, }, }, diff --git a/tests/e2e/steps_stop_chain.go b/tests/e2e/steps_stop_chain.go index 9cef49a9ea..0841086417 100644 --- a/tests/e2e/steps_stop_chain.go +++ b/tests/e2e/steps_stop_chain.go @@ -6,8 +6,8 @@ import "time" func stepsStartRelayer() []Step { return []Step{ { - action: startRelayerAction{}, - state: State{}, + Action: startRelayerAction{}, + State: State{}, }, } } @@ -16,51 +16,51 @@ func stepsStartRelayer() []Step { func stepsStopChain(consumerName string, propNumber uint) []Step { s := []Step{ { - action: submitConsumerRemovalProposalAction{ - chain: chainID("provi"), - from: validatorID("bob"), - deposit: 10000001, - consumerChain: chainID(consumerName), - stopTimeOffset: 0 * time.Millisecond, + Action: submitConsumerRemovalProposalAction{ + Chain: ChainID("provi"), + From: ValidatorID("bob"), + Deposit: 10000001, + ConsumerChain: ChainID(consumerName), + StopTimeOffset: 0 * time.Millisecond, }, - state: State{ - chainID("provi"): ChainState{ - ValBalances: &map[validatorID]uint{ - validatorID("bob"): 9489999999, + State: State{ + ChainID("provi"): ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("bob"): 9489999999, }, Proposals: &map[uint]Proposal{ propNumber: ConsumerRemovalProposal{ Deposit: 10000001, - Chain: chainID(consumerName), + Chain: ChainID(consumerName), StopTime: 0, Status: "PROPOSAL_STATUS_VOTING_PERIOD", }, }, - ConsumerChains: &map[chainID]bool{"consu": true}, // consumer chain not yet removed + ConsumerChains: &map[ChainID]bool{"consu": true}, // consumer chain not yet removed }, }, }, { - action: voteGovProposalAction{ - chain: chainID("provi"), - from: []validatorID{validatorID("alice"), validatorID("bob"), validatorID("carol")}, - vote: []string{"yes", "yes", "yes"}, - propNumber: propNumber, + Action: voteGovProposalAction{ + Chain: ChainID("provi"), + From: []ValidatorID{ValidatorID("alice"), ValidatorID("bob"), ValidatorID("carol")}, + Vote: []string{"yes", "yes", "yes"}, + PropNumber: propNumber, }, - state: State{ - chainID("provi"): ChainState{ + State: State{ + ChainID("provi"): ChainState{ Proposals: &map[uint]Proposal{ propNumber: ConsumerRemovalProposal{ Deposit: 10000001, - Chain: chainID(consumerName), + Chain: ChainID(consumerName), StopTime: 0, Status: "PROPOSAL_STATUS_PASSED", }, }, - ValBalances: &map[validatorID]uint{ - validatorID("bob"): 9500000000, + ValBalances: &map[ValidatorID]uint{ + ValidatorID("bob"): 9500000000, }, - ConsumerChains: &map[chainID]bool{}, // Consumer chain is now removed + ConsumerChains: &map[ChainID]bool{}, // Consumer chain is now removed }, }, }, @@ -74,51 +74,51 @@ func stepsStopChain(consumerName string, propNumber uint) []Step { func stepsConsumerRemovalPropNotPassing(consumerName string, propNumber uint) []Step { s := []Step{ { - action: submitConsumerRemovalProposalAction{ - chain: chainID("provi"), - from: validatorID("bob"), - deposit: 10000001, - consumerChain: chainID(consumerName), - stopTimeOffset: 0 * time.Millisecond, + Action: submitConsumerRemovalProposalAction{ + Chain: ChainID("provi"), + From: ValidatorID("bob"), + Deposit: 10000001, + ConsumerChain: ChainID(consumerName), + StopTimeOffset: 0 * time.Millisecond, }, - state: State{ - chainID("provi"): ChainState{ - ValBalances: &map[validatorID]uint{ - validatorID("bob"): 9489999999, + State: State{ + ChainID("provi"): ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("bob"): 9489999999, }, Proposals: &map[uint]Proposal{ propNumber: ConsumerRemovalProposal{ Deposit: 10000001, - Chain: chainID(consumerName), + Chain: ChainID(consumerName), StopTime: 0, Status: "PROPOSAL_STATUS_VOTING_PERIOD", }, }, - ConsumerChains: &map[chainID]bool{"consu": true}, // consumer chain not removed + ConsumerChains: &map[ChainID]bool{"consu": true}, // consumer chain not removed }, }, }, { - action: voteGovProposalAction{ - chain: chainID("provi"), - from: []validatorID{validatorID("alice"), validatorID("bob"), validatorID("carol")}, - vote: []string{"no", "no", "no"}, - propNumber: propNumber, + Action: voteGovProposalAction{ + Chain: ChainID("provi"), + From: []ValidatorID{ValidatorID("alice"), ValidatorID("bob"), ValidatorID("carol")}, + Vote: []string{"no", "no", "no"}, + PropNumber: propNumber, }, - state: State{ - chainID("provi"): ChainState{ + State: State{ + ChainID("provi"): ChainState{ Proposals: &map[uint]Proposal{ propNumber: ConsumerRemovalProposal{ Deposit: 10000001, - Chain: chainID(consumerName), + Chain: ChainID(consumerName), StopTime: 0, Status: "PROPOSAL_STATUS_REJECTED", }, }, - ValBalances: &map[validatorID]uint{ - validatorID("bob"): 9500000000, + ValBalances: &map[ValidatorID]uint{ + ValidatorID("bob"): 9500000000, }, - ConsumerChains: &map[chainID]bool{"consu": true}, // consumer chain not removed + ConsumerChains: &map[ChainID]bool{"consu": true}, // consumer chain not removed }, }, }, diff --git a/tests/e2e/steps_submit_equivocation_proposal.go b/tests/e2e/steps_submit_equivocation_proposal.go index 8af1d2464d..243c01f04d 100644 --- a/tests/e2e/steps_submit_equivocation_proposal.go +++ b/tests/e2e/steps_submit_equivocation_proposal.go @@ -7,35 +7,35 @@ func stepsRejectEquivocationProposal(consumerName string, propNumber uint) []Ste return []Step{ { // bob submits a proposal to slash himself - action: submitEquivocationProposalAction{ - chain: chainID("consu"), - from: validatorID("bob"), - deposit: 10000001, - height: 10, - time: time.Now(), - power: 500, - validator: validatorID("bob"), + Action: submitEquivocationProposalAction{ + Chain: ChainID("consu"), + From: ValidatorID("bob"), + Deposit: 10000001, + Height: 10, + Time: time.Now(), + Power: 500, + Validator: ValidatorID("bob"), }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, }, - ValBalances: &map[validatorID]uint{ - validatorID("bob"): 9500000000, + ValBalances: &map[ValidatorID]uint{ + ValidatorID("bob"): 9500000000, }, Proposals: &map[uint]Proposal{ // proposal does not exist propNumber: TextProposal{}, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 495, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, }, }, }, @@ -48,24 +48,24 @@ func stepsSubmitEquivocationProposal(consumerName string, propNumber uint) []Ste s := []Step{ { // bob submits a proposal to slash himself - action: submitEquivocationProposalAction{ - chain: chainID("consu"), - from: validatorID("bob"), - deposit: 10000001, - height: 10, - time: time.Now(), // not sure what time in equivocations means - power: 500, - validator: validatorID("bob"), + Action: submitEquivocationProposalAction{ + Chain: ChainID("consu"), + From: ValidatorID("bob"), + Deposit: 10000001, + Height: 10, + Time: time.Now(), // not sure what time in equivocations means + Power: 500, + Validator: ValidatorID("bob"), }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, - ValBalances: &map[validatorID]uint{ - validatorID("bob"): 9489999999, + ValBalances: &map[ValidatorID]uint{ + ValidatorID("bob"): 9489999999, }, Proposals: &map[uint]Proposal{ propNumber: EquivocationProposal{ @@ -77,28 +77,28 @@ func stepsSubmitEquivocationProposal(consumerName string, propNumber uint) []Ste }, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, - validatorID("carol"): 0, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, }, }, }, }, { - action: voteGovProposalAction{ - chain: chainID("provi"), - from: []validatorID{validatorID("alice"), validatorID("bob"), validatorID("carol")}, - vote: []string{"yes", "yes", "yes"}, - propNumber: propNumber, + Action: voteGovProposalAction{ + Chain: ChainID("provi"), + From: []ValidatorID{ValidatorID("alice"), ValidatorID("bob"), ValidatorID("carol")}, + Vote: []string{"yes", "yes", "yes"}, + PropNumber: propNumber, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 0, // bob is tombstoned after proposal passes - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 0, // bob is tombstoned after proposal passes + ValidatorID("carol"): 0, }, Proposals: &map[uint]Proposal{ propNumber: EquivocationProposal{ @@ -110,36 +110,36 @@ func stepsSubmitEquivocationProposal(consumerName string, propNumber uint) []Ste }, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 500, // slash not reflected in consumer chain - validatorID("carol"): 0, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, // slash not reflected in consumer chain + ValidatorID("carol"): 0, }, }, }, }, { // relay power change to consumer1 - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, + Action: relayPacketsAction{ + ChainA: ChainID("provi"), + ChainB: ChainID(consumerName), + Port: "provider", + Channel: 0, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 0, - validatorID("carol"): 0, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 0, + ValidatorID("carol"): 0, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, - validatorID("bob"): 0, // slash relayed to consumer chain - validatorID("carol"): 0, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 0, // slash relayed to consumer chain + ValidatorID("carol"): 0, }, }, }, From cb6f856f1da105ad8f7e3f2803cd7a7dc49447fb Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 21 Sep 2023 19:05:12 +0200 Subject: [PATCH 14/22] doc: add changelog entry for v2.*-lsm releases (#1323) add changelog entry for v2.*-lsm releases --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29b6328e94..a238df4a44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,19 @@ Interchain Security v3 uses SDK 0.47 and IBC 7. * `[x/ccv/provider]` (fix) [#977](https://github.com/cosmos/interchain-security/pull/977) Avoids panicking the provider when an unbonding delegation was removed through a `CancelUnbondingDelegation` message. * `[x/ccv/democracy]` (feat) [#1019](https://github.com/cosmos/interchain-security/pull/1019) Whitelisting non-legacy params in the "democracy module" require the entire module to be whitelisted. +## v2.1.0-provider-lsm + +Date: September 15th, 2023 + +* (feature!) [#1280](https://github.com/cosmos/interchain-security/pull/1280) provider proposal for changing reward denoms + +## v2.0.0-lsm + +Date: August 18th, 2023 + +* (deps!) [#1120](https://github.com/cosmos/interchain-security/pull/1120) Bump [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) to [v0.45.16-ics-lsm](https://github.com/cosmos/cosmos-sdk/tree/v0.45.16-ics-lsm). This requires adapting ICS to support this SDK release. Changes are state breaking. +* (fix) [#720](https://github.com/cosmos/interchain-security/issues/720) Fix the attribute `AttributeDistributionTotal` value in `FeeDistribution` event emit. + ## v2.0.0 Date: June 1st, 2023 From 3d4627b77bdfa809db0229b005c09c9f86f2a35a Mon Sep 17 00:00:00 2001 From: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Date: Mon, 25 Sep 2023 10:54:43 +0200 Subject: [PATCH 15/22] test: Add json marshal/unmarshal for test traces (#1314) * Add json marshal/unmarshal for test traces * Remove auto-generated trace files * Add an example trace to see the input format * Add comment in rapid test * Remove duplicated test case * Remove TODO in favor of comment * Reduce code duplication * Run go mod tidy and make format * Correct testdata directory in gitignore * Remove testdata directory * Remove testdata from gitignore * Add tracehandler_testdata * Remove example trace, since there are examples in the test data * Revert unintentional change to .gitignore * Remove propType field from generator * Add docstrings to action_rapid test and state_rapid_test to better explain what the files are doing * bite -> byte * Refactor: slashThrottleDequeue to slashThrottleDequeueAction * action name -> action type * use method name as first word in docstring * Simply remove simply * Clarify that WriteTrace overrides * Remove outdated comments * Add RegisteredConsumerRewardDenoms to rapid test * Add gen for submitChangeRewardDenomsProposalAction * Remove startChain steps * Marshal step files with indent * Add README that contains info about updates to trace format * Pull out the copied ChainState and Proposal types from methods * Use shadowing to avoid relisting chainstate fields * Make format * Remove log --- go.mod | 6 +- tests/e2e/README.md | 13 + tests/e2e/action_rapid_test.go | 501 ++++ tests/e2e/actions.go | 8 +- tests/e2e/json_marshal_test.go | 189 ++ tests/e2e/json_parser.go | 35 + tests/e2e/json_utils.go | 374 +++ tests/e2e/json_writer.go | 28 + tests/e2e/main.go | 2 +- tests/e2e/state_rapid_test.go | 250 ++ tests/e2e/step_rapid_test.go | 51 + tests/e2e/steps_downtime.go | 2 +- tests/e2e/trace_handlers_test.go | 229 ++ .../e2e/tracehandler_testdata/changeover.json | 603 +++++ .../e2e/tracehandler_testdata/democracy.json | 935 +++++++ .../democracyRewardsSteps.json | 935 +++++++ .../e2e/tracehandler_testdata/happyPath.json | 2007 ++++++++++++++ .../multipleConsumers.json | 2381 +++++++++++++++++ .../e2e/tracehandler_testdata/shorthappy.json | 1578 +++++++++++ .../tracehandler_testdata/slashThrottle.json | 807 ++++++ 20 files changed, 10925 insertions(+), 9 deletions(-) create mode 100644 tests/e2e/README.md create mode 100644 tests/e2e/action_rapid_test.go create mode 100644 tests/e2e/json_marshal_test.go create mode 100644 tests/e2e/json_parser.go create mode 100644 tests/e2e/json_utils.go create mode 100644 tests/e2e/json_writer.go create mode 100644 tests/e2e/state_rapid_test.go create mode 100644 tests/e2e/step_rapid_test.go create mode 100644 tests/e2e/trace_handlers_test.go create mode 100644 tests/e2e/tracehandler_testdata/changeover.json create mode 100644 tests/e2e/tracehandler_testdata/democracy.json create mode 100644 tests/e2e/tracehandler_testdata/democracyRewardsSteps.json create mode 100644 tests/e2e/tracehandler_testdata/happyPath.json create mode 100644 tests/e2e/tracehandler_testdata/multipleConsumers.json create mode 100644 tests/e2e/tracehandler_testdata/shorthappy.json create mode 100644 tests/e2e/tracehandler_testdata/slashThrottle.json diff --git a/go.mod b/go.mod index 1f05100cd2..5f869f97db 100644 --- a/go.mod +++ b/go.mod @@ -68,7 +68,7 @@ require ( github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect github.com/creachadair/taskgroup v0.4.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.1 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect @@ -88,7 +88,7 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.5.9 github.com/google/orderedcode v0.0.1 // indirect github.com/google/uuid v1.3.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect @@ -161,7 +161,7 @@ require ( gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.5.5 // indirect + pgregory.net/rapid v0.5.5 sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/tests/e2e/README.md b/tests/e2e/README.md new file mode 100644 index 0000000000..ee9c962651 --- /dev/null +++ b/tests/e2e/README.md @@ -0,0 +1,13 @@ +## Updating the trace format and tests when adjusting the framework + +Some things in the test framework should stay consistent, in particular with respect to the trace format. +When adding or modifying actions, please follow these guidelines: +* Add a case for your action to `main.go` +* Add a case for your action to `json_utils.go/UnmarshalMapToActionType` +* Add a generator for your action to `action_rapid_test.go` and add the generator to `GetActionGen` + +If the chain state from `state.go` is modified, the `ChainStateWithProposalTypes` in `json_utils.go/MarshalJSON` should be updated. + +When adding a new proposal type: +* add a case for your proposal type to `json_utils.go/UnmarshalProposalWithType` +* add a generator for your proposal type in `state_rapid_test.go` and add it to the `GetProposalGen` function \ No newline at end of file diff --git a/tests/e2e/action_rapid_test.go b/tests/e2e/action_rapid_test.go new file mode 100644 index 0000000000..005f52610d --- /dev/null +++ b/tests/e2e/action_rapid_test.go @@ -0,0 +1,501 @@ +package main + +import ( + "encoding/json" + "fmt" + "testing" + "time" + + "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/require" + "pgregory.net/rapid" +) + +// This file contains tests for serialization/deserialization of actions. +// The tests are written using the rapid testing library, which allows us to +// generate arbitrary actions and test that they can be serialized and +// deserialized without error. +// The generators for the various actions are defined in this file, and +// essentially tell rapid how to build these actions. + +func TestActionMarshalling(t *testing.T) { + rapid.Check(t, func(t *rapid.T) { + action := GetActionGen().Draw(t, "Action") + err := MarshalAndUnmarshalAction(action) + if err != nil { + t.Fatalf("error marshalling and unmarshalling action: %v", err) + } + }) +} + +func MarshalAndUnmarshalAction(action interface{}) error { + // wraps the action with a step, since it needs custom unmarshalling that is called by the step unmarshaller + step := Step{ + Action: action, + } + jsonobj, err := json.Marshal(step) + if err != nil { + return fmt.Errorf("error marshalling action inside step: %v", err) + } + + var got Step + err = json.Unmarshal(jsonobj, &got) + if err != nil { + return fmt.Errorf("error unmarshalling action inside step: %v", err) + } + + diff := cmp.Diff(step, got) + if diff != "" { + return fmt.Errorf("got (-), want (+): %v", diff) + } + + return nil +} + +// This needs to be adjusted manually when new actions are added and should +// include generators for all actions that are mentioned in main.go/runStep. +func GetActionGen() *rapid.Generator[any] { + return rapid.OneOf( + GetStartSovereignChainActionGen().AsAny(), + GetSubmitLegacyUpgradeProposalActionGen().AsAny(), + GetWaitUntilBlockActionGen().AsAny(), + GetChangeoverChainActionGen().AsAny(), + GetSendTokensActionGen().AsAny(), + GetStartChainActionGen().AsAny(), + GetSubmitTextProposalActionGen().AsAny(), + GetSubmitConsumerAdditionProposalActionGen().AsAny(), + GetSubmitConsumerRemovalProposalActionGen().AsAny(), + GetSubmitParamChangeProposalActionGen().AsAny(), + GetSubmitEquivocationProposalActionGen().AsAny(), + GetVoteGovProposalActionGen().AsAny(), + GetStartConsumerChainActionGen().AsAny(), + GetAddChainToRelayerActionGen().AsAny(), + GetAddIbcConnectionActionGen().AsAny(), + GetAddIbcChannelActionGen().AsAny(), + GetStartRelayerActionGen().AsAny(), + GetTransferChannelCompleteActionGen().AsAny(), + GetRelayPacketsActionGen().AsAny(), + GetRelayRewardPacketsToProviderActionGen().AsAny(), + GetDelegateTokensActionGen().AsAny(), + GetUnbondTokensActionGen().AsAny(), + GetRedelegateTokensActionGen().AsAny(), + GetDowntimeSlashActionGen().AsAny(), + GetUnjailValidatorActionGen().AsAny(), + GetRegisterRepresentativeActionGen().AsAny(), + GetDoublesignSlashActionGen().AsAny(), + GetAssignConsumerPubKeyActionGen().AsAny(), + GetSlashThrottleDequeueActionGen().AsAny(), + GetCreateIbcClientsActionGen().AsAny(), + CreateCancelUnbondTokensActionGen().AsAny(), + CreateLightClientEquivocationAttackActionGen().AsAny(), + CreateLightClientAmnesiaAttackActionGen().AsAny(), + CreateLightClientLunaticAttackActionGen().AsAny(), + ) +} + +func CreateSubmitChangeRewardDenomsProposalActionGen() *rapid.Generator[submitChangeRewardDenomsProposalAction] { + return rapid.Custom(func(t *rapid.T) submitChangeRewardDenomsProposalAction { + return submitChangeRewardDenomsProposalAction{ + From: GetValidatorIDGen().Draw(t, "From"), + Deposit: rapid.Uint().Draw(t, "Deposit"), + Denom: rapid.String().Draw(t, "Denom"), + } + }) +} + +func CreateLightClientEquivocationAttackActionGen() *rapid.Generator[lightClientEquivocationAttackAction] { + return rapid.Custom(func(t *rapid.T) lightClientEquivocationAttackAction { + return lightClientEquivocationAttackAction{ + Validator: GetValidatorIDGen().Draw(t, "Validator"), + Chain: GetChainIDGen().Draw(t, "Chain"), + } + }) +} + +func CreateLightClientAmnesiaAttackActionGen() *rapid.Generator[lightClientAmnesiaAttackAction] { + return rapid.Custom(func(t *rapid.T) lightClientAmnesiaAttackAction { + return lightClientAmnesiaAttackAction{ + Validator: GetValidatorIDGen().Draw(t, "Validator"), + Chain: GetChainIDGen().Draw(t, "Chain"), + } + }) +} + +func CreateLightClientLunaticAttackActionGen() *rapid.Generator[lightClientLunaticAttackAction] { + return rapid.Custom(func(t *rapid.T) lightClientLunaticAttackAction { + return lightClientLunaticAttackAction{ + Validator: GetValidatorIDGen().Draw(t, "Validator"), + Chain: GetChainIDGen().Draw(t, "Chain"), + } + }) +} + +func CreateCancelUnbondTokensActionGen() *rapid.Generator[cancelUnbondTokensAction] { + return rapid.Custom(func(t *rapid.T) cancelUnbondTokensAction { + return cancelUnbondTokensAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + Amount: rapid.Uint().Draw(t, "Amount"), + Delegator: GetValidatorIDGen().Draw(t, "Delegator"), + Validator: GetValidatorIDGen().Draw(t, "Validator"), + } + }) +} + +func GetCreateIbcClientsActionGen() *rapid.Generator[createIbcClientsAction] { + return rapid.Custom(func(t *rapid.T) createIbcClientsAction { + return createIbcClientsAction{ + ChainA: GetChainIDGen().Draw(t, "ChainA"), + ChainB: GetChainIDGen().Draw(t, "ChainB"), + } + }) +} + +func GetStartSovereignChainActionGen() *rapid.Generator[StartSovereignChainAction] { + return rapid.Custom(func(t *rapid.T) StartSovereignChainAction { + return StartSovereignChainAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + Validators: GetStartChainValidatorsGen().Draw(t, "Validators"), + GenesisChanges: rapid.String().Draw(t, "GenesisChanges"), + } + }) +} + +func GetSubmitLegacyUpgradeProposalActionGen() *rapid.Generator[LegacyUpgradeProposalAction] { + return rapid.Custom(func(t *rapid.T) LegacyUpgradeProposalAction { + return LegacyUpgradeProposalAction{ + ChainID: GetChainIDGen().Draw(t, "ChainID"), + UpgradeTitle: rapid.String().Draw(t, "UpgradeTitle"), + Proposer: GetValidatorIDGen().Draw(t, "Proposer"), + UpgradeHeight: rapid.Uint64().Draw(t, "UpgradeHeight"), + } + }) +} + +func GetWaitUntilBlockActionGen() *rapid.Generator[waitUntilBlockAction] { + return rapid.Custom(func(t *rapid.T) waitUntilBlockAction { + return waitUntilBlockAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + Block: rapid.Uint().Draw(t, "Block"), + } + }) +} + +func GetChangeoverChainActionGen() *rapid.Generator[ChangeoverChainAction] { + return rapid.Custom(func(t *rapid.T) ChangeoverChainAction { + return ChangeoverChainAction{ + SovereignChain: GetChainIDGen().Draw(t, "SovereignChain"), + ProviderChain: GetChainIDGen().Draw(t, "ProviderChain"), + Validators: GetStartChainValidatorsGen().Draw(t, "Validators"), + GenesisChanges: rapid.String().Draw(t, "GenesisChanges"), + } + }) +} + +func GetSendTokensActionGen() *rapid.Generator[SendTokensAction] { + return rapid.Custom(func(t *rapid.T) SendTokensAction { + return SendTokensAction{ + Amount: rapid.Uint().Draw(t, "Amount"), + Chain: GetChainIDGen().Draw(t, "Chain"), + From: GetValidatorIDGen().Draw(t, "From"), + To: GetValidatorIDGen().Draw(t, "To"), + } + }) +} + +func GetStartChainActionGen() *rapid.Generator[StartChainAction] { + return rapid.Custom(func(t *rapid.T) StartChainAction { + return StartChainAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + Validators: GetStartChainValidatorsGen().Draw(t, "Validators"), + GenesisChanges: rapid.String().Draw(t, "GenesisChanges"), + SkipGentx: rapid.Bool().Draw(t, "SkipGentx"), + } + }) +} + +func GetStartChainValidatorsGen() *rapid.Generator[[]StartChainValidator] { + return rapid.Custom(func(t *rapid.T) []StartChainValidator { + return rapid.SliceOf(GetStartChainValidatorGen()).Draw(t, "StartChainValidators") + }) +} + +func GetStartChainValidatorGen() *rapid.Generator[StartChainValidator] { + return rapid.Custom(func(t *rapid.T) StartChainValidator { + return StartChainValidator{ + Id: GetValidatorIDGen().Draw(t, "Id"), + Allocation: rapid.Uint().Draw(t, "Allocation"), + Stake: rapid.Uint().Draw(t, "Stake"), + } + }) +} + +func GetSubmitTextProposalActionGen() *rapid.Generator[submitTextProposalAction] { + return rapid.Custom(func(t *rapid.T) submitTextProposalAction { + return submitTextProposalAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + From: GetValidatorIDGen().Draw(t, "From"), + Deposit: rapid.Uint().Draw(t, "Deposit"), + Title: rapid.String().Draw(t, "Title"), + Description: rapid.String().Draw(t, "Description"), + } + }) +} + +func GetSubmitConsumerAdditionProposalActionGen() *rapid.Generator[submitConsumerAdditionProposalAction] { + return rapid.Custom(func(t *rapid.T) submitConsumerAdditionProposalAction { + return submitConsumerAdditionProposalAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + From: GetValidatorIDGen().Draw(t, "From"), + Deposit: rapid.Uint().Draw(t, "Deposit"), + ConsumerChain: GetChainIDGen().Draw(t, "ConsumerChain"), + SpawnTime: rapid.Uint().Draw(t, "SpawnTime"), + InitialHeight: GetHeightGen().Draw(t, "InitialHeight"), + } + }) +} + +func GetSubmitConsumerRemovalProposalActionGen() *rapid.Generator[submitConsumerRemovalProposalAction] { + return rapid.Custom(func(t *rapid.T) submitConsumerRemovalProposalAction { + return submitConsumerRemovalProposalAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + From: GetValidatorIDGen().Draw(t, "From"), + Deposit: rapid.Uint().Draw(t, "Deposit"), + ConsumerChain: GetChainIDGen().Draw(t, "ConsumerChain"), + StopTimeOffset: time.Duration(rapid.Int64().Draw(t, "StopTimeOffset")), + } + }) +} + +func GetSubmitParamChangeProposalActionGen() *rapid.Generator[submitParamChangeLegacyProposalAction] { + return rapid.Custom(func(t *rapid.T) submitParamChangeLegacyProposalAction { + return submitParamChangeLegacyProposalAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + From: GetValidatorIDGen().Draw(t, "From"), + Deposit: rapid.Uint().Draw(t, "Deposit"), + Subspace: rapid.String().Draw(t, "Subspace"), + Key: rapid.String().Draw(t, "Key"), + Value: rapid.String().Draw(t, "Value"), // could make this more generic in the future, since Value takes interfaces + } + }) +} + +func GetSubmitEquivocationProposalActionGen() *rapid.Generator[submitEquivocationProposalAction] { + return rapid.Custom(func(t *rapid.T) submitEquivocationProposalAction { + return submitEquivocationProposalAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + From: GetValidatorIDGen().Draw(t, "From"), + Deposit: rapid.Uint().Draw(t, "Deposit"), + Height: rapid.Int64().Draw(t, "Height"), + Time: GetTimeGen().Draw(t, "Time"), + Power: rapid.Int64().Draw(t, "Power"), + } + }) +} + +func TestMarshalAndUnmarshalTime(t *testing.T) { + rapid.Check(t, func(t *rapid.T) { + time1 := GetTimeGen().Draw(t, "time") + data, err := time1.MarshalJSON() + require.NoError(t, err) + var time2 time.Time + err = time2.UnmarshalJSON(data) + require.NoError(t, err) + require.True(t, time1.Equal(time2)) + }) +} + +func GetTimeGen() *rapid.Generator[time.Time] { + return rapid.Custom(func(t *rapid.T) time.Time { + return time.Unix(rapid.Int64Range(-5.9959e+10, 1.5779e+11).Draw(t, "unix time"), 0).UTC() + }) +} + +func GetVoteGovProposalActionGen() *rapid.Generator[voteGovProposalAction] { + return rapid.Custom(func(t *rapid.T) voteGovProposalAction { + return voteGovProposalAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + From: rapid.SliceOf(GetValidatorIDGen()).Draw(t, "From"), + Vote: rapid.SliceOf(rapid.String()).Draw(t, "Vote"), + PropNumber: rapid.Uint().Draw(t, "PropNumber"), + } + }) +} + +func GetStartConsumerChainActionGen() *rapid.Generator[startConsumerChainAction] { + return rapid.Custom(func(t *rapid.T) startConsumerChainAction { + return startConsumerChainAction{ + ConsumerChain: GetChainIDGen().Draw(t, "ConsumerChain"), + ProviderChain: GetChainIDGen().Draw(t, "ProviderChain"), + Validators: GetStartChainValidatorsGen().Draw(t, "Validators"), + GenesisChanges: rapid.String().Draw(t, "GenesisChanges"), + } + }) +} + +func GetAddChainToRelayerActionGen() *rapid.Generator[addChainToRelayerAction] { + return rapid.Custom(func(t *rapid.T) addChainToRelayerAction { + return addChainToRelayerAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + Validator: GetValidatorIDGen().Draw(t, "Validator"), + } + }) +} + +func GetAddIbcConnectionActionGen() *rapid.Generator[addIbcConnectionAction] { + return rapid.Custom(func(t *rapid.T) addIbcConnectionAction { + return addIbcConnectionAction{ + ChainA: GetChainIDGen().Draw(t, "ChainA"), + ChainB: GetChainIDGen().Draw(t, "ChainB"), + ClientA: rapid.Uint().Draw(t, "ClientA"), + ClientB: rapid.Uint().Draw(t, "ClientB"), + } + }) +} + +func GetAddIbcChannelActionGen() *rapid.Generator[addIbcChannelAction] { + return rapid.Custom(func(t *rapid.T) addIbcChannelAction { + return addIbcChannelAction{ + ChainA: GetChainIDGen().Draw(t, "ChainA"), + ChainB: GetChainIDGen().Draw(t, "ChainB"), + ConnectionA: rapid.Uint().Draw(t, "ConnectionA"), + PortA: rapid.String().Draw(t, "PortA"), + PortB: rapid.String().Draw(t, "PortB"), + Order: rapid.String().Draw(t, "Order"), + } + }) +} + +func GetStartRelayerActionGen() *rapid.Generator[startRelayerAction] { + return rapid.Just(startRelayerAction{}) +} + +func GetTransferChannelCompleteActionGen() *rapid.Generator[transferChannelCompleteAction] { + return rapid.Custom(func(t *rapid.T) transferChannelCompleteAction { + return transferChannelCompleteAction{ + ChainA: GetChainIDGen().Draw(t, "ChainA"), + ChainB: GetChainIDGen().Draw(t, "ChainB"), + ConnectionA: rapid.Uint().Draw(t, "ConnectionA"), + PortA: rapid.String().Draw(t, "PortA"), + PortB: rapid.String().Draw(t, "PortB"), + Order: rapid.String().Draw(t, "Order"), + ChannelA: rapid.Uint().Draw(t, "ChannelA"), + ChannelB: rapid.Uint().Draw(t, "ChannelB"), + } + }) +} + +func GetRelayPacketsActionGen() *rapid.Generator[relayPacketsAction] { + return rapid.Custom(func(t *rapid.T) relayPacketsAction { + return relayPacketsAction{ + ChainA: GetChainIDGen().Draw(t, "Chain"), + ChainB: GetChainIDGen().Draw(t, "Chain"), + Port: rapid.String().Draw(t, "Port"), + Channel: rapid.Uint().Draw(t, "Channel"), + } + }) +} + +func GetRelayRewardPacketsToProviderActionGen() *rapid.Generator[relayRewardPacketsToProviderAction] { + return rapid.Custom(func(t *rapid.T) relayRewardPacketsToProviderAction { + return relayRewardPacketsToProviderAction{ + ConsumerChain: GetChainIDGen().Draw(t, "ConsumerChain"), + ProviderChain: GetChainIDGen().Draw(t, "ProviderChain"), + Port: rapid.String().Draw(t, "Port"), + Channel: rapid.Uint().Draw(t, "Channel"), + } + }) +} + +func GetDelegateTokensActionGen() *rapid.Generator[delegateTokensAction] { + return rapid.Custom(func(t *rapid.T) delegateTokensAction { + return delegateTokensAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + Amount: rapid.Uint().Draw(t, "Amount"), + From: GetValidatorIDGen().Draw(t, "From"), + To: GetValidatorIDGen().Draw(t, "To"), + } + }) +} + +func GetUnbondTokensActionGen() *rapid.Generator[unbondTokensAction] { + return rapid.Custom(func(t *rapid.T) unbondTokensAction { + return unbondTokensAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + Amount: rapid.Uint().Draw(t, "Amount"), + Sender: GetValidatorIDGen().Draw(t, "Sender"), + UnbondFrom: GetValidatorIDGen().Draw(t, "UnbondFrom"), + } + }) +} + +func GetRedelegateTokensActionGen() *rapid.Generator[redelegateTokensAction] { + return rapid.Custom(func(t *rapid.T) redelegateTokensAction { + return redelegateTokensAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + Amount: rapid.Uint().Draw(t, "Amount"), + Src: GetValidatorIDGen().Draw(t, "Src"), + Dst: GetValidatorIDGen().Draw(t, "Dst"), + TxSender: GetValidatorIDGen().Draw(t, "TxSender"), + } + }) +} + +func GetDowntimeSlashActionGen() *rapid.Generator[downtimeSlashAction] { + return rapid.Custom(func(t *rapid.T) downtimeSlashAction { + return downtimeSlashAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + Validator: GetValidatorIDGen().Draw(t, "Validator"), + } + }) +} + +func GetUnjailValidatorActionGen() *rapid.Generator[unjailValidatorAction] { + return rapid.Custom(func(t *rapid.T) unjailValidatorAction { + return unjailValidatorAction{ + Validator: GetValidatorIDGen().Draw(t, "Validator"), + Provider: GetChainIDGen().Draw(t, "Provider"), + } + }) +} + +func GetRegisterRepresentativeActionGen() *rapid.Generator[registerRepresentativeAction] { + return rapid.Custom(func(t *rapid.T) registerRepresentativeAction { + return registerRepresentativeAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + Representatives: rapid.SliceOf(GetValidatorIDGen()).Draw(t, "Representatives"), + Stakes: rapid.SliceOf(rapid.Uint()).Draw(t, "Stakes"), + } + }) +} + +func GetDoublesignSlashActionGen() *rapid.Generator[doublesignSlashAction] { + return rapid.Custom(func(t *rapid.T) doublesignSlashAction { + return doublesignSlashAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + Validator: GetValidatorIDGen().Draw(t, "Validator"), + } + }) +} + +func GetAssignConsumerPubKeyActionGen() *rapid.Generator[assignConsumerPubKeyAction] { + return rapid.Custom(func(t *rapid.T) assignConsumerPubKeyAction { + return assignConsumerPubKeyAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + Validator: GetValidatorIDGen().Draw(t, "Validator"), + ConsumerPubkey: rapid.String().Draw(t, "ConsumerPubkey"), + ReconfigureNode: rapid.Bool().Draw(t, "ReconfigureNode"), + ExpectError: rapid.Bool().Draw(t, "ExpectError"), + } + }) +} + +func GetSlashThrottleDequeueActionGen() *rapid.Generator[slashThrottleDequeueAction] { + return rapid.Custom(func(t *rapid.T) slashThrottleDequeueAction { + return slashThrottleDequeueAction{ + Chain: GetChainIDGen().Draw(t, "Chain"), + CurrentQueueSize: rapid.Int().Draw(t, "CurrentQueueSize"), + NextQueueSize: rapid.Int().Draw(t, "NextQueueSize"), + Timeout: time.Duration(rapid.Int().Draw(t, "Timeout")) * time.Millisecond, + } + }) +} diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index 36e0c47dd2..408c9066fc 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -2045,8 +2045,8 @@ func (tr TestRun) assignConsumerPubKey(action assignConsumerPubKeyAction, verbos tr.waitBlocks(ChainID("provi"), 2, 30*time.Second) } -// slashThrottleDequeue polls slash queue sizes until nextQueueSize is achieved -type slashThrottleDequeue struct { +// slashThrottleDequeueAction polls slash queue sizes until nextQueueSize is achieved +type slashThrottleDequeueAction struct { Chain ChainID CurrentQueueSize int NextQueueSize int @@ -2055,7 +2055,7 @@ type slashThrottleDequeue struct { } func (tr TestRun) waitForSlashThrottleDequeue( - action slashThrottleDequeue, + action slashThrottleDequeueAction, verbose bool, ) { timeout := time.Now().Add(action.Timeout) @@ -2077,7 +2077,7 @@ func (tr TestRun) waitForSlashThrottleDequeue( } if time.Now().After(timeout) { - panic(fmt.Sprintf("\n\n\nwaitForSlashThrottleDequeuemethod has timed out after: %s\n\n", action.Timeout)) + panic(fmt.Sprintf("\n\n\nwaitForSlashThrottleDequeue method has timed out after: %s\n\n", action.Timeout)) } time.Sleep(500 * time.Millisecond) diff --git a/tests/e2e/json_marshal_test.go b/tests/e2e/json_marshal_test.go new file mode 100644 index 0000000000..5ee91dcb66 --- /dev/null +++ b/tests/e2e/json_marshal_test.go @@ -0,0 +1,189 @@ +package main + +import ( + "encoding/json" + "reflect" + "strings" + "testing" + + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/davecgh/go-spew/spew" +) + +func TestProposalUnmarshal(t *testing.T) { + proposalAndTypeString := `{ + "Type": "main.ConsumerAdditionProposal", + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_PASSED" + } + }` + + expectedProposal := ConsumerAdditionProposal{ + Deposit: 10000001, + Chain: ChainID("consu"), + SpawnTime: 0, + InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, + Status: "PROPOSAL_STATUS_PASSED", + } + + type ProposalAndType struct { + RawProposal json.RawMessage + Type string + } + + propAndType := &ProposalAndType{} + err := json.Unmarshal([]byte(proposalAndTypeString), propAndType) + if err != nil { + t.Errorf("Unexpected error while unmarshalling: %v", err) + } + + actualProposal, err := UnmarshalProposalWithType(propAndType.RawProposal, propAndType.Type) + if err != nil { + t.Errorf("Unexpected error while unmarshalling\n error: %v\n Raw proposal: %v\n Type: %v", err, spew.Sdump(propAndType.RawProposal), propAndType.Type) + } + + if !reflect.DeepEqual(actualProposal, expectedProposal) { + t.Errorf("Expected proposal: %v, but got: %v", spew.Sdump(expectedProposal), spew.Sdump(actualProposal)) + } +} + +type ChainStateTestCase struct { + name string + jsonBytes []byte + chainState ChainState + expectedUnmarshalErrorText string +} + +var testCases = []ChainStateTestCase{ + { + name: "valid JSON with proposals", + jsonBytes: []byte(`{ + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "Proposals": { + "1": { + "Type": "main.ConsumerAdditionProposal", + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_PASSED" + } + } + } + }`), + chainState: ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9500000000, + ValidatorID("bob"): 9500000000, + ValidatorID("carol"): 9500000000, + }, + Proposals: &map[uint]Proposal{ + 1: ConsumerAdditionProposal{ + Deposit: 10000001, + Chain: ChainID("consu"), + SpawnTime: 0, + InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, + Status: "PROPOSAL_STATUS_PASSED", + }, + }, + }, + expectedUnmarshalErrorText: "", + }, + { + name: "invalid JSON", + jsonBytes: []byte(`thisisnotagoodjsonstring`), + expectedUnmarshalErrorText: "invalid json", + }, + { + name: "unknown proposal type", + jsonBytes: []byte(`{ + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "Proposals": { + "1": { + "Type": "main.NotAProposalTypeProposal", + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_PASSED" + } + } + }, + }`), + expectedUnmarshalErrorText: "not a known proposal type", + }, +} + +func TestUnmarshalJSON(t *testing.T) { + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + var result ChainState + err := result.UnmarshalJSON(tc.jsonBytes) + if err != nil && tc.expectedUnmarshalErrorText == "" { + t.Errorf("Test case %v: Unexpected error: %v", tc.name, err) + } + + if err == nil && tc.expectedUnmarshalErrorText != "" { + t.Errorf("Test case %v: Expected error to contain: %v, but got no error", tc.name, tc.expectedUnmarshalErrorText) + } + + if err != nil && tc.expectedUnmarshalErrorText != "" && strings.Contains(err.Error(), tc.expectedUnmarshalErrorText) { + t.Errorf("Test case %v: Expected error to contain: %v, but got: %v", tc.name, tc.expectedUnmarshalErrorText, err) + } + + if !reflect.DeepEqual(result, tc.chainState) { + t.Errorf("Test case %v: Expected ChainState: %v, but got: %v", tc.name, tc.chainState, result) + } + }) + } +} + +func TestMarshalJSON(t *testing.T) { + // checks that marshalling and unmarshalling is the identity + // would optimally check that the marshalled JSON is the same as the expected JSON, + // but the marshalled JSON will specifically list null fields + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + result, err := tc.chainState.MarshalJSON() + if err != nil { + t.Errorf("Test case %v: Unexpected error while marshalling: %v", tc.name, err) + } + + if tc.expectedUnmarshalErrorText != "" { + // unmarshalling to compare does not make sense, since we expect it to + // fail, so just test that marshalling works and continue + return + } + + unmarshalledResult := ChainState{} + err = unmarshalledResult.UnmarshalJSON(result) + if err != nil { + t.Errorf("Test case %v: Unexpected error while unmarshalling: %v", tc.name, err) + } + + if !reflect.DeepEqual(unmarshalledResult, tc.chainState) { + t.Errorf("Test case %v: Expected: %v, but got: %v", tc.name, string(tc.jsonBytes), string(result)) + } + }) + } +} diff --git a/tests/e2e/json_parser.go b/tests/e2e/json_parser.go new file mode 100644 index 0000000000..3f85a23e30 --- /dev/null +++ b/tests/e2e/json_parser.go @@ -0,0 +1,35 @@ +package main + +import ( + "encoding/json" + "os" + "path/filepath" +) + +// TraceParser provides an interface for parsers that read sequences of Steps from files. +type TraceParser interface { + ReadTraceFromFile(filepath string) ([]Step, error) +} + +// JSONParser is a simple parser that reads steps by unmarshalling from a file. +type JSONParser struct{} + +var GlobalJSONParser = JSONParser{} + +func (parser JSONParser) ReadTraceFromFile(path string) ([]Step, error) { + // Open the JSON file and read into a byte array + jsonData, err := os.ReadFile(filepath.Clean(path)) + if err != nil { + return nil, err + } + + // Unmarshal the JSON into a slice of Step structs + var steps []Step + + err = json.Unmarshal(jsonData, &steps) + if err != nil { + return nil, err + } + + return steps, nil +} diff --git a/tests/e2e/json_utils.go b/tests/e2e/json_utils.go new file mode 100644 index 0000000000..692c34a14f --- /dev/null +++ b/tests/e2e/json_utils.go @@ -0,0 +1,374 @@ +package main + +import ( + "encoding/json" + "fmt" + "reflect" +) + +// stores a proposal as a raw json, together with its type +type ProposalAndType struct { + RawProposal json.RawMessage + Type string +} + +type ( + // to have a ChainState object that does not have the overridden Marshal/Unmarshal method + ChainStateCopy ChainState + + // duplicated from the ChainState with a minor change to the Proposals field + ChainStateWithProposalTypes struct { + ChainStateCopy + Proposals *map[uint]ProposalAndType // the only thing changed from the real ChainState + } +) + +// MarshalJSON marshals a step into JSON while including the type of the action. +func (step Step) MarshalJSON() ([]byte, error) { + actionType := reflect.TypeOf(step.Action) + + result := struct { + ActionType string + Action interface{} + State State + }{ + ActionType: actionType.String(), + Action: step.Action, + State: step.State, + } + + return json.Marshal(result) +} + +// UnmarshalJSON unmarshals a step from JSON while including the type of the action. +func (step *Step) UnmarshalJSON(data []byte) error { + var tmp struct { + ActionType string + Action json.RawMessage + State State + } + if err := json.Unmarshal(data, &tmp); err != nil { + return err + } + + action, err := UnmarshalMapToActionType(tmp.Action, tmp.ActionType) + if err != nil { + return err + } + + step.Action = action + step.State = tmp.State + return nil +} + +// UnmarshalMapToActionType takes a JSON object and an action type and marshals into an object of the corresponding action. +func UnmarshalMapToActionType(rawAction json.RawMessage, actionTypeString string) (interface{}, error) { + var err error + switch actionTypeString { + case "main.submitConsumerAdditionProposalAction": + var a submitConsumerAdditionProposalAction + err = json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.SendTokensAction": + var a SendTokensAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.StartChainAction": + var a StartChainAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.submitTextProposalAction": + var a submitTextProposalAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.submitConsumerRemovalProposalAction": + var a submitConsumerRemovalProposalAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.submitEquivocationProposalAction": + var a submitEquivocationProposalAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.submitParamChangeLegacyProposalAction": + var a submitParamChangeLegacyProposalAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.voteGovProposalAction": + var a voteGovProposalAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.startConsumerChainAction": + var a startConsumerChainAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.addChainToRelayerAction": + var a addChainToRelayerAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.addIbcConnectionAction": + var a addIbcConnectionAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.addIbcChannelAction": + var a addIbcChannelAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.transferChannelCompleteAction": + var a transferChannelCompleteAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.unjailValidatorAction": + var a unjailValidatorAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.assignConsumerPubKeyAction": + var a assignConsumerPubKeyAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.delegateTokensAction": + var a delegateTokensAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.relayPacketsAction": + var a relayPacketsAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.registerRepresentativeAction": + var a registerRepresentativeAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.relayRewardPacketsToProviderAction": + var a relayRewardPacketsToProviderAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.submitChangeRewardDenomsProposalAction": + var a submitChangeRewardDenomsProposalAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.downtimeSlashAction": + var a downtimeSlashAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.unbondTokensAction": + var a unbondTokensAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.cancelUnbondTokensAction": + var a cancelUnbondTokensAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.redelegateTokensAction": + var a redelegateTokensAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.doublesignSlashAction": + var a doublesignSlashAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.startRelayerAction": + var a startRelayerAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.slashThrottleDequeueAction": + var a slashThrottleDequeueAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.createIbcClientsAction": + var a createIbcClientsAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.LegacyUpgradeProposalAction": + var a LegacyUpgradeProposalAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.waitUntilBlockAction": + var a waitUntilBlockAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.ChangeoverChainAction": + var a ChangeoverChainAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.StartSovereignChainAction": + var a StartSovereignChainAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.lightClientEquivocationAttackAction": + var a lightClientEquivocationAttackAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.lightClientAmnesiaAttackAction": + var a lightClientAmnesiaAttackAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.lightClientLunaticAttackAction": + var a lightClientLunaticAttackAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + default: + return nil, fmt.Errorf("unknown action type: %s", actionTypeString) + } + return nil, err +} + +// custom marshal and unmarshal functions for the chainstate that convert proposals to/from the auxiliary type with type info + +// MarshalJSON transforms the ChainState into a ChainStateWithProposalTypes by adding type info to the proposals +func (c ChainState) MarshalJSON() ([]byte, error) { + chainStateCopy := ChainStateCopy(c) + chainStateWithProposalTypes := ChainStateWithProposalTypes{chainStateCopy, nil} + if c.Proposals != nil { + proposalsWithTypes := make(map[uint]ProposalAndType) + for k, v := range *c.Proposals { + rawMessage, err := json.Marshal(v) + if err != nil { + return nil, err + } + proposalsWithTypes[k] = ProposalAndType{rawMessage, reflect.TypeOf(v).String()} + } + chainStateWithProposalTypes.Proposals = &proposalsWithTypes + } + return json.Marshal(chainStateWithProposalTypes) +} + +// UnmarshalJSON unmarshals the ChainStateWithProposalTypes into a ChainState by removing the type info from the proposals and getting back standard proposals +func (c *ChainState) UnmarshalJSON(data []byte) error { + chainStateWithProposalTypes := ChainStateWithProposalTypes{} + err := json.Unmarshal(data, &chainStateWithProposalTypes) + if err != nil { + return err + } + + chainState := ChainState(chainStateWithProposalTypes.ChainStateCopy) + *c = chainState + + if chainStateWithProposalTypes.Proposals != nil { + proposals := make(map[uint]Proposal) + for k, v := range *chainStateWithProposalTypes.Proposals { + proposal, err := UnmarshalProposalWithType(v.RawProposal, v.Type) + if err != nil { + return err + } + proposals[k] = proposal + } + c.Proposals = &proposals + } + return nil +} + +// UnmarshalProposalWithType takes a JSON object and a proposal type and marshals into an object of the corresponding proposal. +func UnmarshalProposalWithType(inputMap json.RawMessage, proposalType string) (Proposal, error) { + var err error + switch proposalType { + case "main.TextProposal": + prop := TextProposal{} + err := json.Unmarshal(inputMap, &prop) + if err == nil { + return prop, nil + } + case "main.ConsumerAdditionProposal": + prop := ConsumerAdditionProposal{} + err := json.Unmarshal(inputMap, &prop) + if err == nil { + return prop, nil + } + case "main.UpgradeProposal": + prop := UpgradeProposal{} + err := json.Unmarshal(inputMap, &prop) + if err == nil { + return prop, nil + } + case "main.ConsumerRemovalProposal": + prop := ConsumerRemovalProposal{} + err := json.Unmarshal(inputMap, &prop) + if err == nil { + return prop, nil + } + case "main.EquivocationProposal": + prop := EquivocationProposal{} + err := json.Unmarshal(inputMap, &prop) + if err == nil { + return prop, nil + } + case "main.ParamsProposal": + prop := ParamsProposal{} + err := json.Unmarshal(inputMap, &prop) + if err == nil { + return prop, nil + } + default: + return nil, fmt.Errorf("%s is not a known proposal type", proposalType) + } + + return nil, err +} diff --git a/tests/e2e/json_writer.go b/tests/e2e/json_writer.go new file mode 100644 index 0000000000..ea56d779dd --- /dev/null +++ b/tests/e2e/json_writer.go @@ -0,0 +1,28 @@ +package main + +import ( + "encoding/json" + "os" +) + +// TraceWriter is an interface for writers that write steps to files. +type TraceWriter interface { + // WriteTraceToFile writes a given trace to a file, overwriting the file if it already exists. + WriteTraceToFile(filepath string, trace []Step) error +} + +// JSONWriter is a simple writer that marshals the array of Step objects. +// To identify which type of action is being used, we add a field to the Step struct. +type JSONWriter struct{} + +var GlobalJSONWriter = JSONWriter{} + +func (writer JSONWriter) WriteTraceToFile(filepath string, trace []Step) error { + jsonobj, err := json.MarshalIndent(trace, "", " ") + if err != nil { + panic(err) + } + + err = os.WriteFile(filepath, jsonobj, 0o600) + return err +} diff --git a/tests/e2e/main.go b/tests/e2e/main.go index 0a376664a0..d24f42676a 100644 --- a/tests/e2e/main.go +++ b/tests/e2e/main.go @@ -254,7 +254,7 @@ func (tr *TestRun) runStep(step Step, verbose bool) { tr.registerRepresentative(action, verbose) case assignConsumerPubKeyAction: tr.assignConsumerPubKey(action, verbose) - case slashThrottleDequeue: + case slashThrottleDequeueAction: tr.waitForSlashThrottleDequeue(action, verbose) case startRelayerAction: tr.startRelayer(action, verbose) diff --git a/tests/e2e/state_rapid_test.go b/tests/e2e/state_rapid_test.go new file mode 100644 index 0000000000..6c82c2e7fb --- /dev/null +++ b/tests/e2e/state_rapid_test.go @@ -0,0 +1,250 @@ +package main + +import ( + "testing" + + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "pgregory.net/rapid" +) + +// This file contains tests for serialization/deserialization of state. +// The tests are written using the rapid testing library, which allows us to +// generate arbitrary state structs and test that they can be serialized and +// deserialized without error. +// The generators for the various parts of the state are defined in this file, and +// essentially tell rapid how to build the state. + +func TestChainStateMarshalling(t *testing.T) { + rapid.Check(t, func(t *rapid.T) { + chainState := GetChainStateGen().Draw(t, "ChainState") + err := MarshalAndUnmarshalChainState(chainState) + if err != nil { + t.Fatalf("error marshalling and unmarshalling chain state: %v", err) + } + }) +} + +// Below this are utility functions for Rapid that define generators for the various structs that can appear in testing. +// These are used in the rapid tests and generate arbitrary test traces for fuzzing. +// These traces will not in general be useful to execute as e2e tests, since they are filled with essentially completely random values. +func GetStateGen() *rapid.Generator[State] { + return rapid.Custom(func(t *rapid.T) State { + return rapid.MapOf(GetChainIDGen(), GetChainStateGen()).Draw(t, "State") + }) +} + +func GetChainStateGen() *rapid.Generator[ChainState] { + return rapid.Custom( + func(t *rapid.T) ChainState { + valBalances := GetValBalancesGen().Draw(t, "ValBalances") + proposals := GetProposalsGen().Draw(t, "Proposals") + valPowers := GetValPowersGen().Draw(t, "ValPowers") + representativePowers := GetRepresentativePowersGen().Draw(t, "RepresentativePowers") + params := GetParamsGen().Draw(t, "Params") + rewards := GetRewardsGen().Draw(t, "Rewards") + consumerChains := GetConsumerChainsGen().Draw(t, "ConsumerChains") + assignedKeys := GetAssignedKeysGen().Draw(t, "AssignedKeys") + providerKeys := GetProviderKeysGen().Draw(t, "ProviderKeys") + consumerChainQueueSizes := GetConsumerChainQueueSizesGen().Draw(t, "ConsumerChainQueueSizes") + globalSlashQueueSize := rapid.Uint().Draw(t, "GlobalSlashQueueSize") + registeredConsumerRewardDenoms := GetRegisteredConsumerRewardDenomsGen().Draw(t, "RegisteredConsumerRewardDenoms") + + return ChainState{ + ValBalances: &valBalances, + Proposals: &proposals, + ValPowers: &valPowers, + RepresentativePowers: &representativePowers, + Params: ¶ms, + Rewards: &rewards, + ConsumerChains: &consumerChains, + AssignedKeys: &assignedKeys, + ProviderKeys: &providerKeys, + ConsumerChainQueueSizes: &consumerChainQueueSizes, + GlobalSlashQueueSize: &globalSlashQueueSize, + RegisteredConsumerRewardDenoms: ®isteredConsumerRewardDenoms, + } + }) +} + +func GetRegisteredConsumerRewardDenomsGen() *rapid.Generator[[]string] { + return rapid.Custom(func(t *rapid.T) []string { + return rapid.SliceOf(rapid.String()).Draw(t, "RegisteredConsumerRewardDenoms") + }) +} + +func GetConsumerChainQueueSizesGen() *rapid.Generator[map[ChainID]uint] { + return rapid.Custom(func(t *rapid.T) map[ChainID]uint { + return rapid.MapOf(GetChainIDGen(), rapid.Uint()).Draw(t, "ConsumerChainQueueSizes") + }) +} + +func GetProviderKeysGen() *rapid.Generator[map[ValidatorID]string] { + return rapid.Custom(func(t *rapid.T) map[ValidatorID]string { + return rapid.MapOf(GetValidatorIDGen(), rapid.String()).Draw(t, "ProviderKeys") + }) +} + +func GetAssignedKeysGen() *rapid.Generator[map[ValidatorID]string] { + return rapid.Custom(func(t *rapid.T) map[ValidatorID]string { + return rapid.MapOf(GetValidatorIDGen(), rapid.String()).Draw(t, "AssignedKeys") + }) +} + +func GetChainIDGen() *rapid.Generator[ChainID] { + return rapid.Custom(func(t *rapid.T) ChainID { + return ChainID(rapid.String().Draw(t, "ChainID")) + }) +} + +func GetConsumerChainsGen() *rapid.Generator[map[ChainID]bool] { + return rapid.Custom(func(t *rapid.T) map[ChainID]bool { + return rapid.MapOf(GetChainIDGen(), rapid.Bool()).Draw(t, "ConsumerChains") + }) +} + +func GetRewardsGen() *rapid.Generator[Rewards] { + return rapid.Custom(func(t *rapid.T) Rewards { + return Rewards{ + IsIncrementalReward: rapid.Bool().Draw(t, "IsIncrementalReward"), + IsNativeDenom: rapid.Bool().Draw(t, "IsNativeDenom"), + IsRewarded: rapid.MapOf(GetValidatorIDGen(), rapid.Bool()).Draw(t, "IsRewarded"), + } + }) +} + +func GetParamsGen() *rapid.Generator[[]Param] { + return rapid.Custom(func(t *rapid.T) []Param { + return rapid.SliceOf(GetParamGen()).Draw(t, "Params") + }) +} + +func GetParamGen() *rapid.Generator[Param] { + return rapid.Custom(func(t *rapid.T) Param { + return Param{ + Key: rapid.String().Draw(t, "Key"), + Value: rapid.String().Draw(t, "Value"), + } + }) +} + +func GetRepresentativePowersGen() *rapid.Generator[map[ValidatorID]uint] { + return rapid.Custom(func(t *rapid.T) map[ValidatorID]uint { + return rapid.MapOf( + GetValidatorIDGen(), + rapid.Uint(), + ).Draw(t, "RepresentativePowers") + }) +} + +func GetValPowersGen() *rapid.Generator[map[ValidatorID]uint] { + return rapid.Custom(func(t *rapid.T) map[ValidatorID]uint { + return rapid.MapOf( + GetValidatorIDGen(), + rapid.Uint(), + ).Draw(t, "ValPowers") + }) +} + +func GetValBalancesGen() *rapid.Generator[map[ValidatorID]uint] { + return rapid.Custom(func(t *rapid.T) map[ValidatorID]uint { + return rapid.MapOf( + GetValidatorIDGen(), + rapid.Uint(), + ).Draw(t, "ValBalances") + }) +} + +func GetValidatorIDGen() *rapid.Generator[ValidatorID] { + return rapid.Custom(func(t *rapid.T) ValidatorID { + return ValidatorID(rapid.String().Draw(t, "ValidatorID")) + }) +} + +func GetProposalsGen() *rapid.Generator[map[uint]Proposal] { + return rapid.Custom(func(t *rapid.T) map[uint]Proposal { + return rapid.MapOf( + rapid.Uint(), + GetProposalGen(), + ).Draw(t, "Proposals") + }) +} + +func GetProposalGen() *rapid.Generator[Proposal] { + return rapid.Custom(func(t *rapid.T) Proposal { + gen := rapid.OneOf( + GetConsumerAdditionProposalGen().AsAny(), + GetConsumerRemovalProposalGen().AsAny(), + GetEquivocationProposalGen().AsAny(), + GetTextProposalGen().AsAny(), + GetParamsProposalGen().AsAny(), + ) + return gen.Draw(t, "Proposal").(Proposal) + }) +} + +func GetConsumerAdditionProposalGen() *rapid.Generator[ConsumerAdditionProposal] { + return rapid.Custom(func(t *rapid.T) ConsumerAdditionProposal { + return ConsumerAdditionProposal{ + Deposit: rapid.Uint().Draw(t, "Deposit"), + Chain: GetChainIDGen().Draw(t, "Chain"), + SpawnTime: rapid.Int().Draw(t, "SpawnTime"), + InitialHeight: GetHeightGen().Draw(t, "InitialHeight"), + Status: rapid.String().Draw(t, "Status"), + } + }) +} + +func GetConsumerRemovalProposalGen() *rapid.Generator[ConsumerRemovalProposal] { + return rapid.Custom(func(t *rapid.T) ConsumerRemovalProposal { + return ConsumerRemovalProposal{ + Deposit: rapid.Uint().Draw(t, "Deposit"), + Chain: GetChainIDGen().Draw(t, "Chain"), + StopTime: rapid.Int().Draw(t, "StopTime"), + Status: rapid.String().Draw(t, "Status"), + } + }) +} + +func GetEquivocationProposalGen() *rapid.Generator[EquivocationProposal] { + return rapid.Custom(func(t *rapid.T) EquivocationProposal { + return EquivocationProposal{ + Power: rapid.Uint().Draw(t, "Power"), + Height: rapid.Uint().Draw(t, "Height"), + ConsensusAddress: rapid.String().Draw(t, "ConesnsuAddress"), + Deposit: rapid.Uint().Draw(t, "Deposit"), + Status: rapid.String().Draw(t, "Status"), + } + }) +} + +func GetTextProposalGen() *rapid.Generator[TextProposal] { + return rapid.Custom(func(t *rapid.T) TextProposal { + return TextProposal{ + Title: rapid.String().Draw(t, "Title"), + Description: rapid.String().Draw(t, "Description"), + Deposit: rapid.Uint().Draw(t, "Deposit"), + Status: rapid.String().Draw(t, "Status"), + } + }) +} + +func GetParamsProposalGen() *rapid.Generator[ParamsProposal] { + return rapid.Custom(func(t *rapid.T) ParamsProposal { + return ParamsProposal{ + Subspace: rapid.String().Draw(t, "Subspace"), + Key: rapid.String().Draw(t, "Key"), + Value: rapid.String().Draw(t, "Value"), + Deposit: rapid.Uint().Draw(t, "Deposit"), + Status: rapid.String().Draw(t, "Status"), + } + }) +} + +func GetHeightGen() *rapid.Generator[clienttypes.Height] { + return rapid.Custom(func(t *rapid.T) clienttypes.Height { + return clienttypes.Height{ + RevisionNumber: rapid.Uint64().Draw(t, "RevisionNumber"), + RevisionHeight: rapid.Uint64().Draw(t, "RevisionHeight"), + } + }) +} diff --git a/tests/e2e/step_rapid_test.go b/tests/e2e/step_rapid_test.go new file mode 100644 index 0000000000..dde5f2f465 --- /dev/null +++ b/tests/e2e/step_rapid_test.go @@ -0,0 +1,51 @@ +package main + +import ( + "log" + "os" + "path/filepath" + "testing" + + "pgregory.net/rapid" +) + +// TestReadAndWriteTrace uses rapid to do property based testing +// of reading and writing traces. +// It generates a random trace, writes it to a file, then reads it back. +// It then compares the original trace to the read trace. +// If the traces are not equal, rapid will generate a minimal example +// that causes the test to fail. +func TestReadAndWriteTrace(t *testing.T) { + parser := JSONParser{} + writer := JSONWriter{} + + dir, err := os.MkdirTemp("", "example") + if err != nil { + log.Fatal(err) + } + defer os.RemoveAll(dir) // clean up + + rapid.Check(t, func(t *rapid.T) { + trace := GetTraceGen().Draw(t, "Trace") + filename := filepath.Join(dir, "trace.json") + err := WriteAndReadTrace(parser, writer, trace, filename) + if err != nil { + t.Fatalf("error writing and reading trace: %v", err) + } + }) +} + +// This can be used to test writing and parsing traces, but does not make much sense +// for testing trace execution, since the generated traces are almost guaranteed to be nonsensical. +func GetTraceGen() *rapid.Generator[[]Step] { + return rapid.SliceOf(GetStepGen()) +} + +func GetStepGen() *rapid.Generator[Step] { + return rapid.Custom(func(t *rapid.T) Step { + return Step{ + Action: GetActionGen().Draw(t, "Action"), + State: GetStateGen().Draw(t, "State"), + } + }) +} diff --git a/tests/e2e/steps_downtime.go b/tests/e2e/steps_downtime.go index 08054f9089..7b4152023b 100644 --- a/tests/e2e/steps_downtime.go +++ b/tests/e2e/steps_downtime.go @@ -381,7 +381,7 @@ func stepsThrottledDowntime(consumerName string) []Step { }, }, { - Action: slashThrottleDequeue{ + Action: slashThrottleDequeueAction{ Chain: ChainID(consumerName), CurrentQueueSize: 1, NextQueueSize: 0, diff --git a/tests/e2e/trace_handlers_test.go b/tests/e2e/trace_handlers_test.go new file mode 100644 index 0000000000..725496c51f --- /dev/null +++ b/tests/e2e/trace_handlers_test.go @@ -0,0 +1,229 @@ +package main + +import ( + "encoding/json" + "fmt" + "log" + "os" + "path/filepath" + "testing" + + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/google/go-cmp/cmp" +) + +// an isolated test case for a proposal submission +var proposalSubmissionSteps = []Step{ + {submitTextProposalAction{Title: "Proposal 1", Description: "Description 1"}, State{}}, +} + +// an isolated test case for a state check involving a proposal +var proposalInStateSteps = []Step{ + { + Action: submitConsumerRemovalProposalAction{}, + State: State{ + ChainID("provi"): ChainState{ + Proposals: &map[uint]Proposal{ + 1: ConsumerRemovalProposal{ + Deposit: 10000001, + Chain: ChainID("foo"), + StopTime: 0, + Status: "PROPOSAL_STATUS_VOTING_PERIOD", + }, + }, + }, + }, + }, +} + +// Checks that writing, then parsing a trace results in the same trace. +func TestWriterThenParser(t *testing.T) { + tests := map[string]struct { + trace []Step + }{ + "proposalSubmission": {proposalSubmissionSteps}, + "proposalInState": {proposalInStateSteps}, + "start_provider_chain": {stepStartProviderChain()}, + "happyPath": {happyPathSteps}, + "democracy": {democracySteps}, + "slashThrottle": {slashThrottleSteps}, + "multipleConsumers": {multipleConsumers}, + "shorthappy": {shortHappyPathSteps}, + "democracyRewardsSteps": {democracyRewardsSteps}, + "changeover": {changeoverSteps}, + } + + dir, err := os.MkdirTemp("", "example") + if err != nil { + log.Fatal(err) + } + defer os.RemoveAll(dir) // clean up + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + filename := filepath.Join(dir, "trace.json") + err := WriteAndReadTrace(GlobalJSONParser, GlobalJSONWriter, tc.trace, filename) + if err != nil { + log.Fatalf("got error for testcase %v: %s", name, err) + } + }) + } +} + +// Checks that writing a trace does not result in an error. +func TestWriteExamples(t *testing.T) { + tests := map[string]struct { + trace []Step + }{ + "happyPath": {happyPathSteps}, + "democracy": {democracySteps}, + "slashThrottle": {slashThrottleSteps}, + "multipleConsumers": {multipleConsumers}, + "shorthappy": {shortHappyPathSteps}, + "democracyRewardsSteps": {democracyRewardsSteps}, + "changeover": {changeoverSteps}, + } + + dir := "tracehandler_testdata" + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + filename := filepath.Join(dir, name+".json") + err := GlobalJSONWriter.WriteTraceToFile(filename, tc.trace) + if err != nil { + t.Fatalf("error writing trace to file: %v", err) + } + }) + } +} + +func TestMarshalAndUnmarshalChainState(t *testing.T) { + tests := map[string]struct { + chainState ChainState + }{ + "consumer addition proposal": {ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9489999999, + ValidatorID("bob"): 9500000000, + }, + Proposals: &map[uint]Proposal{ + 2: ConsumerAdditionProposal{ + Deposit: 10000001, + Chain: ChainID("test"), + SpawnTime: 0, + InitialHeight: clienttypes.Height{RevisionNumber: 5, RevisionHeight: 5}, + Status: "PROPOSAL_STATUS_VOTING_PERIOD", + }, + }, + }}, + "params-proposal": {ChainState{ + ValBalances: &map[ValidatorID]uint{ + ValidatorID("alice"): 9889999998, + ValidatorID("bob"): 9960000001, + }, + Proposals: &map[uint]Proposal{ + 1: ParamsProposal{ + Deposit: 10000001, + Status: "PROPOSAL_STATUS_VOTING_PERIOD", + Subspace: "staking", + Key: "MaxValidators", + Value: "105", + }, + }, + }}, + "consuemr removal proposal": {ChainState{ + Proposals: &map[uint]Proposal{ + 5: ConsumerRemovalProposal{ + Deposit: 10000001, + Chain: ChainID("test123"), + StopTime: 5000000000, + Status: "PROPOSAL_STATUS_PASSED", + }, + }, + ValBalances: &map[ValidatorID]uint{ + ValidatorID("bob"): 9500000000, + }, + ConsumerChains: &map[ChainID]bool{}, // Consumer chain is now removed + }}, + "text-proposal": {ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 495, + }, + ValBalances: &map[ValidatorID]uint{ + ValidatorID("bob"): 9500000000, + }, + Proposals: &map[uint]Proposal{ + // proposal does not exist + 10: TextProposal{}, + }, + }}, + "equivocation-proposal": {ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, + ValidatorID("bob"): 500, + ValidatorID("carol"): 0, + }, + ValBalances: &map[ValidatorID]uint{ + ValidatorID("bob"): 9489999999, + }, + Proposals: &map[uint]Proposal{ + 5: EquivocationProposal{ + Deposit: 10000001, + Status: "PROPOSAL_STATUS_VOTING_PERIOD", + ConsensusAddress: "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", + Power: 500, + Height: 10, + }, + }, + }}, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + err := MarshalAndUnmarshalChainState(tc.chainState) + if err != nil { + t.Fatalf(err.Error()) + } + }) + } +} + +func MarshalAndUnmarshalChainState(chainState ChainState) error { + jsonobj, err := json.Marshal(chainState) + if err != nil { + return fmt.Errorf("error marshalling chain state: %v", err) + } + + var got *ChainState + err = json.Unmarshal(jsonobj, &got) + if err != nil { + return fmt.Errorf("error unmarshalling chain state: %v", err) + } + + diff := cmp.Diff(chainState, *got) + if diff != "" { + log.Print(string(jsonobj)) + return fmt.Errorf(diff) + } + + return nil +} + +func WriteAndReadTrace(parser TraceParser, writer TraceWriter, trace []Step, tmp_filepath string) error { + err := writer.WriteTraceToFile(tmp_filepath, trace) + if err != nil { + return fmt.Errorf("error writing trace to file: %v", err) + } + + got, err := GlobalJSONParser.ReadTraceFromFile(tmp_filepath) + if err != nil { + return fmt.Errorf("got error reading trace from file: %v", err) + } + diff := cmp.Diff(trace, got, cmp.AllowUnexported(Step{})) + if diff != "" { + return fmt.Errorf("Got a difference (-want +got):\n%s", diff) + } + return nil +} diff --git a/tests/e2e/tracehandler_testdata/changeover.json b/tests/e2e/tracehandler_testdata/changeover.json new file mode 100644 index 0000000000..42613462f8 --- /dev/null +++ b/tests/e2e/tracehandler_testdata/changeover.json @@ -0,0 +1,603 @@ +[ + { + "ActionType": "main.StartSovereignChainAction", + "Action": { + "Chain": "sover", + "Validators": [ + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": "" + }, + "State": { + "sover": { + "ValBalances": { + "alice": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.delegateTokensAction", + "Action": { + "Chain": "sover", + "From": "alice", + "To": "alice", + "Amount": 11000000 + }, + "State": { + "sover": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.StartChainAction", + "Action": { + "Chain": "provi", + "Validators": [ + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": "", + "SkipGentx": false + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.createIbcClientsAction", + "Action": { + "ChainA": "sover", + "ChainB": "provi" + }, + "State": {} + }, + { + "ActionType": "main.addIbcChannelAction", + "Action": { + "ChainA": "sover", + "ChainB": "provi", + "ConnectionA": 0, + "PortA": "transfer", + "PortB": "transfer", + "Order": "unordered", + "Version": "ics20-1" + }, + "State": {} + }, + { + "ActionType": "main.LegacyUpgradeProposalAction", + "Action": { + "ChainID": "sover", + "UpgradeTitle": "sovereign-changeover", + "Proposer": "alice", + "UpgradeHeight": 110 + }, + "State": { + "sover": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Title": "sovereign-changeover", + "Description": "", + "UpgradeHeight": 110, + "Type": "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + "Deposit": 10000000, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.UpgradeProposal" + } + } + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "sover", + "From": [ + "alice" + ], + "Vote": [ + "yes" + ], + "PropNumber": 1 + }, + "State": { + "sover": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Title": "sovereign-changeover", + "Description": "", + "UpgradeHeight": 110, + "Type": "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + "Deposit": 10000000, + "Status": "PROPOSAL_STATUS_PASSED" + }, + "Type": "main.UpgradeProposal" + } + } + } + } + }, + { + "ActionType": "main.waitUntilBlockAction", + "Action": { + "Block": 110, + "Chain": "sover" + }, + "State": {} + }, + { + "ActionType": "main.submitConsumerAdditionProposalAction", + "Action": { + "PreCCV": true, + "Chain": "provi", + "From": "alice", + "Deposit": 10000001, + "ConsumerChain": "sover", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 111 + }, + "DistributionChannel": "channel-0" + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9489999999, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "sover", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 111 + }, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 1 + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "sover", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 111 + }, + "Status": "PROPOSAL_STATUS_PASSED" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.ChangeoverChainAction", + "Action": { + "SovereignChain": "sover", + "ProviderChain": "provi", + "Validators": [ + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"" + }, + "State": { + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 500, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "sover": { + "ValBalances": null, + "ValPowers": { + "alice": 500, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.addIbcConnectionAction", + "Action": { + "ChainA": "sover", + "ChainB": "provi", + "ClientA": 1, + "ClientB": 1 + }, + "State": {} + }, + { + "ActionType": "main.addIbcChannelAction", + "Action": { + "ChainA": "sover", + "ChainB": "provi", + "ConnectionA": 1, + "PortA": "consumer", + "PortB": "provider", + "Order": "ordered", + "Version": "" + }, + "State": {} + }, + { + "ActionType": "main.SendTokensAction", + "Action": { + "Chain": "sover", + "From": "alice", + "To": "bob", + "Amount": 100 + }, + "State": { + "sover": { + "ValBalances": { + "bob": 0 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.delegateTokensAction", + "Action": { + "Chain": "provi", + "From": "alice", + "To": "alice", + "Amount": 11000000 + }, + "State": { + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "sover": { + "ValBalances": null, + "ValPowers": { + "alice": 500, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "sover", + "Port": "provider", + "Channel": 1 + }, + "State": { + "sover": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.SendTokensAction", + "Action": { + "Chain": "sover", + "From": "alice", + "To": "bob", + "Amount": 100 + }, + "State": { + "sover": { + "ValBalances": { + "bob": 100 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.unbondTokensAction", + "Action": { + "Chain": "provi", + "Sender": "alice", + "UnbondFrom": "alice", + "Amount": 1000000 + }, + "State": { + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "sover": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "sover", + "Port": "provider", + "Channel": 1 + }, + "State": { + "sover": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + } +] \ No newline at end of file diff --git a/tests/e2e/tracehandler_testdata/democracy.json b/tests/e2e/tracehandler_testdata/democracy.json new file mode 100644 index 0000000000..706eb944f5 --- /dev/null +++ b/tests/e2e/tracehandler_testdata/democracy.json @@ -0,0 +1,935 @@ +[ + { + "ActionType": "main.StartChainAction", + "Action": { + "Chain": "provi", + "Validators": [ + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": "", + "SkipGentx": false + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.submitConsumerAdditionProposalAction", + "Action": { + "PreCCV": false, + "Chain": "provi", + "From": "alice", + "Deposit": 10000001, + "ConsumerChain": "democ", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "DistributionChannel": "" + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9489999999, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "democ", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "democ", + "Validator": "carol", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": false, + "ExpectedError": "" + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "democ", + "Validator": "carol", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": true, + "ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator" + }, + "State": {} + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "democ", + "Validator": "bob", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": true, + "ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator" + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "bob": "", + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 1 + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "democ", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_PASSED" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.startConsumerChainAction", + "Action": { + "ConsumerChain": "democ", + "ProviderChain": "provi", + "Validators": [ + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"" + }, + "State": { + "democ": { + "ValBalances": { + "alice": 10000000000, + "bob": 10000000000, + "carol": 10000000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.addIbcConnectionAction", + "Action": { + "ChainA": "democ", + "ChainB": "provi", + "ClientA": 0, + "ClientB": 0 + }, + "State": {} + }, + { + "ActionType": "main.addIbcChannelAction", + "Action": { + "ChainA": "democ", + "ChainB": "provi", + "ConnectionA": 0, + "PortA": "consumer", + "PortB": "provider", + "Order": "ordered", + "Version": "" + }, + "State": {} + }, + { + "ActionType": "main.transferChannelCompleteAction", + "Action": { + "ChainA": "democ", + "ChainB": "provi", + "ConnectionA": 0, + "PortA": "transfer", + "PortB": "transfer", + "Order": "unordered", + "ChannelA": 1, + "ChannelB": 1 + }, + "State": {} + }, + { + "ActionType": "main.delegateTokensAction", + "Action": { + "Chain": "provi", + "From": "alice", + "To": "alice", + "Amount": 11000000 + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 500, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.SendTokensAction", + "Action": { + "Chain": "democ", + "From": "alice", + "To": "bob", + "Amount": 1 + }, + "State": { + "democ": { + "ValBalances": { + "alice": 10000000000, + "bob": 10000000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "democ", + "Port": "provider", + "Channel": 0 + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.SendTokensAction", + "Action": { + "Chain": "democ", + "From": "alice", + "To": "bob", + "Amount": 1 + }, + "State": { + "democ": { + "ValBalances": { + "alice": 9999999999, + "bob": 10000000001 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.registerRepresentativeAction", + "Action": { + "Chain": "democ", + "Representatives": [ + "alice", + "bob" + ], + "Stakes": [ + 100000000, + 40000000 + ] + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": { + "alice": 100000000, + "bob": 40000000 + }, + "Params": null, + "Rewards": { + "IsRewarded": { + "alice": true, + "bob": true, + "carol": false + }, + "IsIncrementalReward": true, + "IsNativeDenom": true + }, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.delegateTokensAction", + "Action": { + "Chain": "democ", + "From": "carol", + "To": "alice", + "Amount": 500000 + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": { + "alice": 100500000, + "bob": 40000000 + }, + "Params": null, + "Rewards": { + "IsRewarded": { + "alice": true, + "bob": true, + "carol": true + }, + "IsIncrementalReward": true, + "IsNativeDenom": true + }, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.submitParamChangeLegacyProposalAction", + "Action": { + "Chain": "democ", + "From": "alice", + "Deposit": 10000001, + "Subspace": "transfer", + "Key": "SendEnabled", + "Value": true + }, + "State": { + "democ": { + "ValBalances": { + "alice": 9889999998, + "bob": 9960000001 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD", + "Subspace": "transfer", + "Key": "SendEnabled", + "Value": "true" + }, + "Type": "main.ParamsProposal" + } + } + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "democ", + "From": [ + "alice", + "bob" + ], + "Vote": [ + "yes", + "no" + ], + "PropNumber": 1 + }, + "State": { + "democ": { + "ValBalances": { + "alice": 9889999998, + "bob": 9960000001 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": [ + { + "Subspace": "transfer", + "Key": "SendEnabled", + "Value": "true" + } + ], + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayRewardPacketsToProviderAction", + "Action": { + "ConsumerChain": "democ", + "ProviderChain": "provi", + "Port": "transfer", + "Channel": 1 + }, + "State": { + "provi": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": { + "IsRewarded": { + "alice": false, + "bob": false, + "carol": false + }, + "IsIncrementalReward": false, + "IsNativeDenom": false + }, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": [], + "Proposals": null + } + } + }, + { + "ActionType": "main.submitChangeRewardDenomsProposalAction", + "Action": { + "Denom": "ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9", + "Deposit": 10000001, + "From": "bob" + }, + "State": { + "provi": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": [], + "Proposals": null + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 2 + }, + "State": { + "provi": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": [ + "ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9" + ], + "Proposals": null + } + } + }, + { + "ActionType": "main.relayRewardPacketsToProviderAction", + "Action": { + "ConsumerChain": "democ", + "ProviderChain": "provi", + "Port": "transfer", + "Channel": 1 + }, + "State": { + "provi": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": { + "IsRewarded": { + "alice": false, + "bob": false, + "carol": false + }, + "IsIncrementalReward": false, + "IsNativeDenom": false + }, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.downtimeSlashAction", + "Action": { + "Chain": "democ", + "Validator": "bob" + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "democ", + "Port": "provider", + "Channel": 0 + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "democ", + "Port": "provider", + "Channel": 0 + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.unjailValidatorAction", + "Action": { + "Provider": "provi", + "Validator": "bob" + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "democ", + "Port": "provider", + "Channel": 0 + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": { + "alice": 100500000, + "bob": 40000000 + }, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + } +] \ No newline at end of file diff --git a/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json b/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json new file mode 100644 index 0000000000..cea7f937be --- /dev/null +++ b/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json @@ -0,0 +1,935 @@ +[ + { + "ActionType": "main.StartChainAction", + "Action": { + "Chain": "provi", + "Validators": [ + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": "", + "SkipGentx": false + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.submitConsumerAdditionProposalAction", + "Action": { + "PreCCV": false, + "Chain": "provi", + "From": "alice", + "Deposit": 10000001, + "ConsumerChain": "democ", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "DistributionChannel": "" + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9489999999, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "democ", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "democ", + "Validator": "carol", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": false, + "ExpectedError": "" + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "democ", + "Validator": "carol", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": true, + "ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator" + }, + "State": {} + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "democ", + "Validator": "bob", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": true, + "ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator" + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "bob": "", + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 1 + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "democ", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_PASSED" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.startConsumerChainAction", + "Action": { + "ConsumerChain": "democ", + "ProviderChain": "provi", + "Validators": [ + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"" + }, + "State": { + "democ": { + "ValBalances": { + "alice": 10000000000, + "bob": 10000000000, + "carol": 10000000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.addIbcConnectionAction", + "Action": { + "ChainA": "democ", + "ChainB": "provi", + "ClientA": 0, + "ClientB": 0 + }, + "State": {} + }, + { + "ActionType": "main.addIbcChannelAction", + "Action": { + "ChainA": "democ", + "ChainB": "provi", + "ConnectionA": 0, + "PortA": "consumer", + "PortB": "provider", + "Order": "ordered", + "Version": "" + }, + "State": {} + }, + { + "ActionType": "main.transferChannelCompleteAction", + "Action": { + "ChainA": "democ", + "ChainB": "provi", + "ConnectionA": 0, + "PortA": "transfer", + "PortB": "transfer", + "Order": "unordered", + "ChannelA": 1, + "ChannelB": 1 + }, + "State": {} + }, + { + "ActionType": "main.delegateTokensAction", + "Action": { + "Chain": "provi", + "From": "alice", + "To": "alice", + "Amount": 11000000 + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 500, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.SendTokensAction", + "Action": { + "Chain": "democ", + "From": "alice", + "To": "bob", + "Amount": 1 + }, + "State": { + "democ": { + "ValBalances": { + "alice": 10000000000, + "bob": 10000000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "democ", + "Port": "provider", + "Channel": 0 + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.SendTokensAction", + "Action": { + "Chain": "democ", + "From": "alice", + "To": "bob", + "Amount": 1 + }, + "State": { + "democ": { + "ValBalances": { + "alice": 9999999999, + "bob": 10000000001 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.registerRepresentativeAction", + "Action": { + "Chain": "democ", + "Representatives": [ + "alice", + "bob" + ], + "Stakes": [ + 100000000, + 40000000 + ] + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": { + "alice": 100000000, + "bob": 40000000 + }, + "Params": null, + "Rewards": { + "IsRewarded": { + "alice": true, + "bob": true, + "carol": false + }, + "IsIncrementalReward": true, + "IsNativeDenom": true + }, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.delegateTokensAction", + "Action": { + "Chain": "democ", + "From": "carol", + "To": "alice", + "Amount": 500000 + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": { + "alice": 100500000, + "bob": 40000000 + }, + "Params": null, + "Rewards": { + "IsRewarded": { + "alice": true, + "bob": true, + "carol": true + }, + "IsIncrementalReward": true, + "IsNativeDenom": true + }, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.submitParamChangeLegacyProposalAction", + "Action": { + "Chain": "democ", + "From": "alice", + "Deposit": 10000001, + "Subspace": "transfer", + "Key": "SendEnabled", + "Value": true + }, + "State": { + "democ": { + "ValBalances": { + "alice": 9889999998, + "bob": 9960000001 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD", + "Subspace": "transfer", + "Key": "SendEnabled", + "Value": "true" + }, + "Type": "main.ParamsProposal" + } + } + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "democ", + "From": [ + "alice", + "bob" + ], + "Vote": [ + "yes", + "no" + ], + "PropNumber": 1 + }, + "State": { + "democ": { + "ValBalances": { + "alice": 9889999998, + "bob": 9960000001 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": [ + { + "Subspace": "transfer", + "Key": "SendEnabled", + "Value": "true" + } + ], + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayRewardPacketsToProviderAction", + "Action": { + "ConsumerChain": "democ", + "ProviderChain": "provi", + "Port": "transfer", + "Channel": 1 + }, + "State": { + "provi": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": { + "IsRewarded": { + "alice": false, + "bob": false, + "carol": false + }, + "IsIncrementalReward": false, + "IsNativeDenom": false + }, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": [], + "Proposals": null + } + } + }, + { + "ActionType": "main.submitChangeRewardDenomsProposalAction", + "Action": { + "Denom": "ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9", + "Deposit": 10000001, + "From": "bob" + }, + "State": { + "provi": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": [], + "Proposals": null + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 2 + }, + "State": { + "provi": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": [ + "ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9" + ], + "Proposals": null + } + } + }, + { + "ActionType": "main.relayRewardPacketsToProviderAction", + "Action": { + "ConsumerChain": "democ", + "ProviderChain": "provi", + "Port": "transfer", + "Channel": 1 + }, + "State": { + "provi": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": { + "IsRewarded": { + "alice": true, + "bob": true, + "carol": true + }, + "IsIncrementalReward": false, + "IsNativeDenom": false + }, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.downtimeSlashAction", + "Action": { + "Chain": "democ", + "Validator": "bob" + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "democ", + "Port": "provider", + "Channel": 0 + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "democ", + "Port": "provider", + "Channel": 0 + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.unjailValidatorAction", + "Action": { + "Provider": "provi", + "Validator": "bob" + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "democ", + "Port": "provider", + "Channel": 0 + }, + "State": { + "democ": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": { + "alice": 100500000, + "bob": 40000000 + }, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + } +] \ No newline at end of file diff --git a/tests/e2e/tracehandler_testdata/happyPath.json b/tests/e2e/tracehandler_testdata/happyPath.json new file mode 100644 index 0000000000..2ed4363c96 --- /dev/null +++ b/tests/e2e/tracehandler_testdata/happyPath.json @@ -0,0 +1,2007 @@ +[ + { + "ActionType": "main.StartChainAction", + "Action": { + "Chain": "provi", + "Validators": [ + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": "", + "SkipGentx": false + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.submitConsumerAdditionProposalAction", + "Action": { + "PreCCV": false, + "Chain": "provi", + "From": "alice", + "Deposit": 10000001, + "ConsumerChain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "DistributionChannel": "" + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9489999999, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "consu", + "Validator": "carol", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": false, + "ExpectedError": "" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "consu", + "Validator": "carol", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": true, + "ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator" + }, + "State": {} + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "consu", + "Validator": "bob", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": true, + "ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "bob": "", + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 1 + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_PASSED" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.startConsumerChainAction", + "Action": { + "ConsumerChain": "consu", + "ProviderChain": "provi", + "Validators": [ + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"" + }, + "State": { + "consu": { + "ValBalances": { + "alice": 10000000000, + "bob": 10000000000, + "carol": 10000000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.addIbcConnectionAction", + "Action": { + "ChainA": "consu", + "ChainB": "provi", + "ClientA": 0, + "ClientB": 0 + }, + "State": {} + }, + { + "ActionType": "main.addIbcChannelAction", + "Action": { + "ChainA": "consu", + "ChainB": "provi", + "ConnectionA": 0, + "PortA": "consumer", + "PortB": "provider", + "Order": "ordered", + "Version": "" + }, + "State": {} + }, + { + "ActionType": "main.delegateTokensAction", + "Action": { + "Chain": "provi", + "From": "alice", + "To": "alice", + "Amount": 11000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 500, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.SendTokensAction", + "Action": { + "Chain": "consu", + "From": "alice", + "To": "bob", + "Amount": 1 + }, + "State": { + "consu": { + "ValBalances": { + "alice": 10000000000, + "bob": 10000000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.SendTokensAction", + "Action": { + "Chain": "consu", + "From": "alice", + "To": "bob", + "Amount": 1 + }, + "State": { + "consu": { + "ValBalances": { + "alice": 9999999999, + "bob": 10000000001 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "consu", + "Validator": "bob", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"QlG+iYe6AyYpvY1z9RNJKCVlH14Q/qSz4EjGdGCru3o=\"}", + "ReconfigureNode": true, + "ExpectError": false, + "ExpectedError": "" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "bob": "cosmosvalcons1uuec3cjxajv5te08p220usrjhkfhg9wyvqn0tm", + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "bob": "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "bob": "cosmosvalcons1uuec3cjxajv5te08p220usrjhkfhg9wyvqn0tm", + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "bob": "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.unbondTokensAction", + "Action": { + "Chain": "provi", + "Sender": "alice", + "UnbondFrom": "alice", + "Amount": 1000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.unbondTokensAction", + "Action": { + "Chain": "provi", + "Sender": "alice", + "UnbondFrom": "alice", + "Amount": 1000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.cancelUnbondTokensAction", + "Action": { + "Chain": "provi", + "Delegator": "alice", + "Validator": "alice", + "Amount": 1000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.redelegateTokensAction", + "Action": { + "Chain": "provi", + "Src": "alice", + "Dst": "carol", + "TxSender": "alice", + "Amount": 450000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 60, + "bob": 500, + "carol": 950 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 60, + "bob": 500, + "carol": 950 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.downtimeSlashAction", + "Action": { + "Chain": "consu", + "Validator": "alice" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 60, + "bob": 500, + "carol": 950 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 60, + "bob": 500, + "carol": 950 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 60, + "bob": 500, + "carol": 950 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 60, + "bob": 500, + "carol": 950 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.redelegateTokensAction", + "Action": { + "Chain": "provi", + "Src": "carol", + "Dst": "alice", + "TxSender": "carol", + "Amount": 449000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 60, + "bob": 500, + "carol": 950 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.downtimeSlashAction", + "Action": { + "Chain": "consu", + "Validator": "bob" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.unjailValidatorAction", + "Action": { + "Provider": "provi", + "Validator": "bob" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.downtimeSlashAction", + "Action": { + "Chain": "provi", + "Validator": "carol" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.unjailValidatorAction", + "Action": { + "Provider": "provi", + "Validator": "carol" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.submitEquivocationProposalAction", + "Action": { + "Chain": "consu", + "Height": 10, + "Time": "2023-09-20T18:24:51.823193+02:00", + "Power": 500, + "Validator": "bob", + "Deposit": 10000001, + "From": "bob" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": { + "bob": 9500000000 + }, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "2": { + "RawProposal": { + "Title": "", + "Description": "", + "Deposit": 0, + "Status": "" + }, + "Type": "main.TextProposal" + } + } + } + } + }, + { + "ActionType": "main.doublesignSlashAction", + "Action": { + "Validator": "carol", + "Chain": "provi" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.doublesignSlashAction", + "Action": { + "Validator": "bob", + "Chain": "consu" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.submitEquivocationProposalAction", + "Action": { + "Chain": "consu", + "Height": 10, + "Time": "2023-09-20T18:24:51.823197+02:00", + "Power": 500, + "Validator": "bob", + "Deposit": 10000001, + "From": "bob" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": { + "bob": 9489999999 + }, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "2": { + "RawProposal": { + "Height": 10, + "Power": 500, + "ConsensusAddress": "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", + "Deposit": 10000001, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.EquivocationProposal" + } + } + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 2 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "2": { + "RawProposal": { + "Height": 10, + "Power": 500, + "ConsensusAddress": "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", + "Deposit": 10000001, + "Status": "PROPOSAL_STATUS_PASSED" + }, + "Type": "main.EquivocationProposal" + } + } + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.startRelayerAction", + "Action": {}, + "State": {} + }, + { + "ActionType": "main.submitConsumerRemovalProposalAction", + "Action": { + "Chain": "provi", + "From": "bob", + "Deposit": 10000001, + "ConsumerChain": "consu", + "StopTimeOffset": 0 + }, + "State": { + "provi": { + "ValBalances": { + "bob": 9489999999 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": { + "consu": true + }, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "3": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "StopTime": 0, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.ConsumerRemovalProposal" + } + } + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "no", + "no", + "no" + ], + "PropNumber": 3 + }, + "State": { + "provi": { + "ValBalances": { + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": { + "consu": true + }, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "3": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "StopTime": 0, + "Status": "PROPOSAL_STATUS_REJECTED" + }, + "Type": "main.ConsumerRemovalProposal" + } + } + } + } + }, + { + "ActionType": "main.submitConsumerRemovalProposalAction", + "Action": { + "Chain": "provi", + "From": "bob", + "Deposit": 10000001, + "ConsumerChain": "consu", + "StopTimeOffset": 0 + }, + "State": { + "provi": { + "ValBalances": { + "bob": 9489999999 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": { + "consu": true + }, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "4": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "StopTime": 0, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.ConsumerRemovalProposal" + } + } + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 4 + }, + "State": { + "provi": { + "ValBalances": { + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": {}, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "4": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "StopTime": 0, + "Status": "PROPOSAL_STATUS_PASSED" + }, + "Type": "main.ConsumerRemovalProposal" + } + } + } + } + } +] \ No newline at end of file diff --git a/tests/e2e/tracehandler_testdata/multipleConsumers.json b/tests/e2e/tracehandler_testdata/multipleConsumers.json new file mode 100644 index 0000000000..0630749179 --- /dev/null +++ b/tests/e2e/tracehandler_testdata/multipleConsumers.json @@ -0,0 +1,2381 @@ +[ + { + "ActionType": "main.StartChainAction", + "Action": { + "Chain": "provi", + "Validators": [ + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": "", + "SkipGentx": false + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.submitConsumerAdditionProposalAction", + "Action": { + "PreCCV": false, + "Chain": "provi", + "From": "alice", + "Deposit": 10000001, + "ConsumerChain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "DistributionChannel": "" + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9489999999, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "consu", + "Validator": "carol", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": false, + "ExpectedError": "" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "consu", + "Validator": "carol", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": true, + "ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator" + }, + "State": {} + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "consu", + "Validator": "bob", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": true, + "ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "bob": "", + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 1 + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_PASSED" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.startConsumerChainAction", + "Action": { + "ConsumerChain": "consu", + "ProviderChain": "provi", + "Validators": [ + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"" + }, + "State": { + "consu": { + "ValBalances": { + "alice": 10000000000, + "bob": 10000000000, + "carol": 10000000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.addIbcConnectionAction", + "Action": { + "ChainA": "consu", + "ChainB": "provi", + "ClientA": 0, + "ClientB": 0 + }, + "State": {} + }, + { + "ActionType": "main.addIbcChannelAction", + "Action": { + "ChainA": "consu", + "ChainB": "provi", + "ConnectionA": 0, + "PortA": "consumer", + "PortB": "provider", + "Order": "ordered", + "Version": "" + }, + "State": {} + }, + { + "ActionType": "main.submitConsumerAdditionProposalAction", + "Action": { + "PreCCV": false, + "Chain": "provi", + "From": "alice", + "Deposit": 10000001, + "ConsumerChain": "densu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "DistributionChannel": "" + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9489999999, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "2": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "densu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "densu", + "Validator": "carol", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": false, + "ExpectedError": "" + }, + "State": { + "densu": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "densu", + "Validator": "carol", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": true, + "ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator" + }, + "State": {} + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "densu", + "Validator": "bob", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": true, + "ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator" + }, + "State": { + "densu": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "bob": "", + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 2 + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "2": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "densu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_PASSED" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.startConsumerChainAction", + "Action": { + "ConsumerChain": "densu", + "ProviderChain": "provi", + "Validators": [ + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"" + }, + "State": { + "densu": { + "ValBalances": { + "alice": 10000000000, + "bob": 10000000000, + "carol": 10000000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.addIbcConnectionAction", + "Action": { + "ChainA": "densu", + "ChainB": "provi", + "ClientA": 0, + "ClientB": 1 + }, + "State": {} + }, + { + "ActionType": "main.addIbcChannelAction", + "Action": { + "ChainA": "densu", + "ChainB": "provi", + "ConnectionA": 0, + "PortA": "consumer", + "PortB": "provider", + "Order": "ordered", + "Version": "" + }, + "State": {} + }, + { + "ActionType": "main.delegateTokensAction", + "Action": { + "Chain": "provi", + "From": "alice", + "To": "alice", + "Amount": 11000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 500, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 500, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 500, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "densu", + "Port": "provider", + "Channel": 1 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.unbondTokensAction", + "Action": { + "Chain": "provi", + "Sender": "alice", + "UnbondFrom": "alice", + "Amount": 1000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "densu", + "Port": "provider", + "Channel": 1 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.redelegateTokensAction", + "Action": { + "Chain": "provi", + "Src": "alice", + "Dst": "carol", + "TxSender": "alice", + "Amount": 1000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "densu", + "Port": "provider", + "Channel": 1 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.downtimeSlashAction", + "Action": { + "Chain": "consu", + "Validator": "bob" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "densu", + "Port": "provider", + "Channel": 1 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.unjailValidatorAction", + "Action": { + "Provider": "provi", + "Validator": "bob" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "densu", + "Port": "provider", + "Channel": 1 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.downtimeSlashAction", + "Action": { + "Chain": "provi", + "Validator": "carol" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "densu", + "Port": "provider", + "Channel": 1 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.unjailValidatorAction", + "Action": { + "Provider": "provi", + "Validator": "carol" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "densu", + "Port": "provider", + "Channel": 1 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.doublesignSlashAction", + "Action": { + "Validator": "carol", + "Chain": "provi" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "densu", + "Port": "provider", + "Channel": 1 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.doublesignSlashAction", + "Action": { + "Validator": "bob", + "Chain": "consu" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "densu", + "Port": "provider", + "Channel": 1 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "densu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + } +] \ No newline at end of file diff --git a/tests/e2e/tracehandler_testdata/shorthappy.json b/tests/e2e/tracehandler_testdata/shorthappy.json new file mode 100644 index 0000000000..04827a04cf --- /dev/null +++ b/tests/e2e/tracehandler_testdata/shorthappy.json @@ -0,0 +1,1578 @@ +[ + { + "ActionType": "main.StartChainAction", + "Action": { + "Chain": "provi", + "Validators": [ + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": "", + "SkipGentx": false + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.submitConsumerAdditionProposalAction", + "Action": { + "PreCCV": false, + "Chain": "provi", + "From": "alice", + "Deposit": 10000001, + "ConsumerChain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "DistributionChannel": "" + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9489999999, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "consu", + "Validator": "carol", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": false, + "ExpectedError": "" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "consu", + "Validator": "carol", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": true, + "ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator" + }, + "State": {} + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "consu", + "Validator": "bob", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": true, + "ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "bob": "", + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 1 + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_PASSED" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.startConsumerChainAction", + "Action": { + "ConsumerChain": "consu", + "ProviderChain": "provi", + "Validators": [ + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"" + }, + "State": { + "consu": { + "ValBalances": { + "alice": 10000000000, + "bob": 10000000000, + "carol": 10000000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.addIbcConnectionAction", + "Action": { + "ChainA": "consu", + "ChainB": "provi", + "ClientA": 0, + "ClientB": 0 + }, + "State": {} + }, + { + "ActionType": "main.addIbcChannelAction", + "Action": { + "ChainA": "consu", + "ChainB": "provi", + "ConnectionA": 0, + "PortA": "consumer", + "PortB": "provider", + "Order": "ordered", + "Version": "" + }, + "State": {} + }, + { + "ActionType": "main.delegateTokensAction", + "Action": { + "Chain": "provi", + "From": "alice", + "To": "alice", + "Amount": 11000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 500, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.SendTokensAction", + "Action": { + "Chain": "consu", + "From": "alice", + "To": "bob", + "Amount": 1 + }, + "State": { + "consu": { + "ValBalances": { + "alice": 10000000000, + "bob": 10000000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.SendTokensAction", + "Action": { + "Chain": "consu", + "From": "alice", + "To": "bob", + "Amount": 1 + }, + "State": { + "consu": { + "ValBalances": { + "alice": 9999999999, + "bob": 10000000001 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.unbondTokensAction", + "Action": { + "Chain": "provi", + "Sender": "alice", + "UnbondFrom": "alice", + "Amount": 1000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.redelegateTokensAction", + "Action": { + "Chain": "provi", + "Src": "alice", + "Dst": "carol", + "TxSender": "alice", + "Amount": 1000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 510, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.downtimeSlashAction", + "Action": { + "Chain": "consu", + "Validator": "bob" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.unjailValidatorAction", + "Action": { + "Provider": "provi", + "Validator": "bob" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.downtimeSlashAction", + "Action": { + "Chain": "provi", + "Validator": "carol" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 501 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.unjailValidatorAction", + "Action": { + "Provider": "provi", + "Validator": "carol" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.submitEquivocationProposalAction", + "Action": { + "Chain": "consu", + "Height": 10, + "Time": "2023-09-20T18:24:51.823231+02:00", + "Power": 500, + "Validator": "bob", + "Deposit": 10000001, + "From": "bob" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": { + "bob": 9500000000 + }, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "2": { + "RawProposal": { + "Title": "", + "Description": "", + "Deposit": 0, + "Status": "" + }, + "Type": "main.TextProposal" + } + } + } + } + }, + { + "ActionType": "main.doublesignSlashAction", + "Action": { + "Validator": "carol", + "Chain": "provi" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 495 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.doublesignSlashAction", + "Action": { + "Validator": "bob", + "Chain": "consu" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.submitEquivocationProposalAction", + "Action": { + "Chain": "consu", + "Height": 10, + "Time": "2023-09-20T18:24:51.823235+02:00", + "Power": 500, + "Validator": "bob", + "Deposit": 10000001, + "From": "bob" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": { + "bob": 9489999999 + }, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "2": { + "RawProposal": { + "Height": 10, + "Power": 500, + "ConsensusAddress": "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", + "Deposit": 10000001, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.EquivocationProposal" + } + } + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 2 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 500, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "2": { + "RawProposal": { + "Height": 10, + "Power": 500, + "ConsensusAddress": "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", + "Deposit": 10000001, + "Status": "PROPOSAL_STATUS_PASSED" + }, + "Type": "main.EquivocationProposal" + } + } + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 509, + "bob": 0, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.startRelayerAction", + "Action": {}, + "State": {} + }, + { + "ActionType": "main.submitConsumerRemovalProposalAction", + "Action": { + "Chain": "provi", + "From": "bob", + "Deposit": 10000001, + "ConsumerChain": "consu", + "StopTimeOffset": 0 + }, + "State": { + "provi": { + "ValBalances": { + "bob": 9489999999 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": { + "consu": true + }, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "3": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "StopTime": 0, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.ConsumerRemovalProposal" + } + } + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "no", + "no", + "no" + ], + "PropNumber": 3 + }, + "State": { + "provi": { + "ValBalances": { + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": { + "consu": true + }, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "3": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "StopTime": 0, + "Status": "PROPOSAL_STATUS_REJECTED" + }, + "Type": "main.ConsumerRemovalProposal" + } + } + } + } + }, + { + "ActionType": "main.submitConsumerRemovalProposalAction", + "Action": { + "Chain": "provi", + "From": "bob", + "Deposit": 10000001, + "ConsumerChain": "consu", + "StopTimeOffset": 0 + }, + "State": { + "provi": { + "ValBalances": { + "bob": 9489999999 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": { + "consu": true + }, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "4": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "StopTime": 0, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.ConsumerRemovalProposal" + } + } + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 4 + }, + "State": { + "provi": { + "ValBalances": { + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": {}, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "4": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "StopTime": 0, + "Status": "PROPOSAL_STATUS_PASSED" + }, + "Type": "main.ConsumerRemovalProposal" + } + } + } + } + } +] \ No newline at end of file diff --git a/tests/e2e/tracehandler_testdata/slashThrottle.json b/tests/e2e/tracehandler_testdata/slashThrottle.json new file mode 100644 index 0000000000..dc25e590b0 --- /dev/null +++ b/tests/e2e/tracehandler_testdata/slashThrottle.json @@ -0,0 +1,807 @@ +[ + { + "ActionType": "main.StartChainAction", + "Action": { + "Chain": "provi", + "Validators": [ + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": "", + "SkipGentx": false + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.submitConsumerAdditionProposalAction", + "Action": { + "PreCCV": false, + "Chain": "provi", + "From": "alice", + "Deposit": 10000001, + "ConsumerChain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "DistributionChannel": "" + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9489999999, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "consu", + "Validator": "carol", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": false, + "ExpectedError": "" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "consu", + "Validator": "carol", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": true, + "ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator" + }, + "State": {} + }, + { + "ActionType": "main.assignConsumerPubKeyAction", + "Action": { + "Chain": "consu", + "Validator": "bob", + "ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}", + "ReconfigureNode": false, + "ExpectError": true, + "ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": { + "bob": "", + "carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk" + }, + "ProviderKeys": { + "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" + }, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 1 + }, + "State": { + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "1": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "SpawnTime": 0, + "InitialHeight": { + "revision_height": 1 + }, + "Status": "PROPOSAL_STATUS_PASSED" + }, + "Type": "main.ConsumerAdditionProposal" + } + } + } + } + }, + { + "ActionType": "main.startConsumerChainAction", + "Action": { + "ConsumerChain": "consu", + "ProviderChain": "provi", + "Validators": [ + { + "Id": "bob", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "alice", + "Allocation": 10000000000, + "Stake": 500000000 + }, + { + "Id": "carol", + "Allocation": 10000000000, + "Stake": 500000000 + } + ], + "GenesisChanges": ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"" + }, + "State": { + "consu": { + "ValBalances": { + "alice": 10000000000, + "bob": 10000000000, + "carol": 10000000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": { + "alice": 9500000000, + "bob": 9500000000, + "carol": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.addIbcConnectionAction", + "Action": { + "ChainA": "consu", + "ChainB": "provi", + "ClientA": 0, + "ClientB": 0 + }, + "State": {} + }, + { + "ActionType": "main.addIbcChannelAction", + "Action": { + "ChainA": "consu", + "ChainB": "provi", + "ConnectionA": 0, + "PortA": "consumer", + "PortB": "provider", + "Order": "ordered", + "Version": "" + }, + "State": {} + }, + { + "ActionType": "main.delegateTokensAction", + "Action": { + "Chain": "provi", + "From": "alice", + "To": "alice", + "Amount": 11000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 500, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.SendTokensAction", + "Action": { + "Chain": "consu", + "From": "alice", + "To": "bob", + "Amount": 1 + }, + "State": { + "consu": { + "ValBalances": { + "alice": 10000000000, + "bob": 10000000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.SendTokensAction", + "Action": { + "Chain": "consu", + "From": "alice", + "To": "bob", + "Amount": 1 + }, + "State": { + "consu": { + "ValBalances": { + "alice": 9999999999, + "bob": 10000000001 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.downtimeSlashAction", + "Action": { + "Chain": "consu", + "Validator": "bob" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": { + "consu": 0 + }, + "GlobalSlashQueueSize": 0, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.downtimeSlashAction", + "Action": { + "Chain": "consu", + "Validator": "carol" + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 500, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": { + "consu": 1 + }, + "GlobalSlashQueueSize": 1, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.slashThrottleDequeueAction", + "Action": { + "Chain": "consu", + "CurrentQueueSize": 1, + "NextQueueSize": 0, + "Timeout": 80000000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 500 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": { + "consu": 0 + }, + "GlobalSlashQueueSize": 0, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.relayPacketsAction", + "Action": { + "ChainA": "provi", + "ChainB": "consu", + "Port": "provider", + "Channel": 0 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 0 + }, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": { + "consu": 0 + }, + "GlobalSlashQueueSize": 0, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.submitConsumerRemovalProposalAction", + "Action": { + "Chain": "provi", + "From": "bob", + "Deposit": 10000001, + "ConsumerChain": "consu", + "StopTimeOffset": 0 + }, + "State": { + "provi": { + "ValBalances": { + "bob": 9489999999 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": { + "consu": true + }, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "2": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "StopTime": 0, + "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + }, + "Type": "main.ConsumerRemovalProposal" + } + } + } + } + }, + { + "ActionType": "main.voteGovProposalAction", + "Action": { + "Chain": "provi", + "From": [ + "alice", + "bob", + "carol" + ], + "Vote": [ + "yes", + "yes", + "yes" + ], + "PropNumber": 2 + }, + "State": { + "provi": { + "ValBalances": { + "bob": 9500000000 + }, + "ValPowers": null, + "RepresentativePowers": null, + "Params": null, + "Rewards": null, + "ConsumerChains": {}, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerChainQueueSizes": null, + "GlobalSlashQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": { + "2": { + "RawProposal": { + "Deposit": 10000001, + "Chain": "consu", + "StopTime": 0, + "Status": "PROPOSAL_STATUS_PASSED" + }, + "Type": "main.ConsumerRemovalProposal" + } + } + } + } + } +] \ No newline at end of file From 5e3c3529dd32061e00942812dd05fb2ee82f5209 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 08:48:48 +0200 Subject: [PATCH 16/22] build(deps): bump pgregory.net/rapid from 0.5.5 to 1.1.0 (#1327) Bumps [pgregory.net/rapid](https://github.com/flyingmutant/rapid) from 0.5.5 to 1.1.0. - [Release notes](https://github.com/flyingmutant/rapid/releases) - [Commits](https://github.com/flyingmutant/rapid/compare/v0.5.5...v1.1.0) --- updated-dependencies: - dependency-name: pgregory.net/rapid dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5f869f97db..1fa2e45293 100644 --- a/go.mod +++ b/go.mod @@ -161,7 +161,7 @@ require ( gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.5.5 + pgregory.net/rapid v1.1.0 sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index 2246f9decf..feeba1fcc4 100644 --- a/go.sum +++ b/go.sum @@ -1882,8 +1882,8 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= -pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= 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= From 147e435ed82cf8d5d7748d223877cab878377c90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 08:50:22 +0200 Subject: [PATCH 17/22] build(deps): bump google.golang.org/grpc from 1.58.1 to 1.58.2 (#1328) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.58.1 to 1.58.2. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.58.1...v1.58.2) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1fa2e45293..18dd967eef 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( golang.org/x/net v0.12.0 // indirect golang.org/x/sys v0.11.0 // indirect google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect - google.golang.org/grpc v1.58.1 + google.golang.org/grpc v1.58.2 google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index feeba1fcc4..d9c4afc2f7 100644 --- a/go.sum +++ b/go.sum @@ -1813,8 +1813,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.58.1 h1:OL+Vz23DTtrrldqHK49FUOPHyY75rvFqJfXC84NYW58= -google.golang.org/grpc v1.58.1/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= +google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= 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= From 811675e267cd535126e5e9780c6325e7b8583db3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 08:50:38 +0200 Subject: [PATCH 18/22] build(deps): bump github.com/tidwall/gjson from 1.16.0 to 1.17.0 (#1326) Bumps [github.com/tidwall/gjson](https://github.com/tidwall/gjson) from 1.16.0 to 1.17.0. - [Commits](https://github.com/tidwall/gjson/compare/v1.16.0...v1.17.0) --- updated-dependencies: - dependency-name: github.com/tidwall/gjson dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 18dd967eef..8483e0a097 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/spf13/cast v1.5.1 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 - github.com/tidwall/gjson v1.16.0 + github.com/tidwall/gjson v1.17.0 golang.org/x/crypto v0.11.0 // indirect golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb golang.org/x/net v0.12.0 // indirect diff --git a/go.sum b/go.sum index d9c4afc2f7..b062a13dc2 100644 --- a/go.sum +++ b/go.sum @@ -1124,8 +1124,8 @@ github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.16.0 h1:SyXa+dsSPpUlcwEDuKuEBJEz5vzTvOea+9rjyYodQFg= -github.com/tidwall/gjson v1.16.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM= +github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= From d2c295003d8ce33efcef0bafcf91d5a2fb782e28 Mon Sep 17 00:00:00 2001 From: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Date: Wed, 27 Sep 2023 09:14:34 +0200 Subject: [PATCH 19/22] test: introduce flag for trace input to e2e framework (#1318) * Add json marshal/unmarshal for test traces * Remove auto-generated trace files * Add an example trace to see the input format * Add comment in rapid test * Remove duplicated test case * Remove TODO in favor of comment * Reduce code duplication * Run go mod tidy and make format * Correct testdata directory in gitignore * Remove testdata directory * Remove testdata from gitignore * Add tracehandler_testdata * Remove example trace, since there are examples in the test data * Revert unintentional change to .gitignore * Remove propType field from generator * Add docstrings to action_rapid test and state_rapid_test to better explain what the files are doing * Add flag for reading test traces * Refactor testRun to testConfig and remove testConfig specification for predefined cases * Remove ::testConfig from Makefile * Re-add removed BUILDDIR instruction * Re-add removed newline * Fix duplicated words * Checkout tracehandler testdata from main * Remove unecessary test trace * Commit merged file --- .github/workflows/automated-tests.yml | 14 ++ Makefile | 4 + tests/e2e/actions.go | 104 +++++------ tests/e2e/actions_sovereign_chain.go | 6 +- tests/e2e/config.go | 36 ++-- tests/e2e/main.go | 237 +++++++++++++++++++------- tests/e2e/state.go | 64 +++---- 7 files changed, 301 insertions(+), 164 deletions(-) diff --git a/.github/workflows/automated-tests.yml b/.github/workflows/automated-tests.yml index ad53314e76..f7d9988bad 100644 --- a/.github/workflows/automated-tests.yml +++ b/.github/workflows/automated-tests.yml @@ -56,3 +56,17 @@ jobs: go-version: "1.20" - name: E2E tests run: make test-e2e-short-cometmock + Trace-Tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + lfs: true + - name: Checkout LFS objects + run: git lfs checkout + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: "1.20" + - name: E2E tests + run: make test-trace diff --git a/Makefile b/Makefile index a65db076ab..516db825bd 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,10 @@ test-gaia-e2e-parallel-tagged: test-no-cache: go test ./... -count=1 && go run ./tests/e2e/... +# test reading a trace from a file +test-trace: + go run ./tests/e2e/... --test-file tests/e2e/tracehandler_testdata/happyPath.json::default + ############################################################################### ### Linting ### ############################################################################### diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index 408c9066fc..386404baaa 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -31,7 +31,7 @@ type SendTokensAction struct { const done = "done!!!!!!!!" -func (tr TestRun) sendTokens( +func (tr TestConfig) sendTokens( action SendTokensAction, verbose bool, ) { @@ -76,7 +76,7 @@ type StartChainValidator struct { Stake uint } -func (tr *TestRun) startChain( +func (tr *TestConfig) startChain( action StartChainAction, verbose bool, ) { @@ -193,7 +193,7 @@ type submitTextProposalAction struct { Description string } -func (tr TestRun) submitTextProposal( +func (tr TestConfig) submitTextProposal( action submitTextProposalAction, verbose bool, ) { @@ -230,7 +230,7 @@ type submitConsumerAdditionProposalAction struct { DistributionChannel string } -func (tr TestRun) submitConsumerAdditionProposal( +func (tr TestConfig) submitConsumerAdditionProposal( action submitConsumerAdditionProposalAction, verbose bool, ) { @@ -301,7 +301,7 @@ type submitConsumerRemovalProposalAction struct { StopTimeOffset time.Duration // offset from time.Now() } -func (tr TestRun) submitConsumerRemovalProposal( +func (tr TestConfig) submitConsumerRemovalProposal( action submitConsumerRemovalProposalAction, verbose bool, ) { @@ -377,7 +377,7 @@ type paramChangeJSON struct { Value interface{} `json:"value"` } -func (tr TestRun) submitParamChangeProposal( +func (tr TestConfig) submitParamChangeProposal( action submitParamChangeLegacyProposalAction, verbose bool, ) { @@ -441,7 +441,7 @@ type submitEquivocationProposalAction struct { From ValidatorID } -func (tr TestRun) submitEquivocationProposal(action submitEquivocationProposalAction, verbose bool) { +func (tr TestConfig) submitEquivocationProposal(action submitEquivocationProposalAction, verbose bool) { val := tr.validatorConfigs[action.Validator] providerChain := tr.chainConfigs[ChainID("provi")] @@ -510,7 +510,7 @@ type voteGovProposalAction struct { PropNumber uint } -func (tr *TestRun) voteGovProposal( +func (tr *TestConfig) voteGovProposal( action voteGovProposalAction, verbose bool, ) { @@ -553,7 +553,7 @@ type startConsumerChainAction struct { GenesisChanges string } -func (tr *TestRun) startConsumerChain( +func (tr *TestConfig) startConsumerChain( action startConsumerChainAction, verbose bool, ) { @@ -597,7 +597,7 @@ type ChangeoverChainAction struct { GenesisChanges string } -func (tr TestRun) changeoverChain( +func (tr TestConfig) changeoverChain( action ChangeoverChainAction, verbose bool, ) { @@ -634,7 +634,7 @@ func (tr TestRun) changeoverChain( }, verbose) } -func (tr TestRun) startChangeover( +func (tr TestConfig) startChangeover( action ChangeoverChainAction, verbose bool, ) { @@ -769,7 +769,7 @@ const gorelayerChainConfigTemplate = ` } }` -func (tr TestRun) addChainToRelayer( +func (tr TestConfig) addChainToRelayer( action addChainToRelayerAction, verbose bool, ) { @@ -780,7 +780,7 @@ func (tr TestRun) addChainToRelayer( } } -func (tr TestRun) addChainToGorelayer( +func (tr TestConfig) addChainToGorelayer( action addChainToRelayerAction, verbose bool, ) { @@ -818,7 +818,7 @@ func (tr TestRun) addChainToGorelayer( executeCommand(keyRestoreCommand, "restore keys") } -func (tr TestRun) addChainToHermes( +func (tr TestConfig) addChainToHermes( action addChainToRelayerAction, verbose bool, ) { @@ -897,7 +897,7 @@ type addIbcConnectionAction struct { ClientB uint } -func (tr TestRun) addIbcConnection( +func (tr TestConfig) addIbcConnection( action addIbcConnectionAction, verbose bool, ) { @@ -908,7 +908,7 @@ func (tr TestRun) addIbcConnection( } } -func (tr TestRun) addIbcConnectionGorelayer( +func (tr TestConfig) addIbcConnectionGorelayer( action addIbcConnectionAction, verbose bool, ) { @@ -966,7 +966,7 @@ type createIbcClientsAction struct { // if clients are not provided hermes will first // create new clients and then a new connection // otherwise, it would use client provided as CLI argument (-a-client) -func (tr TestRun) createIbcClientsHermes( +func (tr TestConfig) createIbcClientsHermes( action createIbcClientsAction, verbose bool, ) { @@ -1003,7 +1003,7 @@ func (tr TestRun) createIbcClientsHermes( } } -func (tr TestRun) addIbcConnectionHermes( +func (tr TestConfig) addIbcConnectionHermes( action addIbcConnectionAction, verbose bool, ) { @@ -1053,7 +1053,7 @@ type addIbcChannelAction struct { type startRelayerAction struct{} -func (tr TestRun) startRelayer( +func (tr TestConfig) startRelayer( action startRelayerAction, verbose bool, ) { @@ -1064,7 +1064,7 @@ func (tr TestRun) startRelayer( } } -func (tr TestRun) startGorelayer( +func (tr TestConfig) startGorelayer( action startRelayerAction, verbose bool, ) { @@ -1083,7 +1083,7 @@ func (tr TestRun) startGorelayer( } } -func (tr TestRun) startHermes( +func (tr TestConfig) startHermes( action startRelayerAction, verbose bool, ) { @@ -1102,7 +1102,7 @@ func (tr TestRun) startHermes( } } -func (tr TestRun) addIbcChannel( +func (tr TestConfig) addIbcChannel( action addIbcChannelAction, verbose bool, ) { @@ -1113,7 +1113,7 @@ func (tr TestRun) addIbcChannel( } } -func (tr TestRun) addIbcChannelGorelayer( +func (tr TestConfig) addIbcChannelGorelayer( action addIbcChannelAction, verbose bool, ) { @@ -1131,7 +1131,7 @@ func (tr TestRun) addIbcChannelGorelayer( executeCommand(cmd, "addChannel") } -func (tr TestRun) addIbcChannelHermes( +func (tr TestConfig) addIbcChannelHermes( action addIbcChannelAction, verbose bool, ) { @@ -1194,7 +1194,7 @@ type transferChannelCompleteAction struct { ChannelB uint } -func (tr TestRun) transferChannelComplete( +func (tr TestConfig) transferChannelComplete( action transferChannelCompleteAction, verbose bool, ) { @@ -1282,7 +1282,7 @@ type relayPacketsAction struct { Channel uint } -func (tr TestRun) relayPackets( +func (tr TestConfig) relayPackets( action relayPacketsAction, verbose bool, ) { @@ -1293,7 +1293,7 @@ func (tr TestRun) relayPackets( } } -func (tr TestRun) relayPacketsGorelayer( +func (tr TestConfig) relayPacketsGorelayer( action relayPacketsAction, verbose bool, ) { @@ -1317,7 +1317,7 @@ func (tr TestRun) relayPacketsGorelayer( tr.waitBlocks(action.ChainB, 1, 30*time.Second) } -func (tr TestRun) relayPacketsHermes( +func (tr TestConfig) relayPacketsHermes( action relayPacketsAction, verbose bool, ) { @@ -1348,7 +1348,7 @@ type relayRewardPacketsToProviderAction struct { Channel uint } -func (tr TestRun) relayRewardPacketsToProvider( +func (tr TestConfig) relayRewardPacketsToProvider( action relayRewardPacketsToProviderAction, verbose bool, ) { @@ -1369,7 +1369,7 @@ type delegateTokensAction struct { Amount uint } -func (tr TestRun) delegateTokens( +func (tr TestConfig) delegateTokens( action delegateTokensAction, verbose bool, ) { @@ -1413,7 +1413,7 @@ type unbondTokensAction struct { Amount uint } -func (tr TestRun) unbondTokens( +func (tr TestConfig) unbondTokens( action unbondTokensAction, verbose bool, ) { @@ -1458,7 +1458,7 @@ type cancelUnbondTokensAction struct { Amount uint } -func (tr TestRun) cancelUnbondTokens( +func (tr TestConfig) cancelUnbondTokens( action cancelUnbondTokensAction, verbose bool, ) { @@ -1527,7 +1527,7 @@ type redelegateTokensAction struct { Amount uint } -func (tr TestRun) redelegateTokens(action redelegateTokensAction, verbose bool) { +func (tr TestConfig) redelegateTokens(action redelegateTokensAction, verbose bool) { srcCfg := tr.validatorConfigs[action.Src] dstCfg := tr.validatorConfigs[action.Dst] @@ -1580,7 +1580,7 @@ type downtimeSlashAction struct { // takes a string representation of the private key like // `{"address":"DF090A4880B54CD57B2A79E64D9E969BD7514B09","pub_key":{"type":"tendermint/PubKeyEd25519","value":"ujY14AgopV907IYgPAk/5x8c9267S4fQf89nyeCPTes="},"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"TRJgf7lkTjs/sj43pyweEOanyV7H7fhnVivOi0A4yjW6NjXgCCilX3TshiA8CT/nHxz3brtLh9B/z2fJ4I9N6w=="}}` // and returns the value of the "address" field -func (tr TestRun) getValidatorKeyAddressFromString(keystring string) string { +func (tr TestConfig) getValidatorKeyAddressFromString(keystring string) string { var key struct { Address string `json:"address"` } @@ -1591,7 +1591,7 @@ func (tr TestRun) getValidatorKeyAddressFromString(keystring string) string { return key.Address } -func (tr TestRun) invokeDowntimeSlash(action downtimeSlashAction, verbose bool) { +func (tr TestConfig) invokeDowntimeSlash(action downtimeSlashAction, verbose bool) { // Bring validator down tr.setValidatorDowntime(action.Chain, action.Validator, true, verbose) // Wait appropriate amount of blocks for validator to be slashed @@ -1601,7 +1601,7 @@ func (tr TestRun) invokeDowntimeSlash(action downtimeSlashAction, verbose bool) } // Sets validator downtime by setting the virtual ethernet interface of a node to "up" or "down" -func (tr TestRun) setValidatorDowntime(chain ChainID, validator ValidatorID, down, verbose bool) { +func (tr TestConfig) setValidatorDowntime(chain ChainID, validator ValidatorID, down, verbose bool) { var lastArg string if down { lastArg = "down" @@ -1644,7 +1644,7 @@ func (tr TestRun) setValidatorDowntime(chain ChainID, validator ValidatorID, dow } } -func (tr TestRun) GetValidatorPrivateKeyAddress(chain ChainID, validator ValidatorID) string { +func (tr TestConfig) GetValidatorPrivateKeyAddress(chain ChainID, validator ValidatorID) string { var validatorPrivateKeyAddress string if chain == ChainID("provi") { validatorPrivateKeyAddress = tr.getValidatorKeyAddressFromString(tr.validatorConfigs[validator].PrivValidatorKey) @@ -1666,7 +1666,7 @@ type unjailValidatorAction struct { } // Sends an unjail transaction to the provider chain -func (tr TestRun) unjailValidator(action unjailValidatorAction, verbose bool) { +func (tr TestConfig) unjailValidator(action unjailValidatorAction, verbose bool) { // wait until downtime_jail_duration has elapsed, to make sure the validator can be unjailed tr.WaitTime(61 * time.Second) @@ -1705,7 +1705,7 @@ type registerRepresentativeAction struct { Stakes []uint } -func (tr TestRun) registerRepresentative( +func (tr TestConfig) registerRepresentative( action registerRepresentativeAction, verbose bool, ) { @@ -1762,7 +1762,7 @@ type submitChangeRewardDenomsProposalAction struct { From ValidatorID } -func (tr TestRun) submitChangeRewardDenomsProposal(action submitChangeRewardDenomsProposalAction, verbose bool) { +func (tr TestConfig) submitChangeRewardDenomsProposal(action submitChangeRewardDenomsProposalAction, verbose bool) { providerChain := tr.chainConfigs[ChainID("provi")] prop := client.ChangeRewardDenomsProposalJSON{ @@ -1831,7 +1831,7 @@ type doublesignSlashAction struct { Chain ChainID } -func (tr TestRun) invokeDoublesignSlash( +func (tr TestConfig) invokeDoublesignSlash( action doublesignSlashAction, verbose bool, ) { @@ -1868,7 +1868,7 @@ type lightClientEquivocationAttackAction struct { Chain ChainID } -func (tr TestRun) lightClientEquivocationAttack( +func (tr TestConfig) lightClientEquivocationAttack( action lightClientEquivocationAttackAction, verbose bool, ) { @@ -1884,7 +1884,7 @@ type lightClientAmnesiaAttackAction struct { Chain ChainID } -func (tr TestRun) lightClientAmnesiaAttack( +func (tr TestConfig) lightClientAmnesiaAttack( action lightClientAmnesiaAttackAction, verbose bool, ) { @@ -1900,7 +1900,7 @@ type lightClientLunaticAttackAction struct { Chain ChainID } -func (tr TestRun) lightClientLunaticAttack( +func (tr TestConfig) lightClientLunaticAttack( action lightClientLunaticAttackAction, verbose bool, ) { @@ -1915,7 +1915,7 @@ const ( LightClientLunaticAttack LightClientAttackType = "Lunatic" ) -func (tr TestRun) lightClientAttack( +func (tr TestConfig) lightClientAttack( validator ValidatorID, chain ChainID, attackType LightClientAttackType, @@ -1945,7 +1945,7 @@ type assignConsumerPubKeyAction struct { ExpectedError string } -func (tr TestRun) assignConsumerPubKey(action assignConsumerPubKeyAction, verbose bool) { +func (tr TestConfig) assignConsumerPubKey(action assignConsumerPubKeyAction, verbose bool) { valCfg := tr.validatorConfigs[action.Validator] // Note: to get error response reported back from this command '--gas auto' needs to be set. @@ -2054,7 +2054,7 @@ type slashThrottleDequeueAction struct { Timeout time.Duration } -func (tr TestRun) waitForSlashThrottleDequeue( +func (tr TestConfig) waitForSlashThrottleDequeue( action slashThrottleDequeueAction, verbose bool, ) { @@ -2094,7 +2094,7 @@ func uintPointer(i uint) *uint { // GetPathNameForGorelayer returns the name of the path between two given chains used by Gorelayer. // Since paths are bidirectional, we need either chain to be able to be provided as first or second argument // and still return the same name, so we sort the chain names alphabetically. -func (tr TestRun) GetPathNameForGorelayer(chainA, chainB ChainID) string { +func (tr TestConfig) GetPathNameForGorelayer(chainA, chainB ChainID) string { var pathName string if string(chainA) < string(chainB) { pathName = string(chainA) + "-" + string(chainB) @@ -2108,10 +2108,10 @@ func (tr TestRun) GetPathNameForGorelayer(chainA, chainB ChainID) string { // WaitTime waits for the given duration. // To make sure that the new timestamp is visible on-chain, it also waits until at least one block has been // produced on each chain after waiting. -// The CometMock version of this takes a pointer to the TestRun as it needs to manipulate +// The CometMock version of this takes a pointer to the TestConfig as it needs to manipulate // information in the testrun that stores how much each chain has waited, to keep times in sync. -// Be careful that all functions calling WaitTime should therefore also take a pointer to the TestRun. -func (tr *TestRun) WaitTime(duration time.Duration) { +// Be careful that all functions calling WaitTime should therefore also take a pointer to the TestConfig. +func (tr *TestConfig) WaitTime(duration time.Duration) { if !tr.useCometmock { time.Sleep(duration) } else { @@ -2126,7 +2126,7 @@ func (tr *TestRun) WaitTime(duration time.Duration) { } } -func (tr TestRun) AdvanceTimeForChain(chain ChainID, duration time.Duration) { +func (tr TestConfig) AdvanceTimeForChain(chain ChainID, duration time.Duration) { // cometmock avoids sleeping, and instead advances time for all chains method := "advance_time" params := fmt.Sprintf(`{"duration_in_seconds": "%d"}`, int(math.Ceil(duration.Seconds()))) diff --git a/tests/e2e/actions_sovereign_chain.go b/tests/e2e/actions_sovereign_chain.go index 88aa8bf03d..af5f6abab3 100644 --- a/tests/e2e/actions_sovereign_chain.go +++ b/tests/e2e/actions_sovereign_chain.go @@ -18,7 +18,7 @@ type StartSovereignChainAction struct { // calls a simplified startup script (start-sovereign.sh) and runs a validator node // upgrades are simpler with a single validator node since only one node needs to be upgraded -func (tr TestRun) startSovereignChain( +func (tr TestConfig) startSovereignChain( action StartSovereignChainAction, verbose bool, ) { @@ -112,7 +112,7 @@ type LegacyUpgradeProposalAction struct { UpgradeHeight uint64 } -func (tr *TestRun) submitLegacyUpgradeProposal(action LegacyUpgradeProposalAction, verbose bool) { +func (tr *TestConfig) submitLegacyUpgradeProposal(action LegacyUpgradeProposalAction, verbose bool) { submit := fmt.Sprintf( `%s tx gov submit-legacy-proposal software-upgrade %s \ --title %s \ @@ -161,7 +161,7 @@ type waitUntilBlockAction struct { Chain ChainID } -func (tr *TestRun) waitUntilBlockOnChain(action waitUntilBlockAction) { +func (tr *TestConfig) waitUntilBlockOnChain(action waitUntilBlockAction) { fmt.Println("waitUntilBlockOnChain is waiting for block:", action.Block) tr.waitUntilBlock(action.Chain, action.Block, 120*time.Second) fmt.Println("waitUntilBlockOnChain done waiting for block:", action.Block) diff --git a/tests/e2e/config.go b/tests/e2e/config.go index 6726ab2304..0a164c2cec 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -59,8 +59,8 @@ type ContainerConfig struct { Now time.Time } -// TODO: Split out TestRun and system wide config like localsdkpath -type TestRun struct { +// TODO: Split out TestConfig and system wide config like localsdkpath +type TestConfig struct { // These are the non altered values during a typical test run, where multiple test runs can exist // to validate different action sequences and corresponding state checks. containerConfig ContainerConfig @@ -84,8 +84,8 @@ type TestRun struct { name string } -// Initialize initializes the TestRun instance by setting the runningChains field to an empty map. -func (tr *TestRun) Initialize() { +// Initialize initializes the TestConfig instance by setting the runningChains field to an empty map. +func (tr *TestConfig) Initialize() { tr.runningChains = make(map[ChainID]bool) } @@ -151,8 +151,8 @@ func getDefaultValidators() map[ValidatorID]ValidatorConfig { } } -func SlashThrottleTestRun() TestRun { - tr := TestRun{ +func SlashThrottleTestConfig() TestConfig { + tr := TestConfig{ name: "slash-throttling", containerConfig: ContainerConfig{ ContainerName: "interchain-security-slash-container", @@ -196,8 +196,8 @@ func SlashThrottleTestRun() TestRun { return tr } -func DefaultTestRun() TestRun { - tr := TestRun{ +func DefaultTestConfig() TestConfig { + tr := TestConfig{ name: "default", containerConfig: ContainerConfig{ ContainerName: "interchain-security-container", @@ -241,7 +241,7 @@ func DefaultTestRun() TestRun { return tr } -func DemocracyTestRun(allowReward bool) TestRun { +func DemocracyTestConfig(allowReward bool) TestConfig { consumerGenChanges := ".app_state.ccvconsumer.params.blocks_per_distribution_transmission = \"20\" | " + ".app_state.gov.voting_params.voting_period = \"10s\" | " + ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -254,7 +254,7 @@ func DemocracyTestRun(allowReward bool) TestRun { consumerGenChanges += " | .app_state.ccvconsumer.params.reward_denoms = [\"stake\"]" } - tr := TestRun{ + tr := TestConfig{ name: "democracy", containerConfig: ContainerConfig{ ContainerName: "interchain-security-democ-container", @@ -293,8 +293,8 @@ func DemocracyTestRun(allowReward bool) TestRun { return tr } -func MultiConsumerTestRun() TestRun { - tr := TestRun{ +func MultiConsumerTestConfig() TestConfig { + tr := TestConfig{ name: "multi-consumer", containerConfig: ContainerConfig{ ContainerName: "interchain-security-multic-container", @@ -348,8 +348,8 @@ func MultiConsumerTestRun() TestRun { return tr } -func ChangeoverTestRun() TestRun { - tr := TestRun{ +func ChangeoverTestConfig() TestConfig { + tr := TestConfig{ name: "changeover", containerConfig: ContainerConfig{ ContainerName: "interchain-security-changeover-container", @@ -395,7 +395,7 @@ func ChangeoverTestRun() TestRun { return tr } -func (s *TestRun) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag string) { +func (s *TestConfig) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag string) { if localSdkPath != "" { fmt.Println("USING LOCAL SDK", localSdkPath) } @@ -408,11 +408,11 @@ func (s *TestRun) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag str s.localSdkPath = localSdkPath } -func (s *TestRun) SetCometMockConfig(useCometmock bool) { +func (s *TestConfig) SetCometMockConfig(useCometmock bool) { s.useCometmock = useCometmock } -func (s *TestRun) SetRelayerConfig(useRly bool) { +func (s *TestConfig) SetRelayerConfig(useRly bool) { s.useGorelayer = useRly } @@ -423,7 +423,7 @@ func (s *TestRun) SetRelayerConfig(useRly bool) { // within the container will be named as "$CHAIN_ID-$VAL_ID-out" etc. // where this name is constrained to 15 bytes or less. Therefore each string literal // used as a validatorID or chainID needs to be 5 char or less. -func (s *TestRun) validateStringLiterals() { +func (s *TestConfig) validateStringLiterals() { for valID, valConfig := range s.validatorConfigs { if len(valID) > 5 { diff --git a/tests/e2e/main.go b/tests/e2e/main.go index d24f42676a..87c617be18 100644 --- a/tests/e2e/main.go +++ b/tests/e2e/main.go @@ -49,30 +49,74 @@ var ( ) var ( - testSelection TestSet - testMap map[string]*testRunWithSteps = map[string]*testRunWithSteps{ - "happy-path-short": { - testRun: DefaultTestRun(), steps: shortHappyPathSteps, - description: `This is like the happy path, but skips steps -that involve starting or stopping nodes for the same chain outside of the chain setup or teardown. -This is suited for CometMock+Gorelayer testing`, - }, - "light-client-attack": { - testRun: DefaultTestRun(), steps: lightClientAttackSteps, - description: `This is like the short happy path, but will slash validators for LightClientAttackEvidence instead of DuplicateVoteEvidence. -This is suited for CometMock+Gorelayer testing, but currently does not work with CometBFT, -since causing light client attacks is not implemented.`, - }, - "happy-path": {testRun: DefaultTestRun(), steps: happyPathSteps, description: "happy path tests"}, - "changeover": {testRun: ChangeoverTestRun(), steps: changeoverSteps, description: "changeover tests"}, - "democracy-reward": {testRun: DemocracyTestRun(true), steps: democracyRewardsSteps, description: "democracy tests allowing rewards"}, - "democracy": {testRun: DemocracyTestRun(false), steps: democracySteps, description: "democracy tests"}, - "slash-throttle": {testRun: SlashThrottleTestRun(), steps: slashThrottleSteps, description: "slash throttle tests"}, - "multiconsumer": {testRun: MultiConsumerTestRun(), steps: multipleConsumers, description: "multi consumer tests"}, + selectedTests TestSet + + // map the test config names to their structs to allow for easy selection of test configs, + // and also to programatically set parameters, i.e. see DemocracyTestConfig + testConfigs = map[string]TestConfig{ + "default": DefaultTestConfig(), + "changeover": ChangeoverTestConfig(), + "democracy": DemocracyTestConfig(false), + "democracy-reward": DemocracyTestConfig(true), + "slash-throttle": SlashThrottleTestConfig(), + "multiconsumer": MultiConsumerTestConfig(), } ) -func executeTests(tests []testRunWithSteps) (err error) { +var selectedTestfiles TestSet + +var stepChoices = map[string]StepChoice{ + "happy-path-short": { + name: "happy-path-short", + steps: shortHappyPathSteps, + description: `This is like the happy path, but skips steps that involve starting or stopping nodes for the same chain outside of the chain setup or teardown. This is suited for CometMock+Gorelayer testing`, + testConfig: DefaultTestConfig(), + }, + "light-client-attack": { + name: "light-client-attack", + steps: lightClientAttackSteps, + description: `This is like the short happy path, but will slash validators for LightClientAttackEvidence instead of DuplicateVoteEvidence. This is suited for CometMock+Gorelayer testing, but currently does not work with CometBFT, since causing light client attacks is not implemented`, + testConfig: DefaultTestConfig(), + }, + "happy-path": { + name: "happy-path", + steps: happyPathSteps, + description: "happy path tests", + testConfig: DefaultTestConfig(), + }, + "changeover": { + name: "changeover", + steps: changeoverSteps, + description: "changeover tests", + testConfig: ChangeoverTestConfig(), + }, + "democracy-reward": { + name: "democracy-reward", + steps: democracyRewardsSteps, + description: "democracy tests allowing rewards", + testConfig: DemocracyTestConfig(true), + }, + "democracy": { + name: "democracy", + steps: democracySteps, + description: "democracy tests", + testConfig: DemocracyTestConfig(false), + }, + "slash-throttle": { + name: "slash-throttle", + steps: slashThrottleSteps, + description: "slash throttle tests", + testConfig: SlashThrottleTestConfig(), + }, + "multiconsumer": { + name: "multiconsumer", + steps: multipleConsumers, + description: "multi consumer tests", + testConfig: MultiConsumerTestConfig(), + }, +} + +func executeTests(tests []testStepsWithConfig) (err error) { if parallel != nil && *parallel { fmt.Println("=============== running all tests in parallel ===============") } @@ -81,7 +125,7 @@ func executeTests(tests []testRunWithSteps) (err error) { for _, testCase := range tests { if parallel != nil && *parallel { wg.Add(1) - go func(run testRunWithSteps) { + go func(run testStepsWithConfig) { defer wg.Done() run.testRun.Run(run.steps, *localSdkPath, *useGaia, *gaiaTag) }(testCase) @@ -97,57 +141,131 @@ func executeTests(tests []testRunWithSteps) (err error) { return } +func getTestCaseUsageString() string { + var builder strings.Builder + + // Test case selection + builder.WriteString("This flag is used to reference existing, defined test cases to be run.") + builder.WriteString("Test case selection:\nSelection of test steps to be executed:\n") + for _, stepChoice := range stepChoices { + builder.WriteString(fmt.Sprintf("- %s : %s.\n", stepChoice.name, stepChoice.description)) + } + builder.WriteString("\n") + + // Test runner selection + builder.WriteString("Test runner selection:\nSelection of test runners to be executed:\n") + for _, testConfig := range testConfigs { + builder.WriteString(fmt.Sprintf("- %s\n", testConfig.name)) + } + builder.WriteString("\n") + + // Example + builder.WriteString("Example: -tc multiconsumer::multiconsumer -tc happy-path::default") + + return builder.String() +} + +func getTestFileUsageString() string { + var builder strings.Builder + + builder.WriteString("This flag is used to reference files containing step traces to be run.\n") + builder.WriteString("Each filename should be separated by '::' from the test runner name.\n") + + // Test runner selection + builder.WriteString("Test runner selection:\nSelection of test runners to be executed:\n") + for _, testConfig := range testConfigs { + builder.WriteString(fmt.Sprintf("- %s\n", testConfig.name)) + } + builder.WriteString("\n") + + // Example + builder.WriteString("Example: -test-file awesome-trace.json::default -test-file other-trace.json::default") + + return builder.String() +} + func parseArguments() (err error) { - flag.Var(&testSelection, "tc", - fmt.Sprintf("Selection of test cases to be executed:\n%s,\n%s", - func() string { - var keys []string - for k, v := range testMap { - keys = append(keys, fmt.Sprintf("- %s : %s", k, v.description)) - } - return strings.Join(keys, "\n") - }(), - "Example: -tc multiconsumer -tc happy-path ")) + flag.Var(&selectedTests, "tc", + getTestCaseUsageString()) + + flag.Var(&selectedTestfiles, "test-file", + getTestFileUsageString()) flag.Parse() // Enforce go-relayer in case of cometmock as hermes is not yet supported if useCometmock != nil && *useCometmock && (useGorelayer == nil || !*useGorelayer) { fmt.Println("Enforcing go-relayer as cometmock is requested") if err = flag.Set("use-gorelayer", "true"); err != nil { - return - } - } - // check if specified test case exists - for _, tc := range testSelection { - if _, hasKey := testMap[tc]; !hasKey { - err := fmt.Errorf("unknown test case '%s'", tc) return err } } - return + return nil } -func getTestCases(selection TestSet) (tests []testRunWithSteps) { +type testStepsWithConfig struct { + testRun TestConfig + steps []Step +} + +func getTestCases(selectedPredefinedTests, selectedTestFiles TestSet) (tests []testStepsWithConfig) { // Run default tests if no test cases were selected - if len(selection) == 0 { - selection = TestSet{ + if len(selectedPredefinedTests) == 0 && len(selectedTestFiles) == 0 { + selectedPredefinedTests = TestSet{ "changeover", "happy-path", "democracy-reward", "democracy", "slash-throttle", } if includeMultiConsumer != nil && *includeMultiConsumer { - selection = append(selection, "multiconsumer") + selectedPredefinedTests = append(selectedPredefinedTests, "multiconsumer") } } - // Get tests from selection - tests = []testRunWithSteps{} - for _, tc := range selection { - if _, exists := testMap[tc]; !exists { - log.Fatalf("Test case '%s' not found", tc) + tests = []testStepsWithConfig{} + // Get predefined from selection + for _, tc := range selectedPredefinedTests { + // first part of tc is the steps, second part is the test runner + + if _, exists := stepChoices[tc]; !exists { + log.Fatalf("Step choice '%s' not found.\nsee usage info:\n%s", tc, getTestCaseUsageString()) } - tests = append(tests, *testMap[tc]) + + stepChoice := stepChoices[tc] + + tests = append(tests, testStepsWithConfig{ + testRun: stepChoice.testConfig, + steps: stepChoice.steps, + }, + ) } - return + + // get test cases from files + for _, testFile := range selectedTestFiles { + // first part is the file, second part is the test runner + splitTcString := strings.Split(testFile, "::") + if len(splitTcString) != 2 { + log.Fatalf("Test file '%s' is invalid.\nsee usage info:\n%s", testFile, getTestFileUsageString()) + } + + testFileName := splitTcString[0] + testRunnerName := splitTcString[1] + + if _, exists := testConfigs[testRunnerName]; !exists { + log.Fatalf("Test runner '%s' not found.\nsee usage info:\n%s", testRunnerName, getTestFileUsageString()) + } + + testConfig := testConfigs[testRunnerName] + + testCase, err := GlobalJSONParser.ReadTraceFromFile(testFileName) + if err != nil { + log.Fatalf("Error reading test file '%s': %s", testFileName, err) + } + + tests = append(tests, testStepsWithConfig{ + testRun: testConfig, + steps: testCase, + }) + } + + return tests } // runs E2E tests @@ -159,7 +277,7 @@ func main() { log.Fatalf("Error parsing command arguments %s\n", err) } - testCases := getTestCases(testSelection) + testCases := getTestCases(selectedTests, selectedTestfiles) start := time.Now() err := executeTests(testCases) @@ -171,7 +289,7 @@ func main() { // Run sets up docker container and executes the steps in the test run. // Docker containers are torn down after the test run is complete. -func (tr *TestRun) Run(steps []Step, localSdkPath string, useGaia bool, gaiaTag string) { +func (tr *TestConfig) Run(steps []Step, localSdkPath string, useGaia bool, gaiaTag string) { tr.SetDockerConfig(localSdkPath, useGaia, gaiaTag) tr.SetCometMockConfig(*useCometmock) tr.SetRelayerConfig(*useGorelayer) @@ -182,13 +300,14 @@ func (tr *TestRun) Run(steps []Step, localSdkPath string, useGaia bool, gaiaTag tr.teardownDocker() } -type testRunWithSteps struct { - testRun TestRun +type StepChoice struct { + name string steps []Step description string + testConfig TestConfig } -func (tr *TestRun) runStep(step Step, verbose bool) { +func (tr *TestConfig) runStep(step Step, verbose bool) { switch action := step.Action.(type) { case StartChainAction: tr.startChain(action, verbose) @@ -278,7 +397,7 @@ func (tr *TestRun) runStep(step Step, verbose bool) { } // executeSteps sequentially runs steps. -func (tr *TestRun) executeSteps(steps []Step) { +func (tr *TestConfig) executeSteps(steps []Step) { fmt.Printf("=============== started %s tests ===============\n", tr.name) start := time.Now() @@ -292,7 +411,7 @@ func (tr *TestRun) executeSteps(steps []Step) { fmt.Printf("=============== finished %s tests in %v ===============\n", tr.name, time.Since(start)) } -func (tr *TestRun) startDocker() { +func (tr *TestConfig) startDocker() { fmt.Printf("=============== building %s testRun ===============\n", tr.name) localSdk := tr.localSdkPath if localSdk == "" { @@ -356,7 +475,7 @@ func (tr *TestRun) startDocker() { // remove docker container to reduce resource usage // otherwise the chain will keep running in the background -func (tr *TestRun) teardownDocker() { +func (tr *TestConfig) teardownDocker() { fmt.Printf("=============== tearing down %s testRun ===============\n", tr.name) //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "kill", tr.containerConfig.InstanceName) diff --git a/tests/e2e/state.go b/tests/e2e/state.go index f6beb3445c..ebfed57652 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -109,7 +109,7 @@ type Param struct { Value string } -func (tr TestRun) getState(modelState State) State { +func (tr TestConfig) getState(modelState State) State { systemState := State{} for k, modelState := range modelState { log.Println("Getting model state for chain: ", k) @@ -119,7 +119,7 @@ func (tr TestRun) getState(modelState State) State { return systemState } -func (tr TestRun) getChainState(chain ChainID, modelState ChainState) ChainState { +func (tr TestConfig) getChainState(chain ChainID, modelState ChainState) ChainState { chainState := ChainState{} if modelState.ValBalances != nil { @@ -195,7 +195,7 @@ func (tr TestRun) getChainState(chain ChainID, modelState ChainState) ChainState var blockHeightRegex = regexp.MustCompile(`block_height: "(\d+)"`) -func (tr TestRun) getBlockHeight(chain ChainID) uint { +func (tr TestConfig) getBlockHeight(chain ChainID) uint { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, @@ -215,7 +215,7 @@ func (tr TestRun) getBlockHeight(chain ChainID) uint { return uint(blockHeight) } -func (tr TestRun) waitBlocks(chain ChainID, blocks uint, timeout time.Duration) { +func (tr TestConfig) waitBlocks(chain ChainID, blocks uint, timeout time.Duration) { if tr.useCometmock { // call advance_blocks method on cometmock // curl -H 'Content-Type: application/json' -H 'Accept:application/json' --data '{"jsonrpc":"2.0","method":"advance_blocks","params":{"num_blocks": "36000000"},"id":1}' 127.0.0.1:22331 @@ -241,7 +241,7 @@ func (tr TestRun) waitBlocks(chain ChainID, blocks uint, timeout time.Duration) } } -func (tr TestRun) waitUntilBlock(chain ChainID, block uint, timeout time.Duration) { +func (tr TestConfig) waitUntilBlock(chain ChainID, block uint, timeout time.Duration) { start := time.Now() for { thisBlock := tr.getBlockHeight(chain) @@ -255,7 +255,7 @@ func (tr TestRun) waitUntilBlock(chain ChainID, block uint, timeout time.Duratio } } -func (tr TestRun) getBalances(chain ChainID, modelState map[ValidatorID]uint) map[ValidatorID]uint { +func (tr TestConfig) getBalances(chain ChainID, modelState map[ValidatorID]uint) map[ValidatorID]uint { actualState := map[ValidatorID]uint{} for k := range modelState { actualState[k] = tr.getBalance(chain, k) @@ -264,7 +264,7 @@ func (tr TestRun) getBalances(chain ChainID, modelState map[ValidatorID]uint) ma return actualState } -func (tr TestRun) getProposals(chain ChainID, modelState map[uint]Proposal) map[uint]Proposal { +func (tr TestConfig) getProposals(chain ChainID, modelState map[uint]Proposal) map[uint]Proposal { actualState := map[uint]Proposal{} for k := range modelState { actualState[k] = tr.getProposal(chain, k) @@ -273,7 +273,7 @@ func (tr TestRun) getProposals(chain ChainID, modelState map[uint]Proposal) map[ return actualState } -func (tr TestRun) getValPowers(chain ChainID, modelState map[ValidatorID]uint) map[ValidatorID]uint { +func (tr TestConfig) getValPowers(chain ChainID, modelState map[ValidatorID]uint) map[ValidatorID]uint { actualState := map[ValidatorID]uint{} for k := range modelState { actualState[k] = tr.getValPower(chain, k) @@ -282,7 +282,7 @@ func (tr TestRun) getValPowers(chain ChainID, modelState map[ValidatorID]uint) m return actualState } -func (tr TestRun) getRepresentativePowers(chain ChainID, modelState map[ValidatorID]uint) map[ValidatorID]uint { +func (tr TestConfig) getRepresentativePowers(chain ChainID, modelState map[ValidatorID]uint) map[ValidatorID]uint { actualState := map[ValidatorID]uint{} for k := range modelState { actualState[k] = tr.getRepresentativePower(chain, k) @@ -291,7 +291,7 @@ func (tr TestRun) getRepresentativePowers(chain ChainID, modelState map[Validato return actualState } -func (tr TestRun) getParams(chain ChainID, modelState []Param) []Param { +func (tr TestConfig) getParams(chain ChainID, modelState []Param) []Param { actualState := []Param{} for _, p := range modelState { actualState = append(actualState, Param{Subspace: p.Subspace, Key: p.Key, Value: tr.getParam(chain, p)}) @@ -300,7 +300,7 @@ func (tr TestRun) getParams(chain ChainID, modelState []Param) []Param { return actualState } -func (tr TestRun) getRewards(chain ChainID, modelState Rewards) Rewards { +func (tr TestConfig) getRewards(chain ChainID, modelState Rewards) Rewards { receivedRewards := map[ValidatorID]bool{} currentBlock := tr.getBlockHeight(chain) @@ -318,7 +318,7 @@ func (tr TestRun) getRewards(chain ChainID, modelState Rewards) Rewards { return Rewards{IsRewarded: receivedRewards, IsIncrementalReward: modelState.IsIncrementalReward, IsNativeDenom: modelState.IsNativeDenom} } -func (tr TestRun) getReward(chain ChainID, validator ValidatorID, blockHeight uint, isNativeDenom bool) float64 { +func (tr TestConfig) getReward(chain ChainID, validator ValidatorID, blockHeight uint, isNativeDenom bool) float64 { delAddresss := tr.validatorConfigs[validator].DelAddress if chain != ChainID("provi") && tr.validatorConfigs[validator].UseConsumerKey { delAddresss = tr.validatorConfigs[validator].ConsumerDelAddress @@ -345,7 +345,7 @@ func (tr TestRun) getReward(chain ChainID, validator ValidatorID, blockHeight ui return gjson.Get(string(bz), denomCondition).Float() } -func (tr TestRun) getBalance(chain ChainID, validator ValidatorID) uint { +func (tr TestConfig) getBalance(chain ChainID, validator ValidatorID) uint { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. valDelAddress := tr.validatorConfigs[validator].DelAddress if chain != ChainID("provi") && tr.validatorConfigs[validator].UseConsumerKey { @@ -373,7 +373,7 @@ func (tr TestRun) getBalance(chain ChainID, validator ValidatorID) uint { var noProposalRegex = regexp.MustCompile(`doesn't exist: key not found`) // interchain-securityd query gov proposals -func (tr TestRun) getProposal(chain ChainID, proposal uint) Proposal { +func (tr TestConfig) getProposal(chain ChainID, proposal uint) Proposal { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, @@ -497,7 +497,7 @@ type ValPubKey struct { Value string `yaml:"value"` } -func (tr TestRun) getValPower(chain ChainID, validator ValidatorID) uint { +func (tr TestConfig) getValPower(chain ChainID, validator ValidatorID) uint { if *verbose { log.Println("getting validator power for chain: ", chain, " validator: ", validator) } @@ -547,7 +547,7 @@ func (tr TestRun) getValPower(chain ChainID, validator ValidatorID) uint { return 0 } -func (tr TestRun) getRepresentativePower(chain ChainID, validator ValidatorID) uint { +func (tr TestConfig) getRepresentativePower(chain ChainID, validator ValidatorID) uint { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, @@ -566,7 +566,7 @@ func (tr TestRun) getRepresentativePower(chain ChainID, validator ValidatorID) u return uint(amount.Uint()) } -func (tr TestRun) getParam(chain ChainID, param Param) string { +func (tr TestConfig) getParam(chain ChainID, param Param) string { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, @@ -588,7 +588,7 @@ func (tr TestRun) getParam(chain ChainID, param Param) string { // getConsumerChains returns a list of consumer chains that're being secured by the provider chain, // determined by querying the provider chain. -func (tr TestRun) getConsumerChains(chain ChainID) map[ChainID]bool { +func (tr TestConfig) getConsumerChains(chain ChainID) map[ChainID]bool { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, @@ -612,7 +612,7 @@ func (tr TestRun) getConsumerChains(chain ChainID) map[ChainID]bool { return chains } -func (tr TestRun) getConsumerAddresses(chain ChainID, modelState map[ValidatorID]string) map[ValidatorID]string { +func (tr TestConfig) getConsumerAddresses(chain ChainID, modelState map[ValidatorID]string) map[ValidatorID]string { actualState := map[ValidatorID]string{} for k := range modelState { actualState[k] = tr.getConsumerAddress(chain, k) @@ -621,7 +621,7 @@ func (tr TestRun) getConsumerAddresses(chain ChainID, modelState map[ValidatorID return actualState } -func (tr TestRun) getProviderAddresses(chain ChainID, modelState map[ValidatorID]string) map[ValidatorID]string { +func (tr TestConfig) getProviderAddresses(chain ChainID, modelState map[ValidatorID]string) map[ValidatorID]string { actualState := map[ValidatorID]string{} for k := range modelState { actualState[k] = tr.getProviderAddressFromConsumer(chain, k) @@ -630,7 +630,7 @@ func (tr TestRun) getProviderAddresses(chain ChainID, modelState map[ValidatorID return actualState } -func (tr TestRun) getConsumerAddress(consumerChain ChainID, validator ValidatorID) string { +func (tr TestConfig) getConsumerAddress(consumerChain ChainID, validator ValidatorID) string { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[ChainID("provi")].BinaryName, @@ -648,7 +648,7 @@ func (tr TestRun) getConsumerAddress(consumerChain ChainID, validator ValidatorI return addr } -func (tr TestRun) getProviderAddressFromConsumer(consumerChain ChainID, validator ValidatorID) string { +func (tr TestConfig) getProviderAddressFromConsumer(consumerChain ChainID, validator ValidatorID) string { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[ChainID("provi")].BinaryName, @@ -667,7 +667,7 @@ func (tr TestRun) getProviderAddressFromConsumer(consumerChain ChainID, validato return addr } -func (tr TestRun) getGlobalSlashQueueSize() uint { +func (tr TestConfig) getGlobalSlashQueueSize() uint { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[ChainID("provi")].BinaryName, @@ -684,7 +684,7 @@ func (tr TestRun) getGlobalSlashQueueSize() uint { return uint(len(packets)) } -func (tr TestRun) getConsumerChainPacketQueueSize(consumerChain ChainID) uint { +func (tr TestConfig) getConsumerChainPacketQueueSize(consumerChain ChainID) uint { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[ChainID("provi")].BinaryName, @@ -702,7 +702,7 @@ func (tr TestRun) getConsumerChainPacketQueueSize(consumerChain ChainID) uint { return uint(size) } -func (tr TestRun) getRegisteredConsumerRewardDenoms(chain ChainID) []string { +func (tr TestConfig) getRegisteredConsumerRewardDenoms(chain ChainID) []string { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, @@ -724,7 +724,7 @@ func (tr TestRun) getRegisteredConsumerRewardDenoms(chain ChainID) []string { return rewardDenoms } -func (tr TestRun) getValidatorNode(chain ChainID, validator ValidatorID) string { +func (tr TestConfig) getValidatorNode(chain ChainID, validator ValidatorID) string { // for CometMock, validatorNodes are all the same address as the query node (which is CometMocks address) if tr.useCometmock { return tr.getQueryNode(chain) @@ -733,27 +733,27 @@ func (tr TestRun) getValidatorNode(chain ChainID, validator ValidatorID) string return "tcp://" + tr.getValidatorIP(chain, validator) + ":26658" } -func (tr TestRun) getValidatorIP(chain ChainID, validator ValidatorID) string { +func (tr TestConfig) getValidatorIP(chain ChainID, validator ValidatorID) string { return tr.chainConfigs[chain].IpPrefix + "." + tr.validatorConfigs[validator].IpSuffix } -func (tr TestRun) getValidatorHome(chain ChainID, validator ValidatorID) string { +func (tr TestConfig) getValidatorHome(chain ChainID, validator ValidatorID) string { return `/` + string(tr.chainConfigs[chain].ChainId) + `/validator` + fmt.Sprint(validator) } // getQueryNode returns query node tcp address on chain. -func (tr TestRun) getQueryNode(chain ChainID) string { +func (tr TestConfig) getQueryNode(chain ChainID) string { return fmt.Sprintf("tcp://%s", tr.getQueryNodeRPCAddress(chain)) } -func (tr TestRun) getQueryNodeRPCAddress(chain ChainID) string { +func (tr TestConfig) getQueryNodeRPCAddress(chain ChainID) string { return fmt.Sprintf("%s:26658", tr.getQueryNodeIP(chain)) } // getQueryNodeIP returns query node IP for chain, // ipSuffix is hardcoded to be 253 on all query nodes // except for "sover" chain where there's only one node -func (tr TestRun) getQueryNodeIP(chain ChainID) string { +func (tr TestConfig) getQueryNodeIP(chain ChainID) string { if chain == ChainID("sover") { // return address of first and only validator return fmt.Sprintf("%s.%s", @@ -763,7 +763,7 @@ func (tr TestRun) getQueryNodeIP(chain ChainID) string { return fmt.Sprintf("%s.253", tr.chainConfigs[chain].IpPrefix) } -func (tr TestRun) curlJsonRPCRequest(method, params, address string) { +func (tr TestConfig) curlJsonRPCRequest(method, params, address string) { cmd_template := `curl -H 'Content-Type: application/json' -H 'Accept:application/json' --data '{"jsonrpc":"2.0","method":"%s","params":%s,"id":1}' %s` //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. From 3cbf9c814df7c4d42f9ffa05018c4c1166eed652 Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 27 Sep 2023 13:01:15 +0200 Subject: [PATCH 20/22] refactor: RepresentativePowers to StakedTokens (#1333) refactor RepresentativePowers to StakedTokens --- tests/e2e/state.go | 14 +- tests/e2e/state_rapid_test.go | 8 +- tests/e2e/steps_democracy.go | 6 +- tests/e2e/steps_reward_denom.go | 6 +- .../e2e/tracehandler_testdata/changeover.json | 34 +-- .../e2e/tracehandler_testdata/democracy.json | 57 ++--- .../democracyRewardsSteps.json | 56 ++--- .../e2e/tracehandler_testdata/happyPath.json | 142 ++++++------- .../multipleConsumers.json | 194 +++++++++--------- .../e2e/tracehandler_testdata/shorthappy.json | 108 +++++----- .../tracehandler_testdata/slashThrottle.json | 52 ++--- 11 files changed, 339 insertions(+), 338 deletions(-) diff --git a/tests/e2e/state.go b/tests/e2e/state.go index ebfed57652..0febed41f7 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -20,7 +20,7 @@ type ChainState struct { ValBalances *map[ValidatorID]uint Proposals *map[uint]Proposal ValPowers *map[ValidatorID]uint - RepresentativePowers *map[ValidatorID]uint + StakedTokens *map[ValidatorID]uint Params *[]Param Rewards *Rewards ConsumerChains *map[ChainID]bool @@ -138,9 +138,9 @@ func (tr TestConfig) getChainState(chain ChainID, modelState ChainState) ChainSt chainState.ValPowers = &powers } - if modelState.RepresentativePowers != nil { - representPowers := tr.getRepresentativePowers(chain, *modelState.RepresentativePowers) - chainState.RepresentativePowers = &representPowers + if modelState.StakedTokens != nil { + representPowers := tr.getStakedTokens(chain, *modelState.StakedTokens) + chainState.StakedTokens = &representPowers } if modelState.Params != nil { @@ -282,10 +282,10 @@ func (tr TestConfig) getValPowers(chain ChainID, modelState map[ValidatorID]uint return actualState } -func (tr TestConfig) getRepresentativePowers(chain ChainID, modelState map[ValidatorID]uint) map[ValidatorID]uint { +func (tr TestConfig) getStakedTokens(chain ChainID, modelState map[ValidatorID]uint) map[ValidatorID]uint { actualState := map[ValidatorID]uint{} for k := range modelState { - actualState[k] = tr.getRepresentativePower(chain, k) + actualState[k] = tr.getValStakedTokens(chain, k) } return actualState @@ -547,7 +547,7 @@ func (tr TestConfig) getValPower(chain ChainID, validator ValidatorID) uint { return 0 } -func (tr TestConfig) getRepresentativePower(chain ChainID, validator ValidatorID) uint { +func (tr TestConfig) getValStakedTokens(chain ChainID, validator ValidatorID) uint { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, diff --git a/tests/e2e/state_rapid_test.go b/tests/e2e/state_rapid_test.go index 6c82c2e7fb..313e4a68ba 100644 --- a/tests/e2e/state_rapid_test.go +++ b/tests/e2e/state_rapid_test.go @@ -39,7 +39,7 @@ func GetChainStateGen() *rapid.Generator[ChainState] { valBalances := GetValBalancesGen().Draw(t, "ValBalances") proposals := GetProposalsGen().Draw(t, "Proposals") valPowers := GetValPowersGen().Draw(t, "ValPowers") - representativePowers := GetRepresentativePowersGen().Draw(t, "RepresentativePowers") + stakedTokens := GetStakedTokensGen().Draw(t, "StakedTokens") params := GetParamsGen().Draw(t, "Params") rewards := GetRewardsGen().Draw(t, "Rewards") consumerChains := GetConsumerChainsGen().Draw(t, "ConsumerChains") @@ -53,7 +53,7 @@ func GetChainStateGen() *rapid.Generator[ChainState] { ValBalances: &valBalances, Proposals: &proposals, ValPowers: &valPowers, - RepresentativePowers: &representativePowers, + StakedTokens: &stakedTokens, Params: ¶ms, Rewards: &rewards, ConsumerChains: &consumerChains, @@ -127,12 +127,12 @@ func GetParamGen() *rapid.Generator[Param] { }) } -func GetRepresentativePowersGen() *rapid.Generator[map[ValidatorID]uint] { +func GetStakedTokensGen() *rapid.Generator[map[ValidatorID]uint] { return rapid.Custom(func(t *rapid.T) map[ValidatorID]uint { return rapid.MapOf( GetValidatorIDGen(), rapid.Uint(), - ).Draw(t, "RepresentativePowers") + ).Draw(t, "StakedTokens") }) } diff --git a/tests/e2e/steps_democracy.go b/tests/e2e/steps_democracy.go index 9779ce45bc..a264f868a7 100644 --- a/tests/e2e/steps_democracy.go +++ b/tests/e2e/steps_democracy.go @@ -12,7 +12,7 @@ func stepsDemocracy(consumerName string) []Step { }, State: State{ ChainID(consumerName): ChainState{ - RepresentativePowers: &map[ValidatorID]uint{ + StakedTokens: &map[ValidatorID]uint{ ValidatorID("alice"): 100000000, ValidatorID("bob"): 40000000, }, @@ -38,7 +38,7 @@ func stepsDemocracy(consumerName string) []Step { State: State{ ChainID(consumerName): ChainState{ // Check that delegators on gov-consumer chain can change representative powers - RepresentativePowers: &map[ValidatorID]uint{ + StakedTokens: &map[ValidatorID]uint{ ValidatorID("alice"): 100500000, ValidatorID("bob"): 40000000, }, @@ -286,7 +286,7 @@ func stepsDemocracy(consumerName string) []Step { ValidatorID("carol"): 500, }, // Check that slashing on the gov-consumer chain does not result in slashing for the representatives or their delegators - RepresentativePowers: &map[ValidatorID]uint{ + StakedTokens: &map[ValidatorID]uint{ ValidatorID("alice"): 100500000, ValidatorID("bob"): 40000000, }, diff --git a/tests/e2e/steps_reward_denom.go b/tests/e2e/steps_reward_denom.go index 125f3dd401..1a47accd07 100644 --- a/tests/e2e/steps_reward_denom.go +++ b/tests/e2e/steps_reward_denom.go @@ -10,7 +10,7 @@ func stepsRewardDenomConsumer(consumerName string) []Step { }, State: State{ ChainID(consumerName): ChainState{ - RepresentativePowers: &map[ValidatorID]uint{ + StakedTokens: &map[ValidatorID]uint{ ValidatorID("alice"): 100000000, ValidatorID("bob"): 40000000, }, @@ -36,7 +36,7 @@ func stepsRewardDenomConsumer(consumerName string) []Step { State: State{ ChainID(consumerName): ChainState{ // Check that delegators on gov-consumer chain can change representative powers - RepresentativePowers: &map[ValidatorID]uint{ + StakedTokens: &map[ValidatorID]uint{ ValidatorID("alice"): 100500000, ValidatorID("bob"): 40000000, }, @@ -284,7 +284,7 @@ func stepsRewardDenomConsumer(consumerName string) []Step { ValidatorID("carol"): 500, }, // Check that slashing on the gov-consumer chain does not result in slashing for the representatives or their delegators - RepresentativePowers: &map[ValidatorID]uint{ + StakedTokens: &map[ValidatorID]uint{ ValidatorID("alice"): 100500000, ValidatorID("bob"): 40000000, }, diff --git a/tests/e2e/tracehandler_testdata/changeover.json b/tests/e2e/tracehandler_testdata/changeover.json index 42613462f8..d973b46fe4 100644 --- a/tests/e2e/tracehandler_testdata/changeover.json +++ b/tests/e2e/tracehandler_testdata/changeover.json @@ -18,7 +18,7 @@ "alice": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -47,7 +47,7 @@ "bob": 0, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -92,7 +92,7 @@ "carol": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -138,7 +138,7 @@ "sover": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -179,7 +179,7 @@ "sover": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -233,7 +233,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -282,7 +282,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -340,7 +340,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -358,7 +358,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -408,7 +408,7 @@ "bob": 0 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -437,7 +437,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -455,7 +455,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -484,7 +484,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -511,7 +511,7 @@ "bob": 100 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -540,7 +540,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -558,7 +558,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -587,7 +587,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, diff --git a/tests/e2e/tracehandler_testdata/democracy.json b/tests/e2e/tracehandler_testdata/democracy.json index 706eb944f5..9a435b3a0b 100644 --- a/tests/e2e/tracehandler_testdata/democracy.json +++ b/tests/e2e/tracehandler_testdata/democracy.json @@ -1,3 +1,4 @@ + [ { "ActionType": "main.StartChainAction", @@ -31,7 +32,7 @@ "carol": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -65,7 +66,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -105,7 +106,7 @@ "democ": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -148,7 +149,7 @@ "democ": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -189,7 +190,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -247,7 +248,7 @@ "carol": 10000000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -265,7 +266,7 @@ "carol": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -331,7 +332,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -349,7 +350,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -377,7 +378,7 @@ "bob": 10000000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -406,7 +407,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -434,7 +435,7 @@ "bob": 10000000001 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -464,7 +465,7 @@ "democ": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": { + "StakedTokens": { "alice": 100000000, "bob": 40000000 }, @@ -504,7 +505,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": { + "StakedTokens": { "alice": 100500000, "bob": 40000000 }, @@ -545,7 +546,7 @@ "bob": 9960000001 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -590,7 +591,7 @@ "bob": 9960000001 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": [ { "Subspace": "transfer", @@ -621,7 +622,7 @@ "provi": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": { "IsRewarded": { @@ -653,7 +654,7 @@ "provi": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -686,7 +687,7 @@ "provi": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -713,7 +714,7 @@ "provi": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": { "IsRewarded": { @@ -748,7 +749,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -766,7 +767,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -795,7 +796,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -813,7 +814,7 @@ "bob": 0, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -842,7 +843,7 @@ "bob": 0, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -869,7 +870,7 @@ "bob": 0, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -887,7 +888,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -916,7 +917,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": { + "StakedTokens": { "alice": 100500000, "bob": 40000000 }, diff --git a/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json b/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json index cea7f937be..355ff1fbb8 100644 --- a/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json +++ b/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json @@ -31,7 +31,7 @@ "carol": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -65,7 +65,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -105,7 +105,7 @@ "democ": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -148,7 +148,7 @@ "democ": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -189,7 +189,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -247,7 +247,7 @@ "carol": 10000000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -265,7 +265,7 @@ "carol": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -331,7 +331,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -349,7 +349,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -377,7 +377,7 @@ "bob": 10000000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -406,7 +406,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -434,7 +434,7 @@ "bob": 10000000001 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -464,7 +464,7 @@ "democ": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": { + "StakedTokens": { "alice": 100000000, "bob": 40000000 }, @@ -504,7 +504,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": { + "StakedTokens": { "alice": 100500000, "bob": 40000000 }, @@ -545,7 +545,7 @@ "bob": 9960000001 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -590,7 +590,7 @@ "bob": 9960000001 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": [ { "Subspace": "transfer", @@ -621,7 +621,7 @@ "provi": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": { "IsRewarded": { @@ -653,7 +653,7 @@ "provi": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -686,7 +686,7 @@ "provi": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -713,7 +713,7 @@ "provi": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": { "IsRewarded": { @@ -748,7 +748,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -766,7 +766,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -795,7 +795,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -813,7 +813,7 @@ "bob": 0, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -842,7 +842,7 @@ "bob": 0, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -869,7 +869,7 @@ "bob": 0, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -887,7 +887,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -916,7 +916,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": { + "StakedTokens": { "alice": 100500000, "bob": 40000000 }, diff --git a/tests/e2e/tracehandler_testdata/happyPath.json b/tests/e2e/tracehandler_testdata/happyPath.json index 2ed4363c96..f46a4e983b 100644 --- a/tests/e2e/tracehandler_testdata/happyPath.json +++ b/tests/e2e/tracehandler_testdata/happyPath.json @@ -31,7 +31,7 @@ "carol": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -65,7 +65,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -105,7 +105,7 @@ "consu": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -148,7 +148,7 @@ "consu": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -189,7 +189,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -247,7 +247,7 @@ "carol": 10000000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -265,7 +265,7 @@ "carol": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -317,7 +317,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -335,7 +335,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -363,7 +363,7 @@ "bob": 10000000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -392,7 +392,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -420,7 +420,7 @@ "bob": 10000000001 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -451,7 +451,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -475,7 +475,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -504,7 +504,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -528,7 +528,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -557,7 +557,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -575,7 +575,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -604,7 +604,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -633,7 +633,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -651,7 +651,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -680,7 +680,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -709,7 +709,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -727,7 +727,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -756,7 +756,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -786,7 +786,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -804,7 +804,7 @@ "bob": 500, "carol": 950 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -833,7 +833,7 @@ "bob": 500, "carol": 950 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -860,7 +860,7 @@ "bob": 500, "carol": 950 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -878,7 +878,7 @@ "bob": 500, "carol": 950 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -907,7 +907,7 @@ "bob": 500, "carol": 950 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -925,7 +925,7 @@ "bob": 500, "carol": 950 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -955,7 +955,7 @@ "bob": 500, "carol": 950 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -973,7 +973,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1002,7 +1002,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1029,7 +1029,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1047,7 +1047,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1076,7 +1076,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1094,7 +1094,7 @@ "bob": 0, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1123,7 +1123,7 @@ "bob": 0, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1150,7 +1150,7 @@ "bob": 0, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1168,7 +1168,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1197,7 +1197,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1224,7 +1224,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1242,7 +1242,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1271,7 +1271,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1298,7 +1298,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1316,7 +1316,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1345,7 +1345,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1377,7 +1377,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1397,7 +1397,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1434,7 +1434,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1452,7 +1452,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1481,7 +1481,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1499,7 +1499,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1526,7 +1526,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1544,7 +1544,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1573,7 +1573,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1591,7 +1591,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1620,7 +1620,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1638,7 +1638,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1670,7 +1670,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1690,7 +1690,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1738,7 +1738,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1756,7 +1756,7 @@ "bob": 0, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1796,7 +1796,7 @@ "bob": 0, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1814,7 +1814,7 @@ "bob": 0, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1847,7 +1847,7 @@ "bob": 9489999999 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": { @@ -1894,7 +1894,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": { @@ -1934,7 +1934,7 @@ "bob": 9489999999 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": { @@ -1981,7 +1981,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": {}, diff --git a/tests/e2e/tracehandler_testdata/multipleConsumers.json b/tests/e2e/tracehandler_testdata/multipleConsumers.json index 0630749179..4774a94ad8 100644 --- a/tests/e2e/tracehandler_testdata/multipleConsumers.json +++ b/tests/e2e/tracehandler_testdata/multipleConsumers.json @@ -31,7 +31,7 @@ "carol": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -65,7 +65,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -105,7 +105,7 @@ "consu": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -148,7 +148,7 @@ "consu": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -189,7 +189,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -247,7 +247,7 @@ "carol": 10000000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -265,7 +265,7 @@ "carol": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -322,7 +322,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -362,7 +362,7 @@ "densu": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -405,7 +405,7 @@ "densu": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -446,7 +446,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -504,7 +504,7 @@ "carol": 10000000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -522,7 +522,7 @@ "carol": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -574,7 +574,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -592,7 +592,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -610,7 +610,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -639,7 +639,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -657,7 +657,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -675,7 +675,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -704,7 +704,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -722,7 +722,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -740,7 +740,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -769,7 +769,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -787,7 +787,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -805,7 +805,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -834,7 +834,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -852,7 +852,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -870,7 +870,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -899,7 +899,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -917,7 +917,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -935,7 +935,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -965,7 +965,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -983,7 +983,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1001,7 +1001,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1030,7 +1030,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1048,7 +1048,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1066,7 +1066,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1095,7 +1095,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1113,7 +1113,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1131,7 +1131,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1158,7 +1158,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1176,7 +1176,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1194,7 +1194,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1223,7 +1223,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1241,7 +1241,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1259,7 +1259,7 @@ "bob": 0, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1288,7 +1288,7 @@ "bob": 0, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1306,7 +1306,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1335,7 +1335,7 @@ "bob": 0, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1353,7 +1353,7 @@ "bob": 0, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1380,7 +1380,7 @@ "bob": 0, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1398,7 +1398,7 @@ "bob": 0, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1416,7 +1416,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1445,7 +1445,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1463,7 +1463,7 @@ "bob": 0, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1481,7 +1481,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1510,7 +1510,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1528,7 +1528,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1546,7 +1546,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1573,7 +1573,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1591,7 +1591,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1609,7 +1609,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1638,7 +1638,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1656,7 +1656,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1674,7 +1674,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1703,7 +1703,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1721,7 +1721,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1739,7 +1739,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1766,7 +1766,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1784,7 +1784,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1802,7 +1802,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1831,7 +1831,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1849,7 +1849,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1867,7 +1867,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1896,7 +1896,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1914,7 +1914,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1932,7 +1932,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1959,7 +1959,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1977,7 +1977,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1995,7 +1995,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2024,7 +2024,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2042,7 +2042,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2060,7 +2060,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2089,7 +2089,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2107,7 +2107,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2125,7 +2125,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2152,7 +2152,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2170,7 +2170,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2188,7 +2188,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2217,7 +2217,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2235,7 +2235,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2253,7 +2253,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2282,7 +2282,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2300,7 +2300,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2318,7 +2318,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2347,7 +2347,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -2365,7 +2365,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, diff --git a/tests/e2e/tracehandler_testdata/shorthappy.json b/tests/e2e/tracehandler_testdata/shorthappy.json index 04827a04cf..ee82bf619f 100644 --- a/tests/e2e/tracehandler_testdata/shorthappy.json +++ b/tests/e2e/tracehandler_testdata/shorthappy.json @@ -31,7 +31,7 @@ "carol": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -65,7 +65,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -105,7 +105,7 @@ "consu": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -148,7 +148,7 @@ "consu": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -189,7 +189,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -247,7 +247,7 @@ "carol": 10000000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -265,7 +265,7 @@ "carol": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -317,7 +317,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -335,7 +335,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -363,7 +363,7 @@ "bob": 10000000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -392,7 +392,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -420,7 +420,7 @@ "bob": 10000000001 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -449,7 +449,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -467,7 +467,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -496,7 +496,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -526,7 +526,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -544,7 +544,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -573,7 +573,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -600,7 +600,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -618,7 +618,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -647,7 +647,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -665,7 +665,7 @@ "bob": 0, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -694,7 +694,7 @@ "bob": 0, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -721,7 +721,7 @@ "bob": 0, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -739,7 +739,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -768,7 +768,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -795,7 +795,7 @@ "bob": 500, "carol": 501 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -813,7 +813,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -842,7 +842,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -869,7 +869,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -887,7 +887,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -916,7 +916,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -948,7 +948,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -968,7 +968,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1005,7 +1005,7 @@ "bob": 500, "carol": 495 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1023,7 +1023,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1052,7 +1052,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1070,7 +1070,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1097,7 +1097,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1115,7 +1115,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1144,7 +1144,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1162,7 +1162,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1191,7 +1191,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1209,7 +1209,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1241,7 +1241,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1261,7 +1261,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1309,7 +1309,7 @@ "bob": 500, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1327,7 +1327,7 @@ "bob": 0, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1367,7 +1367,7 @@ "bob": 0, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1385,7 +1385,7 @@ "bob": 0, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -1418,7 +1418,7 @@ "bob": 9489999999 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": { @@ -1465,7 +1465,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": { @@ -1505,7 +1505,7 @@ "bob": 9489999999 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": { @@ -1552,7 +1552,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": {}, diff --git a/tests/e2e/tracehandler_testdata/slashThrottle.json b/tests/e2e/tracehandler_testdata/slashThrottle.json index dc25e590b0..ea8306fd4c 100644 --- a/tests/e2e/tracehandler_testdata/slashThrottle.json +++ b/tests/e2e/tracehandler_testdata/slashThrottle.json @@ -31,7 +31,7 @@ "carol": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -65,7 +65,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -105,7 +105,7 @@ "consu": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -148,7 +148,7 @@ "consu": { "ValBalances": null, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -189,7 +189,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -247,7 +247,7 @@ "carol": 10000000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -265,7 +265,7 @@ "carol": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -317,7 +317,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -335,7 +335,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -363,7 +363,7 @@ "bob": 10000000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -392,7 +392,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -420,7 +420,7 @@ "bob": 10000000001 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -447,7 +447,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -465,7 +465,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -494,7 +494,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -512,7 +512,7 @@ "bob": 0, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -541,7 +541,7 @@ "bob": 500, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -559,7 +559,7 @@ "bob": 0, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -588,7 +588,7 @@ "bob": 0, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -606,7 +606,7 @@ "bob": 0, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -637,7 +637,7 @@ "bob": 0, "carol": 500 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -655,7 +655,7 @@ "bob": 0, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -686,7 +686,7 @@ "bob": 0, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -704,7 +704,7 @@ "bob": 0, "carol": 0 }, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -734,7 +734,7 @@ "bob": 9489999999 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": { @@ -781,7 +781,7 @@ "bob": 9500000000 }, "ValPowers": null, - "RepresentativePowers": null, + "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": {}, From 67ec7154bab11f92e66da7d752b52e8b5a150bc6 Mon Sep 17 00:00:00 2001 From: yaruwangway <69694322+yaruwangway@users.noreply.github.com> Date: Mon, 2 Oct 2023 17:09:06 +0200 Subject: [PATCH 21/22] feat!: store proposed chainID before voting finishes (#1289) * feat: store chain in proposal * add govHook * delete GetChainsInProposal * check proposal type * update key * feat: add query proposed chainIDs * feat: set govhook * feat: parse key * refactor: names * feat: add list proposed consumer chains * test: add e2e test * add e2e test * update comments * update ProposeConsumerChains in e2e test * remove wait for block * docs: update changelog * fix: lint * add TestParseProposedConsumerChainKey * refactor gov hook * Update proto/interchain_security/ccv/provider/v1/query.proto Co-authored-by: MSalopek * update proto * add test for set kv * refactor key to be prefix_proposalID * formatting * update e2e test * format * Update x/ccv/provider/keeper/gov_hook.go Co-authored-by: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> * Update x/ccv/provider/keeper/keeper.go Co-authored-by: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> * Update x/ccv/provider/keeper/keeper.go Co-authored-by: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> * fix e2e test * fix gosec * remove type url check * test: add unit test * lint * fix lint * fix err --------- Co-authored-by: MSalopek Co-authored-by: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> --- CHANGELOG.md | 1 + app/provider/app.go | 9 +- .../ccv/provider/v1/query.proto | 21 + tests/e2e/config.go | 23 +- tests/e2e/state.go | 28 + tests/e2e/steps_start_chains.go | 2 + x/ccv/provider/client/cli/query.go | 28 + x/ccv/provider/keeper/gov_hook.go | 93 +++ x/ccv/provider/keeper/grpc_query.go | 14 + x/ccv/provider/keeper/keeper.go | 44 ++ x/ccv/provider/keeper/keeper_test.go | 95 +++ x/ccv/provider/types/keys.go | 22 + x/ccv/provider/types/keys_test.go | 20 + x/ccv/provider/types/query.pb.go | 719 ++++++++++++++++-- x/ccv/provider/types/query.pb.gw.go | 65 ++ 15 files changed, 1086 insertions(+), 98 deletions(-) create mode 100644 x/ccv/provider/keeper/gov_hook.go diff --git a/CHANGELOG.md b/CHANGELOG.md index a238df4a44..cb2477b334 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Add an entry to the unreleased provider section whenever merging a PR to main th * (deps) [#1258](https://github.com/cosmos/interchain-security/pull/1258) Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.47.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.4). * (deps!) [#1196](https://github.com/cosmos/interchain-security/pull/1196) Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v7.2.0](https://github.com/cosmos/ibc-go/releases/tag/v7.2.0). * `[x/ccv/provider]` (fix) [#1076](https://github.com/cosmos/interchain-security/pull/1076) Add `InitTimeoutTimestamps` and `ExportedVscSendTimestamps` to exported genesis. +* (feature) [#1282](https://github.com/cosmos/interchain-security/issues/1282) In the `ConsumerAdditionProposal`, consumer chainIDs proposed before the voting period finishes are now stored in the state. The gRPC query `/interchain_security/ccv/provider/proposed_consumer_chainids` and CLI command `query provider proposed-consumer-chains` can be used to retrieve this information. ## [Unreleased for Consumer] diff --git a/app/provider/app.go b/app/provider/app.go index 4550ec77d2..377bedd10c 100644 --- a/app/provider/app.go +++ b/app/provider/app.go @@ -443,7 +443,7 @@ func New( AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) govConfig := govtypes.DefaultConfig() - app.GovKeeper = *govkeeper.NewKeeper( + govKeeper := govkeeper.NewKeeper( appCodec, keys[govtypes.StoreKey], app.AccountKeeper, @@ -455,7 +455,12 @@ func New( ) // Set legacy router for backwards compatibility with gov v1beta1 - app.GovKeeper.SetLegacyRouter(govRouter) + govKeeper.SetLegacyRouter(govRouter) + + govHook := app.ProviderKeeper.GovHooks(govKeeper) + app.GovKeeper = *govKeeper.SetHooks( + govtypes.NewMultiGovHooks(govHook), + ) app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index 6dfcdcb320..0136a420e7 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -81,6 +81,15 @@ service Query { option (google.api.http).get = "/interchain_security/ccv/provider/registered_consumer_reward_denoms"; } + + // QueryProposedConsumerChainIDs query chainIDs in consumerAdditionProposals + // before voting period finishes, after voting period finishes, this chainID will be removed from the result + rpc QueryProposedConsumerChainIDs( + QueryProposedChainIDsRequest) + returns (QueryProposedChainIDsResponse) { + option (google.api.http).get = + "/interchain_security/ccv/provider/proposed_consumer_chains"; + } } message QueryConsumerGenesisRequest { string chain_id = 1; } @@ -187,3 +196,15 @@ message QueryRegisteredConsumerRewardDenomsRequest {} message QueryRegisteredConsumerRewardDenomsResponse { repeated string denoms = 1; } + +message QueryProposedChainIDsRequest {} + +message QueryProposedChainIDsResponse { + repeated ProposedChain proposedChains = 1 + [ (gogoproto.nullable) = false ]; +} + +message ProposedChain { + string chainID = 1; + uint64 proposalID = 2; +} diff --git a/tests/e2e/config.go b/tests/e2e/config.go index 0a164c2cec..f17deb9843 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -395,7 +395,7 @@ func ChangeoverTestConfig() TestConfig { return tr } -func (s *TestConfig) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag string) { +func (tr *TestRun) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag string) { if localSdkPath != "" { fmt.Println("USING LOCAL SDK", localSdkPath) } @@ -403,17 +403,17 @@ func (s *TestConfig) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag fmt.Println("USING GAIA INSTEAD OF ICS provider app", gaiaTag) } - s.useGaia = useGaia - s.gaiaTag = gaiaTag - s.localSdkPath = localSdkPath + tr.useGaia = useGaia + tr.gaiaTag = gaiaTag + tr.localSdkPath = localSdkPath } -func (s *TestConfig) SetCometMockConfig(useCometmock bool) { - s.useCometmock = useCometmock +func (tr *TestRun) SetCometMockConfig(useCometmock bool) { + tr.useCometmock = useCometmock } -func (s *TestConfig) SetRelayerConfig(useRly bool) { - s.useGorelayer = useRly +func (tr *TestRun) SetRelayerConfig(useRly bool) { + tr.useGorelayer = useRly } // validateStringLiterals enforces that configs follow the constraints @@ -423,9 +423,8 @@ func (s *TestConfig) SetRelayerConfig(useRly bool) { // within the container will be named as "$CHAIN_ID-$VAL_ID-out" etc. // where this name is constrained to 15 bytes or less. Therefore each string literal // used as a validatorID or chainID needs to be 5 char or less. -func (s *TestConfig) validateStringLiterals() { - for valID, valConfig := range s.validatorConfigs { - +func (tr *TestRun) validateStringLiterals() { + for valID, valConfig := range tr.validatorConfigs { if len(valID) > 5 { panic("validator id string literal must be 5 char or less") } @@ -448,7 +447,7 @@ func (s *TestConfig) validateStringLiterals() { } } - for chainID, chainConfig := range s.chainConfigs { + for chainID, chainConfig := range tr.chainConfigs { if len(chainID) > 5 { panic("chain id string literal must be 5 char or less") } diff --git a/tests/e2e/state.go b/tests/e2e/state.go index 0febed41f7..f4001b4879 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -19,6 +19,7 @@ type State map[ChainID]ChainState type ChainState struct { ValBalances *map[ValidatorID]uint Proposals *map[uint]Proposal + ProposedConsumerChains *[]string ValPowers *map[ValidatorID]uint StakedTokens *map[ValidatorID]uint Params *[]Param @@ -132,6 +133,11 @@ func (tr TestConfig) getChainState(chain ChainID, modelState ChainState) ChainSt chainState.Proposals = &proposals } + if modelState.ProposedConsumerChains != nil { + proposedConsumerChains := tr.getProposedConsumerChains(chain) + chainState.ProposedConsumerChains = &proposedConsumerChains + } + if modelState.ValPowers != nil { tr.waitBlocks(chain, 1, 10*time.Second) powers := tr.getValPowers(chain, *modelState.ValPowers) @@ -772,3 +778,25 @@ func (tr TestConfig) curlJsonRPCRequest(method, params, address string) { verbosity := false executeCommandWithVerbosity(cmd, "curlJsonRPCRequest", verbosity) } + +func (tr TestRun) getProposedConsumerChains(chain ChainID) []string { + tr.waitBlocks(chain, 1, 10*time.Second) + //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. + bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, + "query", "provider", "list-proposed-consumer-chains", + `--node`, tr.getQueryNode(chain), + `-o`, `json`, + ).CombinedOutput() + if err != nil { + log.Fatal(err, "\n", string(bz)) + } + + arr := gjson.Get(string(bz), "proposedChains").Array() + chains := []string{} + for _, c := range arr { + cid := c.Get("chainID").String() + chains = append(chains, cid) + } + + return chains +} diff --git a/tests/e2e/steps_start_chains.go b/tests/e2e/steps_start_chains.go index ace3d6c255..58a5f75162 100644 --- a/tests/e2e/steps_start_chains.go +++ b/tests/e2e/steps_start_chains.go @@ -54,6 +54,7 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint Status: "PROPOSAL_STATUS_VOTING_PERIOD", }, }, + ProposedConsumerChains: &[]string{consumerName}, }, }, }, @@ -163,6 +164,7 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint ValidatorID("bob"): 9500000000, ValidatorID("carol"): 9500000000, }, + ProposedConsumerChains: &[]string{}, }, ChainID(consumerName): ChainState{ ValBalances: &map[ValidatorID]uint{ diff --git a/x/ccv/provider/client/cli/query.go b/x/ccv/provider/client/cli/query.go index 1240e242f0..b1cbb2d9ef 100644 --- a/x/ccv/provider/client/cli/query.go +++ b/x/ccv/provider/client/cli/query.go @@ -33,6 +33,7 @@ func NewQueryCmd() *cobra.Command { cmd.AddCommand(CmdThrottleState()) cmd.AddCommand(CmdThrottledConsumerPacketData()) cmd.AddCommand(CmdRegisteredConsumerRewardDenoms()) + cmd.AddCommand(CmdProposedConsumerChains()) return cmd } @@ -93,6 +94,33 @@ func CmdConsumerChains() *cobra.Command { return cmd } +func CmdProposedConsumerChains() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-proposed-consumer-chains", + Short: "Query chainIDs in consumer addition proposal before voting finishes", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryProposedChainIDsRequest{} + res, err := queryClient.QueryProposedConsumerChainIDs(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + func CmdConsumerStartProposals() *cobra.Command { cmd := &cobra.Command{ Use: "list-start-proposals", diff --git a/x/ccv/provider/keeper/gov_hook.go b/x/ccv/provider/keeper/gov_hook.go new file mode 100644 index 0000000000..61f504366f --- /dev/null +++ b/x/ccv/provider/keeper/gov_hook.go @@ -0,0 +1,93 @@ +package keeper + +import ( + "fmt" + + "github.com/cosmos/gogoproto/proto" + + sdk "github.com/cosmos/cosmos-sdk/types" + govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" + sdkgov "github.com/cosmos/cosmos-sdk/x/gov/types" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + + "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" +) + +type GovHooks struct { + gk *govkeeper.Keeper + k *Keeper +} + +// Implements GovHooks interface +// GovHooks exist in cosmos-sdk/x/gov/keeper/hooks.go of v0.45.16-lsm-ics and on +var _ sdkgov.GovHooks = GovHooks{} + +func (k *Keeper) GovHooks(gk *govkeeper.Keeper) GovHooks { + return GovHooks{ + gk: gk, + k: k, + } +} + +// AfterProposalSubmission - call hook if registered +// After consumerAddition proposal submission, the consumer chainID is stored +func (gh GovHooks) AfterProposalSubmission(ctx sdk.Context, proposalID uint64) { + p, ok := gh.gk.GetProposal(ctx, proposalID) + if !ok { + panic(fmt.Errorf("failed to get proposal %d in gov hook", proposalID)) + } + msgs := p.GetMessages() + + for _, msg := range msgs { + var msgLegacyContent v1.MsgExecLegacyContent + err := proto.Unmarshal(msg.Value, &msgLegacyContent) + if err != nil { + panic(fmt.Errorf("failed to unmarshal proposal content in gov hook: %w", err)) + } + + // if the consumer addition proposal cannot be unmarshaled, continue + var consAdditionProp types.ConsumerAdditionProposal + if err := proto.Unmarshal(msgLegacyContent.Content.Value, &consAdditionProp); err != nil { + continue + } + + if consAdditionProp.ProposalType() == types.ProposalTypeConsumerAddition { + gh.k.SetProposedConsumerChain(ctx, consAdditionProp.ChainId, proposalID) + } + } +} + +// AfterProposalVotingPeriodEnded - call hook if registered +// After proposal voting ends, the consumer chainID in store is deleted. +// When a proposal passes, this chainID will be available in providerKeeper.GetAllPendingConsumerAdditionProps +// or providerKeeper.GetAllConsumerChains(ctx). +func (gh GovHooks) AfterProposalVotingPeriodEnded(ctx sdk.Context, proposalID uint64) { + p, ok := gh.gk.GetProposal(ctx, proposalID) + if !ok { + panic(fmt.Errorf("failed to get proposal %d in gov hook", proposalID)) + } + msgs := p.GetMessages() + + for _, msg := range msgs { + var msgLegacyContent v1.MsgExecLegacyContent + err := proto.Unmarshal(msg.Value, &msgLegacyContent) + if err != nil { + panic(fmt.Errorf("failed to unmarshal proposal content in gov hook: %w", err)) + } + + var consAdditionProp types.ConsumerAdditionProposal + // if the proposal is not ConsumerAdditionProposal, return + if err := proto.Unmarshal(msgLegacyContent.Content.Value, &consAdditionProp); err != nil { + continue + } + + if consAdditionProp.ProposalType() == types.ProposalTypeConsumerAddition { + gh.k.DeleteProposedConsumerChainInStore(ctx, proposalID) + } + } +} + +func (gh GovHooks) AfterProposalDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) { +} +func (gh GovHooks) AfterProposalVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) {} +func (gh GovHooks) AfterProposalFailedMinDeposit(ctx sdk.Context, proposalID uint64) {} diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 2b522ea9ef..93837df229 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -253,3 +253,17 @@ func (k Keeper) QueryRegisteredConsumerRewardDenoms(goCtx context.Context, req * Denoms: denoms, }, nil } + +func (k Keeper) QueryProposedConsumerChainIDs(goCtx context.Context, req *types.QueryProposedChainIDsRequest) (*types.QueryProposedChainIDsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + chains := k.GetAllProposedConsumerChainIDs(ctx) + + return &types.QueryProposedChainIDsResponse{ + ProposedChains: chains, + }, nil +} diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index e9bb1d1bd0..ba2b6f47fe 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -178,6 +178,50 @@ func (k Keeper) DeleteChainToChannel(ctx sdk.Context, chainID string) { store.Delete(types.ChainToChannelKey(chainID)) } +// SetProposedConsumerChain stores a consumer chainId corresponding to a submitted consumer addition proposal +// This consumer chainId is deleted once the voting period for the proposal ends +// does not end. +func (k Keeper) SetProposedConsumerChain(ctx sdk.Context, chainID string, proposalID uint64) { + store := ctx.KVStore(k.storeKey) + store.Set(types.ProposedConsumerChainKey(proposalID), []byte(chainID)) +} + +// GetProposedConsumerChain get the proposed chainID in consumerAddition proposal. +func (k Keeper) GetProposedConsumerChain(ctx sdk.Context, proposalID uint64) string { + store := ctx.KVStore(k.storeKey) + return string(store.Get(types.ProposedConsumerChainKey(proposalID))) +} + +// DeleteProposedConsumerChainInStore deletes the consumer chainID from store +// which is in gov consumerAddition proposal +func (k Keeper) DeleteProposedConsumerChainInStore(ctx sdk.Context, proposalID uint64) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.ProposedConsumerChainKey(proposalID)) +} + +// GetAllProposedConsumerChainIDs get consumer chainId in gov consumerAddition proposal before voting period ends. +func (k Keeper) GetAllProposedConsumerChainIDs(ctx sdk.Context) []types.ProposedChain { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, []byte{types.ProposedConsumerChainByteKey}) + defer iterator.Close() + + proposedChains := []types.ProposedChain{} + for ; iterator.Valid(); iterator.Next() { + proposalID, err := types.ParseProposedConsumerChainKey(types.ProposedConsumerChainByteKey, iterator.Key()) + if err != nil { + panic(fmt.Errorf("proposed chains cannot be parsed: %w", err)) + } + + proposedChains = append(proposedChains, types.ProposedChain{ + ChainID: string(iterator.Value()), + ProposalID: proposalID, + }) + + } + + return proposedChains +} + // GetAllConsumerChains gets all of the consumer chains, for which the provider module // created IBC clients. Consumer chains with created clients are also referred to as registered. // diff --git a/x/ccv/provider/keeper/keeper_test.go b/x/ccv/provider/keeper/keeper_test.go index be3ef4001c..14c86fe775 100644 --- a/x/ccv/provider/keeper/keeper_test.go +++ b/x/ccv/provider/keeper/keeper_test.go @@ -533,3 +533,98 @@ func TestSetSlashLog(t *testing.T) { require.True(t, providerKeeper.GetSlashLog(ctx, addrWithDoubleSigns)) require.False(t, providerKeeper.GetSlashLog(ctx, addrWithoutDoubleSigns)) } + +func TestSetProposedConsumerChains(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + tests := []struct { + chainID string + proposalID uint64 + }{ + {chainID: "1", proposalID: 1}, + {chainID: "some other ID", proposalID: 12}, + {chainID: "some other other chain ID", proposalID: 123}, + {chainID: "", proposalID: 1234}, + } + + for _, test := range tests { + providerKeeper.SetProposedConsumerChain(ctx, test.chainID, test.proposalID) + cID := providerKeeper.GetProposedConsumerChain(ctx, test.proposalID) + require.Equal(t, cID, test.chainID) + } +} + +func TestDeleteProposedConsumerChainInStore(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + tests := []struct { + chainID string + proposalID uint64 + deleteProposalID uint64 + ok bool + }{ + {chainID: "1", proposalID: 1, deleteProposalID: 1, ok: true}, + {chainID: "", proposalID: 12, deleteProposalID: 12, ok: true}, + {chainID: "1", proposalID: 0, deleteProposalID: 1, ok: false}, + } + for _, test := range tests { + providerKeeper.SetProposedConsumerChain(ctx, test.chainID, test.proposalID) + providerKeeper.DeleteProposedConsumerChainInStore(ctx, test.deleteProposalID) + cID := providerKeeper.GetProposedConsumerChain(ctx, test.proposalID) + if test.ok { + require.Equal(t, cID, "") + } else { + require.Equal(t, cID, test.chainID) + } + } +} + +func TestGetAllProposedConsumerChainIDs(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) + defer ctrl.Finish() + tests := [][]types.ProposedChain{ + {}, + { + { + ChainID: "1", + ProposalID: 1, + }, + }, + { + { + ChainID: "1", + ProposalID: 1, + }, + { + ChainID: "2", + ProposalID: 2, + }, + { + ChainID: "", + ProposalID: 3, + }, + }, + } + + for _, test := range tests { + for _, tc := range test { + providerKeeper.SetProposedConsumerChain(ctx, tc.ChainID, tc.ProposalID) + } + + chains := providerKeeper.GetAllProposedConsumerChainIDs(ctx) + + sort.Slice(chains, func(i, j int) bool { + return chains[i].ProposalID < chains[j].ProposalID + }) + sort.Slice(test, func(i, j int) bool { + return test[i].ProposalID < test[j].ProposalID + }) + require.Equal(t, chains, test) + + for _, tc := range test { + providerKeeper.DeleteProposedConsumerChainInStore(ctx, tc.ProposalID) + } + } +} diff --git a/x/ccv/provider/types/keys.go b/x/ccv/provider/types/keys.go index ee4c11015b..fa0428311c 100644 --- a/x/ccv/provider/types/keys.go +++ b/x/ccv/provider/types/keys.go @@ -138,6 +138,8 @@ const ( // handled in the current block VSCMaturedHandledThisBlockBytePrefix + // ProposedConsumerChainByteKey is the byte prefix storing the consumer chainId in consumerAddition gov proposal submitted before voting finishes + ProposedConsumerChainByteKey // NOTE: DO NOT ADD NEW BYTE PREFIXES HERE WITHOUT ADDING THEM TO getAllKeyPrefixes() IN keys_test.go ) @@ -484,6 +486,26 @@ func VSCMaturedHandledThisBlockKey() []byte { return []byte{VSCMaturedHandledThisBlockBytePrefix} } +// ProposedConsumerChainKey returns the key of proposed consumer chainId in consumerAddition gov proposal before voting finishes, the stored key format is prefix|proposalID, value is chainID +func ProposedConsumerChainKey(proposalID uint64) []byte { + return ccvtypes.AppendMany( + []byte{ProposedConsumerChainByteKey}, + sdk.Uint64ToBigEndian(proposalID), + ) +} + +// ParseProposedConsumerChainKey get the proposalID in the key +func ParseProposedConsumerChainKey(prefix byte, bz []byte) (uint64, error) { + expectedPrefix := []byte{prefix} + prefixL := len(expectedPrefix) + if prefix := bz[:prefixL]; !bytes.Equal(prefix, expectedPrefix) { + return 0, fmt.Errorf("invalid prefix; expected: %X, got: %X", expectedPrefix, prefix) + } + proposalID := sdk.BigEndianToUint64(bz[prefixL:]) + + return proposalID, nil +} + // // End of generic helpers section // diff --git a/x/ccv/provider/types/keys_test.go b/x/ccv/provider/types/keys_test.go index 9f470f4a82..6d32e49178 100644 --- a/x/ccv/provider/types/keys_test.go +++ b/x/ccv/provider/types/keys_test.go @@ -54,6 +54,7 @@ func getAllKeyPrefixes() []byte { providertypes.ConsumerAddrsToPruneBytePrefix, providertypes.SlashLogBytePrefix, providertypes.VSCMaturedHandledThisBlockBytePrefix, + providertypes.ProposedConsumerChainByteKey, } } @@ -309,3 +310,22 @@ func TestKeysWithUint64Payload(t *testing.T) { } } } + +func TestParseProposedConsumerChainKey(t *testing.T) { + tests := []struct { + chainID string + proposalID uint64 + }{ + {chainID: "1", proposalID: 1}, + {chainID: "some other ID", proposalID: 12}, + {chainID: "some other other chain ID", proposalID: 123}, + } + + for _, test := range tests { + key := providertypes.ProposedConsumerChainKey(test.proposalID) + pID, err := providertypes.ParseProposedConsumerChainKey( + providertypes.ProposedConsumerChainByteKey, key) + require.NoError(t, err) + require.Equal(t, pID, test.proposalID) + } +} diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index eac75ded70..229bb7c7e0 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -1039,6 +1039,138 @@ func (m *QueryRegisteredConsumerRewardDenomsResponse) GetDenoms() []string { return nil } +type QueryProposedChainIDsRequest struct { +} + +func (m *QueryProposedChainIDsRequest) Reset() { *m = QueryProposedChainIDsRequest{} } +func (m *QueryProposedChainIDsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProposedChainIDsRequest) ProtoMessage() {} +func (*QueryProposedChainIDsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_422512d7b7586cd7, []int{21} +} +func (m *QueryProposedChainIDsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposedChainIDsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposedChainIDsRequest.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 *QueryProposedChainIDsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposedChainIDsRequest.Merge(m, src) +} +func (m *QueryProposedChainIDsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProposedChainIDsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposedChainIDsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposedChainIDsRequest proto.InternalMessageInfo + +type QueryProposedChainIDsResponse struct { + ProposedChains []ProposedChain `protobuf:"bytes,1,rep,name=proposedChains,proto3" json:"proposedChains"` +} + +func (m *QueryProposedChainIDsResponse) Reset() { *m = QueryProposedChainIDsResponse{} } +func (m *QueryProposedChainIDsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProposedChainIDsResponse) ProtoMessage() {} +func (*QueryProposedChainIDsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_422512d7b7586cd7, []int{22} +} +func (m *QueryProposedChainIDsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposedChainIDsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposedChainIDsResponse.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 *QueryProposedChainIDsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposedChainIDsResponse.Merge(m, src) +} +func (m *QueryProposedChainIDsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProposedChainIDsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposedChainIDsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposedChainIDsResponse proto.InternalMessageInfo + +func (m *QueryProposedChainIDsResponse) GetProposedChains() []ProposedChain { + if m != nil { + return m.ProposedChains + } + return nil +} + +type ProposedChain struct { + ChainID string `protobuf:"bytes,1,opt,name=chainID,proto3" json:"chainID,omitempty"` + ProposalID uint64 `protobuf:"varint,2,opt,name=proposalID,proto3" json:"proposalID,omitempty"` +} + +func (m *ProposedChain) Reset() { *m = ProposedChain{} } +func (m *ProposedChain) String() string { return proto.CompactTextString(m) } +func (*ProposedChain) ProtoMessage() {} +func (*ProposedChain) Descriptor() ([]byte, []int) { + return fileDescriptor_422512d7b7586cd7, []int{23} +} +func (m *ProposedChain) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposedChain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposedChain.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 *ProposedChain) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposedChain.Merge(m, src) +} +func (m *ProposedChain) XXX_Size() int { + return m.Size() +} +func (m *ProposedChain) XXX_DiscardUnknown() { + xxx_messageInfo_ProposedChain.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposedChain proto.InternalMessageInfo + +func (m *ProposedChain) GetChainID() string { + if m != nil { + return m.ChainID + } + return "" +} + +func (m *ProposedChain) GetProposalID() uint64 { + if m != nil { + return m.ProposalID + } + return 0 +} + func init() { proto.RegisterType((*QueryConsumerGenesisRequest)(nil), "interchain_security.ccv.provider.v1.QueryConsumerGenesisRequest") proto.RegisterType((*QueryConsumerGenesisResponse)(nil), "interchain_security.ccv.provider.v1.QueryConsumerGenesisResponse") @@ -1061,6 +1193,9 @@ func init() { proto.RegisterType((*ThrottledPacketDataWrapper)(nil), "interchain_security.ccv.provider.v1.ThrottledPacketDataWrapper") proto.RegisterType((*QueryRegisteredConsumerRewardDenomsRequest)(nil), "interchain_security.ccv.provider.v1.QueryRegisteredConsumerRewardDenomsRequest") proto.RegisterType((*QueryRegisteredConsumerRewardDenomsResponse)(nil), "interchain_security.ccv.provider.v1.QueryRegisteredConsumerRewardDenomsResponse") + proto.RegisterType((*QueryProposedChainIDsRequest)(nil), "interchain_security.ccv.provider.v1.QueryProposedChainIDsRequest") + proto.RegisterType((*QueryProposedChainIDsResponse)(nil), "interchain_security.ccv.provider.v1.QueryProposedChainIDsResponse") + proto.RegisterType((*ProposedChain)(nil), "interchain_security.ccv.provider.v1.ProposedChain") } func init() { @@ -1068,90 +1203,96 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 1321 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcf, 0x8f, 0x14, 0x45, - 0x18, 0x9d, 0x9e, 0x5d, 0x96, 0xdd, 0x5a, 0x14, 0x2c, 0x10, 0x87, 0x86, 0xcc, 0x60, 0x13, 0x75, - 0x01, 0xed, 0x66, 0x87, 0x98, 0x00, 0xba, 0x0c, 0x33, 0xcb, 0xba, 0x10, 0x20, 0xac, 0xbd, 0x04, - 0x12, 0x35, 0xb4, 0xb5, 0xdd, 0xe5, 0x4c, 0xc7, 0x9e, 0xae, 0xa6, 0xaa, 0x66, 0x96, 0x95, 0x78, - 0x50, 0x13, 0xe5, 0x48, 0x62, 0xbc, 0x79, 0xe0, 0xe4, 0x7f, 0xe1, 0x9d, 0x9b, 0x44, 0x2e, 0x9c, - 0xd0, 0x2c, 0x1e, 0x3c, 0x1a, 0xef, 0x26, 0xa6, 0xab, 0xab, 0x7b, 0x7e, 0xf5, 0xce, 0xf4, 0x0c, - 0xdc, 0x66, 0xaa, 0xeb, 0x7b, 0xdf, 0x7b, 0x6f, 0xbe, 0xaa, 0x7e, 0x03, 0x0c, 0xd7, 0xe7, 0x98, - 0xda, 0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 0x9f, 0xf2, 0xe0, 0x58, 0x86, 0xd7, 0x39, 0xbc, - 0x9e, 0x9d, 0x7a, 0xa6, 0x18, 0xa1, 0xae, 0xbd, 0x3c, 0x40, 0x69, 0xc7, 0x15, 0x61, 0xc7, 0x0a, - 0x5c, 0x1e, 0x6d, 0x07, 0x4d, 0x10, 0x3b, 0x8e, 0x50, 0x81, 0x69, 0x45, 0xf1, 0xa4, 0x76, 0xeb, - 0xd1, 0x76, 0x51, 0x79, 0xbc, 0x5d, 0x54, 0xfe, 0xdc, 0x2e, 0x2a, 0x0f, 0x9e, 0x17, 0x73, 0x8f, - 0x9f, 0x17, 0x73, 0x4f, 0x9f, 0x17, 0x73, 0x9f, 0x2c, 0xd5, 0x5d, 0xde, 0x68, 0x6d, 0xe8, 0x36, - 0x69, 0x1a, 0x36, 0x61, 0x4d, 0xc2, 0xba, 0xfa, 0xbd, 0x97, 0xf4, 0x6b, 0x9f, 0x36, 0xee, 0xf6, - 0xcd, 0xdf, 0x56, 0x80, 0xd9, 0xc6, 0x8c, 0xf8, 0xb7, 0x72, 0xfa, 0xff, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x03, 0xbe, 0x75, 0x9c, 0x41, 0x13, 0x00, 0x00, + // 1418 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcf, 0x6f, 0x13, 0xc7, + 0x17, 0xf7, 0x3a, 0x21, 0x24, 0x2f, 0xfc, 0xd2, 0x84, 0x2f, 0x5f, 0xb3, 0x50, 0x9b, 0x2e, 0x6a, + 0x1b, 0xa0, 0xf5, 0x12, 0xa3, 0x4a, 0x40, 0x1b, 0x42, 0x1c, 0xa7, 0xc1, 0x02, 0x44, 0xba, 0x41, + 0x20, 0xb5, 0x15, 0xcb, 0x64, 0x77, 0xea, 0xac, 0xba, 0xde, 0x5d, 0x76, 0xc6, 0x0e, 0x29, 0xea, + 0x81, 0x56, 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04, 0x02, 0x43, 0xef, 0x7a, 0xc6, 0xcb, 0xb7, + 0x9f, 0x6e, 0xe7, 0xa5, 0x67, 0xdb, 0x79, 0xe9, 0xf7, 0xed, 0xbc, 0xf4, 0xf8, 0x55, 0x3e, 0xf3, + 0xec, 0x55, 0x3e, 0xf3, 0xe2, 0x55, 0x3e, 0xf3, 0xc9, 0x7c, 0xcd, 0x62, 0x1b, 0x8d, 0xf5, 0xa2, + 0xe1, 0xd6, 0x55, 0xc3, 0xa5, 0x75, 0x97, 0xb6, 0x95, 0x79, 0x2f, 0x2e, 0xd3, 0x3c, 0xa7, 0xde, + 0xef, 0x3a, 0x6c, 0x5b, 0x1e, 0xa1, 0xeb, 0x13, 0xfc, 0x97, 0xe8, 0xb9, 0xff, 0x02, 0x00, 0x00, + 0xff, 0xff, 0x1c, 0xfd, 0x42, 0x7e, 0x1d, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1191,6 +1332,9 @@ type QueryClient interface { // QueryRegisteredConsumerRewardDenoms returns a list of consumer reward // denoms that are registered QueryRegisteredConsumerRewardDenoms(ctx context.Context, in *QueryRegisteredConsumerRewardDenomsRequest, opts ...grpc.CallOption) (*QueryRegisteredConsumerRewardDenomsResponse, error) + // QueryProposedConsumerChainIDs query chainIDs in consumerAdditionProposals + // before voting period finishes, after voting period finishes, this chainID will be removed from the result + QueryProposedConsumerChainIDs(ctx context.Context, in *QueryProposedChainIDsRequest, opts ...grpc.CallOption) (*QueryProposedChainIDsResponse, error) } type queryClient struct { @@ -1282,6 +1426,15 @@ func (c *queryClient) QueryRegisteredConsumerRewardDenoms(ctx context.Context, i return out, nil } +func (c *queryClient) QueryProposedConsumerChainIDs(ctx context.Context, in *QueryProposedChainIDsRequest, opts ...grpc.CallOption) (*QueryProposedChainIDsResponse, error) { + out := new(QueryProposedChainIDsResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Query/QueryProposedConsumerChainIDs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // ConsumerGenesis queries the genesis state needed to start a consumer chain @@ -1309,6 +1462,9 @@ type QueryServer interface { // QueryRegisteredConsumerRewardDenoms returns a list of consumer reward // denoms that are registered QueryRegisteredConsumerRewardDenoms(context.Context, *QueryRegisteredConsumerRewardDenomsRequest) (*QueryRegisteredConsumerRewardDenomsResponse, error) + // QueryProposedConsumerChainIDs query chainIDs in consumerAdditionProposals + // before voting period finishes, after voting period finishes, this chainID will be removed from the result + QueryProposedConsumerChainIDs(context.Context, *QueryProposedChainIDsRequest) (*QueryProposedChainIDsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1342,6 +1498,9 @@ func (*UnimplementedQueryServer) QueryThrottledConsumerPacketData(ctx context.Co func (*UnimplementedQueryServer) QueryRegisteredConsumerRewardDenoms(ctx context.Context, req *QueryRegisteredConsumerRewardDenomsRequest) (*QueryRegisteredConsumerRewardDenomsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryRegisteredConsumerRewardDenoms not implemented") } +func (*UnimplementedQueryServer) QueryProposedConsumerChainIDs(ctx context.Context, req *QueryProposedChainIDsRequest) (*QueryProposedChainIDsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryProposedConsumerChainIDs not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1509,6 +1668,24 @@ func _Query_QueryRegisteredConsumerRewardDenoms_Handler(srv interface{}, ctx con return interceptor(ctx, in, info, handler) } +func _Query_QueryProposedConsumerChainIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProposedChainIDsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryProposedConsumerChainIDs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.provider.v1.Query/QueryProposedConsumerChainIDs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryProposedConsumerChainIDs(ctx, req.(*QueryProposedChainIDsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "interchain_security.ccv.provider.v1.Query", HandlerType: (*QueryServer)(nil), @@ -1549,6 +1726,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryRegisteredConsumerRewardDenoms", Handler: _Query_QueryRegisteredConsumerRewardDenoms_Handler, }, + { + MethodName: "QueryProposedConsumerChainIDs", + Handler: _Query_QueryProposedConsumerChainIDs_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "interchain_security/ccv/provider/v1/query.proto", @@ -2293,6 +2474,101 @@ func (m *QueryRegisteredConsumerRewardDenomsResponse) MarshalToSizedBuffer(dAtA return len(dAtA) - i, nil } +func (m *QueryProposedChainIDsRequest) 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 *QueryProposedChainIDsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposedChainIDsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryProposedChainIDsResponse) 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 *QueryProposedChainIDsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposedChainIDsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ProposedChains) > 0 { + for iNdEx := len(m.ProposedChains) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ProposedChains[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ProposedChain) 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 *ProposedChain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposedChain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalID != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalID)) + i-- + dAtA[i] = 0x10 + } + if len(m.ChainID) > 0 { + i -= len(m.ChainID) + copy(dAtA[i:], m.ChainID) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2613,6 +2889,46 @@ func (m *QueryRegisteredConsumerRewardDenomsResponse) Size() (n int) { return n } +func (m *QueryProposedChainIDsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryProposedChainIDsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ProposedChains) > 0 { + for _, e := range m.ProposedChains { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *ProposedChain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainID) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.ProposalID != 0 { + n += 1 + sovQuery(uint64(m.ProposalID)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4486,6 +4802,241 @@ func (m *QueryRegisteredConsumerRewardDenomsResponse) Unmarshal(dAtA []byte) err } return nil } +func (m *QueryProposedChainIDsRequest) 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 ErrIntOverflowQuery + } + 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: QueryProposedChainIDsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposedChainIDsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposedChainIDsResponse) 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 ErrIntOverflowQuery + } + 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: QueryProposedChainIDsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposedChainIDsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposedChains", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposedChains = append(m.ProposedChains, ProposedChain{}) + if err := m.ProposedChains[len(m.ProposedChains)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProposedChain) 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 ErrIntOverflowQuery + } + 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: ProposedChain: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProposedChain: 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalID", wireType) + } + m.ProposalID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/ccv/provider/types/query.pb.gw.go b/x/ccv/provider/types/query.pb.gw.go index 6a249ca2a2..c417c4688c 100644 --- a/x/ccv/provider/types/query.pb.gw.go +++ b/x/ccv/provider/types/query.pb.gw.go @@ -285,6 +285,24 @@ func local_request_Query_QueryRegisteredConsumerRewardDenoms_0(ctx context.Conte } +func request_Query_QueryProposedConsumerChainIDs_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProposedChainIDsRequest + var metadata runtime.ServerMetadata + + msg, err := client.QueryProposedConsumerChainIDs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryProposedConsumerChainIDs_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProposedChainIDsRequest + var metadata runtime.ServerMetadata + + msg, err := server.QueryProposedConsumerChainIDs(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -498,6 +516,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryProposedConsumerChainIDs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryProposedConsumerChainIDs_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryProposedConsumerChainIDs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -719,6 +760,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryProposedConsumerChainIDs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryProposedConsumerChainIDs_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryProposedConsumerChainIDs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -740,6 +801,8 @@ var ( pattern_Query_QueryThrottledConsumerPacketData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "pending_consumer_packets"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryRegisteredConsumerRewardDenoms_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "registered_consumer_reward_denoms"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryProposedConsumerChainIDs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "proposed_consumer_chains"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -760,4 +823,6 @@ var ( forward_Query_QueryThrottledConsumerPacketData_0 = runtime.ForwardResponseMessage forward_Query_QueryRegisteredConsumerRewardDenoms_0 = runtime.ForwardResponseMessage + + forward_Query_QueryProposedConsumerChainIDs_0 = runtime.ForwardResponseMessage ) From 3a3e157b79cfde1aa1213fbb33db67a2ea25e1a3 Mon Sep 17 00:00:00 2001 From: Yaru Wang Date: Mon, 2 Oct 2023 17:19:40 +0200 Subject: [PATCH 22/22] fix test --- tests/e2e/config.go | 22 +++++++++++----------- tests/e2e/state.go | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/e2e/config.go b/tests/e2e/config.go index f17deb9843..f58af0de65 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -395,7 +395,7 @@ func ChangeoverTestConfig() TestConfig { return tr } -func (tr *TestRun) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag string) { +func (s *TestConfig) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag string) { if localSdkPath != "" { fmt.Println("USING LOCAL SDK", localSdkPath) } @@ -403,17 +403,17 @@ func (tr *TestRun) SetDockerConfig(localSdkPath string, useGaia bool, gaiaTag st fmt.Println("USING GAIA INSTEAD OF ICS provider app", gaiaTag) } - tr.useGaia = useGaia - tr.gaiaTag = gaiaTag - tr.localSdkPath = localSdkPath + s.useGaia = useGaia + s.gaiaTag = gaiaTag + s.localSdkPath = localSdkPath } -func (tr *TestRun) SetCometMockConfig(useCometmock bool) { - tr.useCometmock = useCometmock +func (s *TestConfig) SetCometMockConfig(useCometmock bool) { + s.useCometmock = useCometmock } -func (tr *TestRun) SetRelayerConfig(useRly bool) { - tr.useGorelayer = useRly +func (s *TestConfig) SetRelayerConfig(useRly bool) { + s.useGorelayer = useRly } // validateStringLiterals enforces that configs follow the constraints @@ -423,8 +423,8 @@ func (tr *TestRun) SetRelayerConfig(useRly bool) { // within the container will be named as "$CHAIN_ID-$VAL_ID-out" etc. // where this name is constrained to 15 bytes or less. Therefore each string literal // used as a validatorID or chainID needs to be 5 char or less. -func (tr *TestRun) validateStringLiterals() { - for valID, valConfig := range tr.validatorConfigs { +func (s *TestConfig) validateStringLiterals() { + for valID, valConfig := range s.validatorConfigs { if len(valID) > 5 { panic("validator id string literal must be 5 char or less") } @@ -447,7 +447,7 @@ func (tr *TestRun) validateStringLiterals() { } } - for chainID, chainConfig := range tr.chainConfigs { + for chainID, chainConfig := range s.chainConfigs { if len(chainID) > 5 { panic("chain id string literal must be 5 char or less") } diff --git a/tests/e2e/state.go b/tests/e2e/state.go index f4001b4879..41a20bccc8 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -779,7 +779,7 @@ func (tr TestConfig) curlJsonRPCRequest(method, params, address string) { executeCommandWithVerbosity(cmd, "curlJsonRPCRequest", verbosity) } -func (tr TestRun) getProposedConsumerChains(chain ChainID) []string { +func (tr TestConfig) getProposedConsumerChains(chain ChainID) []string { tr.waitBlocks(chain, 1, 10*time.Second) //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. bz, err := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName,