Skip to content

Implement Real Genesis Certificate #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Sep 7, 2022
Merged

Conversation

jpraynaud
Copy link
Member

@jpraynaud jpraynaud commented Aug 22, 2022

This PR implements the Real Genesis Certificate:

  • Add a Genesis Signer that signs a message with a Genesis Secret Key (only for test purpose)
  • Add a Genesis Verifier that verifies a Genesis Signature against a Genesis Verification Key
  • Implement the verify_genesis_certificate of the Certificate Verifier
  • Make Client load/use the Genesis Verification Key
  • Make Aggregator load/use the Genesis Verification Key
  • Make Aggregator verify that the Certificate Chain is valid before trying to produce new Mithril Certificates
  • Add a sub command to the Aggregator CLI to generate test only Genesis Keys, and boostrap a test only Genesis Certificate
  • Add a sub command to the Aggregator CLI to export the message that must be signed with Genesis Secret Key into a Genesis Signature
  • Add a sub command to the Aggregator CLI to import the Genesis Signature and create a Genesis Certificate
  • Update test lab to bootstrap a Genesis Certificate
  • Update devnet standalone to bootstrap a Genesis Certificate
  • Update GCP Aggregator to use the test Genesis Keys
  • Fix crashes of the end to end tests in CI
  • Update documentations

Closes #364

@jpraynaud jpraynaud changed the base branch from main to jpraynaud/364-move-certificate-verifier-to-common August 22, 2022 09:47
@jpraynaud jpraynaud marked this pull request as draft August 22, 2022 09:48
@github-actions
Copy link

github-actions bot commented Aug 22, 2022

Unit Test Results

    7 files  ±  0    22 suites  ±0   2m 3s ⏱️ -24s
318 tests +24  318 ✔️ +24  0 💤 ±0  0 ±0 
319 runs  +24  319 ✔️ +24  0 💤 ±0  0 ±0 

Results for commit c0e1cff. ± Comparison against base commit 3f9a99a.

This pull request removes 7 and adds 31 tests. Note that renamed tests count towards both.
runtime::runner::tests ‑ test_certificate_exist_for_beacon
runtime::runner::tests ‑ test_is_new_beacon
runtime::state_machine::tests ‑ idle_certificate_already_exist_for_beacon
runtime::state_machine::tests ‑ idle_check_no_new_beacon_with_no_current_beacon
runtime::state_machine::tests ‑ signing_multisig_ready_to_idle
runtime::state_machine::tests ‑ signing_same_beacon_to_signing
runtime::state_machine::tests ‑ unregistered_no_transition
certificate_handler::tests ‑ test_epoch_settings_ko_500
certificate_handler::tests ‑ test_epoch_settings_ok_200
crypto_helper::genesis::tests ‑ test_codec_genesis_keypair
crypto_helper::genesis::tests ‑ test_generate_test_deterministic_genesis_keypair
crypto_helper::genesis::tests ‑ test_generate_test_non_deterministic_genesis_keypair
entities::beacon::tests ‑ test_beacon_compare_to_older_different_network
entities::beacon::tests ‑ test_beacon_compare_to_older_epochs_greater
entities::beacon::tests ‑ test_beacon_compare_to_older_epochs_less
entities::beacon::tests ‑ test_beacon_compare_to_older_equal
entities::beacon::tests ‑ test_beacon_compare_to_older_lower_epoch_greater_immutable
…

♻️ This comment has been updated with latest results.

@jpraynaud jpraynaud force-pushed the jpraynaud/364-genesis-certificate branch from 55b95dd to 8eef101 Compare August 22, 2022 09:58
Base automatically changed from jpraynaud/364-move-certificate-verifier-to-common to main August 22, 2022 11:38
@jpraynaud jpraynaud force-pushed the jpraynaud/364-genesis-certificate branch 2 times, most recently from 4334052 to 5a84d9f Compare August 23, 2022 10:01
@jpraynaud jpraynaud mentioned this pull request Aug 23, 2022
@jpraynaud jpraynaud force-pushed the jpraynaud/364-genesis-certificate branch 16 times, most recently from c816bc7 to 30a2a01 Compare August 30, 2022 16:58
@jpraynaud jpraynaud force-pushed the jpraynaud/364-genesis-certificate branch 5 times, most recently from 6843e7c to d6fe5f3 Compare August 31, 2022 18:07
jpraynaud and others added 27 commits September 7, 2022 13:06
Modify the state machine so that it can handle the case where certificate chain is not valid
but we still need to update stake distribution and protocol parameters at each epoch
With deterministic RNG for tests and non deterministic RNG to use for testnet
This route is mandatory to enable the registration of the Signers before
boostraping the genesis certificate of the chain
In transtion from REGISTERED to SIGNED in Aggregator
And use the correct beacon so that stake distribution and protocol parameters
are really updated on next cycle when epoch changes
By replacing the wait for a pending certificate by a wait for epoch settings,
as pending certificates are not always available
Of the Aggregator and the Client nodes
@jpraynaud jpraynaud force-pushed the jpraynaud/364-genesis-certificate branch from b32a325 to c0e1cff Compare September 7, 2022 11:17
@jpraynaud jpraynaud merged commit 94a3de4 into main Sep 7, 2022
@jpraynaud jpraynaud deleted the jpraynaud/364-genesis-certificate branch September 7, 2022 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change 🔥 Contains a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bootstrap Certificate Chain w/ Genesis Certificate
3 participants