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

MBT: check that clients and connections match those in the model #704

Closed
wants to merge 131 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
413d3f4
Add ICS02 model
vitorenesduarte Feb 2, 2021
065631e
Add MBT test driver
vitorenesduarte Feb 2, 2021
b98c7d3
Add ICS02TestExecutor
vitorenesduarte Feb 2, 2021
6685cc1
Add another apalache counterexample
vitorenesduarte Feb 2, 2021
f863486
Fix ICS02.tla: client counter starts at 0
vitorenesduarte Feb 2, 2021
cd0d0a6
Check for errors in MockContext.deliver
vitorenesduarte Feb 2, 2021
02c020b
Handle errors in MBT tests
vitorenesduarte Feb 2, 2021
a5d06c5
Remove SyntheticTendermint mock context
vitorenesduarte Feb 2, 2021
356c6d2
More idiomatic check_next_state
vitorenesduarte Feb 2, 2021
6ab8611
Buffered file reads
vitorenesduarte Feb 3, 2021
490d77b
Make extract_handler_error_kind generic over the IBC handler
vitorenesduarte Feb 3, 2021
92b843c
Support multiple chains in MBT
vitorenesduarte Feb 3, 2021
d57cf41
Make eyre a dev-dependency
vitorenesduarte Feb 3, 2021
f4dbe00
s/ICS0/IBC on TLA files
vitorenesduarte Feb 3, 2021
20867a5
Initial support for conn open init
vitorenesduarte Feb 3, 2021
e5e2f7b
Start connection and channel identifiers at 0
vitorenesduarte Feb 3, 2021
b9ca90a
Add conn open init to TLA spec
vitorenesduarte Feb 3, 2021
f3cd434
Represent clients with a record in TLA spec
vitorenesduarte Feb 3, 2021
4167d29
Finish connection open init
vitorenesduarte Feb 3, 2021
7755fec
s/state/step
vitorenesduarte Feb 3, 2021
70e70f6
Minimize diff
vitorenesduarte Feb 4, 2021
44747d3
Merge branch 'master' into vitor/ics02_mbt
vitorenesduarte Feb 4, 2021
41d34d3
Modularize TLA spec
vitorenesduarte Feb 4, 2021
1f9881c
TLA format convention
vitorenesduarte Feb 4, 2021
e2605bb
s/Null/None
vitorenesduarte Feb 4, 2021
5b98a7e
Sketch conn open try; Model chain's height
vitorenesduarte Feb 4, 2021
244efa6
Bound model space
vitorenesduarte Feb 4, 2021
7d9202a
Only update chain height upon success
vitorenesduarte Feb 4, 2021
28879f0
Check that chain heights match the ones in the model
vitorenesduarte Feb 4, 2021
a870537
Sketch conn open try
vitorenesduarte Feb 4, 2021
a533def
Sketch conn open try
vitorenesduarte Feb 4, 2021
1cdb02a
Model missing connections and connection mismatches in conn open try
vitorenesduarte Feb 4, 2021
0186a1c
Trigger bug in conn open try
vitorenesduarte Feb 4, 2021
f777144
Merge branch 'master' into vitor/ics02_mbt
vitorenesduarte Feb 4, 2021
6b6cd43
Go back to previous way of generating connection and channel ids
vitorenesduarte Feb 4, 2021
6186bec
Disable failing MBT test
vitorenesduarte Feb 4, 2021
a7b50d7
Fix panic in conn open try when no connection id is provided
vitorenesduarte Feb 5, 2021
5b66aac
ICS02TestExecutor -> IBCTestExecutor
vitorenesduarte Feb 5, 2021
095433e
Merge branch 'vitor/conn_open_try' into vitor/ics02_mbt
vitorenesduarte Feb 5, 2021
f2194cf
Failing MBT test now passes with #615
vitorenesduarte Feb 5, 2021
7bdd3b6
Add notes on MBT
vitorenesduarte Feb 8, 2021
9ee48bd
Remove ICS02
vitorenesduarte Feb 8, 2021
035651e
Add README
vitorenesduarte Feb 8, 2021
b6854ce
Improve README
vitorenesduarte Feb 8, 2021
cd484a6
Remove MBT intro
vitorenesduarte Feb 8, 2021
d69d15e
new lines
vitorenesduarte Feb 8, 2021
b4aea95
Merge branch 'master' into vitor/ics02_mbt
vitorenesduarte Feb 9, 2021
5e9dd63
Make MBT README more easily discoverable
vitorenesduarte Feb 9, 2021
fb20ce0
IBCTestExecutor: Map from ChainId (instead of String) to MockContext
vitorenesduarte Feb 9, 2021
75db6bb
s/epoch/revision
vitorenesduarte Feb 9, 2021
a102863
Move from eyre to thiserror
vitorenesduarte Feb 9, 2021
2e5d6de
Improve README
vitorenesduarte Feb 9, 2021
dfb683d
Improve README
vitorenesduarte Feb 9, 2021
7e24841
Improve arguments order in modelator::test
vitorenesduarte Feb 9, 2021
5d6bf08
Improve chain identifiers
vitorenesduarte Feb 10, 2021
60e4aba
Improve README
vitorenesduarte Feb 10, 2021
c700ba5
Start ICS03
vitorenesduarte Feb 10, 2021
c1206ae
Merge branch 'master' into vitor/mbt_ics03
vitorenesduarte Feb 11, 2021
7233987
Store all client heights and improve names in model output actions to…
vitorenesduarte Feb 11, 2021
ca8b839
Parse Action as an internally tagged enum
vitorenesduarte Feb 11, 2021
01b557b
merge master
vitorenesduarte Feb 12, 2021
b37982a
Separate action apply from action outcome checking
vitorenesduarte Feb 12, 2021
acbe0d8
improve conn open try enabling condition
vitorenesduarte Feb 12, 2021
28ee9a9
Fix IBCTests.tla
vitorenesduarte Feb 12, 2021
129ff9b
Add connectionProofs to each chain in TLA model
vitorenesduarte Feb 17, 2021
1d6d5e9
Generate actions in the handlers
vitorenesduarte Feb 18, 2021
00afd55
Save proofs in counterparty chain upon a successful action
vitorenesduarte Feb 18, 2021
8a2581d
Reduce state space
vitorenesduarte Feb 18, 2021
cf54ff4
Update tests
vitorenesduarte Feb 18, 2021
5e04972
Fix ICS02UpdateClient
vitorenesduarte Feb 18, 2021
a8023f2
Allow a conn open try to succeed only after a conn open init
vitorenesduarte Feb 19, 2021
e9af4de
Improve modelator's error
vitorenesduarte Feb 19, 2021
3575491
Generate tests
vitorenesduarte Feb 19, 2021
5170cc1
Add MockContext::host_oldest_height
vitorenesduarte Feb 19, 2021
3b83a64
Update CHANGELOG
vitorenesduarte Feb 19, 2021
fc6a238
Update CHANGELOG
vitorenesduarte Feb 19, 2021
5663b14
Merge branch 'vitor/overflow' into vitor/mbt_ics03
vitorenesduarte Feb 19, 2021
4da1d34
Fix conn open ack tests
vitorenesduarte Feb 19, 2021
56382c4
Update CHANGELOG.md
vitorenesduarte Feb 19, 2021
c851c33
Remove MockContext::host_chain_history_size
vitorenesduarte Feb 19, 2021
9b6d29a
Merge branch 'vitor/overflow' of https://github.com/informalsystems/i…
vitorenesduarte Feb 19, 2021
f4e8c27
Fix clippy
vitorenesduarte Feb 19, 2021
7fa9932
Fix clippy
vitorenesduarte Feb 19, 2021
d5aa60a
Merge branch 'vitor/overflow' into vitor/mbt_ics03
vitorenesduarte Feb 19, 2021
b4f31b2
Fix ICS03_ConnectionOpenTry
vitorenesduarte Feb 19, 2021
4bd0ea9
Finish connection open try
vitorenesduarte Feb 19, 2021
87bd1d7
Start conn open ack
vitorenesduarte Feb 19, 2021
b1115a9
merge master
vitorenesduarte Feb 19, 2021
daccb9b
merge master
vitorenesduarte Feb 19, 2021
f751e0e
handle ICS03ConnectionOpenAckOK
vitorenesduarte Feb 19, 2021
04b60bb
Merge branch 'master' into vitor/overflow
vitorenesduarte Feb 19, 2021
a2f40c8
merge master
vitorenesduarte Feb 19, 2021
1c6bd3a
Add conn open ack
vitorenesduarte Feb 20, 2021
ff4fbde
potential bug
vitorenesduarte Feb 22, 2021
ebb8569
Finish conn open ack
vitorenesduarte Feb 22, 2021
5f10217
Add conn open confirm
vitorenesduarte Feb 22, 2021
5a051af
Fix conn open ack
vitorenesduarte Feb 22, 2021
122210b
add conn open ack and conn open confirm failing tests
vitorenesduarte Feb 22, 2021
ac70ba3
updated height on successful conn open confirm
vitorenesduarte Feb 22, 2021
1d63ca9
Allow a conn open ack to succeed
vitorenesduarte Feb 22, 2021
b889b7b
Remove invalid test
vitorenesduarte Feb 22, 2021
abc29d8
merge vitor/open-ack
vitorenesduarte Feb 22, 2021
52a3390
enable all tests
vitorenesduarte Feb 22, 2021
0ef4b5a
merge master
vitorenesduarte Feb 22, 2021
a173dcd
update CHANGELOG
vitorenesduarte Feb 22, 2021
d25cc7b
fix CHANGELOG
vitorenesduarte Feb 22, 2021
96c4c6e
Merge branch 'vitor/open-ack' into vitor/mbt_ics03
vitorenesduarte Feb 22, 2021
067fc0c
fix CHANGELOG
vitorenesduarte Feb 22, 2021
809effb
Minimize diff
vitorenesduarte Feb 22, 2021
a3e95d3
Minimize diff
vitorenesduarte Feb 22, 2021
bf7c81d
Update README
vitorenesduarte Feb 22, 2021
731dcc9
Fix clippy
vitorenesduarte Feb 22, 2021
7269ee2
Merge branch 'vitor/open-ack' into vitor/mbt_ics03
vitorenesduarte Feb 22, 2021
ce23256
update README
vitorenesduarte Feb 22, 2021
6c7ee61
update README
vitorenesduarte Feb 22, 2021
53e2a08
Make MsgConnectionOpenAck.counterparty_connection_id not an Option
vitorenesduarte Feb 22, 2021
93a133b
Merge branch 'vitor/open-ack' into vitor/mbt_ics03
vitorenesduarte Feb 22, 2021
dda8c6f
Make MsgConnectionOpenAck.counterparty_connection_id not an Option
vitorenesduarte Feb 22, 2021
40adce4
Merge branch 'vitor/open-ack' into vitor/mbt_ics03
vitorenesduarte Feb 22, 2021
a8dbfe1
Fix test executor
vitorenesduarte Feb 22, 2021
0c5e9e4
Update README.md
vitorenesduarte Feb 22, 2021
eabf89d
Update README.md
vitorenesduarte Feb 22, 2021
4b0910a
merge master
vitorenesduarte Feb 23, 2021
6ca5e46
Parse more chain state from the couterexamples
vitorenesduarte Feb 23, 2021
fa7f9c9
Check that clients match the one in the model
vitorenesduarte Feb 23, 2021
6b66f7e
Uninit -> Uninitialized
vitorenesduarte Feb 23, 2021
391643f
Merge branch 'vitor/mbt_ics03' into vitor/629
vitorenesduarte Feb 23, 2021
a40fe43
Check that connections match the one in the model
vitorenesduarte Feb 23, 2021
39265b7
fmt
vitorenesduarte Feb 23, 2021
2025a9c
merge master
vitorenesduarte Mar 2, 2021
b1decfb
WIP dbg
vitorenesduarte Mar 3, 2021
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
4 changes: 2 additions & 2 deletions modules/src/ics03_connection/connection.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::convert::{TryFrom, TryInto};
use std::str::FromStr;

use serde::Serialize;
use serde::{Deserialize, Serialize};
use tendermint_proto::Protobuf;

use ibc_proto::ibc::core::connection::v1::{
Expand Down Expand Up @@ -248,7 +248,7 @@ impl Counterparty {
}
}

#[derive(Clone, Debug, PartialEq, Eq, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum State {
Uninitialized = 0,
Init = 1,
Expand Down
5 changes: 5 additions & 0 deletions modules/tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mbt:
cargo t --features mocks -- --nocapture mbt

stateright:
cargo t --features mocks -- --nocapture stateright
75 changes: 69 additions & 6 deletions modules/tests/executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ pub mod modelator;
pub mod step;

use ibc::ics02_client::client_def::{AnyClientState, AnyConsensusState, AnyHeader};
use ibc::ics02_client::client_type::ClientType;
use ibc::ics02_client::context::ClientReader;
use ibc::ics02_client::error::Kind as ICS02ErrorKind;
use ibc::ics02_client::msgs::create_client::MsgCreateAnyClient;
use ibc::ics02_client::msgs::update_client::MsgUpdateAnyClient;
use ibc::ics02_client::msgs::ClientMsg;
use ibc::ics03_connection::connection::Counterparty;
use ibc::ics03_connection::connection::{Counterparty, State as ConnectionState};
use ibc::ics03_connection::error::Kind as ICS03ErrorKind;
use ibc::ics03_connection::msgs::conn_open_ack::MsgConnectionOpenAck;
use ibc::ics03_connection::msgs::conn_open_confirm::MsgConnectionOpenConfirm;
Expand All @@ -27,6 +27,7 @@ use ibc::mock::header::MockHeader;
use ibc::mock::host::HostType;
use ibc::proofs::{ConsensusProof, Proofs};
use ibc::Height;
use ibc::{ics02_client::client_type::ClientType, ics04_channel::context::ChannelReader};
use std::collections::HashMap;
use std::error::Error;
use std::fmt::{Debug, Display};
Expand Down Expand Up @@ -200,11 +201,72 @@ impl IBCTestExecutor {
self.contexts.values().all(|ctx| ctx.validate().is_ok())
}

/// Check that chain heights match the ones in the model.
pub fn check_chain_heights(&self, chains: HashMap<String, Chain>) -> bool {
/// Check that chain states match the ones in the model.
pub fn check_chain_states(&self, chains: HashMap<String, Chain>) -> bool {
chains.into_iter().all(|(chain_id, chain)| {
let ctx = self.chain_context(chain_id);
ctx.query_latest_height() == Self::height(chain.height)
// check that heights match
let heights_match = ctx.query_latest_height() == Self::height(chain.height);

// check that clients match
let clients_match = chain.clients.into_iter().all(|(client_id, client)| {
client.heights.into_iter().all(|height| {
// check that each consensus state from the model exists
ctx.consensus_state(&Self::client_id(client_id), Self::height(height))
.is_some()
})
});

// check that connections match
let connections_match =
chain
.connections
.into_iter()
.all(|(connection_id, connection)| {
if connection.state == ConnectionState::Uninitialized {
// if the connection has not yet been initialized, then
// there's nothing to check
true
} else {
if let Some(connection_end) =
ctx.connection_end(&Self::connection_id(connection_id))
{
println!("END: {:?}", connection_end);
// states must match
let states_match = *connection_end.state() == connection.state;

// client ids must match
let client_ids = *connection_end.client_id()
== Self::client_id(connection.client_id.unwrap());

// counterparty client ids must match
let counterparty_client_ids = *connection_end
.counterparty()
.client_id()
== Self::client_id(connection.counterparty_client_id.unwrap());

// counterparty connection ids must match
let counterparty_connection_ids =
connection_end.counterparty().connection_id()
== connection
.counterparty_connection_id
.map(|connection_id| Self::connection_id(connection_id))
.as_ref();

states_match
&& client_ids
&& counterparty_client_ids
&& counterparty_connection_ids
} else {
// if the connection exists in the model, then it must
// also exist in the implementation; in this case it
// doesn't, so we fail the verification
false
}
}
});

heights_match && clients_match && connections_match
})
}

Expand Down Expand Up @@ -360,6 +422,7 @@ impl modelator::TestExecutor<Step> for IBCTestExecutor {

fn next_step(&mut self, step: Step) -> bool {
let result = self.apply(step.action);
println!("{:?} vs {:?}", result, step.action_outcome);
let outcome_matches = match step.action_outcome {
ActionOutcome::None => panic!("unexpected action outcome"),
ActionOutcome::ICS02CreateOK => result.is_ok(),
Expand Down Expand Up @@ -406,6 +469,6 @@ impl modelator::TestExecutor<Step> for IBCTestExecutor {
ActionOutcome::ICS03ConnectionOpenConfirmOK => result.is_ok(),
};
// also check the state of chains
outcome_matches && self.validate_chains() && self.check_chain_heights(step.chains)
outcome_matches && self.validate_chains() && self.check_chain_states(step.chains)
}
}
1 change: 1 addition & 0 deletions modules/tests/executor/modelator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ where
let step_count = steps.len();

for (i, step) in steps.iter().enumerate() {
println!("({}/{}) {:?}", i + 1, step_count, step);
// check the step
let ok = if i == 0 {
executor.initial_step(step.clone())
Expand Down
64 changes: 48 additions & 16 deletions modules/tests/executor/step.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use ibc::ics03_connection::connection::State as ConnectionState;
use serde::{Deserialize, Deserializer};
use std::collections::HashMap;
use std::fmt::Debug;
Expand Down Expand Up @@ -53,7 +54,7 @@ pub enum Action {
chain_id: String,

#[serde(alias = "previousConnectionId")]
#[serde(default, deserialize_with = "deserialize_connection_id")]
#[serde(default, deserialize_with = "deserialize_id")]
previous_connection_id: Option<u64>,

#[serde(alias = "clientId")]
Expand Down Expand Up @@ -105,21 +106,6 @@ pub enum Action {
},
}

/// On the model, a non-existing `connection_id` is represented with -1.
/// For this reason, this function maps a `Some(-1)` to a `None`.
fn deserialize_connection_id<'de, D>(deserializer: D) -> Result<Option<u64>, D::Error>
where
D: Deserializer<'de>,
{
let connection_id: Option<i64> = Deserialize::deserialize(deserializer)?;
let connection_id = if connection_id == Some(-1) {
None
} else {
connection_id.map(|connection_id| connection_id as u64)
};
Ok(connection_id)
}

#[derive(Debug, Clone, PartialEq, Deserialize)]
pub enum ActionOutcome {
None,
Expand All @@ -143,4 +129,50 @@ pub enum ActionOutcome {
#[derive(Debug, Clone, PartialEq, Deserialize)]
pub struct Chain {
pub height: u64,

pub clients: HashMap<u64, Client>,

pub connections: HashMap<u64, Connection>,
}

#[derive(Debug, Clone, PartialEq, Deserialize)]
pub struct Client {
pub heights: Vec<u64>,
}

#[derive(Debug, Clone, PartialEq, Deserialize)]
pub struct Connection {
#[serde(alias = "clientId")]
#[serde(default, deserialize_with = "deserialize_id")]
pub client_id: Option<u64>,

#[serde(alias = "connectionId")]
#[serde(default, deserialize_with = "deserialize_id")]
pub connection_id: Option<u64>,

#[serde(alias = "counterpartyClientId")]
#[serde(default, deserialize_with = "deserialize_id")]
pub counterparty_client_id: Option<u64>,

#[serde(alias = "counterpartyConnectionId")]
#[serde(default, deserialize_with = "deserialize_id")]
pub counterparty_connection_id: Option<u64>,

pub state: ConnectionState,
}

/// On the model, a non-existing `client_id` and a `connection_id` is
/// represented with -1.
/// For this reason, this function maps a `Some(-1)` to a `None`.
fn deserialize_id<'de, D>(deserializer: D) -> Result<Option<u64>, D::Error>
where
D: Deserializer<'de>,
{
let id: Option<i64> = Deserialize::deserialize(deserializer)?;
let id = if id == Some(-1) {
None
} else {
id.map(|id| id as u64)
};
Ok(id)
}
7 changes: 7 additions & 0 deletions modules/tests/gen_tests_loop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

cd support/model_based/
gen_tests.py
cd -
make

30 changes: 16 additions & 14 deletions modules/tests/mbt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@ const TESTS_DIR: &str = "tests/support/model_based/tests";
#[test]
fn mbt() {
let tests = vec![
"ICS02CreateOKTest",
"ICS02UpdateOKTest",
"ICS02ClientNotFoundTest",
"ICS02HeaderVerificationFailureTest",
"ICS03ConnectionOpenInitOKTest",
"ICS03MissingClientTest",
"ICS03ConnectionOpenTryOKTest",
"ICS03InvalidConsensusHeightTest",
"ICS03ConnectionNotFoundTest",
"ICS03ConnectionMismatchTest",
"ICS03MissingClientConsensusStateTest",
// "ICS02CreateOKTest",
// "ICS02UpdateOKTest",
// "ICS02ClientNotFoundTest",
// "ICS02HeaderVerificationFailureTest",
// "ICS03ConnectionOpenInitOKTest",
// "ICS03MissingClientTest",
// "ICS03ConnectionOpenTryOKTest",
"ICS03ConnectionOpenTryStateInitTest",
// "ICS03InvalidConsensusHeightTest",
// "ICS03ConnectionNotFoundTest",
// "ICS03ConnectionMismatchTest",
// "ICS03MissingClientConsensusStateTest",
// TODO: the following test should fail but doesn't because proofs are
// not yet verified
// "ICS03InvalidProofTest",
"ICS03ConnectionOpenAckOKTest",
"ICS03UninitializedConnectionTest",
"ICS03ConnectionOpenConfirmOKTest",
// "ICS03ConnectionOpenAckOKTest",
// "ICS03UninitializedConnectionTest",
// "ICS03ConnectionOpenAckTryOpenStateTest",
// "ICS03ConnectionOpenConfirmOKTest",
];

for test in tests {
Expand Down
11 changes: 11 additions & 0 deletions modules/tests/support/model_based/IBCTests.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

CONSTANTS
ChainIds = {"chainA", "chainB"}
MaxChainHeight = 5
MaxClientsPerChain = 1
MaxConnectionsPerChain = 1

INIT InitTest
NEXT NextTest

INVARIANT ICS03ConnectionOpenTryStateInitTestNeg
29 changes: 28 additions & 1 deletion modules/tests/support/model_based/IBCTests.tla
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
------------------------------ MODULE IBCTests --------------------------------

EXTENDS IBC
EXTENDS IBC, Sequences

VARIABLE
previousChains

PreviousConnectionState(chainId, connectionId) ==
previousChains[chainId].connections[connectionId].state

InitTest ==
/\ Init
/\ previousChains = chains

NextTest ==
/\ Next
/\ previousChains' = chains

ICS02CreateOKTest ==
/\ actionOutcome = "ICS02CreateOK"
Expand All @@ -23,6 +37,12 @@ ICS03MissingClientTest ==
ICS03ConnectionOpenTryOKTest ==
/\ actionOutcome = "ICS03ConnectionOpenTryOK"

ICS03ConnectionOpenTryStateInitTest ==
/\ action.type = "ICS03ConnectionOpenTry"
/\ action.previousConnectionId /= -1
/\ PreviousConnectionState(action.chainId, action.previousConnectionId) = "Init"
/\ actionOutcome = "ICS03ConnectionOpenTryOK"

ICS03InvalidConsensusHeightTest ==
/\ actionOutcome = "ICS03InvalidConsensusHeight"

Expand All @@ -41,6 +61,11 @@ ICS03InvalidProofTest ==
ICS03ConnectionOpenAckOKTest ==
/\ actionOutcome = "ICS03ConnectionOpenAckOK"

ICS03ConnectionOpenAckStateTryOpenTest ==
/\ action.type = "ICS03ConnectionOpenAck"
/\ PreviousConnectionState(action.chainId, action.connectionId) = "TryOpen"
/\ actionOutcome = "ICS03ConnectionOpenAckOK"

ICS03UninitializedConnectionTest ==
/\ actionOutcome = "ICS03UninitializedConnection"

Expand All @@ -61,6 +86,7 @@ ICS03MissingClientTestNeg == ~ICS03MissingClientTest

\* ICS03ConnectionOpenTry tests
ICS03ConnectionOpenTryOKTestNeg == ~ICS03ConnectionOpenTryOKTest
ICS03ConnectionOpenTryStateInitTestNeg == ~ICS03ConnectionOpenTryStateInitTest
ICS03InvalidConsensusHeightTestNeg == ~ICS03InvalidConsensusHeightTest
ICS03ConnectionNotFoundTestNeg == ~ICS03ConnectionNotFoundTest
ICS03ConnectionMismatchTestNeg == ~ICS03ConnectionMismatchTest
Expand All @@ -69,6 +95,7 @@ ICS03InvalidProofTestNeg == ~ICS03InvalidProofTest

\* ICS03ConnectionOpenAck tests
ICS03ConnectionOpenAckOKTestNeg == ~ICS03ConnectionOpenAckOKTest
ICS03ConnectionOpenAckStateTryOpenTestNeg == ~ICS03ConnectionOpenAckStateTryOpenTest
ICS03UninitializedConnectionTestNeg == ~ICS03UninitializedConnectionTest

\* ICS03ConnectionOpenConfirm tests
Expand Down
5 changes: 5 additions & 0 deletions modules/tests/support/model_based/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
check:
apalache-mc check --length=16 --nworkers=12 --inv=ModelNeverErrors IBC.tla

test:
apalache-mc check --inv=ICS03ConnectionMismatchTestNeg IBCTests.tla
Loading