BIP155: clarify variable integer format and change time to fixed 32 bit#967
Merged
luke-jr merged 2 commits intobitcoin:masterfrom Oct 1, 2020
Merged
BIP155: clarify variable integer format and change time to fixed 32 bit#967luke-jr merged 2 commits intobitcoin:masterfrom
luke-jr merged 2 commits intobitcoin:masterfrom
Conversation
32 bit unsigned can represent time up to year 2106 (32 bit signed is limited to just 2038). So, we don't need to have "time" encoded as variable integer which would take 5 bytes instead of 4.
41f49f2 to
44ff4bf
Compare
Contributor
Author
|
cc @jonasschnelli @luke-jr - this touches your suggestions. |
Contributor
Author
Contributor
Author
18 tasks
Member
|
LGTM |
Member
|
ACK but agree with @jonatack nit |
|
ACK |
The Bitcoin Core source code has `VARINT` type which is different than the "variable integer" format used all over the P2P protocol and also for the "services" field in this BIP. The latter is called `CompactSize` in some BIPs and also in the Bitcoin Core source code, thus use the word `CompactSize` to refer to it and link to its documentation.
44ff4bf to
87ef5aa
Compare
Contributor
Author
|
Addressed nit: |
Member
|
re-ACK |
|
reACK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clarify that by
VARINT(variable integer) we meanCompactSize, notVARINT(as in the source code) (huh!?). Relevant IRC discussion: http://www.erisian.com.au/bitcoin-core-dev/log-2020-07-27.html#l-94Change
timeto fixed 32 bits as that will work until year 2106, not just 2038 and takes 1 byte less than a variable integer format.