Skip to content

Commit

Permalink
Take into account comments
Browse files Browse the repository at this point in the history
  • Loading branch information
p-offtermatt committed Mar 6, 2024
1 parent 9290a21 commit ccf24af
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
11 changes: 4 additions & 7 deletions tests/mbt/driver/mbt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ func RunItfTrace(t *testing.T, path string) {

for index, state := range trace.States {
t.Log("Height modulo epoch length:", driver.providerChain().CurrentHeader.Height%blocksPerEpoch)
t.Log("Model height:", ProviderHeight(state.VarValues["currentState"].Value.(itf.MapExprType))%modelBlocksPerEpoch)
t.Log("Model height modulo epoch length:", ProviderHeight(state.VarValues["currentState"].Value.(itf.MapExprType))%modelBlocksPerEpoch)
t.Logf("Reading state %v of trace %v", index, path)

// store the height of the provider state before each step.
// The height should only pass an epoch when there passes an epoch in the model, too,
// The height should only pass an epoch when it passes an epoch in the model, too,
// otherwise there is an error, and blocksPerEpoch needs to be increased.
// See the comment for blocksPerEpoch above.
heightBeforeStep := driver.providerHeight()
Expand Down Expand Up @@ -273,8 +273,8 @@ func RunItfTrace(t *testing.T, path string) {

// we need at least 2 blocks, because for a packet sent at height H, the receiving chain
// needs a header of height H+1 to accept the packet
// so, we do `blocksPerEpoch` time advancements with a very small increment,
// and then increment the rest of the time
// so, we do two blocks, one with a very small increment,
// and then another to increment the rest of the time
runningConsumersBefore := driver.runningConsumers()

driver.endAndBeginBlock("provider", 1*time.Nanosecond)
Expand Down Expand Up @@ -558,9 +558,6 @@ func ComparePacketQueues(
consumer string,
timeOffset time.Time,
) {
if consumer == "consumer1" {
return
}
t.Helper()
ComparePacketQueue(t, driver, currentModelState, PROVIDER, consumer, timeOffset)
ComparePacketQueue(t, driver, currentModelState, consumer, PROVIDER, timeOffset)
Expand Down
10 changes: 0 additions & 10 deletions tests/mbt/driver/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,16 +397,6 @@ func (s *Driver) ConfigureNewPath(consumerChain, providerChain *ibctesting.TestC
// their channel, and are ready for anything to happen.
s.consumerKeeper(consumerChainId).SetProviderChannel(s.ctx(consumerChainId), consumerEndPoint.ChannelID)

// Commit a block on the consumer to get a header
lastConsumerHeader, _ := simibc.EndBlock(consumerChain, func() {})

// Begin a block on the consumer to get it ready for testing
simibc.BeginBlock(consumerChain, 5)

// Update the client on the provider with the latest consumer header
err = simibc.UpdateReceiverClient(consumerEndPoint, providerEndPoint, lastConsumerHeader, false)
require.NoError(s.t, err, "Error updating client on consumer for chain %v", consumerChain.ChainID)

// path is ready to go
return path
}
Expand Down
2 changes: 1 addition & 1 deletion tests/mbt/model/ccv.qnt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ module ccv_types {
// Stores VscPackets which have been sent but where the provider has *not received a response yet*.
sentVscPacketsToConsumer: Chain -> List[VscPacket],

// stores for which consumer chains, in this epoch, the validator set is considered to have changed and we thus need to send a vscPacket to the consumer chains.
// stores for which consumer chains, in this epoch, the validator set is considered to have changed and we thus need to send a VscPacket to the consumer chains.
consumersWithPowerChangesInThisEpoch: Set[Chain],

// stores, for each consumer chain, its current status -
Expand Down
2 changes: 1 addition & 1 deletion tests/mbt/model/ccv_model.qnt
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ module ccv_model {
// change voting power on provider again
VotingPowerChange("node1", 50).then(
// end the epoch
EndProviderEpoch(3 * Second, Set(), Set())
EndProviderEpoch(1 * Second, Set(), Set())
)
.then(
// deliver packet to consumer1
Expand Down

0 comments on commit ccf24af

Please sign in to comment.