-
Notifications
You must be signed in to change notification settings - Fork 11
follow up relayer update about parallelizing chain prove #44
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
Open
dai1975
wants to merge
17
commits into
v0.5
Choose a base branch
from
features/lo7181
base: v0.5
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
0dbeef3
update relayer
c5a4abe
long tendermint chain-upgrade timeout
1bb3187
add make target to remove deploying info for convenience
e724c20
use debug prover
1cf8491
support fakelost
2b9d064
Update tests/cases/tm2eth/scripts/test-service
dai1975 ad98a03
Update tests/cases/tm2eth/scripts/test-service
dai1975 d32f2c6
fix env variable name change
cfc787f
update yui-relayer version
1b55d94
Merge remote-tracking branch 'origin/features/lo7181' into features/l…
24f6859
remove unused code and rename
5d2d66c
run service before sending tx in test-service
f7b8072
use debug chain module
9252361
unset PRUNE_AFTER_BLOCKS_CHAIN when exec query channel-upgrade
54317e7
update yrly
750eacb
remove local replace in go.mod
02344ee
bump up yui-relayer to v0.5.19
siburu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,55 @@ | ||
| #!/bin/bash | ||
|
|
||
| : <<'END_COMMENT' | ||
| * relay-interval = 20s | ||
| * src-relay-optimize-interval = 30s | ||
| * src-relay-optimize-count = 3 | ||
| * dst-relay-optimize-interval = 30s | ||
| * dst-relay-optimize-count = 3 | ||
| END_COMMENT | ||
|
|
||
| set -eux | ||
|
|
||
| SCRIPT_DIR=$(cd $(dirname $0); pwd) | ||
| source $SCRIPT_DIR/utils | ||
| RLY_BIN=${SCRIPT_DIR}/../../../../build/yrly | ||
| RLY="${RLY_BIN} --debug" | ||
|
|
||
| if [ "USE_FAKELOST-$USE_FAKELOST" = "USE_FAKELOST-yes" ]; then | ||
| export DEBUG_RELAYER_MISSING_TRIE_NODE_HEIGHT_ibc1="10" | ||
| export DEBUG_RELAYER_MISSING_TRIE_NODE_HEIGHT_PROVER_ibc1="10" | ||
| export DEBUG_RELAYER_SHFU_WAIT_ibc0="20" | ||
| fi | ||
|
|
||
| PATH_NAME=mockapp-path | ||
| TM_ADDRESS0=$(${RLY} tendermint keys show ibc0 testkey) | ||
|
|
||
| expectUnrelayedCount $PATH_NAME "unrelayed-packets" "src" 0 | ||
| expectUnrelayedCount $PATH_NAME "unrelayed-packets" "dst" 0 | ||
| expectUnrelayedCount $PATH_NAME "unrelayed-acknowledgements" "src" 0 | ||
| expectUnrelayedCount $PATH_NAME "unrelayed-acknowledgements" "dst" 0 | ||
|
|
||
| sendPacketToEth $PATH_NAME | ||
| waitUnrelayedCount $PATH_NAME "unrelayed-packets" "dst" 1 300 | ||
|
|
||
| docker exec tendermint-chain0-mock sh -c "simd --home /root/data/ibc0 tx --keyring-backend=test --from ${TM_ADDRESS0} --chain-id ibc0 mockapp send mockapp channel-0 'mock packet data' --yes" | ||
| waitUnrelayedCount $PATH_NAME "unrelayed-packets" "src" 1 30 | ||
|
|
||
| date; echo "Server has started. Both chains already have a message to relay which will be ready after optimize-interval (30s)." | ||
siburu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ${RLY} service start $PATH_NAME --relay-interval 20s --src-relay-optimize-interval 30s --src-relay-optimize-count 3 --dst-relay-optimize-interval 30s --dst-relay-optimize-count 3 & | ||
| RLY_PID=$! | ||
dai1975 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| echo "Waiting dst->src packets are relayed. Note that src chain(tendermint) has fast confirmation time" | ||
| waitUnrelayedCount $PATH_NAME "unrelayed-packets" "dst" 0 300 | ||
| echo "Waiting src->dst packets are relayed" | ||
| waitUnrelayedCount $PATH_NAME "unrelayed-packets" "src" 0 300 | ||
|
|
||
| echo "Waiting dst->src ack is relayed. Note that the time of src->dst->src relay and dst->src->dst relay takes nearly same time" | ||
| waitUnrelayedCount $PATH_NAME "unrelayed-acknowledgements" "dst" 0 300 | ||
| echo "Waiting src->dst ack is relayed" | ||
| waitUnrelayedCount $PATH_NAME "unrelayed-acknowledgements" "src" 0 300 | ||
|
|
||
| echo "Finished" | ||
|
|
||
| kill $RLY_PID | ||
siburu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or 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,83 @@ | ||
| expectUnrelayedCount() { | ||
| local PATH_NAME=$1 | ||
| local query_type=$2 | ||
| local filter=".$3 | length" | ||
| local expect_count=$4 | ||
| unrelayed_count=$(${RLY} query ${query_type} $PATH_NAME | jq "${filter}") | ||
| if [ "$unrelayed_count" -ne "${expect_count}" ]; then | ||
| echo "$query_type: $unrelayed_count" | ||
| test -z "$RLY_PID" || kill $RLY_PID | ||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| waitUnrelayedCount() { | ||
| local PATH_NAME=$1 | ||
| local query_type=$2 | ||
| local chain=$3 | ||
| local filter=".$chain | length" | ||
| local expect_count=$4 | ||
| timeout=$(( $(date +%s) + $5 )) | ||
| unrelayed_count=999 | ||
| until [ "$unrelayed_count" -eq "$expect_count" ]; do | ||
| unrelayed_count=$(${RLY} query ${query_type} $PATH_NAME | jq "${filter}") | ||
| date | ||
| echo "$0 ${query_type} is $unrelayed_count" | ||
| t=$(date +%s) | ||
| if [ $t -gt $timeout ]; then | ||
| echo "TIMEOUT waitUnrelayedCount: $query_type $chain expect $expect_count but $unrelayed_count" | ||
| exit 1 | ||
| fi | ||
| sleep 10 | ||
| done | ||
| } | ||
|
|
||
| sendPacketToEth() { | ||
siburu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| local PATH_NAME=$1 | ||
| local MOCKAPP_CONTRACT_B=$(cat $(dirname $0)/../fixtures/ethereum/ibc1/addresses/AppV1) | ||
| local RPC_ADDRESS_B=$($RLY config show | jq -r '.chains[] | select(.chain.chain_id == "ibc1").chain.rpc_addr') | ||
| local PORT_B=$($RLY paths list --json | jq -r --arg path $PATH_NAME '.[$path].dst."port-id"') | ||
| local CHANNEL_B=$($RLY paths list --json | jq -r --arg path $PATH_NAME '.[$path].dst."channel-id"') | ||
|
|
||
| local MNEMONIC_B=$($RLY config show | jq -r '.chains[] | select(.chain.chain_id == "ibc1").chain.signer.mnemonic') | ||
| local SENDER=$(cast wallet address --mnemonic "$MNEMONIC_B" --mnemonic-index 2) | ||
|
|
||
| cast balance $SENDER --rpc-url $RPC_ADDRESS_B | ||
| cast nonce $SENDER --rpc-url $RPC_ADDRESS_B | ||
| cast send \ | ||
| --rpc-url $RPC_ADDRESS_B \ | ||
| --mnemonic "$MNEMONIC_B" --mnemonic-index 2 \ | ||
| --legacy \ | ||
| $MOCKAPP_CONTRACT_B \ | ||
| 'sendPacket(bytes,string,string,(uint64,uint64),uint64)' \ | ||
| $(cast from-utf8 'mock packet data') \ | ||
| $PORT_B \ | ||
| $CHANNEL_B \ | ||
| '(0,100000)' \ | ||
| $(date -d 1hour +%s%N) || exit 1 | ||
dai1975 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| xsendPacketToEth() { | ||
siburu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| local PATH_NAME=$1 | ||
| local MOCKAPP_CONTRACT_B=$(cat $(dirname $0)/../fixtures/ethereum/ibc1/addresses/AppV1) | ||
| local RPC_ADDRESS_B=$($RLY config show | jq -r '.chains[] | select(.chain.chain_id == "ibc1").chain.rpc_addr') | ||
| local PORT_B=$($RLY paths list --json | jq -r --arg path $PATH_NAME '.[$path].dst."port-id"') | ||
| local CHANNEL_B=$($RLY paths list --json | jq -r --arg path $PATH_NAME '.[$path].dst."channel-id"') | ||
|
|
||
| local MNEMONIC_B=$($RLY config show | jq -r '.chains[] | select(.chain.chain_id == "ibc1").chain.signer.mnemonic') | ||
| local SENDER=$(cast wallet address --mnemonic "$MNEMONIC_B" --mnemonic-index 2) | ||
|
|
||
| cast balance $SENDER --rpc-url $RPC_ADDRESS_B | ||
| cast nonce $SENDER --rpc-url $RPC_ADDRESS_B | ||
| echo test: cast send \ | ||
| --rpc-url $RPC_ADDRESS_B \ | ||
| --mnemonic "$MNEMONIC_B" --mnemonic-index 2 \ | ||
| --legacy \ | ||
| $MOCKAPP_CONTRACT_B \ | ||
| 'sendPacket(bytes,string,string,(uint64,uint64),uint64)' \ | ||
| $(cast from-utf8 'mock packet data') \ | ||
| $PORT_B \ | ||
| $CHANNEL_B \ | ||
| '(0,100000)' \ | ||
| $(date -d 1hour +%s%N) || exit 1 | ||
| } | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dai1975 I think this timeout could be set shorter. What would be a appropriate value?