forked from aptos-labs/aptos-core
-
Notifications
You must be signed in to change notification settings - Fork 12
Exp/bls-multisig-impl #175
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
Closed
Closed
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3b902ef
initial changes for supporting bls sigs, no failure till this point, …
naitik-supraoracles 8f0f3c8
added bls sig to few structs required in smr-moonshot
naitik-supraoracles 1fb062c
changed blsttc version and tried changing bls key feild from option t…
naitik-supraoracles 3bf72f9
added new field on ValidatoConfig in stake.move to have bls key
naitik-supraoracles 7d457d8
temp impl of blsttc move and other changes in move files for adding f…
naitik-supraoracles File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,6 +153,7 @@ module supra_framework::stake { | |
| /// Validator info stored in validator address. | ||
| struct ValidatorConfig has key, copy, store, drop { | ||
| consensus_pubkey: vector<u8>, | ||
| consensus_bls_pubkey: vector<u8>, | ||
| network_addresses: vector<u8>, | ||
| // to make it compatible with previous definition, remove later | ||
| fullnode_addresses: vector<u8>, | ||
|
|
@@ -561,6 +562,7 @@ module supra_framework::stake { | |
| initialize_owner(owner); | ||
| move_to(owner, ValidatorConfig { | ||
| consensus_pubkey: vector::empty(), | ||
| consensus_bls_pubkey: vector::empty(), | ||
| network_addresses: vector::empty(), | ||
| fullnode_addresses: vector::empty(), | ||
| validator_index: 0, | ||
|
|
@@ -583,16 +585,18 @@ module supra_framework::stake { | |
| public entry fun initialize_validator( | ||
| account: &signer, | ||
| consensus_pubkey: vector<u8>, | ||
| consensus_bls_pubkey: vector<u8>, | ||
| network_addresses: vector<u8>, | ||
| fullnode_addresses: vector<u8>, | ||
| ) acquires AllowedValidators { | ||
| // Checks the public key is valid to prevent rogue-key attacks. | ||
| let valid_public_key = ed25519::new_validated_public_key_from_bytes(consensus_pubkey); | ||
| assert!(option::is_some(&valid_public_key), error::invalid_argument(EINVALID_PUBLIC_KEY)); | ||
|
|
||
| //DO WE HAVE TO ADD CHECK FOR BLS KEY TOO? I AM NOT SURE. | ||
| initialize_owner(account); | ||
| move_to(account, ValidatorConfig { | ||
| consensus_pubkey, | ||
| consensus_bls_pubkey, | ||
| network_addresses, | ||
| fullnode_addresses, | ||
| validator_index: 0, | ||
|
|
@@ -1900,8 +1904,10 @@ module supra_framework::stake { | |
| account::create_account_for_test(validator_address); | ||
| }; | ||
|
|
||
| let bls_pk_bytes = vector[]; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are calling this function anywhere, then this could be causing deserialization problems. The value needs to be initialized. |
||
|
|
||
| let pk_bytes = ed25519::unvalidated_public_key_to_bytes(public_key); | ||
| initialize_validator(validator, pk_bytes, vector::empty(), vector::empty()); | ||
| initialize_validator(validator, pk_bytes, bls_pk_bytes,vector::empty(), vector::empty()); | ||
|
|
||
| if (amount > 0) { | ||
| mint_and_add_stake(validator, amount); | ||
|
|
@@ -1931,6 +1937,7 @@ module supra_framework::stake { | |
| voting_power: 0, | ||
| config: ValidatorConfig { | ||
| consensus_pubkey: ed25519::unvalidated_public_key_to_bytes(pk), | ||
| consensus_bls_pubkey: vector[], | ||
| network_addresses: b"", | ||
| fullnode_addresses: b"", | ||
| validator_index: 0, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Yes, we will need to ensure that the bytes comprise a valid BLS key.
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.
for this verification, we required native function in move VM.