Skip to content
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

consensus::valid_header_version() logic incorrect for floonet/user_testing #3335

Closed
antiochp opened this issue May 28, 2020 · 1 comment
Closed
Labels

Comments

@antiochp
Copy link
Member

consensus::valid_header_version() makes assumptions around the HARD_FORK_INTERVAL.
This is only valid in mainnet.
floonet and user_testing and automated_testing use different HF intervals.

grin/core/src/consensus.rs

Lines 174 to 178 in b570ac9

/// Check whether the block version is valid at a given height, implements
/// 6 months interval scheduled hard forks for the first 2 years.
pub fn valid_header_version(height: u64, version: HeaderVersion) -> bool {
height < 3 * HARD_FORK_INTERVAL && version == header_version(height)
}

We should rework valid_header_version() with consistent behavior across all chain types.

height < n * HARD_FORK_INTERVAL will effectively be true for all chain types other than mainnet due to reduced chain height. Logic here is not correct for other chain types.

@antiochp antiochp added the bug label May 28, 2020
@antiochp antiochp mentioned this issue May 28, 2020
@antiochp
Copy link
Member Author

As @tromp mentioned in #3334 this just means we have 2 years of blocks at version 4 regardless of chain type.
So lets leave this as-is.

We can test against automatedtesting chain type based on header version once we get to version 4 regardless.

Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant