Update migration for Jakarta
Context
Jakarta proposal has been injected - we can start doing stitching to Alpha from Jakarta rather than Ithaca.
This MR includes the following changes:
- update definition of previous protocol constants to a copy of Jakarta constants,
- initialise constants in migration as a copy of previous constants, plus defaults for SCORU flags,
- remove migration code related to transition from Ithaca to Alpha (no longer needed),
- update tests to do migration from Jakarta to Alpha (instead of Ithaca to Alpha).
Manually testing the MR
Import snapshot of mainnet data (Ithaca), migrate to Jakarta, then to Alpha, and try to bake a few blocks.
- Download and import snapshot.
$ wget https://mainnet.xtz-shots.io/mainnet-2289371.rolling
$ ./tezos-node snapshot import mainnet-2289371.rolling --block BMTysK8NHpcjnch4xfEaMxXyaxnf8Zdv4J1sv9hSSGJq7Ddotfr
- 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 for Jakarta in the next level, and for Alpha in the level after that (note that block level in the filename is off by two - issue).
$ patch -p1 <<EOF
diff --git a/src/bin_node/node_config_file.ml b/src/bin_node/node_config_file.ml
index 9f7a91c1c4..1c91810134 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 =
+ (2289370l, "PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw");
+ (2289371l, "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK");
EOF
-
Build with
$ make
. -
Run tezos node in one terminal, bake migration block for Jakarta 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
Observe activation of Jakarta protocol in the Tezos node logs.
Apr 18 12:35:09.017 - node.protocol: 013-PtJakart: Patching KT1CT7S2b9hXNRxRrEcany9sak1qe4aaFAZJ...
Apr 18 12:36:43.131 - node.protocol: 013-PtJakart: Contract KT1CT7S2b9hXNRxRrEcany9sak1qe4aaFAZJ successfully patched
...
Apr 18 12:36:43.135 - node.protocol: 013-PtJakart: Patching KT1MzfYSbq18fYr4f44aQRoZBQN72BAtiz5j...
Apr 18 12:36:43.135 - node.protocol: 013-PtJakart: Contract KT1MzfYSbq18fYr4f44aQRoZBQN72BAtiz5j successfully patched
Apr 18 12:36:43.135 - validation: initializing protocol PtJakartaiDz...
Apr 18 12:36:43.140 - validator.block: block at level 2289370 successfully pre-applied
Apr 18 12:36:43.140 - validator.block: Request pushed on 2022-04-18T12:35:07.068-00:00, treated in 39.83us, completed in 1min36s
Apr 18 12:36:44.107 - validator.block: block BL1CLhBX2Cxm6S1xR14HvkMWFDymeee9XKja6jXpR4xA7Jqe4i2 successfully validated
Apr 18 12:36:44.107 - validator.block: Request pushed on 2022-04-18T12:36:43.992-00:00, treated in 8us, completed in 115ms
Apr 18 12:36:44.110 - node.store: the protocol table was updated: protocol PtJakartaiDz (level 13) was
Apr 18 12:36:44.110 - node.store: activated on block BL1CLhBX2Cxm6S1xR14HvkMWFDymeee9XKja6jXpR4xA7Jqe4i2
Apr 18 12:36:44.110 - node.store: (level 2289370)
Apr 18 12:36:44.141 - validator.chain: Update current head to BL1CLhBX2Cxm6S1xR14HvkMWFDymeee9XKja6jXpR4xA7Jqe4i2 (level 2289370, timestamp 2022-04-17T18:29:29-00:00, fitness 02::0022eeda::::ffffffff::00000000), same branch
Apr 18 12:36:44.141 - validator.chain: Request pushed on 2022-04-18T12:36:44.106-00:00, treated in 120us, completed in 33.598ms
- Bake migration block for Alpha with tezos client.
$ ./tezos-client -d /tmp/yes-wallet bake for --minimal-timestamp
Observe activation of Alpha protocol in the Tezos node logs.
Apr 18 12:37:17.241 - validation: initializing protocol ProtoALphaAL...
Apr 18 12:37:17.283 - validator.block: block at level 2289371 successfully pre-applied
Apr 18 12:37:17.283 - validator.block: Request pushed on 2022-04-18T12:37:17.073-00:00, treated in 15.792us, completed in 209ms
Apr 18 12:37:17.538 - validator.block: block BMT3pdZtnPqhKgQU6x2XuBckGXev5VVH4ayc6orqsMg5imZR8nq successfully validated
Apr 18 12:37:17.538 - validator.block: Request pushed on 2022-04-18T12:37:17.482-00:00, treated in 11.42us, completed in 55.89ms
Apr 18 12:37:17.543 - node.store: the protocol table was updated: protocol ProtoALphaAL (level 14) was
Apr 18 12:37:17.543 - node.store: activated on block BMT3pdZtnPqhKgQU6x2XuBckGXev5VVH4ayc6orqsMg5imZR8nq
Apr 18 12:37:17.543 - node.store: (level 2289371)
Apr 18 12:37:17.576 - validator.chain: Update current head to BMT3pdZtnPqhKgQU6x2XuBckGXev5VVH4ayc6orqsMg5imZR8nq (level 2289371, timestamp 2022-04-17T18:29:59-00:00, fitness 02::0022eedb::::ffffffff::00000000), same branch
Apr 18 12:37:17.576 - validator.chain: Request pushed on 2022-04-18T12:37:17.537-00:00, treated in 101us, completed in 38.523ms
- Bake a few more blocks with the same command - just in case.
Edited by Fedor Sheremetyev