-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
dkg rounding on chain #15071
base: main
Are you sure you want to change the base?
dkg rounding on chain #15071
Conversation
⏱️ 7m total CI duration on this PR
|
3be1a84
to
e8d05a7
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
❌ Forge suite
|
✅ Forge suite
|
@@ -133,6 +133,7 @@ pub enum FeatureFlag { | |||
CollectionOwner, | |||
NativeMemoryOperations, | |||
EnableLoaderV2, | |||
NewFlag, |
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.
This needs a proper name, no?
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.
yup, probably rounding v2?
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.
Sure!
let mut function_name = BLOCK_PROLOGUE_EXT; | ||
|
||
if self.features().is_enabled(FeatureFlag::NEW_FLAG) { | ||
args.insert(0, MoveValue::Signer(AccountAddress::ONE)); |
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.
Giving a framework signer
to the prologue that wasn't there before?
Security issues?
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.
today: call block_prologue_ext
without framework signer.
After the feature is enabled: call block_prologue_ext_v2
with the signer.
should be fine?
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.
in principle fine for now
but in the future, block_prologue_ext_v2
implementations could misues the signer
...
@@ -246,6 +248,38 @@ module aptos_framework::block { | |||
}; | |||
} | |||
|
|||
/// `block_prologue()` but trigger reconfiguration with DKG after epoch timed out. |
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.
- Shouldn't this comment be "
block_prologue_**ext**()
but callstry_start_v2
instead oftry_start
?
2." - Can you add a comment to the old
block_prologue_ext()
to indicate when it is called and when it isn't? Same to this function?
@@ -123,8 +125,24 @@ module aptos_framework::randomness_config { | |||
} | |||
} | |||
|
|||
#[test_only] | |||
use aptos_std::fixed_point64; | |||
/// Return the typy name, the secrecy threshold, the reconstruction threshold and the fast-path secrecy threshold. |
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.
"typy"? or "type"?
let v2 = copyable_any::unpack<ConfigV2>(config.variant); | ||
(type_name, v2.secrecy_threshold, v2.reconstruction_threshold, v2.fast_path_secrecy_threshold) | ||
} else { | ||
let zero = fixed_point64::create_from_u128(0); |
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.
Shouldn't this return a Result::Err
instead of zero's?
@@ -39,6 +43,32 @@ module aptos_framework::reconfiguration_with_dkg { | |||
); | |||
} | |||
|
|||
public(friend) fun try_start_v2(framework: &signer) { |
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.
Add comment and explain how this differs from try_start
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 took a look, but did not check:
- the actual rounding code
- the DKG consensus-specific code
- the tests
Also, the PR is complex and should have a good description together with a suggested reviewing strategy
Description
How Has This Been Tested?
Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?
Checklist