Draft: Dry run of protocol K snapshotting and linking
PLEASE DO NOT MERGE - THIS IS NOT A FINAL SNAPSHOT
Context
Dry run of protocol snapshotting for K.
$ git checkout 10685c987c43e29f69b74864a74cc27fe9275987
$ ./scripts/snapshot_alpha.sh kashkaval_014
$ git add --all
$ git stash
$ git checkout master
$ git stash pop
$ git add --all
$ git checkout -b shrmtv@proto-k-dry-run
$ git commit -m "Snapshot protocol"
$ ./scripts/link_protocol.sh src/proto_014_PsrBnRgf
$ dune exec scripts/declare-new-protocol-unit-test/main.exe -- 014 PsrBnRgf
$ git add --all
$ git commit -m "Link protocol"
Create .ocamlformat-ignore file for the new protocol.
$ ./scripts/lint.sh --update-ocamlformat
Remove duplicate target in .gitlab/ci/test/unit.yml and commit.
Fix OCaml formatting.
$ make fmt-ocaml
$ git commit -am "Fix OCaml formatting"
Updated tests_python/tests_alpha/protocol.py to test stitching from Jakarta for now (until migration code is updated), and added RPC docs generation. Changes to migration code (stitching of Alpha from Kashkaval) will be done in a separate MR.
Updated Tezt tests, adding encoding samples and updating regression tests.
$ cp -r tezt/tests/encoding_samples/alpha tezt/tests/encoding_samples/kashkaval
$ dune exec tezt/tests/main.exe -- regression --reset-regressions
Manually testing the MR
Import snapshot of mainnet (Ithaca), migrate to Jakarta, then Kashkaval and bake a few blocks.
- Download and import snapshot.
$ wget https://mainnet.xtz-shots.io/mainnet-2469963.rolling
$ ./tezos-node snapshot import mainnet-2469963.rolling --block BMUjJZYkbSRZsp6Syjyu6TqvcEkWNR2Xs9UaHZY5gnwj3x3q3wy
- Create "yes wallet", patch node to accept fake signatures.
$ dune exec scripts/yes-wallet/yes_wallet.exe -- create from context ~/.tezos-node in /tmp/yes-wallet --active-bakers-only
$ patch -p1 < scripts/yes-node.patch
- Configure protocol override in the next level.
$ patch -p1 <<EOF
diff --git a/src/bin_node/node_config_file.ml b/src/bin_node/node_config_file.ml
index 7551f24af8..7505dff78d 100644
--- a/src/bin_node/node_config_file.ml
+++ b/src/bin_node/node_config_file.ml
@@ -89,0 +90,2 @@ let mainnet_user_activated_upgrades =
+ (2469964l, "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY");
+ (2469965l, "PsrBnRgfNPTdFtYi42S79RUupVNJodJp7snrkEze1hXg9jCDoHG");
EOF
-
Build with
$ make. -
Run tezos node in one terminal, bake migration blocks with tezos client in another terminal.
$ ./tezos-node run --synchronisation-threshold 0 --connections 0 --rpc-addr localhost
$ ./tezos-client -d /tmp/yes-wallet bake for --minimal-timestamp
$ ./tezos-client -d /tmp/yes-wallet bake for --minimal-timestamp
Observe activation of protocols in the tezos node logs.
Jun 21 22:16:51.679 - node.protocol: 013-PtJakart: Patching KT1CT7S2b9hXNRxRrEcany9sak1qe4aaFAZJ...
Jun 21 22:18:18.955 - node.protocol: 013-PtJakart: Contract KT1CT7S2b9hXNRxRrEcany9sak1qe4aaFAZJ successfully patched
...
Jun 21 22:18:18.962 - node.protocol: 013-PtJakart: Patching KT1MzfYSbq18fYr4f44aQRoZBQN72BAtiz5j...
Jun 21 22:18:18.962 - node.protocol: 013-PtJakart: Contract KT1MzfYSbq18fYr4f44aQRoZBQN72BAtiz5j successfully patched
Jun 21 22:18:18.962 - validation: initializing protocol PtJakart2xVj...
Jun 21 22:18:18.966 - validator.block: block at level 2469964 successfully pre-applied
Jun 21 22:18:18.966 - validator.block: Request pushed on 2022-06-21T22:16:50.377-00:00, treated in 53.167us, completed in 1min29s
Jun 21 22:18:19.411 - validator.block: block BMC7uVCraFKsQLp9QA3bB3EBVaVe2oqZvCTiv1Uv45VLvG1sWCa successfully validated
Jun 21 22:18:19.411 - validator.block: Request pushed on 2022-06-21T22:18:19.277-00:00, treated in 8.333us, completed in 133ms
Jun 21 22:18:19.413 - node.store: the protocol table was updated: protocol PtJakart2xVj (level 13) was
Jun 21 22:18:19.413 - node.store: activated on block BMC7uVCraFKsQLp9QA3bB3EBVaVe2oqZvCTiv1Uv45VLvG1sWCa
Jun 21 22:18:19.413 - node.store: (level 2469964)
Jun 21 22:18:19.451 - validator.chain: Update current head to BMC7uVCraFKsQLp9QA3bB3EBVaVe2oqZvCTiv1Uv45VLvG1sWCa (level 2469964, timestamp 2022-06-21T13:48:14-00:00, fitness 02::0025b04c::::ffffffff::00000000), same branch
Jun 21 22:18:19.451 - validator.chain: Request pushed on 2022-06-21T22:18:19.411-00:00, treated in 109us, completed in 39.442ms
Jun 21 22:19:24.707 - validation: initializing protocol PsrBnRgfNPTd...
Jun 21 22:19:24.708 - validator.block: block at level 2469965 successfully pre-applied
Jun 21 22:19:24.708 - validator.block: Request pushed on 2022-06-21T22:19:24.598-00:00, treated in 33.84us, completed in 109ms
Jun 21 22:19:25.027 - validator.block: block BLtUGuLiRogrKS4U9zeykJXvccLUEqUvERKuDFgzjNMz461m1yD successfully validated
Jun 21 22:19:25.027 - validator.block: Request pushed on 2022-06-21T22:19:24.953-00:00, treated in 5.542us, completed in 73.353ms
Jun 21 22:19:25.313 - node.store: the protocol table was updated: protocol PsrBnRgfNPTd (level 14) was
Jun 21 22:19:25.313 - node.store: activated on block BLtUGuLiRogrKS4U9zeykJXvccLUEqUvERKuDFgzjNMz461m1yD
Jun 21 22:19:25.313 - node.store: (level 2469965)
Jun 21 22:19:25.341 - validator.chain: Update current head to BLtUGuLiRogrKS4U9zeykJXvccLUEqUvERKuDFgzjNMz461m1yD (level 2469965, timestamp 2022-06-21T13:48:44-00:00, fitness 02::0025b04d::::ffffffff::00000000), same branch
Jun 21 22:19:25.341 - validator.chain: Request pushed on 2022-06-21T22:19:25.026-00:00, treated in 79.333us, completed in 314m
- Bake a few more blocks with the same tezos-client command - just in case.