[go: up one dir, main page]

Update migration for Kathmandu

Context

Kathmandu proposal has been released, we can start doing stitching to Alpha from Kathmandu rather than Jakarta.

This MR includes the following changes:

  • update definition of previous protocol constants to a copy of Kathmandu constants,
  • initialise constants in migration as a copy of previous constants, plus defaults for new SCORU flags,
  • remove migration code related to transition from Jakarta to Alpha (no longer needed),
  • update tests to do migration from Kathmandu to Alpha (instead of Jakarta to Alpha).

Manually testing the MR

Import snapshot of mainnet data (Jakarta), migrate to Kathmandu, then to Alpha, and try to bake a few blocks.

  1. Download and import snapshot.
$ wget https://mainnet.xtz-shots.io/mainnet-2523178.rolling
$ ./tezos-node snapshot import mainnet-2523178.rolling --block BKpVTvzDxZkRoJDEfL9HioSnBtVH25tFXddrJg9AibDnUP4jkpk
  1. 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
  1. Configure protocol override for Kathmandu in the next level, and for Alpha in the level after that.
$ patch -p1 <<EOF
diff --git a/src/bin_node/node_config_file.ml b/src/bin_node/node_config_file.ml
index 32f3e02c80..ffc6d0134a 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 =
+    (2523179l, "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg");
+    (2523180l, "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK");
EOF
  1. Build with $ make.

  2. 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 Kathmandu protocol in the Tezos node logs.

Jul 13 22:31:22.900 - validation: initializing protocol PtKathmankSp...
Jul 13 22:31:22.901 - validator.block: block at level 2523179 successfully pre-applied
Jul 13 22:31:22.901 - validator.block: Request pushed on 2022-07-13T22:31:20.695-00:00, treated in 30.834us, completed in 2.206s 
Jul 13 22:31:23.197 - validator.block: block BLnGfbXipfQCcEYKmdeXUdXSJHmhubR9S1252M6fMojFc2x2RcZ successfully validated
Jul 13 22:31:23.197 - validator.block: Request pushed on 2022-07-13T22:31:23.097-00:00, treated in 3.375us, completed in 99.211ms 
Jul 13 22:31:23.198 - node.store: the protocol table was updated: protocol PtKathmankSp (level 14) was
Jul 13 22:31:23.198 - node.store:   activated on block BLnGfbXipfQCcEYKmdeXUdXSJHmhubR9S1252M6fMojFc2x2RcZ
Jul 13 22:31:23.198 - node.store:   (level 2523179)
Jul 13 22:31:23.219 - validator.chain: Update current head to BLnGfbXipfQCcEYKmdeXUdXSJHmhubR9S1252M6fMojFc2x2RcZ (level 2523179, timestamp 2022-07-10T22:43:44-00:00, fitness 02::0026802b::::ffffffff::00000000), same branch
Jul 13 22:31:23.219 - validator.chain: Request pushed on 2022-07-13T22:31:23.196-00:00, treated in 92.792us, completed in 22.375ms 
  1. 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.

Jul 13 22:31:43.714 - validation: initializing protocol ProtoALphaAL...
Jul 13 22:31:43.715 - validator.block: block at level 2523180 successfully pre-applied
Jul 13 22:31:43.715 - validator.block: Request pushed on 2022-07-13T22:31:43.621-00:00, treated in 41.542us, completed in 93.468ms 
Jul 13 22:31:44.130 - validator.block: block BLEmwQgQz22oBXHfu9s2ixubPn92rA1knbfnibfBmBExsiHHF9Y successfully validated
Jul 13 22:31:44.130 - validator.block: Request pushed on 2022-07-13T22:31:44.045-00:00, treated in 4.125us, completed in 84.674ms 
Jul 13 22:31:44.132 - node.store: the protocol table was updated: protocol ProtoALphaAL (level 15) was
Jul 13 22:31:44.132 - node.store:   activated on block BLEmwQgQz22oBXHfu9s2ixubPn92rA1knbfnibfBmBExsiHHF9Y
Jul 13 22:31:44.132 - node.store:   (level 2523180)
Jul 13 22:31:44.153 - validator.chain: Update current head to BLEmwQgQz22oBXHfu9s2ixubPn92rA1knbfnibfBmBExsiHHF9Y (level 2523180, timestamp 2022-07-10T22:44:14-00:00, fitness 02::0026802c::::ffffffff::00000000), same branch
Jul 13 22:31:44.153 - validator.chain: Request pushed on 2022-07-13T22:31:44.130-00:00, treated in 79.417us, completed in 22.959ms 
  1. Bake a few more blocks with the same command - just in case.
Edited by Fedor Sheremetyev

Merge request reports

Loading