-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat: Generate class-groups key pair & proof with crypto lib #420
base: 459-update-api
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
fdb94e6
to
2dad3a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
crates/dwallet-mpc-types/src/lib.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create mock keypairs and proofs we'll be able to keep using for local development
sdk/dwallet-mpc-wasm/src/lib.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to modify this file because of the updated API of the cryptography-private lib.
079cdcc
to
112cf68
Compare
112cf68
to
31acde9
Compare
…oups-keygen # Conflicts: # crates/pera-core/src/dwallet_mpc/mpc_manager.rs
…ass-groups-keygen # Conflicts: # Cargo.lock # Cargo.toml # crates/class-groups-constants/src/lib.rs # crates/dwallet-classgroups-types/src/lib.rs # crates/pera-config/src/node.rs # crates/pera-core/src/authority/authority_per_epoch_store.rs # crates/pera-core/src/dwallet_mpc/mpc_manager.rs # crates/pera-core/src/dwallet_mpc/mpc_session.rs # crates/pera-keys/src/keypair_file.rs # crates/pera-swarm-config/src/genesis_config.rs # sdk/dwallet-mpc-wasm/Cargo.lock
crates/pera-keys/src/keypair_file.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
crates/pera-framework/packages/pera-system/sources/dwallet_network_key.move
Show resolved
Hide resolved
public(package) fun emit_validator_data_for_secret_share(data: ValidatorDataForDWalletSecretShare) { | ||
event::emit(data); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public(package) fun emit_validator_data_for_secret_share(data: ValidatorDataForDWalletSecretShare) { | |
event::emit(data); | |
} |
crates/pera-framework/packages/pera-system/sources/pera_system_state_inner.move
Outdated
Show resolved
Hide resolved
@@ -347,32 +352,54 @@ module pera_system::validator_set { | |||
// ==== epoch change functions ==== | |||
|
|||
public(package) fun lock_next_epoch_committee(self: &mut ValidatorSet, epoch: u64) { | |||
let mut next_epoch_vals = vector::empty(); | |||
let mut _next_epoch_vals = vector::empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why _
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
crates/pera-framework/packages/pera-system/sources/validator_set.move
Outdated
Show resolved
Hide resolved
Co-authored-by: Zeev Manilovich <zeevmoney@users.noreply.github.com>
let validators_len = validators_data.length(); | ||
let mut i = 0; | ||
while (i < validators_len) { | ||
let validator_data = validators_data[i]; | ||
emit_validator_data_for_secret_share(validator_data); | ||
i = i + 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let validators_len = validators_data.length(); | |
let mut i = 0; | |
while (i < validators_len) { | |
let validator_data = validators_data[i]; | |
emit_validator_data_for_secret_share(validator_data); | |
i = i + 1; | |
} | |
let mut i = 0; | |
while (i < validators_data.length()) { | |
emit_validator_data_for_secret_share(validators_data[i]); | |
i = i + 1; | |
} |
Up until now, the real Class-Groups key generation logic was not fully implemented, and each generation process took a long time.
This PR introduces the actual functions and types required for the Class-Groups key generation. It also stores each validator's encryption key and proof on-chain.
Notes:
mock-class-groups
feature in "dev" mode takes a significant amount of time, though it is faster in "release" mode.