Skip to content

Commit

Permalink
Track ibc-rs changes in PR #600 (#137)
Browse files Browse the repository at this point in the history
* Update ibc and ibc-query rev frields in cargo.toml

* Implement delete_* methods for IbcContext

* Fix clippy warnings

* Run cargo fmt

* Update cargo.toml

* Add basecoin integration steps to readme

* Update Cargo.toml rev

* Update cargo.lock

* chore: set trusting_period=2m to hit pruning mechanism

* fix: set to 3m

* Update ibc revs

---------

Co-authored-by: Farhad Shabani <[email protected]>
  • Loading branch information
seanchen1991 and Farhad-Shabani authored Oct 19, 2023
1 parent cf1633d commit ae4d7e4
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 47 deletions.
91 changes: 54 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ base64 = { version = "0.21", default-features = false, features = ["alloc"] }
displaydoc = { version = "0.2", default-features = false }
derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display"] }
ed25519 = { version = "2.1.0", default-features = false }
ibc = { git ="https://github.com/cosmos/ibc-rs", rev = "56273f6" }
ibc-query = { git ="https://github.com/cosmos/ibc-rs", rev = "56273f6" }
ibc = { git ="https://github.com/cosmos/ibc-rs", rev = "52ea3ef" }
ibc-query = { git ="https://github.com/cosmos/ibc-rs", rev = "52ea3ef" }
ibc-proto = { version = "0.37.1", default-features = false }
ics23 = { version = "0.11", default-features = false }
ics23 = { version = "0.11", default-features = false }
prost = { version = "0.12", default-features = false }
serde = "1.0"
serde_json = "1.0"
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ So far this app has been tested with:
* Rust >v1.52.1
* CometBFT v0.37

## Usage
## How to integrate ibc-rs changes into basecoin
Since basecoin serves as a suite of integration tests against ibc-rs's functionality, each ibc-rs
PR also requires an accompanying basecoin PR. The steps to do this are:
1. In a new branch in basecoin, update ibc [revisions][revs] with the latest commit of the ibc-rs PR.
2. Implement the necessary changes in basecoin in order to get it working with the latest commit revision of ibc-rs.
3. Run `cargo clippy --all-features` and `cargo clippy --no-default-features` and fix any issues that clippy raises.
4. Open a PR in the basecoin-rs repository, making sure to the link to the associated ibc-rs PR.
5. Check to see if the [integration tests][integration-tests] pass.

## Starting up an instance of basecoin
### Step 1: Reset your local CometBFT node
```shell
$ cometbft init
Expand Down Expand Up @@ -69,3 +78,6 @@ $ cometbft node
![class diagram](docs/images/class-diagram.png)
---
![activity diagram - DeliverTx](docs/images/activity-diagram-deliverTx.png)

[revs]: https://github.com/informalsystems/basecoin-rs/blob/9610b29067ba122808d1d14354a32e2005b54517/Cargo.toml#L15-L16
[integration-tests]: https://github.com/informalsystems/basecoin-rs/blob/8f744c8356569d5f87a546f46d1ade247ebe5256/.github/workflows/integration.yml#L1
2 changes: 1 addition & 1 deletion ci/cometbft-config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ enable = false
rpc_servers = ""
trust_height = 0
trust_hash = ""
trust_period = "168h0m0s"
trust_period = "3m"

# Time to spend discovering snapshots before initiating a restore.
discovery_time = "15s"
Expand Down
6 changes: 4 additions & 2 deletions ci/hermes-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ key_name = 'testkey'
store_prefix = 'ibc'
gas_price = { price = 0.001, denom = 'stake' }
clock_drift = '5s'
trusting_period = '14days'
# `trusting_period` default value is '14days', but for the purpose of testing
# the consensus state pruning mechanism of Tendermint client it is set to '3m'
trusting_period = '3m'

[chains.trust_threshold]
numerator = '1'
Expand All @@ -29,7 +31,7 @@ key_name = 'testkey'
store_prefix = 'ibc'
gas_price = { price = 0.001, denom = 'basecoin' }
clock_drift = '5s'
trusting_period = '14days'
trusting_period = '3m'
proof_specs = '''
[
{
Expand Down
2 changes: 2 additions & 0 deletions ci/one-chain
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ if [ $platform = 'linux' ]; then
sed -i 's#"localhost:6060"#"localhost:'"$PROF_PORT"'"#g' $CHAIN_DIR/$CHAIN_ID/config/config.toml
sed -i 's/timeout_commit = "5s"/timeout_commit = "1s"/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml
sed -i 's/timeout_propose = "3s"/timeout_propose = "1s"/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml
sed -i 's/trust_period = "168h0m0s"/trust_period = "3m"/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml
sed -i 's/index_all_keys = false/index_all_keys = true/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml
# sed -i '' 's#index-events = \[\]#index-events = \["message.action","send_packet.packet_src_channel","send_packet.packet_sequence"\]#g' $CHAIN_DIR/$CHAIN_ID/config/app.toml
else
Expand All @@ -135,6 +136,7 @@ else
sed -i '' 's#"localhost:6060"#"localhost:'"$PROF_PORT"'"#g' $CHAIN_DIR/$CHAIN_ID/config/config.toml
sed -i '' 's/timeout_commit = "5s"/timeout_commit = "1s"/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml
sed -i '' 's/timeout_propose = "3s"/timeout_propose = "1s"/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml
sed -i '' 's/trust_period = "168h0m0s"/trust_period = "3m"/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml
sed -i '' 's/index_all_keys = false/index_all_keys = true/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml
# sed -i '' 's/min-retain-blocks = 0/min-retain-blocks = 100/g' $CHAIN_DIR/$CHAIN_ID/config/app.toml
# sed -i '' 's#index-events = \[\]#index-events = \["message.action","send_packet.packet_src_channel","send_packet.packet_sequence"\]#g' $CHAIN_DIR/$CHAIN_ID/config/app.toml
Expand Down
Loading

0 comments on commit ae4d7e4

Please sign in to comment.