update migration test and test the migration between 007 and 008
Context: migration test
This MR does multiple things :
-
use
--forceto the shell so it does not check if the block is in the future (@vbotbol)This is needed to bake on a real context because the test will quickly fails with
Block in the futureotherwise. -
modify some script and CI test related to migration
-
create a new test to test the migration from 007 to 008 and check some particular features/RPC of edo works on a real context.
Preparation of the test
step 2, 3 and 4 are not mandatory but advise
- download a real context snapshot (https://mainnet.xtz-shots.io/)
- prepare environment (yes-node, yes-wallet, fresh context):
./scripts/prepare_migration_test.sh manual 2000000000 <path/to/snapshot>
Here the large number is only to force the script to import the snapshot and create the yes-node & yes-wallet
- Retrieve the current voting period position
# start a node
./tezos-node run --data-dir <path/to/imported/context> --rpc-addr localhost --connection 0 &
# copy current_period_position
./tezos-client rpc get /chains/main/blocks/head/helpers/current_level
- Bake to the end of a voting period;
current_period_position = blocks_per_voting_period - 2
#!/bin/bash
baker=("foundation1" "foundation2" "foundation3" "foundation4" "foundation5")
x=32768 - CURRENT_VOTING_POSITION
n=0
while (( $n < $x ));do
rand=$(($RANDOM % ${#baker[@]}))
./tezos-client -d $TMP/yes-wallet bake for ${baker[$rand]} --minimal-timestamp --force
n=$(( n + 1 ))
done
A couple of blocks are going to be missed, you might need to redo that operation to be really close to the end of a voting period. Best is to be < 10 blocks for the test to be quick.
- prepare test with the new context (you may first clean the repo from previous
prepare_migration_test.sh)
./scripts/prepare_migration_test.sh auto <path/to/context>
run the test
dune exec ./tezt/manual_tests/main.exe -- --verbose --keep-temp edo
reviewer
Edited by Sylvain R.