[EAN-Issue-2530] Added emv-contracts-details move module#342
Open
aregng wants to merge 12 commits into
Open
Conversation
31a63cb to
0cf508d
Compare
sjoshisupra
requested changes
Mar 26, 2026
Comment on lines
+98
to
+104
| /// Input for DKG key output - contains threshold type and keys for one committee | ||
| struct DkgCommitteeOutput has copy, drop { | ||
| /// The threshold type (0=validity, 1=quorum, 2=unanimous, etc.) | ||
| threshold_type: u8, | ||
| /// Public key shares for each validator (indexed by validator position) | ||
| keys: vector<vector<u8>>, | ||
| } |
There was a problem hiding this comment.
struct should be before any method as a standard practice in Move modules
Comment on lines
+31
to
+91
| public fun new_dkg_node_config(addr: address, identity: vector<u8>, dkg_pubkey: vector<u8>,): DkgNodeConfig{ | ||
| DkgNodeConfig{ | ||
| addr, | ||
| identity, | ||
| dkg_pubkey | ||
| } | ||
| } | ||
|
|
||
| public fun get_addr(dkg_node: &DkgNodeConfig): address{ | ||
| dkg_node.addr | ||
| } | ||
|
|
||
| public fun get_dkg_pubkey(dkg_node: &DkgNodeConfig): vector<u8>{ | ||
| dkg_node.dkg_pubkey | ||
| } | ||
|
|
||
| public fun len(committee: &DkgCommittee): u64{ | ||
| vector::length(&committee.committee) | ||
| } | ||
|
|
||
| public fun get_committee(dkg_committee: &DkgCommittee): vector<DkgNodeConfig>{ | ||
| dkg_committee.committee | ||
| } | ||
|
|
||
| public fun new_dkg_committee(committee: vector<DkgNodeConfig>, threshold_type: CertificateThresholdType): DkgCommittee{ | ||
|
|
||
| assert!(vector::length(&committee) > 0, EINVALID_DKG_COMMITTEE_SIZE); | ||
| DkgCommittee{ | ||
| committee, | ||
| threshold_type | ||
| } | ||
| } | ||
|
|
||
| public fun new_dkg_committee_from_validator_consensus_info(validator_committee: vector<ValidatorConsensusInfo>, threshold_type: CertificateThresholdType): DkgCommittee{ | ||
|
|
||
| assert!(vector::length(&validator_committee) > 0, EINVALID_DKG_COMMITTEE_SIZE); | ||
|
|
||
| // The order of the committee members is important for DKG. | ||
| // The order should correspond to the order of the validator committee. | ||
| // The output of the DKG has keys in the same order as the committee. | ||
| let dkg_committee = vector[]; | ||
| vector::for_each(validator_committee, |x| | ||
| { | ||
| let validator_keys_bytes = validator_consensus_info::get_pk_bytes(&x); | ||
| let addr = validator_consensus_info::get_addr(&x); | ||
| vector::push_back(&mut dkg_committee, DkgNodeConfig{ | ||
| addr, | ||
| identity: bcs::to_bytes(&addr), | ||
| dkg_pubkey: validator_keys_bytes, | ||
| }); | ||
| } | ||
| ); | ||
|
|
||
| DkgCommittee{ | ||
| committee: dkg_committee, | ||
| threshold_type | ||
| } | ||
| } | ||
|
|
||
| public fun new_receiver_committee(is_resharing: bool, dkg_threshold_type: CertificateThresholdType, committee: DkgCommittee): ReceiverCommittee{ | ||
| ReceiverCommittee{ |
There was a problem hiding this comment.
I think all of the methods here are pure functions so should either be tagged as view or perhaps use public(friend) if this is to be invoked only from other module? Not sure what purpose is served by this module since Move state is not changed at all. If this is only for validators, wouldn't it make more sense to do this in rust layer?
| @@ -34,12 +35,14 @@ module supra_framework::stake { | |||
| use supra_framework::system_addresses; | |||
| use supra_framework::staking_config::{Self, StakingConfig, StakingRewardsConfig}; | |||
| use supra_framework::chain_status; | |||
| use std::dkg_committee; | |||
There was a problem hiding this comment.
use supra_framework::dkg_committee
96b264d to
66ba102
Compare
isaacdoidge
reviewed
Apr 23, 2026
isaacdoidge
left a comment
There was a problem hiding this comment.
Looks good, only a few minor things.
isaacdoidge
previously approved these changes
Apr 24, 2026
sjoshisupra
reviewed
Apr 24, 2026
sjoshisupra
previously approved these changes
Apr 24, 2026
sjoshisupra
previously approved these changes
Apr 27, 2026
isaacdoidge
reviewed
May 1, 2026
- The module will hold the evm contract names accosiated with the corresponding addresses - Supra node runtime will utilize this information to retrieve evm block-metadata and automation-registry contract addresses - Users can retrieve the 0x1::evm_contracts_details::EvmContractsDetails resource to get info on supra native evm contracts
* add evm_config in Move state * add config validation for required key and value type match * add test * remove double negative assert check * change to EvmScalarCOnfig with everything u128 * minor * add evm config to encode testnet * Fixed test * Fixed build error * Enabled serde for OnChainEvmConfig required by to be able to cache on-chain-config * remove nested if * validate gas used ratio, add other evm parameters --------- Co-authored-by: Saurabh Joshi <sjoshi@supra.com> Co-authored-by: Aregnaz Harutyunyan <>
… well (#354) Co-authored-by: Aregnaz Harutyunyan <>
Co-authored-by: Saurabh Joshi <sjoshi@supra.com>
isaacdoidge
approved these changes
May 29, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
0x1::evm_contracts_details::EvmContractsDetailsresource to get info on supra native evm contractsFixes: https://github.com/Entropy-Foundation/smr-moonshot/issues/2530