Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
rename v1.4.0 to v0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sotnikov-s committed Nov 18, 2021
1 parent b560614 commit 25d7d82
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions HowTo.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,11 @@ shasum keys.json

If the checksum is correct for all participants, run:
```
./dc4bc_dkg_reinitializer reinit -i dc4bc_async_ceremony_13_12_2020_dump.csv -o reinit.json -k keys.json --adapt_1_4_0 --skip-header
./dc4bc_dkg_reinitializer reinit -i dc4bc_async_ceremony_13_12_2020_dump.csv -o reinit.json -k keys.json --adapt_0_1_4 --skip-header
```

In this example the message will be saved to ```reinit.json``` file.
* `--adapt_1_4_0`: this flag patches the old append log so that it is compatible with the latest version. You can see the utility source code [here](https://github.com/lidofinance/dc4bc/blob/eb72f74e25d910fc70c4a77158fed07435d48d7c/client/client.go#L679);
* `--adapt_0_1_4`: this flag patches the old append log so that it is compatible with the latest version. You can see the utility source code [here](https://github.com/lidofinance/dc4bc/blob/eb72f74e25d910fc70c4a77158fed07435d48d7c/client/client.go#L679);
* `-k keys.json`: new communication public keys from this file will be added to `reinit.json`.

**Note: all participants can run this command and check the `reinit.json` file checksum:**
Expand Down
10 changes: 5 additions & 5 deletions HowToReinit.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# How to Reinit from version 1.4.0
# How to Reinit from version 0.1.4

This document describes how to make a signature using:
1. Version 2.0.0,
2. Append log from version 1.4.0;
1. Version 2.0.0 or above,
2. Append log from version 0.1.4;
3. The Airgapped private key mnemonic that was saved during the master ceremony setup.

### Initial setup
Expand Down Expand Up @@ -81,10 +81,10 @@ shasum keys.json
```
If the checksums are correct for all participants, everyone should run:
```shell
./dc4bc_dkg_reinitializer reinit -i dc4bc_async_ceremony_13_12_2020_dump.csv -o reinit.json -k keys.json --adapt_1_4_0 --skip-header
./dc4bc_dkg_reinitializer reinit -i dc4bc_async_ceremony_13_12_2020_dump.csv -o reinit.json -k keys.json --adapt_0_1_4 --skip-header
```
In this example the message will be saved to ```reinit.json``` file.
* `--adapt_1_4_0`: this flag patches the old append log so that it is compatible with the latest version. You can see the utility source code [here](https://github.com/lidofinance/dc4bc/blob/eb72f74e25d910fc70c4a77158fed07435d48d7c/client/client.go#L679);
* `--adapt_0_1_4`: this flag patches the old append log so that it is compatible with the latest version. You can see the utility source code [here](https://github.com/lidofinance/dc4bc/blob/eb72f74e25d910fc70c4a77158fed07435d48d7c/client/client.go#L679);
* `-k keys.json`: new communication public keys from this file will be added to `reinit.json`.
**All participants should run this command and check the `reinit.json` file checksum:**
Expand Down
10 changes: 5 additions & 5 deletions cmd/dkg_reinitializer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
flagSeparator = "separator"
flagColumnIndex = "column"
flagSkipHeader = "skip-header"
flagAdapt140 = "adapt_1_4_0"
flagAdapt014 = "adapt_0_1_4"
)

var rootCmd = &cobra.Command{
Expand All @@ -38,7 +38,7 @@ func init() {
rootCmd.PersistentFlags().StringP(flagSeparator, "s", ";", "Separator")
rootCmd.PersistentFlags().IntP(flagColumnIndex, "p", 4, "Column index (with message JSON)")
rootCmd.PersistentFlags().Bool(flagSkipHeader, false, "Skip header (if present)")
rootCmd.PersistentFlags().Bool(flagAdapt140, true, "Adapt 1.4.0 dump")
rootCmd.PersistentFlags().Bool(flagAdapt014, true, "Adapt 0.1.4 dump")
}

func reinit() *cobra.Command {
Expand Down Expand Up @@ -71,11 +71,11 @@ func reinit() *cobra.Command {
return fmt.Errorf("failed to generate reDKG message: %v", err)
}

// Adapt from 1.4.0 if required.
if adapt140, _ := cmd.Flags().GetBool(flagAdapt140); adapt140 {
// Adapt from 0.1.4 if required.
if adapt014, _ := cmd.Flags().GetBool(flagAdapt014); adapt014 {
reDKG, err = node.GetAdaptedReDKG(reDKG)
if err != nil {
return fmt.Errorf("failed to adapt reinit DKG message from 1.4.0: %v", err)
return fmt.Errorf("failed to adapt reinit DKG message from 0.1.4: %v", err)
}
}

Expand Down

0 comments on commit 25d7d82

Please sign in to comment.