Mumbai Initial Snapshot
Steps
Snapshot
Start from Proto M branch.
git checkout origin/proto-m
Make working environment clean.
git clean -dfx
make
Snapshot.
./scripts/snapshot_alpha.sh mumbai_016
Commit on top of master.
git stash -u
git fetch
git checkout -b mumbai origin/master
git stash pop
git add --all
git commit -m "Protocol: Mumbai"
Link
./scripts/link_protocol.sh src/proto_016_PtMumbai
dune exec scripts/declare-new-protocol-unit-test/main.exe -- 016 PtMumbai
Commit
git add --all
git commit -m "Build: Link Mumbai"
Formatting
Reset .ocamlformat-ignores.
./scripts/lint.sh --update-ocamlformat
Format everything.
make fmt-ocaml # May be run again to check if it worked
git commit -am "Fix OCaml formatting"
Documentation
After editing the documentation generator like so, build the docs.
make -C docs rpc-protocols
make -C docs
Adapt Python tests
Ensure that tests_python/tests_alpha/protocol.py mentions Lima as the previous protocol.
Then reset regressions tests.
poetry run pytest --regtest-reset tests_python/tests_016 -m regression
Adapt tezt tests
Add the Mumbai protocol to the tezt tests analogous to this.
Then reset regression outputs.
cp -r tezt/tests/encoding_samples/alpha tezt/tests/encoding_samples/mumbai
dune exec tezt/tests/main.exe -- regression --reset-regressions
Disable building TORU binaries and associated tests
Disable building TORU binaries and associated tests.
Backports
Some non-protocol related backports were required to make things compile:
- !7095 (merged) + fix error registration
- !7075 (merged)
- Non-proto part of !7102 (merged) and !7074 (merged)
Manual test
Simulate upgrade
Create node from mainnet snapshot.
wget https://mainnet-v14.xtz-shots.io/mainnet-2954632.rolling
./tezos-node snapshot import mainnet-2954632.rolling --block BM3yCSj4jiQA9gw1bLLFUwgDHfZnRQkTVwQ7USChSyrCiauZivg
Set up yes wallet.
dune exec devtools/yes_wallet/yes_wallet.exe -- create from context ~/.tezos-node in /tmp/yes-wallet --active-bakers-only
patch -p1 < scripts/yes-node.patch
Configure node to upgrade the protocol.
git apply <<EOF
diff --git a/src/lib_node_config/config_file.ml b/src/lib_node_config/config_file.ml
index 528eae7885..37849fd5de 100644
--- a/src/lib_node_config/config_file.ml
+++ b/src/lib_node_config/config_file.ml
@@ -88,6 +88,8 @@ let mainnet_user_activated_upgrades =
[
(28082l, "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt");
(204761l, "PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP");
+ (2954633l, "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW");
+ (2954635l, "PtMumbaiaByZhjUPaSHEdbLZ6LUzw2YdzbGE2VX2oHSKAS4K2MD");
]
(* END_PATCHING_ZONE_FOR_MAINNET_USER_ACTIVATED_UPGRADES *)
EOF
Build everything.
make
Run node in one terminal.
./tezos-node run --synchronisation-threshold 0 --connections 0 --rpc-addr localhost
Bake a few blocks (at least 3) in another terminal.
./tezos-client -d /tmp/yes-wallet bake for --minimal-timestamp
Observe protocols being upgraded.
Dec 12 17:10:08.558 - node.protocol: 015-PtLimaPt: Patching KT1SL6CGhjPUyLypDbFv9bXsNF2sHG7Fy3j9...
Dec 12 17:10:08.559 - node.protocol: 015-PtLimaPt: Contract KT1SL6CGhjPUyLypDbFv9bXsNF2sHG7Fy3j9 successfully patched
Dec 12 17:10:08.559 - validation: initializing protocol PtLimaPtLMwf...
Dec 12 17:10:08.602 - validator.block: block at level 2954633 successfully pre-applied:
Dec 12 17:10:08.602 - validator.block: Request pushed on 2022-12-12T17:10:04.451-00:00, treated in 11us, completed in 4.151s
Dec 12 17:10:08.771 - validator.block: prechecked block BM5kMWeQKCfJj8ftwBzYFSGipF2brdLyRnby55HfjdLsMWeC3Eh
Dec 12 17:10:08.870 - validator.block: block BM5kMWeQKCfJj8ftwBzYFSGipF2brdLyRnby55HfjdLsMWeC3Eh validated
Dec 12 17:10:08.870 - validator.block: Request pushed on 2022-12-12T17:10:08.720-00:00, treated in 10us, completed in 150ms
Dec 12 17:10:08.872 - node.store: the protocol table was updated: protocol PtLimaPtLMwf (level 15) was
Dec 12 17:10:08.872 - node.store: activated on block BM5kMWeQKCfJj8ftwBzYFSGipF2brdLyRnby55HfjdLsMWeC3Eh
Dec 12 17:10:08.872 - node.store: (level 2954633)
Dec 12 17:10:08.884 - validator.chain: Update current head to BM5kMWeQKCfJj8ftwBzYFSGipF2brdLyRnby55HfjdLsMWeC3Eh
Dec 12 17:10:08.884 - validator.chain: (level 2954633, timestamp 2022-12-09T13:10:59-00:00, fitness
Dec 12 17:10:08.884 - validator.chain: 02::002d1589::::ffffffff::00000000), same branch
Dec 12 17:10:30.412 - validator.block: block at level 2954634 successfully pre-applied:
Dec 12 17:10:30.412 - validator.block: Request pushed on 2022-12-12T17:10:30.332-00:00, treated in 10us, completed in 79.246ms
Dec 12 17:10:30.654 - validator.block: prechecked block BKjn1Dowv1G9xPFk2qNRpha3SKbwaLmMEYd3DV8TbbZcB6iwKvN
Dec 12 17:10:30.656 - validator.block: block BKjn1Dowv1G9xPFk2qNRpha3SKbwaLmMEYd3DV8TbbZcB6iwKvN validated
Dec 12 17:10:30.656 - validator.block: Request pushed on 2022-12-12T17:10:30.617-00:00, treated in 7us, completed in 38.265ms
Dec 12 17:10:30.669 - prevalidator: switching to new head BKjn1Dowv1G9xPFk2qNRpha3SKbwaLmMEYd3DV8TbbZcB6iwKvN
Dec 12 17:10:30.669 - prevalidator: Request pushed on 2022-12-12T17:10:30.656-00:00, treated in 178us, completed in 12.198ms
Dec 12 17:10:30.669 - validator.chain: Update current head to BKjn1Dowv1G9xPFk2qNRpha3SKbwaLmMEYd3DV8TbbZcB6iwKvN
Dec 12 17:10:30.669 - validator.chain: (level 2954634, timestamp 2022-12-09T13:11:29-00:00, fitness
Dec 12 17:10:30.669 - validator.chain: 02::002d158a::::ffffffff::00000000), same branch
Dec 12 17:10:46.042 - validation: initializing protocol PtMumbaiaByZ...
Dec 12 17:10:46.042 - validator.block: block at level 2954635 successfully pre-applied:
Dec 12 17:10:46.042 - validator.block: Request pushed on 2022-12-12T17:10:45.961-00:00, treated in 16us, completed in 80.700ms
Dec 12 17:10:46.110 - validator.block: prechecked block BLvMiC3E8bGwyYbMtFBPrriZP8YTh9d1CkfoJU1uewqCpERkL2E
Dec 12 17:10:46.116 - validator.block: block BLvMiC3E8bGwyYbMtFBPrriZP8YTh9d1CkfoJU1uewqCpERkL2E validated
Dec 12 17:10:46.116 - validator.block: Request pushed on 2022-12-12T17:10:46.074-00:00, treated in 9us, completed in 41.543ms
Dec 12 17:10:46.175 - node.store: the protocol table was updated: protocol PtMumbaiaByZ (level 16) was
Dec 12 17:10:46.175 - node.store: activated on block BLvMiC3E8bGwyYbMtFBPrriZP8YTh9d1CkfoJU1uewqCpERkL2E
Dec 12 17:10:46.175 - node.store: (level 2954635)