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

Port Qtum to Bitcoin core 0.19 #804

Merged
merged 1,935 commits into from
Feb 22, 2020
Merged

Port Qtum to Bitcoin core 0.19 #804

merged 1,935 commits into from
Feb 22, 2020

Conversation

timemarkovqtum
Copy link
Contributor

Porting Qtum to Bitcoin core 0.19.
The python tests might need fix.

laanwj and others added 30 commits September 25, 2019 11:16
Primarily I'd like to remove this because it is very imprecise, due to
Python's dynamic nature, giving it a large list of false positives that
need to be listed as exceptions. See for example #16906.

It's also a frequent source of complaints. I'm doubtful of the
usefulness of checking for dead code in a linter in the first place.
Having some dead code in the test framework for a while is not a
disaster.
27fcb40 doc: replace outdated OpenSSL comment in test README (fanquake)

Pull request description:

  The OpenSSL dependency was removed in #15826.

ACKs for top commit:
  laanwj:
    ACK 27fcb40
  theStack:
    ACK bitcoin/bitcoin@27fcb40

Tree-SHA512: eb7a3b18fefa91e6f27c50fa065d6cc330f7b633ae8ee51145cdeec4df51dea5155f0d1fa91e75f1202adef04e063f3eda12773cd00a093f29f5a5e83c4fda73
6659810 test: use named args for sendrawtransaction calls (Jon Atack)
5c1cd78 doc: improve rawtransaction code/test docs (Jon Atack)
acc14c5 test: fix incorrect value in rpc_rawtransaction.py (Jon Atack)

Pull request description:

  Follow-up to PR #16521.

  - Fix incorrect value in rpc_rawtransaction test as per https://github.com/bitcoin/bitcoin/pull/16521/files#r325842308
  - Improve the code docs
  - Use named arguments as per https://github.com/bitcoin/bitcoin/pull/16521/files#r310715127

  Happy to squash or keep only the first commit if the others are too fixup-y.

ACKs for top commit:
  laanwj:
    ACK 6659810

Tree-SHA512: bf5258f23802ab3ba3defb8791097e08e63f3e2af21023f832cd270dc88d1fa04349e921d69f9f5fedac5dce5cd3c1cc46b48febbede4bc18dccb8be994565b2
fadd76a ci: Remove TRAVIS env vars (MarcoFalke)
fa449b8 ci: Set $HOST before setting fallback values (MarcoFalke)

Pull request description:

  This shouldn't change anything, except that `$HOST` is now properly set in the `$BASE_OUTDIR`. (Previously it would always use `x86_64-unknown-linux-gnu` in the directory name and now it should use the correct host)

  The second commit removes travis environment variables in the `ci` system. Also, shouldn't change any behavior.

ACKs for top commit:
  fanquake:
    ACK fadd76a - assuming Travis etc is happy.

Tree-SHA512: aafd65bfc039523208b17d1ed886a3311995d984ec56c3de5f837b5a71d985061ee2da7af947f95a56ab101a0666fe7cd99434e196cd1b7ee9c460d156a185f6
This prevents the common annoyance of the text being included into PRs
accidentally.
fa7847d gui: Rename address checkbox back to bech32 (MarcoFalke)

Pull request description:

  This is the wording that has been used in the previous release, so translations should still exist for it.

  Fixes: #16924

ACKs for top commit:
  promag:
    ACK fa7847d.
  laanwj:
    ACK fa7847d

Tree-SHA512: 0ac6c47fe5eb2145b609a30fd3f56052d3e08abe6c67fc74b6d209a55a4df509c52f13eb1c759520a4fa43916ece0e6d4cefef87e061b51114a6582db911944a
f4beb49 test: Remove python dead code linter (Wladimir J. van der Laan)

Pull request description:

  Primarily I'd like to remove this because it is very imprecise, due to Python's dynamic nature, giving it a large list of false positives that need to be listed as exceptions. See for example #16906.

  It's also a frequent source of complaints. I'm doubtful of the usefulness of checking for dead code in a linter in the first place.
  Having some dead code in the test framework for a while is not a
  disaster.

ACKs for top commit:
  sdaftuar:
    utACK f4beb49
  practicalswift:
    ACK f4beb49 -- diff looks correct
  jamesob:
    ACK bitcoin/bitcoin@f4beb49

Tree-SHA512: 329b1555210311d5d15799fd2cb794b3208b0ac4d8a2ffaf4dece1bcc3e0e8b1fe952d5e7a394f94a98919cab579fb579eae7db2a796cc9a1a42ef495dd17507
If the hash is not noexcept, unorderd_map has to assume that it can throw an exception. Thus when rehashing care needs to be taken. libstdc++ solves this by simply caching the hash value, which increases memory of each node by 8 bytes. Adding noexcept prevents this caching. In my experiments with -reindex-chainstate -stopatheight=594000, memory usage has decreased by 9.4% while runtime has increased by 1.6% due to additional hashing. Additionally, memusage::DynamicUsage() is now more accurate and does not underestimate.
fa607c2 validation: Make GetWitnessCommitmentIndex public (MarcoFalke)

Pull request description:

  `GenerateCoinbaseCommitment` is public and can be used in unit tests to update the witness commitment after the list of txs in a block has been changed. However, for it to work, the existing commitment (added by default in `CreateNewBlock`) must be removed (and thus its index must be known).

  Make that possible by exposing the `GetWitnessCommitmentIndex` helper function in the header.

ACKs for top commit:
  jb55:
    ACK fa607c2
  jamesob:
    ACK bitcoin/bitcoin@fa607c2
  promag:
    ACK fa607c2.
  fanquake:
    ACK fa607c2 - This unblocks work in #15845.

Tree-SHA512: d563aa2c201d5fb4874e506a28f468c37e457cc8a20229c377178af08c22d3be44e19ee6e8e524b6de99236cd5f2c9e39b8009d88c26854aa774737912bd5889
1b4030e depends: qt: Fix LDFLAGS pickup (Carl Dong)
6eb12ff depends: qt: Fix C{,XX}FLAGS pickup (Carl Dong)

Pull request description:

  Note: ~~Will~~ [Did](bitcoin/bitcoin#16838) open issue about robustness of `sed` calls in `depends`.

ACKs for top commit:
  laanwj:
    ACK 1b4030e

Tree-SHA512: d0bfc8ea32118cd90bb323efab58661f2218a2cb0f150e716cfd5355c7e2a1eba70298a144b159941248170e2894659c376219edac2c79a9d777f6ada5fa6b2f
efd2474 util: CBufferedFile fixes (Larry Ruane)

Pull request description:

  The `CBufferedFile` object guarantees its user is able to "rewind" the data stream (that's being read from a file) up to a certain number of bytes, as specified by the user in the constructor. This guarantee is not honored due to a bug in the `SetPos` method.

  Such rewinding is done in `LoadExternalBlockFile()` (currently the only user of this object), which deserializes a series of `CBlock` objects. If that function encounters something unexpected in the data stream, which is coming from a `blocks/blk00???.dat` file, it "rewinds" to an earlier position in the stream to try to get in sync again. The `CBufferedFile` object does not actually rewind its file offset; it simply repositions its internal offset, `nReadPos`, to an earlier position within the object's private buffer; this is why there's a limit to how far the user may rewind.

  If `LoadExternalBlockFile()` needs to rewind (call `blkdat.SetPos()`), the stream may not be positioned as it should be, causing errors in deserialization. This need to rewind is probably rare, which is likely why this bug hasn't been noticed already. But if this object is used elsewhere in the future, this could be a serious problem, especially as, due to the nature of the bug, the `SetPos()` _sometimes_ works.

  This PR adds a unit test for `CBufferedFile` that fails due to this bug. (Until now it has had no unit tests.) The unit test provides good documentation and examples for developers trying to understand `LoadExternalBlockFile()` and for future users of this object.

  This PR also adds code to throw an exception from the constructor if the rewind argument is not less than the buffer size (since that doesn't make any sense).

  Finally, I discovered that the object is too restrictive in one respect: When the deserialization methods call this object's `read` method, a check ensures that the number of bytes being requested is less than the size of the buffer (adjusting for the rewind size), else it throws an exception. This restriction is unnecessary; the object being deserialized can be larger than the buffer because multiple reads from disk can satisfy the request.

ACKs for top commit:
  laanwj:
    ACK ~after squash.~ efd2474
  mzumsande:
    I had intended to follow up earlier on my last comment, ACK efd2474. I reviewed the code, ran tests and did a successful reindex on testnet with this branch.

Tree-SHA512: 695529e0af38bae2af4e0cc2895dda56a71b9059c3de04d32e09c0165a50f6aacee499f2042156ab5eaa6f0349bab6bcca4ef9f6f9ded4e60d4483beab7e4554
…he response

The response in the RPC result `starttime` is camel cased while the rest of the response seems to be lower cased.

If this was intentional please ignore this PR.

Note: case might break existing callers

Reflect the change in the test data

Change to snake case
This part of the build system has been removed in #15529 and thus no
longer needs to be updated.
8d841ad doc: Remove MSVC update step from translation process (Wladimir J. van der Laan)

Pull request description:

  This part of the build system has been removed in #15529 and thus no longer needs to be updated.

ACKs for top commit:
  MarcoFalke:
    ACK 8d841ad
  sipsorcery:
    ACK 8d841ad

Tree-SHA512: f561a6b1da806e8868a265c77725b94fabef60bc7b9d401e3f70c3d859323adc2e204e3d6fbfea4f1ff86e70667f8bd01157411106ea93974921c02d874e0083
following situations are covered:
- negative target
- overflow target
- target easier then powLimit
- invalid hash (hash > target)
- zero target

Signed-off-by: soroosh-sdi <soroosh.sardari@gmail.com>
…other fields

1a02edb [RPC] Fix casing in getblockchaininfo to be inline with the rest of the response (Dan Gershony)

Pull request description:

  The response in the RPC result `startTime` is camel cased while the rest of the response seems to be lower cased.

  If this was intentional please ignore and close this PR.

  Note: RPC field case changes might break existing callers

ACKs for top commit:
  laanwj:
    ACK 1a02edb

Tree-SHA512: 6f0eaf2b4aaf73c9a9bf1fbd4af59af5f95fc012fa88f94e050e6ae273b3ad647f5729df53bfce91e1a925fe4fd7b14818908bb6131a81413a555137d1007d7c
…tforks' warning

fdb3e8f Ignore old versionbit activations (Anthony Towns)

Pull request description:

  PR 16060 removed the CSV and Segwit BIP9 softfork definitions and hard-coded ('buried') the activation heights. The versionbits code will warn users if an undefined softfork has been signalled in block header versions, and removing the CSV/Segwit definitions caused those warnings to be triggered.

  Change the BIP 9 warning code to only check for unknown softforks after the segwit activation height.

ACKs for top commit:
  MarcoFalke:
    ACK fdb3e8f
  ajtowns:
    ACK fdb3e8f for what it's worth
  achow101:
    ACK fdb3e8f
  Sjors:
    ACK fdb3e8f. It makes the bit 0 warning go away in mainnet and testnet QT when a new block arrives. I think the code is clear enough.
  jonatack:
    ACK fdb3e8f

Tree-SHA512: e6fd34e8902f8c7affb28e8951803e47d542710d5f1229000746656a37ee59d754439fc33e36b7eef87544262e5aac374645db91b74cb507e73514003ca7a67f
Move qt translations to a separate make include file.
This makes it easier to auto-generate this list from tooling
(see bitcoin-core/bitcoin-maintainer-tools#36).
43e7d57 doc: Improve test READMEs (Fabian Jahr)

Pull request description:

  General improvements on READMEs for unit tests and functional tests:
  - Give unit test readme a headline
  - Move general information on `src/test` folder to the top
  - Add information on logging and debugging unit tests
  - Improve debugging and logging information in functional testing
  - Include all available log levels in functional tests

ACKs for top commit:
  laanwj:
    ACK 43e7d57

Tree-SHA512: 22b27644992ba5d99a885cd51b7a474806714396fcea1fd2d6285e41bdf3b28835ad8c81449099e3ee15a63d57b3ab9acb89c425d9855ed1d9b4af21db35ab03
4320bfc build: Factor out qt translations from build system (Wladimir J. van der Laan)

Pull request description:

  Move qt translations to a separate make include file. This makes it easier to auto-generate this list from tooling (see bitcoin-core/bitcoin-maintainer-tools#36).

ACKs for top commit:
  promag:
    ACK 4320bfc.

Tree-SHA512: 7133d0103bcf97672ae5aa40ba35d4b81331a8c179190031bbc887da6a5ccc929428e522938db43d87dbcbf9ad3b121dac1e6faf1daa5ae81d0b5fed7f053b5f
Pull new translations from Transifex and run `make translate`.
67d9990 make SaltedOutpointHasher noexcept (Martin Ankerl)

Pull request description:

  If the hash is not `noexcept`, `unorderd_map` has to assume that it can throw an exception. Thus when rehashing care needs to be taken. libstdc++ solves this by simply caching the hash value, which increases memory of each node by 8 bytes. Adding `noexcept` prevents this caching. In my experiments with `-reindex-chainstate -stopatheight=594000`, memory usage (maximum resident set size) has decreased by 9.4% while runtime has increased by 1.6% due to additional hashing. Additionally, memusage::DynamicUsage() is now more accurate and does not underestimate.

  |                                       | runtime h:mm:ss | max RSS kbyte |
  |---------------------------------------|-----------------|--------------|
  | master                                |         4:13:59 |      7696728 |
  | 2019-09-SaltedOutpointHasher-noexcept |         4:18:11 |      6971412 |
  | change                                |          +1.65% |       -9,42% |

  Comparison of progress masters vs. 2019-09-SaltedOutpointHasher-noexcept
  ![out](https://user-images.githubusercontent.com/14386/65541887-69424e00-df0e-11e9-8644-b3a068ed8c3f.png)

ACKs for top commit:
  jamesob:
    Tested ACK bitcoin/bitcoin@67d9990

Tree-SHA512: 9c44e3cca993b5a564dd61ebd2926b9c4a238609ea4d283514c018236f977d935e35a384dd4696486fd3d78781dd2ba190bb72596e20a5e931042fa465872a0b
203a67d doc: Put PR template in comments (Wladimir J. van der Laan)

Pull request description:

  This prevents the common annoyance of the text being included into PRs
  accidentally.

ACKs for top commit:
  sdaftuar:
    utACK 203a67d
  fanquake:
    ACK 203a67d - I make an effort to remove it whenever I see it in a PR.

Tree-SHA512: 3514d285488b7930d7f3d7f8823198d7325d8b7de57a6d8f13e559c0c23b30d58916b15782cbbdc347a375b418e9d0f7a5b99b34d26f3b957d7d5a03a3d83dfd
@qtum-neil qtum-neil merged commit 342d769 into master Feb 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.