-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Avoid using sizes on non-fixed-width types to derive protocol constants. #10854
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
Thanks to awemany for pointing this out.
| for (const CTxIn &_txin : ptxConflicting->vin) | ||
| { | ||
| if (_txin.nSequence < std::numeric_limits<unsigned int>::max()-1) | ||
| if (_txin.nSequence <= MAX_BIP125_RBF_SEQUENCE) |
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.
MAX_BIP125_RBF_SEQUENCE is 0xfffffffd
The old value was 0xfffffffe (on supported platforms)
Is this intended?
Edit: oh, <=, ok never mind
| #include "init.h" | ||
| #include "policy/fees.h" | ||
| #include "policy/policy.h" | ||
| #include "policy/rbf.h" |
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.
Do we want validation to depend on those policy headers? It seems the wrong way around.
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.
ATMP does policy-based decisions. I think the real answer here is ATMP belongs outside of validation.cpp, but dear god thats a big refactor (I think).
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.
I don't make the standards, I just follow them. (didn't think much about it because of the above two lines). :)
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.
Well it would be wrong to rely on a policy constant if ATMP was a consensus critical function, but you're right.
|
utACK 095b917 |
|
utACK 095b917 |
…otocol constants. 095b917 Avoid using sizes on non-fixed-width types to derive protocol constants. (Gregory Maxwell) Pull request description: Thanks to awemany for pointing this out. This replaces #10172 which appears to be abandoned, but uses the constants as requested on that PR. Tree-SHA512: 032c0d75b3aaf807a7d0c7fb8ff5515acc45ad58bd00fe81413f900fe02bad900534a970403b9bb568e132c9eddea6043e958daf625e8acc84375bd41ee2e2ef
Update release notes from wiki, and fill in authors list from git. Additional credits: - Awemany (for #10854) - Gregory Maxwell (release notes writing) - John Newbery (release notes writing) - Kibbled Jive Elk Zoo (for #10177 (comment)) - Luke Dashjr (release notes writing) - Marco Falke (release notes writing) - Pieter Wuille (release notes writing) - Rusty Russell (release notes writing) - tintinweb (for early-announcing miniupnp CVE-2017-8798, forgot this for 0.14.2) Tree-SHA512: 8024eb761fcac4bb7f16ba3a9db376508f1f1bcf8a89cfb5e2928ad384675d3e912cada6ffef7d5aac181a965ebb8b823f6a63d9e976c1be753ec8eb9a8b9ef5
…rive protocol constants. 095b917 Avoid using sizes on non-fixed-width types to derive protocol constants. (Gregory Maxwell) Pull request description: Thanks to awemany for pointing this out. This replaces bitcoin#10172 which appears to be abandoned, but uses the constants as requested on that PR. Tree-SHA512: 032c0d75b3aaf807a7d0c7fb8ff5515acc45ad58bd00fe81413f900fe02bad900534a970403b9bb568e132c9eddea6043e958daf625e8acc84375bd41ee2e2ef
Backport bitcoin#10854: Avoid using sizes on non-fixed-width types to derive protocol constants
Thanks to awemany for pointing this out.
This replaces #10172 which appears to be abandoned, but uses the constants as requested on that PR.