Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add epochs to MBT #1676

Merged
merged 47 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
01daa3c
cleanup ./changelog entries
mpoke Jan 11, 2024
1ab7c20
rebase
insumity Feb 23, 2024
efe8cb1
fix!: Validation of SlashAcks fails due to marshaling to Bech32 (bac…
mergify[bot] Jan 19, 2024
a5c1d4e
docs: update changelog for v4.0.0 (#1578)
mpoke Jan 22, 2024
c03587c
docs: prepare for v4.0.0 (#1581)
mpoke Jan 22, 2024
6c39a2f
added proto declaration
insumity Feb 21, 2024
ddae681
temp commit
insumity Feb 21, 2024
c9b1b3e
temp commit
insumity Feb 21, 2024
e0861e2
more changes
insumity Feb 21, 2024
d6cd207
first commit
insumity Feb 22, 2024
d144c39
add param and fix tests
insumity Feb 23, 2024
44d13cd
reduce epoch size for e2e
insumity Feb 23, 2024
076ec8b
clean up
insumity Feb 23, 2024
a56b6e0
mbt fix
insumity Feb 23, 2024
36afb40
fix diff bug
insumity Feb 26, 2024
481fd88
cleaning up
insumity Feb 26, 2024
35385dd
cleaning up
insumity Feb 26, 2024
27290f6
cleaning up
insumity Feb 26, 2024
c707c54
cleaning up
insumity Feb 26, 2024
cf8bdb8
cleaning up
insumity Feb 27, 2024
ead0873
cleaning up
insumity Feb 27, 2024
88081cd
added more tests
insumity Feb 27, 2024
f6397ad
more fixes
insumity Feb 27, 2024
bee8c10
nit fixes
insumity Feb 27, 2024
abb4abc
cleaning up
insumity Feb 27, 2024
30f2061
increase downtime by one block
insumity Feb 28, 2024
e986692
fix logs
insumity Feb 28, 2024
8aa1dc9
took into account Marius' comments
insumity Feb 28, 2024
16958bc
tiny fixes
insumity Feb 28, 2024
513a75d
Update x/ccv/provider/keeper/params.go
insumity Feb 29, 2024
2208cd4
use Bech32 addresses as keys for maps
insumity Feb 29, 2024
914840c
refactor nextBlocks(epoch) to nextEpoch
insumity Mar 1, 2024
3164a09
Start adding epochs
p-offtermatt Mar 1, 2024
4fe6b75
Adjust tests for epochs
p-offtermatt Mar 1, 2024
af9df64
Use invariant script instead of handwriting Makefile
p-offtermatt Mar 1, 2024
614ff82
Fix key assignment valset invariant
p-offtermatt Mar 1, 2024
a16c49a
Add better run_invariants script
p-offtermatt Mar 1, 2024
bf9552b
Start adding epochs from trace into driver
p-offtermatt Mar 1, 2024
f7b38da
Remove new block creation during consumer chain setup
p-offtermatt Mar 4, 2024
9290a21
Adjust model for epochs
p-offtermatt Mar 4, 2024
ccf24af
Take into account comments
p-offtermatt Mar 6, 2024
9dba765
Merge branch 'feat/epochs' into ph/mbt-epochs
p-offtermatt Mar 8, 2024
9f1d40c
Revert changes to actions.go
p-offtermatt Mar 8, 2024
4edaae2
Revert changes to x/
p-offtermatt Mar 8, 2024
edf8cd0
Remove unused listMul
p-offtermatt Mar 8, 2024
769dc15
Advance time by epochLength instead of 1 second
p-offtermatt Mar 8, 2024
46e8e4e
Indent condition and clarify EndProviderEpoch
p-offtermatt Mar 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,8 @@ test-trace:
# Note: this is *not* using the Quint models to test the system,
# this tests/verifies the Quint models *themselves*.
verify-models:
quint test tests/mbt/model/ccv_test.qnt;\
quint test tests/mbt/model/ccv_model.qnt;\
quint run --invariant "all{ValidatorUpdatesArePropagatedInv,ValidatorSetHasExistedInv,SameVscPacketsInv,MatureOnTimeInv,EventuallyMatureOnProviderInv}" tests/mbt/model/ccv_model.qnt --max-steps 200 --max-samples 200;\
quint run --invariant "all{ValidatorUpdatesArePropagatedKeyAssignmentInv,ValidatorSetHasExistedKeyAssignmentInv,SameVscPacketsKeyAssignmentInv,MatureOnTimeInv,EventuallyMatureOnProviderInv,KeyAssignmentRulesInv}" tests/mbt/model/ccv_model.qnt --step stepKeyAssignment --max-steps 200 --max-samples 200
cd tests/mbt/model;\
../run_invariants.sh



Expand Down
14 changes: 14 additions & 0 deletions proto/interchain_security/ccv/provider/v1/provider.proto
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ message Params {
// The fee required to be paid to add a reward denom
cosmos.base.v1beta1.Coin consumer_reward_denom_registration_fee = 9
[ (gogoproto.nullable) = false ];

// The number of blocks that comprise an epoch.
int64 blocks_per_epoch = 10;
}

// SlashAcks contains cons addresses of consumer chain validators
Expand Down Expand Up @@ -295,3 +298,14 @@ message ConsumerAddrsToPrune {
uint64 vsc_id = 2;
AddressList consumer_addrs = 3;
}

// ConsumerValidator is used to facilitate epoch-based transitions. It contains relevant info for
// a validator that is expected to validate on a consumer chain during an epoch.
message ConsumerValidator {
// validator's consensus address on the provider chain
bytes provider_cons_addr = 1;
// voting power the validator has during this epoch
int64 power = 2;
// public key the validator uses on the consumer chain during this epoch
tendermint.crypto.PublicKey consumer_public_key = 3;
}
8 changes: 7 additions & 1 deletion tests/e2e/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,9 @@ func (tr TestConfig) relayPacketsGorelayer(
target ExecutionTarget,
verbose bool,
) {
tr.waitBlocks(action.ChainA, 3, 90*time.Second)
tr.waitBlocks(action.ChainB, 3, 90*time.Second)

pathName := tr.GetPathNameForGorelayer(action.ChainA, action.ChainB)

// rly transact relay-packets [path-name] --channel [channel-id]
Expand All @@ -1331,6 +1334,9 @@ func (tr TestConfig) relayPacketsHermes(
target ExecutionTarget,
verbose bool,
) {
tr.waitBlocks(action.ChainA, 3, 90*time.Second)
tr.waitBlocks(action.ChainB, 3, 90*time.Second)

// hermes clear packets ibc0 transfer channel-13
cmd := target.ExecCommand("hermes", "clear", "packets",
"--chain", string(tr.chainConfigs[action.ChainA].ChainId),
Expand Down Expand Up @@ -1639,7 +1645,7 @@ func (tr TestConfig) invokeDowntimeSlash(action DowntimeSlashAction, target Exec
// Bring validator down
tr.setValidatorDowntime(action.Chain, action.Validator, true, target, verbose)
// Wait appropriate amount of blocks for validator to be slashed
tr.waitBlocks(action.Chain, 10, 3*time.Minute)
tr.waitBlocks(action.Chain, 11, 3*time.Minute)
// Bring validator back up
tr.setValidatorDowntime(action.Chain, action.Validator, false, target, verbose)
}
Expand Down
33 changes: 20 additions & 13 deletions tests/e2e/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ func SlashThrottleTestConfig() TestConfig {
".app_state.slashing.params.downtime_jail_duration = \"60s\" | " +
".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\" | " +
".app_state.provider.params.slash_meter_replenish_fraction = \"0.10\" | " +
".app_state.provider.params.slash_meter_replenish_period = \"20s\"",
".app_state.provider.params.slash_meter_replenish_period = \"20s\" | " +
".app_state.provider.params.blocks_per_epoch = 2",
},
ChainID("consu"): {
ChainId: ChainID("consu"),
Expand All @@ -249,7 +250,7 @@ func SlashThrottleTestConfig() TestConfig {
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.signed_blocks_window = \"20\" | " +
".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\" | " +
Expand Down Expand Up @@ -288,7 +289,8 @@ func DefaultTestConfig() TestConfig {
".app_state.slashing.params.downtime_jail_duration = \"60s\" | " +
".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\" | " +
".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\" | " + // This disables slash packet throttling
".app_state.provider.params.slash_meter_replenish_period = \"3s\"",
".app_state.provider.params.slash_meter_replenish_period = \"3s\" | " +
".app_state.provider.params.blocks_per_epoch = 2",
},
ChainID("consu"): {
ChainId: ChainID("consu"),
Expand All @@ -297,7 +299,7 @@ func DefaultTestConfig() TestConfig {
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.signed_blocks_window = \"20\" | " +
".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\"",
Expand All @@ -317,7 +319,8 @@ func DemocracyTestConfig(allowReward bool) TestConfig {
".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\" | " +
".app_state.transfer.params.send_enabled = false"
".app_state.transfer.params.send_enabled = false | " +
".app_state.provider.params.blocks_per_epoch = 2"

if allowReward {
// This allows the consumer chain to send rewards in the stake denom
Expand Down Expand Up @@ -347,7 +350,8 @@ func DemocracyTestConfig(allowReward bool) TestConfig {
".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\" | " +
".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\"", // This disables slash packet throttling
".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\" | " + // This disables slash packet throttling
".app_state.provider.params.blocks_per_epoch = 2",
},
ChainID("democ"): {
ChainId: ChainID("democ"),
Expand Down Expand Up @@ -389,7 +393,8 @@ func MultiConsumerTestConfig() TestConfig {
".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\" | " +
".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\"", // This disables slash packet throttling
".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\" | " + // This disables slash packet throttling
".app_state.provider.params.blocks_per_epoch = 2",
},
ChainID("consu"): {
ChainId: ChainID("consu"),
Expand All @@ -398,7 +403,7 @@ func MultiConsumerTestConfig() TestConfig {
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.signed_blocks_window = \"20\" | " +
".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\"",
Expand All @@ -410,7 +415,7 @@ func MultiConsumerTestConfig() TestConfig {
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.signed_blocks_window = \"20\" | " +
".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\"",
Expand Down Expand Up @@ -448,7 +453,8 @@ func ChangeoverTestConfig() TestConfig {
".app_state.slashing.params.downtime_jail_duration = \"60s\" | " +
".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\" | " +
".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\" | " + // This disables slash packet throttling
".app_state.provider.params.slash_meter_replenish_period = \"3s\"",
".app_state.provider.params.slash_meter_replenish_period = \"3s\" | " +
".app_state.provider.params.blocks_per_epoch = 2",
},
ChainID("sover"): {
ChainId: ChainID("sover"),
Expand All @@ -458,7 +464,7 @@ func ChangeoverTestConfig() TestConfig {
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.signed_blocks_window = \"20\" | " +
".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\" | " +
Expand Down Expand Up @@ -548,7 +554,8 @@ func ConsumerMisbehaviourTestConfig() TestConfig {
".app_state.slashing.params.downtime_jail_duration = \"60s\" | " +
".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\" | " +
".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\" | " + // This disables slash packet throttling
".app_state.provider.params.slash_meter_replenish_period = \"3s\"",
".app_state.provider.params.slash_meter_replenish_period = \"3s\" | " +
".app_state.provider.params.blocks_per_epoch = 2",
},
ChainID("consu"): {
ChainId: ChainID("consu"),
Expand All @@ -557,7 +564,7 @@ func ConsumerMisbehaviourTestConfig() TestConfig {
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.signed_blocks_window = \"20\" | " +
".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\"",
Expand Down
11 changes: 10 additions & 1 deletion tests/integration/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func delegateAndRedelegate(s *CCVTestSuite, delAddr sdk.AccAddress,
srcValTokensAfter := s.getVal(s.providerCtx(), srcValAddr).GetBondedTokens()
s.Require().Equal(srcValTokensAfter.Sub(srcValTokensBefore), amount)

s.providerChain.NextBlock()
s.nextEpoch()

dstValTokensBefore := s.getVal(s.providerCtx(), dstValAddr).GetBondedTokens()

Expand Down Expand Up @@ -625,3 +625,12 @@ func (s *CCVTestSuite) mustGetStakingValFromTmVal(tmVal tmtypes.Validator) (stak
s.Require().True(found)
return stakingVal
}

// nextEpoch moves `chain` forward by an epoch
func (s *CCVTestSuite) nextEpoch() {
blocksPerEpoch := s.providerApp.GetProviderKeeper().GetParams(s.providerCtx()).BlocksPerEpoch

for i := int64(0); i < blocksPerEpoch; i++ {
s.providerChain.NextBlock()
}
}
6 changes: 3 additions & 3 deletions tests/integration/distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (s *CCVTestSuite) TestRewardsDistribution() {
bondAmt := sdk.NewInt(10000000)
delAddr := s.providerChain.SenderAccount.GetAddress()
delegate(s, delAddr, bondAmt)
s.providerChain.NextBlock()
s.nextEpoch()

// register a consumer reward denom
params := s.consumerApp.GetConsumerKeeper().GetConsumerParams(s.consumerCtx())
Expand Down Expand Up @@ -124,7 +124,7 @@ func (s *CCVTestSuite) TestSendRewardsRetries() {
bondAmt := sdk.NewInt(10000000)
delAddr := s.providerChain.SenderAccount.GetAddress()
delegate(s, delAddr, bondAmt)
s.providerChain.NextBlock()
s.nextEpoch()

// Register denom on consumer chain
params := s.consumerApp.GetConsumerKeeper().GetConsumerParams(s.consumerCtx())
Expand Down Expand Up @@ -253,7 +253,7 @@ func (s *CCVTestSuite) TestEndBlockRD() {
bondAmt := sdk.NewInt(10000000)
delAddr := s.providerChain.SenderAccount.GetAddress()
delegate(s, delAddr, bondAmt)
s.providerChain.NextBlock()
s.nextEpoch()

if tc.denomRegistered {
params := s.consumerApp.GetConsumerKeeper().GetConsumerParams(s.consumerCtx())
Expand Down
16 changes: 8 additions & 8 deletions tests/integration/expired_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ func (s *CCVTestSuite) TestVSCPacketSendExpiredClient() {
delegate(s, delAddr, bondAmt)

// try to send CCV packet to consumer
s.providerChain.NextBlock()
s.nextEpoch()

// check that the packet was added to the list of pending VSC packets
packets := providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.consumerChain.ChainID)
s.Require().NotEmpty(packets, "no pending VSC packets found")
s.Require().Equal(1, len(packets), "unexpected number of pending VSC packets")

// try again to send CCV packet to consumer
s.providerChain.NextBlock()
s.nextEpoch()

// check that the packet is still in the list of pending VSC packets
packets = providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.consumerChain.ChainID)
Expand All @@ -52,7 +52,7 @@ func (s *CCVTestSuite) TestVSCPacketSendExpiredClient() {
delegate(s, delAddr, bondAmt)

// try again to send CCV packets to consumer
s.providerChain.NextBlock()
s.nextEpoch()

// check that the packets are still in the list of pending VSC packets
packets = providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.consumerChain.ChainID)
Expand All @@ -62,8 +62,8 @@ func (s *CCVTestSuite) TestVSCPacketSendExpiredClient() {
// upgrade expired client to the consumer
upgradeExpiredClient(s, Consumer)

// go to next block
s.providerChain.NextBlock()
// go to next epoch
s.nextEpoch()

// check that the packets are not in the list of pending VSC packets
packets = providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.consumerChain.ChainID)
Expand All @@ -73,7 +73,7 @@ func (s *CCVTestSuite) TestVSCPacketSendExpiredClient() {
// - bond more tokens on provider to change validator powers
delegate(s, delAddr, bondAmt)
// - send CCV packet to consumer
s.providerChain.NextBlock()
s.nextEpoch()
// - relay all VSC packet from provider to consumer
relayAllCommittedPackets(s, s.providerChain, s.path, ccv.ProviderPortID, s.path.EndpointB.ChannelID, 3)
// - increment time so that the unbonding period ends on the consumer
Expand Down Expand Up @@ -102,7 +102,7 @@ func (s *CCVTestSuite) TestConsumerPacketSendExpiredClient() {
delegate(s, delAddr, bondAmt)

// send CCV packets to consumer
s.providerChain.NextBlock()
s.nextEpoch()

// check that the packets are not in the list of pending VSC packets
providerPackets := providerKeeper.GetPendingVSCPackets(s.providerCtx(), s.consumerChain.ChainID)
Expand Down Expand Up @@ -172,7 +172,7 @@ func (s *CCVTestSuite) TestConsumerPacketSendExpiredClient() {
// - bond more tokens on provider to change validator powers
delegate(s, delAddr, bondAmt)
// - send CCV packet to consumer
s.providerChain.NextBlock()
s.nextEpoch()
// - relay 1 VSC packet from provider to consumer
relayAllCommittedPackets(s, s.providerChain, s.path, ccv.ProviderPortID, s.path.EndpointB.ChannelID, 1)
// - increment time so that the unbonding period ends on the provider
Expand Down
18 changes: 9 additions & 9 deletions tests/integration/key_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (s *CCVTestSuite) TestKeyAssignment() {
}

// check that a VSCPacket is queued
s.providerChain.NextBlock()
s.nextEpoch()
pendingPackets := pk.GetPendingVSCPackets(s.providerCtx(), s.consumerChain.ChainID)
s.Require().Len(pendingPackets, 1)

Expand All @@ -51,7 +51,7 @@ func (s *CCVTestSuite) TestKeyAssignment() {
if err != nil {
return err
}
s.providerChain.NextBlock()
s.nextEpoch()

return nil
}, false, 2,
Expand All @@ -73,7 +73,7 @@ func (s *CCVTestSuite) TestKeyAssignment() {
delAddr := s.providerChain.SenderAccount.GetAddress()
delegate(s, delAddr, bondAmt)

s.providerChain.NextBlock()
s.nextEpoch()

return nil
}, false, 2,
Expand All @@ -95,7 +95,7 @@ func (s *CCVTestSuite) TestKeyAssignment() {
if err != nil {
return err
}
s.providerChain.NextBlock()
s.nextEpoch()

return nil
}, true, 2,
Expand All @@ -118,7 +118,7 @@ func (s *CCVTestSuite) TestKeyAssignment() {
if err != nil {
return err
}
s.providerChain.NextBlock()
s.nextEpoch()

return nil
}, false, 2,
Expand All @@ -134,14 +134,14 @@ func (s *CCVTestSuite) TestKeyAssignment() {
if err != nil {
return err
}
s.providerChain.NextBlock()
s.nextEpoch()

// same key assignment
err = pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey)
if err != nil {
return err
}
s.providerChain.NextBlock()
s.nextEpoch()

return nil
}, true, 2,
Expand All @@ -157,15 +157,15 @@ func (s *CCVTestSuite) TestKeyAssignment() {
if err != nil {
return err
}
s.providerChain.NextBlock()
s.nextEpoch()

// same key assignment
validator, consumerKey = generateNewConsumerKey(s, 0)
err = pk.AssignConsumerKey(s.providerCtx(), s.consumerChain.ChainID, validator, consumerKey)
if err != nil {
return err
}
s.providerChain.NextBlock()
s.nextEpoch()

return nil
}, false, 3,
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ func (suite *CCVTestSuite) SetupTest() {
suite.registerPacketSniffer(suite.providerChain)
providerKeeper := suite.providerApp.GetProviderKeeper()

// set `BlocksPerEpoch` to 10: a reasonable small value greater than 1 that prevents waiting for too
// many blocks and slowing down the integration tests
params := providerKeeper.GetParams(suite.providerCtx())
params.BlocksPerEpoch = 10
providerKeeper.SetParams(suite.providerCtx(), params)

// re-assign all validator keys for the first consumer chain
providerKeeper.SetPendingConsumerAdditionProp(suite.providerCtx(), &types.ConsumerAdditionProposal{
ChainId: icstestingutils.FirstConsumerChainID,
Expand Down
Loading
Loading