-
Notifications
You must be signed in to change notification settings - Fork 72
Add bip94 setting for Testnet4 #792
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -360,6 +360,11 @@ options_metadata parser::load_settings() THROWS | |
| value<bool>(&configured.bitcoin.forks.bip90), | ||
| "Assume bip34, bip65, and bip66 activation if enabled, defaults to 'true' (hard fork)." | ||
| ) | ||
| ( | ||
| "forks.bip94", | ||
| value<bool>(&configured.bitcoin.forks.bip94), | ||
| "Assume bip94 activation if enabled, defaults to 'true' (hard fork)." | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be moved to the top section with these: /* [forks] */
(
"forks.difficult",
value<bool>(&configured.bitcoin.forks.difficult),
"Require difficult blocks, defaults to 'true' (use false for testnet)."
)
(
"forks.retarget",
value<bool>(&configured.bitcoin.forks.retarget),
"Retarget difficulty, defaults to 'true' (use false for regtest)."
)or to the bottom with these: (
"forks.time_warp_patch",
value<bool>(&configured.bitcoin.forks.time_warp_patch),
"Fix time warp bug, defaults to 'false' (hard fork)."
)
(
"forks.retarget_overflow_patch",
value<bool>(&configured.bitcoin.forks.retarget_overflow_patch),
"Fix target overflow for very low difficulty, defaults to 'false' (hard fork)."
)
(
"forks.scrypt_proof_of_work",
value<bool>(&configured.bitcoin.forks.scrypt_proof_of_work),
"Use scrypt hashing for proof of work, defaults to 'false' (hard fork)."
)
BIP fork settings are named so that they can default to true (as are retarget and difficult). If this one does as well (as described in its text) it would need to be named Also in bip94:
So as you showed in the config, this part of bip94 is implemented in a distinct fork. And this config is therefore activating a pair of additional forks ("Block Storm Fix", "Time Warp Attack Prevention"). Which means by default, there is a "block storm" behavior and a "time warp" behavior, that are enabled, and this fork disables them. Note that we have these three settings for litecoin: /// Litecoin rules.
/// -----------------------------------------------------------------------
/// Fix Satoshi's time warp bug (hard fork, security).
time_warp_patch = bit_right<uint32_t>(17),
/// Fix target overflow for very low difficulty (hard fork, security).
retarget_overflow_patch = bit_right<uint32_t>(18),
/// Use scrypt hashing for proof of work (hard fork, feature).
scrypt_proof_of_work = bit_right<uint32_t>(19), forks.time_warp_patch = false; // litecoin
forks.retarget_overflow_patch = false; // litecoin
forks.scrypt_proof_of_work = false; // litecoin[And we are using up our 32 flag space (impacts database schema/size).] bip94 describes a second "time warp patch" (not sure why this different one was chosen, ltc has had this forever).
This implies that this could become non-testnet rule. I would not implement the "cleanup" rules as one rule either, as they are entirely independent rules. So this "time warp patch" could just eventually be re-labelled/activated as one of those. JR has proposed independent BIPs for the three "cleanup" forks. Might be worth taking the name from that one. In any case we need to deconflict with bip94 also defines a "block storm patch" to the problems cause by the /// Address block storms caused by !difficult rule (hard fork, testnet4).
block_storm_patch = bit_right<uint32_t>(...)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was a mistake:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To resolve the naming conflicts above I recommend the approach of prefixing altcoin-only forks with the a chain identifier, eg: And grouping them at the bottom (high end) of flags (so they appear together as 1) in the bit matrix. Which frees up this distinct So a distinct set of PRs to add
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not opposed to splitting things up more with additional settings/flags, but there are 2 reasons I think we shouldn't: 1) bip94 is either implemented/enforced, or it's not (there's no independent path for the changes so far, at least that's specified in that bip), and 2) as you noted, we're running out of flag bits. I'm ok with
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just saw your previous comment now (sorry, didn't reload the page I guess before posting my last response). Sounds good though |
||
| ) | ||
| ( | ||
| "forks.bip68", | ||
| value<bool>(&configured.bitcoin.forks.bip68), | ||
|
|
||
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.
artifacts?
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.
No, I was trying to see if it would pull my branches to pass CI, but I'll remove that stuff because it didn't work anyway
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.
If you merge them all in your own repos you can get a result spanning all of them. This was a change that @pmienk make a few months ago. As for the origin repo, there's no better answer for that - but if you pull them all it should generally be after you've verified them all in your repo. Then when they are all good to go we can merge them all quickly in origin.