forked from ComposableFi/picasso
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: fix scripts run node * feat: save state * fix: push wasm code gov * feat: add store wasm code * test: use correct version go.mod * fix: store wasm code 50 * update relayer hyperspace raw scripts * feat: use notional fork to handle decode grandpa url * change the name of creatae clients file * chore: change delay period to 10 * fix type url grandpa not registered * chore: add hyperspace and cwgranpda wasm file * feat: update make file * docs: add how to reproduce the error * fix miss chain-id * feat: add scripts to config and start relayer * fix: correcting go sum * deps: update go version * test: setup relayer with sdk 50 * setup gas auto * update script test-upgrade --------- Co-authored-by: kienn6034 <[email protected]>
- Loading branch information
Showing
30 changed files
with
436 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Running the test | ||
|
||
## How did i build the `hyperspace` and `cw-grandpa` binaries | ||
Go to the `ComposableFi/composable-ibc`, and building it in the master branch | ||
|
||
https://github.com/ComposableFi/composable-ibc/tree/master/hyperspace | ||
|
||
## How to reproduce the case | ||
|
||
1. Build the `picad` binary | ||
```bash | ||
make install | ||
``` | ||
|
||
2. Run the localnet pica with `wasmClient` deployed | ||
```bash | ||
make localnet-pica | ||
``` | ||
|
||
3. Run the localnet picasso | ||
```bash | ||
make localnet-picasso` | ||
``` | ||
|
||
4. Run create clients | ||
```bash | ||
make relayer-create-clients | ||
``` | ||
|
||
|
||
# Current issue | ||
## Client State decode into 08-wasm | ||
`6981` | ||
### Logging msg at ValidateBasic on cosmos side on v47 | ||
add this log at ValidateBasic() function, at modules/core/02-client/types/msgs/go | ||
|
||
```go | ||
fmt.Printf("msg.ClientState : %v\n", msg.ClientState) | ||
clientState, err := UnpackClientState(msg.ClientState) | ||
if err != nil { | ||
return err | ||
} | ||
``` | ||
then, i get this value, basically, it says the clientState constructed from hyperspace is `08-wasm` | ||
``` | ||
msg.ClientState : &Any{TypeUrl:/ibc.lightclients.wasm.v1.ClientState,Value:[10 204 1 10 40 47 105 98 99 46 108 105 103 104 116 99 108 105 101 110 116 115 46 103 114 97 110 100 112 97 46 118 49 46 67 108 105 101 110 116 83 116 97 116 101 18 159 1 10 32 146 240 69 84 49 1 104 67 240 92 67 123 199 101 70 152 115 0 205 47 91 76 8 16 108 92 254 197 173 59 35 206 16 67 24 5 40 2 48 167 16 56 20 66 36 10 32 199 203 131 204 79 173 68 214 92 44 140 240 46 150 66 83 144 154 219 206 75 174 118 245 90 177 194 134 163 255 44 194 16 1 66 36 10 32 20 164 40 156 190 217 24 43 102 84 102 53 144 50 192 109 195 183 142 183 238 104 52 237 95 167 180 159 149 51 85 167 16 1 66 36 10 32 184 160 36 189 114 208 123 150 110 8 135 7 155 93 135 60 197 160 19 53 186 39 222 219 43 141 20 36 169 95 136 128 16 1 18 32 157 80 86 242 181 81 33 48 148 160 59 120 141 184 2 116 68 81 117 186 231 140 143 237 227 139 242 90 45 220 132 188 26 5 8 167 16 16 20],XXX_unrecognized:[]} | ||
``` | ||
### Logging it at v50 | ||
`hyperspace` | ||
``` | ||
msg.ClientState : &Any{TypeUrl:/ibc.lightclients.grandpa.v1.ClientState,Value:[10 32 106 46 120 116 154 178 37 115 118 3 65 47 241 205 37 168 10 129 250 125 20 121 236 81 77 119 185 185 155 72 122 11 16 17 40 2 48 167 16 56 1 66 36 10 32 199 203 131 204 79 173 68 214 92 44 140 240 46 150 66 83 144 154 219 206 75 174 118 245 90 177 194 134 163 255 44 194 16 1 66 36 10 32 20 164 40 156 190 217 24 43 102 84 102 53 144 50 192 109 195 183 142 183 238 104 52 237 95 167 180 159 149 51 85 167 16 1 66 36 10 32 184 160 36 189 114 208 123 150 110 8 135 7 155 93 135 60 197 160 19 53 186 39 222 219 43 141 20 36 169 95 136 128 16 1 66 36 10 32 140 4 179 243 122 62 235 12 208 118 154 107 153 87 196 106 60 118 44 155 224 91 89 26 250 8 121 224 61 159 194 212 16 1],XXX_unrecognized:[]} |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
KEY=mykey | ||
DENOM="ppica" | ||
HOME_DIR="mytestnet" | ||
CHAINID="centauri-dev" | ||
BINARY=picad | ||
WASM_CONTRACT_PATH="/Users/kien6034/notional/projects/composable-ibc/target/wasm32-unknown-unknown/release/ics10_grandpa_cw.wasm" | ||
|
||
# Create a proposale to store wasm code | ||
$BINARY tx ibc-wasm store-code $WASM_CONTRACT_PATH --title "migrate new contract" --summary "none" --from $KEY --keyring-backend test --home $HOME_DIR --deposit 10000000000${DENOM} --gas 20002152622 --fees 20020166${DENOM} -y | ||
|
||
# Fetch proposal id | ||
sleep 6 | ||
$BINARY query gov proposals -o json > tmp-proposals.json | ||
PROPOSAL_ID=$(jq -r '.proposals[-1].id' tmp-proposals.json) | ||
echo "Proposal ID is: $PROPOSAL_ID" | ||
rm -rf tmp-proposals.json | ||
|
||
# Validator vote yes | ||
$BINARY tx gov vote $PROPOSAL_ID yes --from $KEY --fees 100000${DENOM} --keyring-backend test --home $HOME_DIR --chain-id $CHAINID -y | ||
|
||
#Voting time is 20s, check in localnode.sh | ||
sleep 20 | ||
|
||
# Check the status | ||
$BINARY query gov proposal $PROPOSAL_ID -o json > tmp-proposal.json | ||
STATUS=$(jq -r '.proposal.status' tmp-proposal.json) | ||
echo "Proposal status is: $STATUS" | ||
|
||
# Query newly wasm checksums | ||
CHECKSUM=$($BINARY query ibc-wasm checksums -o json | jq -r '.checksums[-1]') | ||
|
||
|
||
|
||
##### Migrate the contract |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
KEY=mykey | ||
DENOM="ppica" | ||
HOME_DIR="mytestnet" | ||
CHAINID="centauri-dev" | ||
BINARY=picad | ||
WASM_CONTRACT_PATH="$PWD/bin/ics10_grandpa_cw.wasm" | ||
|
||
# Wait for chain to start | ||
echo "Waiting for chain to start..." | ||
sleep 10 | ||
# Create a proposale to store wasm code | ||
$BINARY tx ibc-wasm store-code $WASM_CONTRACT_PATH --title "store new wasm code" --summary "none" --from $KEY --keyring-backend test --chain-id $CHAINID --home $HOME_DIR --deposit 10000000000${DENOM} --gas 20002152622 --fees 20020166${DENOM} -y | ||
|
||
# Fetch proposal id | ||
sleep 6 | ||
$BINARY query gov proposals -o json > /tmp/proposals.json | ||
PROPOSAL_ID=$(jq -r '.proposals[-1].id' /tmp/proposals.json) | ||
echo "Proposal ID is: $PROPOSAL_ID" | ||
|
||
# Validator vote yes | ||
$BINARY tx gov vote $PROPOSAL_ID yes --from $KEY --fees 100000${DENOM} --keyring-backend test --home $HOME_DIR --chain-id $CHAINID -y | ||
|
||
#Voting time is 20s, check in localnode.sh | ||
sleep 20 | ||
|
||
# Check the status | ||
$BINARY query gov proposal $PROPOSAL_ID -o json > /tmp/proposal.json | ||
STATUS=$(jq -r '.proposal.status' /tmp/proposal.json) | ||
echo "Proposal status is: $STATUS" | ||
|
||
# Query wasm checksums | ||
$BINARY query ibc-wasm checksums |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/bash | ||
BINARY=$1 | ||
CHAINID="localpica" | ||
MONIKER="localtestnet" | ||
KEYALGO="secp256k1" | ||
KEYRING="test" | ||
LOGLEVEL="info" | ||
CONTINUE=${CONTINUE:-"false"} | ||
# to trace evm | ||
#TRACE="--trace" | ||
TRACE="" | ||
|
||
KEY="test0" | ||
KEY1="test1" | ||
KEY2="test2" | ||
|
||
HOME_DIR=mytestnet | ||
DENOM=${2:-ppica} | ||
|
||
|
||
if [ "$CONTINUE" == "true" ]; then | ||
echo "\n ->> continuing from previous state" | ||
$BINARY start --home $HOME_DIR --log_level debug | ||
exit 0 | ||
fi | ||
|
||
|
||
# remove existing daemon | ||
rm -rf $HOME_DIR | ||
|
||
$BINARY config keyring-backend $KEYRING | ||
$BINARY config chain-id $CHAINID | ||
# if $KEY exists it should be deleted | ||
|
||
$BINARY init $CHAINID --chain-id $CHAINID --default-denom $DENOM --home $HOME_DIR >/dev/null 2>&1 | ||
|
||
|
||
echo "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry" | $BINARY keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO --recover --home $HOME_DIR | ||
|
||
$BINARY keys add $KEY1 --keyring-backend $KEYRING --home $HOME_DIR | ||
$BINARY keys add $KEY2 --keyring-backend $KEYRING --home $HOME_DIR | ||
$BINARY keys add $KEY3 --keyring-backend $KEYRING --home $HOME_DIR | ||
|
||
|
||
update_test_genesis () { | ||
# update_test_genesis '.consensus_params["block"]["max_gas"]="100000000"' | ||
cat $HOME_DIR/config/genesis.json | jq "$1" > $HOME_DIR/config/tmp_genesis.json && mv $HOME_DIR/config/tmp_genesis.json $HOME_DIR/config/genesis.json | ||
} | ||
|
||
# Allocate genesis accounts (cosmos formatted addresses) | ||
$BINARY add-genesis-account $KEY 100000000000000000000000000$DENOM --keyring-backend $KEYRING --home $HOME_DIR | ||
$BINARY add-genesis-account $KEY1 100000000000000000000000000$DENOM --keyring-backend $KEYRING --home $HOME_DIR | ||
$BINARY add-genesis-account $KEY2 100000000000000000000000000$DENOM --keyring-backend $KEYRING --home $HOME_DIR | ||
$BINARY add-genesis-account $KEY3 100000000000000000000000000$DENOM --keyring-backend $KEYRING --home $HOME_DIR | ||
|
||
|
||
# Sign genesis transaction | ||
$BINARY gentx $KEY 1000000000000000000000$DENOM --keyring-backend $KEYRING --chain-id $CHAINID --home $HOME_DIR | ||
|
||
update_test_genesis '.app_state["gov"]["params"]["voting_period"]="5s"' | ||
update_test_genesis '.app_state["mint"]["params"]["mint_denom"]="'$DENOM'"' | ||
update_test_genesis '.app_state["gov"]["params"]["min_deposit"]=[{"denom":"'$DENOM'","amount": "100"}]' | ||
update_test_genesis '.app_state["crisis"]["constant_fee"]={"denom":"'$DENOM'","amount":"1000"}' | ||
update_test_genesis '.app_state["staking"]["params"]["bond_denom"]="'$DENOM'"' | ||
|
||
# sed -i 's/timeout_commit = "5s"/timeout_commit = "500ms"/' $HOME_DIR/config/config.toml | ||
|
||
echo "updating.." | ||
sed -i '' 's/timeout_commit = "5s"/timeout_commit = "500ms"/' $HOME_DIR/config/config.toml | ||
|
||
# Collect genesis tx | ||
$BINARY collect-gentxs --home $HOME_DIR | ||
|
||
# Run this to ensure everything worked and that the genesis file is setup correctly | ||
$BINARY validate-genesis --home $HOME_DIR | ||
|
||
$BINARY start --rpc.unsafe --rpc.laddr tcp://0.0.0.0:26657 --pruning=nothing --minimum-gas-prices=0.000ppica --home $HOME_DIR | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
echo "kill composable node" | ||
pkill -f picad | ||
rm -rf mytestnet | ||
|
||
|
||
echo "Cleanign up devnet-picasso containers..." | ||
# The image name you want to stop containers for | ||
IMAGE_NAME="composablefi/devnet-picasso" | ||
|
||
# Find the container ID(s) for containers running this image | ||
CONTAINER_IDS=$(docker ps --filter "ancestor=$IMAGE_NAME" --format "{{.ID}}") | ||
|
||
# Stop the container(s) | ||
for ID in $CONTAINER_IDS; do | ||
echo "Stopping container $ID..." | ||
docker stop $ID | ||
done | ||
|
||
echo "Cleanup complete." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
type = "parachain" | ||
name = "picasso_dev" | ||
para_id = 2000 | ||
parachain_rpc_url = "ws://127.0.0.1:9988" | ||
relay_chain_rpc_url = "ws://127.0.0.1:9944" | ||
client_id = "08-wasm-0" | ||
connection_id = "connection-0" | ||
commitment_prefix = "0x6962632f" | ||
private_key = "//Alice" | ||
ss58_version = 49 | ||
channel_whitelist = [["channel-0", "transfer"], ["channel-0", "transfer"]] | ||
finality_protocol = "Grandpa" | ||
key_type = "sr25519" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
type = "cosmos" | ||
name = "centauri" | ||
rpc_url = "http://127.0.0.1:26657/" | ||
grpc_url = "http://127.0.0.1:9090/" | ||
websocket_url = "ws://127.0.0.1:26657/websocket" | ||
chain_id = "centauri-dev" | ||
client_id = "07-tendermint-1" | ||
connection_id = "connection-0" | ||
account_prefix = "pica" | ||
fee_denom = "ppica" | ||
fee_amount = "9223372036854776" | ||
gas_limit = 9223372036854775806 | ||
store_prefix = "ibc" | ||
max_tx_size = 20000000 | ||
wasm_code_id = "9d5056f2b551213094a03b788db80274445175bae78c8fede38bf25a2ddc84bc" | ||
channel_whitelist = [["channel-0", "transfer"], ["channel-0", "transfer"]] | ||
mnemonic = "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry" | ||
skip_optional_client_updates = false | ||
max_packets_to_process = 50 | ||
skip_tokens_list = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
prometheus_endpoint = "https://127.0.0.1" |
Oops, something went wrong.