Skip to content

Commit

Permalink
Release v5.0.2 (#798)
Browse files Browse the repository at this point in the history
* patch account script for val upgrade

* patch makefile

* add hard vdf fixtures for bob and carol. For use on staging testnet

* makefile

* patch fixture 0L.toml files

* changelog

* changelog
  • Loading branch information
0o-de-lally authored Nov 6, 2021
1 parent 2f67d49 commit b4abf36
Show file tree
Hide file tree
Showing 14 changed files with 116 additions and 14 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,11 @@ ifdef TEST
mkdir -p ${DATA_PATH}/vdf_proofs/; \
fi

@if test ! -d ${DATA_PATH}/vdf_proofs; then \
echo Creating Directories \
mkdir -p ${DATA_PATH}/vdf_proofs/; \
fi

@if test -f ${DATA_PATH}/vdf_proofs/proof_0.json; then \
rm ${DATA_PATH}/vdf_proofs/proof_0.json; \
fi
Expand Down Expand Up @@ -466,13 +471,13 @@ dev-join: clear fix fix-genesis dev-wizard

dev-wizard:
# REQUIRES there is a genesis.blob in the fixtures/genesis/<version> you are testing
MNEM='${MNEM}' cargo run -p onboard -- val --prebuilt-genesis ${DATA_PATH}/genesis.blob --skip-mining --chain-id 1 --upstream-peer http://64.225.2.108
MNEM='${MNEM}' cargo run -p onboard -- val --prebuilt-genesis ${DATA_PATH}/genesis.blob --skip-mining --chain-id 1 --genesis-ceremony

#### DEVNET RESTART ####
# usually do this on Alice, which has the dev-epoch-archive repo, and dev-genesis

# Do the ceremony: and also save the genesis fixtures, needs to happen before fix.
dev-register: clear fix dev-wizard register
dev-register: clear fix dev-wizard gen-register
# Do a dev genesis on each node after EVERY NODE COMPLETED registration.
dev-genesis: genesis dev-save-genesis fix-genesis

Expand Down
2 changes: 1 addition & 1 deletion language/diem-framework/modules/doc/ol_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@

// check <b>if</b> this account <b>exists</b>
<b>let</b> (new_account_address, _) = <a href="VDF.md#0x1_VDF_extract_address_from_challenge">VDF::extract_address_from_challenge</a>(&challenge);
<b>assert</b>(!<a href="DiemAccount.md#0x1_DiemAccount_exists_at">DiemAccount::exists_at</a>(new_account_address), <a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_invalid_state">Errors::invalid_state</a>(<a href="ol_account.md#0x1_AccountScripts_ACCOUNT_ALREADY_EXISTS">ACCOUNT_ALREADY_EXISTS</a>));
// <b>assert</b>(!<a href="DiemAccount.md#0x1_DiemAccount_exists_at">DiemAccount::exists_at</a>(new_account_address), <a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_invalid_state">Errors::invalid_state</a>(<a href="ol_account.md#0x1_AccountScripts_ACCOUNT_ALREADY_EXISTS">ACCOUNT_ALREADY_EXISTS</a>));


<a href="DiemAccount.md#0x1_DiemAccount_create_validator_account_with_proof">DiemAccount::create_validator_account_with_proof</a>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@

// check <b>if</b> this account <b>exists</b>
<b>let</b> (new_account_address, _) = <a href="VDF.md#0x1_VDF_extract_address_from_challenge">VDF::extract_address_from_challenge</a>(&challenge);
<b>assert</b>(!<a href="DiemAccount.md#0x1_DiemAccount_exists_at">DiemAccount::exists_at</a>(new_account_address), <a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_invalid_state">Errors::invalid_state</a>(<a href="ol_account.md#0x1_AccountScripts_ACCOUNT_ALREADY_EXISTS">ACCOUNT_ALREADY_EXISTS</a>));
// <b>assert</b>(!<a href="DiemAccount.md#0x1_DiemAccount_exists_at">DiemAccount::exists_at</a>(new_account_address), <a href="../../../../../../move-stdlib/docs/Errors.md#0x1_Errors_invalid_state">Errors::invalid_state</a>(<a href="ol_account.md#0x1_AccountScripts_ACCOUNT_ALREADY_EXISTS">ACCOUNT_ALREADY_EXISTS</a>));


<a href="DiemAccount.md#0x1_DiemAccount_create_validator_account_with_proof">DiemAccount::create_validator_account_with_proof</a>(
Expand Down
Binary file not shown.
Binary file modified language/diem-framework/staged/stdlib.mv
Binary file not shown.
14 changes: 7 additions & 7 deletions ol/changelog/5_0_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ We take the opportunity of the test upgrade to introduce a minor change to Move
### Changes

##### Move Changes
- initialization of TowerState for end-users

##### - initialization of TowerState for end-users

TowerState is initialized when a user submits a VDF proof to the system. In v5+ this is done 1) at genesis by the genesis validator set, 2) by onboaring a new validator from the account.json (which includes a VDF proof) 3) onboarding an end-user with an account.json.

Expand All @@ -18,15 +19,14 @@ There is another method of onboarding wich does not use account.json: end-user a
Relevant source:
language/diem-framework/0L/TowerState.move

- better error message on account creation tx
##### - better error message on account creation tx
When accounts are being created the transaction script was displaying a cryptic message 0x1::Role error code 0. A proper error code was added to the tx script (no changes to DiemAccount module).

Relevant source:
language/diem-framework/0L_transaction_scripts/ol_account.move

##### All Files Changed
language/diem-framework/0L/TowerState.move
language/diem-framework/0L_transaction_scripts/ol_account.move

##### Compatibility
The Move framework is backwards compatible with `diem-node` from v5.0.0
### Rust changes
None necessary. The Move framework is backwards compatible with `diem-node` from v5.0.0

No changes to Rust codebase
65 changes: 65 additions & 0 deletions ol/changelog/5_0_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
## 5.0.2

The stdlib payload hash for voting is: 15e0a82fa161991f439f344d8184326b51f978a49d62dc253b1ba181aad28bc8

### Summary
v5.0.2 includes bugfixes to the behavior of onboarding in edge-cases.

### Changes

##### Move Changes

##### - upgrading from end-user to validator user

Once an end-user has created an account, and has begun registering a Delay Tower, that user has the option of upgrading that account to a validator account. This was an edge case which the account creations scripts were not handling correctly. And the end-user was not able ultimately to upgrade an account. The error given was that the account already existed on chain.

This upgrade creates the appropriate checks: whether the account exists or not, and if should be upgraded. The patches happend on both the DiemAccount.move module, as well as the ol_account.move transaction scripts.

Verification:

Further functional tests were included in testsuite.

QA of this feature was also conducted on Rex TestNet.

Relevant source:

language/diem-framework/0L/DiemAccount.move

language/diem-framework/0L_transaction_scripts/ol_account.move


##### - patch bug on TowerState genesis proof submission.
V5.0.1 introduced a bug in an edge-case of account createion. End-users that had created accounts by coin transfer and subsequently started committing a Delay Tower, were not having the proof zero checked against the account address for uniqueness.

Verification:

Functional tests were patched: language/move-lang/functional-tests/tests/0L/tower_state/state_not_initialized.move

QA was conducted on Rex TestNet.

Relevant source:
language/diem-framework/0L/TowerState.move

##### All Files Changed In this Upgrade
language/diem-framework/0L/TowerState.move
language/diem-framework/0L_transaction_scripts/ol_account.move

##### Compatibility
The Move framework is backwards compatible with `diem-node` from v5.0.1

##### Relevant pull requests
Onboarding patches (#788)
https://github.com/OLSF/libra/commit/3b2e34cb794ca3f4a7da8e0b1a4e3b211e8d7759

Patch validator upgrade (#794)
https://github.com/OLSF/libra/commit/647e6c21fd6ed22d5649fbaf6d5a9bc9601389bd

Patch towerstate genesis proof (#791)
https://github.com/OLSF/libra/commit/faebc4f6aa1e10479ff7f3df6757b42ad4454f92

Patch account script for val upgrade (#796)
https://github.com/OLSF/libra/commit/2f67d49e4660170aa4822f23604d3b4c23385858

### Rust changes

Minor API changes to 0L tooling, for use with deskop client (Carpe)
2 changes: 1 addition & 1 deletion ol/fixtures/configs/alice.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
node_home = "/root/.0L/"
source_path = "/root/libra"
block_dir = "blocks"
block_dir = "vdf_proofs"
stdlib_bin_path = "/root/libra/language/diem-framework/staged/stdlib.mv"
db_path = "/root/.0L/db"

Expand Down
2 changes: 1 addition & 1 deletion ol/fixtures/configs/bob.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
node_home = "/root/.0L/"
source_path = "/root/libra"
block_dir = "blocks"
block_dir = "vdf_proofs"
stdlib_bin_path = "/root/libra/language/diem-framework/staged/stdlib.mv"
db_path = "/root/.0L/db"

Expand Down
2 changes: 1 addition & 1 deletion ol/fixtures/configs/carol.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
node_home = "/root/.0L/"
source_path = "/root/libra"
block_dir = "blocks"
block_dir = "vdf_proofs"
stdlib_bin_path = "/root/libra/language/diem-framework/staged/stdlib.mv"
db_path = "/root/.0L/db"

Expand Down
8 changes: 8 additions & 0 deletions ol/fixtures/vdf_proofs/prod/bob/proof_0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"height": 0,
"elapsed_secs": 10729,
"preimage": "74ea911c261e07ba0198baf4d9ac852e88e74dfed34420f2ad8032148280a84b00000000000000000000000000000031000e2707000000000002000000000000016538363734306633363930393130383565346638376530353332353034353361636638356262343531366133616562376236646639666665303966623936636500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000074657374",
"proof": "0031ffd902993d525f09d2042a1a01a6c8ab38e5d21d593b415f3c6235602102a4ffea4c36996a475237ae51049507e5033b8e9be98efda8c44fe6e4c9722a1b10e50049ef239421ebd3789492ea8ea41b24642a56971e9406b6da7410c292a0e547690048c4836e2f2b94d28f2913853451710162faeee5599c7b20d6d6053d6ca92d75004af2a9b6413675d36a8e9d7773d355b8cc46612e68b6ac9630371f05730fc7d2fff9b8468f395c8e07dad3d9fded2aa1c59e4c8e79275168b01e1958df469c296f0046aaffbc4c532a18638bb8005a4542fc7e6b54f4ba7334fbefcf004da5dcf3f9ffcfeac59784445ba65147590a1525ebe45697fd8eb881168b0627a46ca253b0e300263a4b670a6a01b1a0431b3b7bd0922279c4ec88e3cf68c338d78e7b739f5d92000ae1742a66686dbeebcf426d950d47f37ec110cd1488111511bf5be4eb4d4c4f001299287eb32fe7cc9c78fa776134c0dfdb5bfabd280e2ded6926c1f07225d6c6fff012b37925af5d25e86eee6d4e0f2f2eb7d741fd9af85851c6cf745bc5a1becb00151987cb2597f70e333dc86f4600e05a902b6fe16ea96ae514cbe76936a9d0f700136c5a3e8a4840546c6e698463b389d12746f31e41a83510ff7590bc03080ec700572fdb0f0cab7070a4a9a70b033bc6c76f9bbc585336d0aea4ee50c390443e56ffe2fbb1da367f86e2ed1afbd6de22c05a85c819ae5a0f5885fe7f5dcf5ab4d31f00558555388fd917aa40f03f77ee16ef75a69ce43ecbf65dd613f611ec0bbfd1fdfff89ee40acd7fa8328527d748d2977b137102002e2128c25e7fca3b8e72f1df850064a6b4402e153d9dbb199922cf2af145ec8cefaab977b87e0d4659f56f61dad9005f5988530a10b6431cb4087bfb1c15cba1c0fd1d6406fe2e6113c2414dd65bbf0065dccbb564757b6747b412dfd66cf038b5bb94e887b9f5e751793da1b4a122010062900f069f29034e75e2adac7e1456fba438c0347e681d3d7ba68e67929e9c93003b1935facd731863643907876b342cb4e8496917c52262646ed9067d2123d2850034d64ead5abc34ba253b0a481fc5b1b791aee2e7d7509c1750130f972c3e94190032ea73d288bd8b17b3663a79dd93c75c82e1d1bd8bae39fddb3c9974cc8b57ff0002fa09424b0b3346d67fd939305d031c21f12f97b1af31ccf1679c7a2e63e3e30035993cd4740ab3e86a7222f3fd5398084390b6b1c9f66c68e19eec0b32657340ffe9a2f6ad44fa79552a8393b0cd9b106dd4e25aa411f9b2f648d47c649e18581b001f153a4f0d118eaab0f543a441f62c2afa1f39a86c33741bca27597ec298f19c001a936589218c7e19f40b7962d08b6481db9ef5bdc1978ca7bbb99848644b6ded002c8ab77ff21d01609cc14d370218afeeb0c54b1d64d5e167ca7c459dae595d42001a2b7a072d0ed72ee29a44d9887a5d82661e8de37b41fe40dd3428802a4100a900292f28fe02c87d6085e0c15f11a10d525a583d7b5db6b76d3642faaff791d7b4ffd746b6421aebae4e1f2e915f0f7e6fa086083549e7e414a5e237f1c0c63afdcd002fb37c48afeff2c2637c9ca50926f303b25ec89c67ae22a7f5d72bf9f4a3f879001232b3c42c08de7b4a63c8a14c21750569d410401b63ca69ae8139b7ff7c9149002a02ee67d8a41d78543fa11a460f7b6042ca0b0f2d91fc0ec54a3a07e8e802cc00167675f8910889e2db6f20a27bff83b345d34ec85e93d1edc0104143018a21a5005b9ee938730058eb6e17deab61899601781a59a16c463b5e7840288e05a8ff62ffb805e978c57ca3e135896ae661b35829e0797977b5985a998b83999d115e91ed00579b49e10b5b155f10281ddf3b83575480923c9b6f49710b80547dca9f67b79a0048836961a99ec5ef3b83db60707167ae8c098e769e358e6e82b65a762169c59b",
"difficulty": 120000000,
"security": 512
}
8 changes: 8 additions & 0 deletions ol/fixtures/vdf_proofs/prod/carol/proof_0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"height": 0,
"elapsed_secs": 10021,
"preimage": "926945e56bc68675380bb3a4bbcc3a31e660402d586ad220ed9beff47d662d54000000006578706572696d656e74616c000e2707000000000002000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050726f74657374732072616765206163726f737320746865206e6174696f6e",
"proof": "00285fd91f4254fea217a2b8c030ce41308d20243a9c16e59ec8af07f5bef47000fff035962b58bc9d8513bec4da615282fa72756b3a29f7afd93ea87a9227255e270044a36407159787cee55b7ee109a5ccda478017c1e9f4c90bd9fd641e6d7f2abbffc8aa897e209ed480e44596db4df523ca1d136b7ba6d35813acd5099b686c3199003de27eaa254625e8471f79506da5744a02c1879716609825a1bd2113e6e62a7effc32926f78bc4074ace1123acb13878646a4264923db31b1a6ff4e909be2ea645001fd48a9006b273f57985d20c5480cd39938d718b3740ed2d3a785d743538fac3ffe2250a2cd15ee6ef5b144e6ed04cd7313534a729f05d5c03fc51ef5e48b62de3003a81f538de91818eb1d3f5c1802b28d3ec12a75d50ec9a4290fede9aebe0a178001229e47ea1fe71e23200f7da0276d683d9a68173b40392b7d7d28cb9ad3f43570013f04787ceb4ec3e6d69203cb0a18565829f0f181bdd7a26a94e4c0a6e5950ee00065011b40855c07caaa094cf4ac445898c08947ef4ffa225a3d4d07ff2a1794b0069effcd1914c95650ebbd1b033fa01ceaf8236dd8f6c9cb83af2fd1462b3e35cff9787b183f4cfba0dacdf17b8fe4675bfb65c2ec130c45425b4c48df437e275b90061a73cdf79018758bd3efc5f4d2c9e5ccf3f31127ea817a59959e0c33eb4ae5cffdf2f52d295b1e5dc4758f7780a0e15ec22f73eef920b70d9fbe3a6133462f0ff001c7389d50d7a17945abd21f9954d589a3dfd90d6b637c07a7f830210d24cb6cdffe569265df03393754ba9d78bc7c7b11d2ab75d420a5cb97f52cfdafee4a210530043d0ea106d84b06f432753076e8c20396c4371e279db6bfe62791cdb7806d110ffc76058d899bf614b690c19399ba4530f434714f84e1e84061f53785392bf56a7001bdba7af91ad1446f8ae1521c904d5b7568a46f65e8cd3c96618cbfaa057792bfff9a27a034ab68c2344d683a9c9f472932dffe9bc98113314a8a9d9d4062c38c9001bf2f0f906821244c12a5df3e19673ec144137b874596e90e0ec24411d5b3fb60018a3268fb019a3e5e2dc302e0a02d386cbc8cd972ea88f34cd7e269b7d56235d003eb7a080534253bfb9a14dc51238ce1f00083b494adcfd4d83ca6a7c65a6cd1cffe582a3aea6263c64f3d2b2df0563798ef600a98dc96e6ba3b9bd2403925774a9003184bc7867b01f9744140e392019711d10946c15e7ba25d04f5826325af7c8dc0026bbde6b44ceae08276eabdf566c06baee0fc312edad29c23568661a484cbba9001b04d1a267fdfdffa5396aa3acdb47a32520e3c02816e76e89497ed47569fdae0006ca6b6d800339d2060041332c82d6844c7026ef0bdc33837da71ac51776a1cd00309ac03339b0ad1a81d9f09ff9252b7839c01cc9cbae3fc3da456bdf5237fe5d0025e522e1f2890ab54bc6600da41de2bf5a28a4b926d48d9842e77e8481e3583d004b8796ec1f4474aa8bbed0e0da1e946c4185d12b3194ddd3c81613f4763b0034001e1a2f1a08297f9d250c55d590c9a75445d85a2c6f43842d0f2cc8522a7a50490033ff0896c27e4d42fe9d985ce31dc890affcb6f4af8623bb6de23017035736bafff6f19f16f44f19d59794a23d3f240747a89116b172b8685bc2e0900f129ab509000df4dae77b8408296669ca7d57f5887ed824e2d9f350fd4f4d9fdb4eeb28274afff6d292ecbdbff319e005ec781cb8b33f0314441805a26118c990424e2385e38b00074a88652eabd915377ed5b6a0848fb486abd61ed3031f8ff652153ea2470a50fffe1bb5464f450bc3e14bf229160003bbb0a936de827e8732e15c1009f06283e7003c3bc81f7acc565792ef566b8c9f0adf13ddcb6bf1eedaa2e528d3b1f7d783e2fffa29836aac5756f3a3217d9dc81a5b97e0399400d97a017fad16f28da3b0faf1",
"difficulty": 120000000,
"security": 512
}
Loading

0 comments on commit b4abf36

Please sign in to comment.