Skip to content

Commit

Permalink
Update steps_downtime.go
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz committed Jul 21, 2023
1 parent 46251c9 commit 9b39582
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions tests/e2e/steps_downtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func stepsThrottledDowntime(consumerName string) []Step {
validator: validatorID("bob"),
},
state: State{
// powers not affected on either chain yet
// slash packet queued on consumer, but powers not affected on either chain yet
chainID("provi"): ChainState{
ValPowers: &map[validatorID]uint{
validatorID("alice"): 511,
Expand All @@ -295,6 +295,39 @@ func stepsThrottledDowntime(consumerName string) []Step {
},
},
},
// Relay packets so bob is jailed on provider,
// 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,
},
// no provider throttling engaged yet
GlobalSlashQueueSize: uintPointer(0),
ConsumerChainQueueSizes: &map[chainID]uint{
chainID(consumerName): uint(0),
},
},
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,
},
},
},
},
{
action: downtimeSlashAction{
chain: chainID(consumerName),
Expand All @@ -305,11 +338,12 @@ func stepsThrottledDowntime(consumerName string) []Step {
chainID("provi"): ChainState{
ValPowers: &map[validatorID]uint{
validatorID("alice"): 511,
validatorID("bob"): 500,
validatorID("bob"): 0,
validatorID("carol"): 500,
},
},
chainID(consumerName): ChainState{
// VSC packet applying jailing is not yet relayed to consumer
ValPowers: &map[validatorID]uint{
validatorID("alice"): 511,
validatorID("bob"): 500,
Expand Down Expand Up @@ -338,10 +372,9 @@ func stepsThrottledDowntime(consumerName string) []Step {
},
},
chainID(consumerName): ChainState{
// no updates received on consumer
ValPowers: &map[validatorID]uint{
validatorID("alice"): 511,
validatorID("bob"): 500,
validatorID("bob"): 0,
validatorID("carol"): 500,
},
},
Expand Down Expand Up @@ -373,7 +406,7 @@ func stepsThrottledDowntime(consumerName string) []Step {
// no updates received on consumer
ValPowers: &map[validatorID]uint{
validatorID("alice"): 511,
validatorID("bob"): 500,
validatorID("bob"): 0,
validatorID("carol"): 500,
},
},
Expand Down

0 comments on commit 9b39582

Please sign in to comment.