Skip to content
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

summoner: provide phase 1 root during ceremony initialization #3183

Merged
merged 6 commits into from
Oct 12, 2023

Conversation

redshiftzero
Copy link
Member

Closes #3156

Note that I have intentionally not done the transition from the provided phase 1 to phase 2, which will be done in #3158 which I'll pick up after this one.

@redshiftzero redshiftzero temporarily deployed to smoke-test October 11, 2023 18:57 — with GitHub Actions Inactive
Copy link
Contributor

@cronokirby cronokirby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking was that instead initialization should be a separate command, rather than something done automatically.

The reason behind that is that then we could make this command take in a non-dummy root from an external source to populate things instead.

@redshiftzero redshiftzero temporarily deployed to smoke-test October 12, 2023 18:30 — with GitHub Actions Inactive
@redshiftzero redshiftzero temporarily deployed to smoke-test October 12, 2023 19:00 — with GitHub Actions Inactive
@redshiftzero
Copy link
Member Author

The commands we have now are:

Running `target/debug/summonerd --help`
summonerd v0.62.0-11-g6d156c5
Penumbra summoning ceremony coordinator

USAGE:
    summonerd [OPTIONS] <SUBCOMMAND>

OPTIONS:
    -h, --help                             Print help information
        --tokio-console <tokio-console>    Enable Tokio Console support [default: false]
    -V, --version                          Print version information

SUBCOMMANDS:
    generate-phase1    Generate a phase 1 root (for testing purposes)
    help               Print this message or the help of the given subcommand(s)
    init               Initialize the coordinator
    start              Start the coordinator

I tested this via:

  1. Generate a test phase 1 root and store in a file (if we use an externally provided phase 1 root later we can delete this):
cargo run --bin summonerd -- generate-phase1 --output testphase1.txt
  1. Initialize the database using the provided phase 1 root:
cargo run --bin summonerd -- init --storage-dir /tmp/summonerd --phase1-root testphase1.txt

After this step the database exists and we can validate that the phase 1 root has been inserted in the database:

% sqlite3 /tmp/summonerd/ceremony.db
SQLite version 3.39.5 2022-10-14 20:58:05
Enter ".help" for usage hints.
sqlite> sqlite> select * from phase1_contributions;
0|1|������n���N9��H�\�7�Ȃ��A��,��T���%b��g
t��H�|
  1. Now we start the summonerd server as before:
cargo run --bin summonerd -- start --storage-dir /tmp/summonerd --fvk YOURFVKHERE --node https://grpc.testnet-preview.penumbra.zone

Copy link
Contributor

@cronokirby cronokirby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I'll just apply my suggestion, check CI, and then merge

tools/summonerd/src/main.rs Outdated Show resolved Hide resolved
Signed-off-by: Lúcás Meier <cronokirby@gmail.com>
@cronokirby cronokirby temporarily deployed to smoke-test October 12, 2023 22:15 — with GitHub Actions Inactive
@cronokirby cronokirby merged commit 7626552 into main Oct 12, 2023
8 checks passed
@cronokirby cronokirby deleted the init-phase-1 branch October 12, 2023 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Summonerd: Initializing phase 1 root
2 participants