-
Notifications
You must be signed in to change notification settings - Fork 989
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
HardFork3 #3334
HardFork3 #3334
Conversation
NOTE that the FLOONET_THIRD_HARD_FORK value may need revising when building a beta or RC according to whether we still want to HF on June 20 and how fast floonet progressed. |
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.
valid_header_version()
is incorrect logic for floonet
but this is not directly related to this PR (see comment above).
Otherwise 👍.
Minor comment - I think there's a typo in there.
Can't speak for the cuckarooz impl but the HF stuff looks 👍.
pub fn valid_header_version(height: u64, version: HeaderVersion) -> bool { | ||
height < 3 * HARD_FORK_INTERVAL && version == header_version(height) | ||
height < 4 * HARD_FORK_INTERVAL && version == header_version(height) | ||
} |
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.
Just realized this logic is only correct for mainnet
.
It is not valid for either floonet or usertesting
which do not use HARD_FORK_INTERVAL
directly.
This is not specific to this PR and I don't think it has a material impact here - but we should revisit this.
Tracking here - #3335
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.
Why can't floonet and usertesting be limited to 2 years worth of block just like mainnet is for version 4? Of course that will be changed downward at the next HF, but for now it looks fine to me.
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.
Yeah maybe that is fine actually.
I was originally thinking automatedtesting wants to be able to test an invalid block due to excessive block height. But its going to be based on header version anyway.
👍
@tromp can you fix the merge conflict? |
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.
Looking good to me
@@ -133,12 +133,18 @@ pub const FLOONET_FIRST_HARD_FORK: u64 = 185_040; | |||
/// Floonet second hard fork height, set to happen around 2019-12-19 | |||
pub const FLOONET_SECOND_HARD_FORK: u64 = 298_080; | |||
|
|||
/// Floonet second hard fork height, set to happen around 2020-06-20 | |||
pub const FLOONET_THIRD_HARD_FORK: u64 = 552_960; |
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 reference the exact time is currently 2020-06-19 18:49:36 +0000 UTC
name: HardFork3
about: This hard-fork allows blocks with 3*HARD_FORK_INTERVAL/FLOONET_THIRD_HARD_FORK <= height < 4*HARD_FORK_INTERVAL with header version 4 and Cuckarooz29 as secondary PoW.
title: HardFork3
labels: consensus breaking
assignees: @antiochp @yeastplume @quentinlesceller
Currently, consensus::valid_header_version(height, version) returns false for all height >= 3*HARD_FORK_INTERVAL.
This PR changes that to return true for version 4 at either FLOONET_THIRD_HARD_FORK <= height < 4*HARD_FORK_INTERVAL on floonet or 3*HARD_FORK_INTERVAL <= height < 4*HARD_FORK_INTERVAL on mainnet.
This PR also changes global::create_pow_context to return new_cuckarooz_ctx(edge_bits, proof_size) when consensus::valid_header_version(height, version) holds for version 4, which means that Cuckarooz29 [1] is the only valid secondary PoW after the hard fork.
Successfully tested on a mainnet fast sync.
[1] https://forum.grin.mw/t/introducing-the-final-tweak-cuckarooz