-
Notifications
You must be signed in to change notification settings - Fork 779
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
Bridges: add test 0002 to CI #3310
Merged
Merged
Changes from 2 commits
Commits
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 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
23 changes: 23 additions & 0 deletions
23
bridges/zombienet/environments/rococo-westend/start_relayer.sh
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,23 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
source "${BASH_SOURCE%/*}/../../utils/common.sh" | ||
source "${BASH_SOURCE%/*}/../../utils/zombienet.sh" | ||
|
||
rococo_dir=$1 | ||
westend_dir=$2 | ||
__relayer_pid=$3 | ||
|
||
logs_dir=$TEST_DIR/logs | ||
helper_script="${BASH_SOURCE%/*}/helper.sh" | ||
|
||
relayer_log=$logs_dir/relayer.log | ||
echo -e "Starting rococo-westend relayer. Logs available at: $relayer_log\n" | ||
start_background_process "$helper_script run-relay" $relayer_log relayer_pid | ||
|
||
run_zndsl ${BASH_SOURCE%/*}/rococo.zndsl $rococo_dir | ||
run_zndsl ${BASH_SOURCE%/*}/westend.zndsl $westend_dir | ||
|
||
eval $__relayer_pid="'$relayer_pid'" | ||
|
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
8 changes: 8 additions & 0 deletions
8
bridges/zombienet/tests/0002-mandatory-headers-synced-while-idle/rococo-to-westend.zndsl
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,8 @@ | ||
Description: While relayer is idle, we only sync mandatory Rococo (and a single Rococo BH) headers to Westend BH. | ||
Network: ../../../../cumulus/zombienet/bridge-hubs/bridge_hub_westend_local_network.toml | ||
Creds: config | ||
|
||
# ensure that relayer is only syncing mandatory headers while idle. This includes both headers that were | ||
# generated while relay was offline and those in the next 100 seconds while script is active. | ||
bridge-hub-westend-collator1: js-script ../../helpers/only-mandatory-headers-synced-when-idle.js with "300,rococo-at-westend" within 600 seconds | ||
|
35 changes: 35 additions & 0 deletions
35
bridges/zombienet/tests/0002-mandatory-headers-synced-while-idle/run.sh
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 | ||
|
||
set -e | ||
|
||
source "${BASH_SOURCE%/*}/../../utils/common.sh" | ||
source "${BASH_SOURCE%/*}/../../utils/zombienet.sh" | ||
|
||
# We use `--relayer-delay` in order to sleep some time before starting relayer. | ||
# We want to sleep for at least 1 session, which is expected to be 60 seconds for test environment. | ||
${BASH_SOURCE%/*}/../../environments/rococo-westend/spawn.sh & | ||
env_pid=$! | ||
|
||
ensure_process_file $env_pid $TEST_DIR/rococo.env 400 | ||
rococo_dir=`cat $TEST_DIR/rococo.env` | ||
echo | ||
|
||
ensure_process_file $env_pid $TEST_DIR/westend.env 180 | ||
westend_dir=`cat $TEST_DIR/westend.env` | ||
echo | ||
|
||
# Sleep for some time before starting the relayer. We want to sleep for at least 1 session, | ||
# which is expected to be 60 seconds for the test environment. | ||
echo -e "Sleeping 90s before starting relayer ...\n" | ||
sleep 90 | ||
${BASH_SOURCE%/*}/../../environments/rococo-westend/start_relayer.sh $rococo_dir $westend_dir relayer_pid | ||
|
||
# Sometimes the relayer syncs 2 parachain heads in the begining leading to test failures. | ||
# We do this as a workaround. | ||
# TODO: investigate. Not sure if it's expected. | ||
echo -e "Sleeping 90s before runing the tests ...\n" | ||
sleep 90 | ||
|
||
run_zndsl ${BASH_SOURCE%/*}/rococo-to-westend.zndsl $westend_dir | ||
run_zndsl ${BASH_SOURCE%/*}/westend-to-rococo.zndsl $rococo_dir | ||
|
7 changes: 7 additions & 0 deletions
7
bridges/zombienet/tests/0002-mandatory-headers-synced-while-idle/westend-to-rococo.zndsl
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,7 @@ | ||
Description: While relayer is idle, we only sync mandatory Westend (and a single Westend BH) headers to Rococo BH. | ||
Network: ../../../../cumulus/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml | ||
Creds: config | ||
|
||
# ensure that relayer is only syncing mandatory headers while idle. This includes both headers that were | ||
# generated while relay was offline and those in the next 100 seconds while script is active. | ||
bridge-hub-rococo-collator1: js-script ../../helpers/only-mandatory-headers-synced-when-idle.js with "300,westend-at-rococo" within 600 seconds |
Oops, something went wrong.
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.
That is the key point of this test :) If we really do that, we should investigate - we won't be refunding costs of such transactions and if they're submitted on a regular basis, we definitely should investigate. Let's at least submit an issue (with as steps to reproduce - IIUC we need to revert this sleep + revert
oldParachainHeaders
change in the js script) to not forget that.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.
Opened issue paritytech/parity-bridges-common#2838 for investigating this.
With the
oldParachainHeaders
I was trying to fix another issue. Namely the fact that sometimes we might miss the parachains head update (if there's only 1) and we'll getthrow new Error("No bridged parachain headers imported");
. But now that you mentioned it, I realized it's not the best fix. Changed the approach.Also removed the sleep and just commented the test. Basically, not adding it in the CI. Added a TODO to uncomment it after the issue is fixed.
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.
Ok, cool, thank you! It could be enabled on CI imo if it works in its current form - then we can avoid pinging CI team for another approval :)
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.
But we should start relayer right before calling that js script, right?
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.
Ah, maybe it takes some time for zombienet to start because you're starting
zombienet
just to check it. This way we may also accidentally miss the duplicate submissions though. But eventually we should see it (given multiple runs on CI)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.
Ok, good point ! Enabled the the test in CI then. And increased the sleep to 180s to make sure we don't hit the issue.
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.
Yes. Also we run the
zndsl
s sequentially. So when we get torun_zndsl ${BASH_SOURCE%/*}/westend-to-rococo.zndsl $rococo_dir
already 5 minutes have passed because of the first zndsl. We could run them in parallel, but I would do it in a separate PR.