-
Notifications
You must be signed in to change notification settings - Fork 0
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
BEP341 & BEP402 #52
BEP341 & BEP402 #52
Conversation
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
073f713
to
104e135
Compare
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
@@ -105,6 +113,32 @@ impl ETHHeader { | |||
stream.append(&self.extra_data[..self.extra_data.len() - EXTRA_SEAL].to_vec()); | |||
stream.append(&self.mix_digest); | |||
stream.append(&self.nonce); | |||
if let Some(parent_beacon_root) = &self.parent_beacon_root { |
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.
Calculation of the seal hash according to BEP-402
let start = EXTRA_VANITY + VALIDATOR_NUM_SIZE; | ||
let end = start + num * VALIDATOR_BYTES_LENGTH; | ||
let turn_length = extra_data[end]; | ||
if !(turn_length == 1 || (3..=9).contains(&turn_length)) { |
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.
According to 424-governable-number-of-consecutive-blocks
currently, the range for the value of n is set to [1,9] but except 2.
|
||
impl Epoch { | ||
pub fn new(validator_set: ValidatorSet, turn_length: u8) -> Self { | ||
let seed = [[turn_length].as_slice(), validator_set.hash.as_slice()].concat(); |
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.
Save this hash as a validator hash in the cons state.
|
||
pub struct Localnet; | ||
|
||
impl Network for Localnet { |
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.
Test data can be prepared for each network for future HF support. Currently, Bohr is only operating on the localnet, so the test data is for the localnet only.
We will increase the corresponding test data once it is deployed on the testnet and mainnet.
Signed-off-by: Naohiro Yoshida <[email protected]>
Signed-off-by: Naohiro Yoshida <[email protected]>
BEP-341 4.2.1 Priority Allocation
Signed-off-by: Naohiro Yoshida <[email protected]>
support bep-341 & bep-342 Signed-off-by: Naohiro Yoshida <[email protected]>
https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-341.md
https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-402.md