-
Notifications
You must be signed in to change notification settings - Fork 5
chore: add more checks for block #115
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
Conversation
|
|
||
| // Reject blocks with outdated version | ||
| require!( | ||
| block_header.version >= 4, |
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.
Perhaps we should also reject future versions as an additional safeguard in case we don't update the light client in time?
However, this line matches the reference
| use crate::u256::U256; | ||
|
|
||
| pub const ZCASH_MEDIAN_TIME_SPAN: usize = 11; | ||
| pub const MEDIAN_TIME_SPAN: usize = 11; |
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.
Could you add links to the places where these constants are taken from?
| * Maximum amount of time that a block timestamp is allowed to be ahead of the | ||
| * current local time. | ||
| */ | ||
| pub const MAX_FUTURE_BLOCK_TIME_LOCAL: u32 = 2 * 60 * 60; |
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.
Could you add to the variable name that this is in SEC?
| ) -> u32 { | ||
| use btc_types::network::ZCASH_MEDIAN_TIME_SPAN; | ||
|
|
||
| if let Some(pow_allow_min_difficulty_blocks_after_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.
We have require checks further down that weren’t triggered before, but now, after moving the code to the end, they might start triggering. Do we want them to trigger?
Added timestamp and version checks for Bitcoin, Litecoin, Zcash.
The extrta dogecoin cehck should be added in #116