-
Notifications
You must be signed in to change notification settings - Fork 79
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
Reintroduce randomness precompile #1576
Conversation
/// | ||
/// | Param | Value | | ||
/// |------------------|---------------------------| | ||
/// | randomness_epoch | U256 - low i64 | |
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.
formatting
|
||
let randomness_epoch = input_params.read_value()?; | ||
let entropy_length: u32 = input_params.read_value()?; | ||
let entropy = input_params.read_padded(entropy_length.try_into().unwrap_or(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.
Are you sure we want the unwrap or zero here? u32::MAX
will turn into 0, I think we want to fail in that case.
Some(resolve_address::<RT>), // 0xfe00..01 | ||
Some(lookup_delegated_address::<RT>), // 0xfe00..02 | ||
Some(call_actor::<RT>), // 0xfe00..03 | ||
None, // 0xfe00..04 DISABLED | ||
Some(call_actor_id::<RT>), // 0xfe00..05 | ||
Some(get_randomness::<RT>), // 0xfe00..06 |
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.
nit: re-use 4? This sued to be 4.
Reverting this to a draft while we settle FIP / design questions. |
An alternative which just exposes the beacon values: #1577 |
I'm happy with your approach @anorth, closing in favor of that one |
Implementation of filecoin-project/FIPs#1048
cc @anorth