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

Sync with the main repo #12

Merged
merged 56 commits into from
Jul 21, 2021
Merged

Sync with the main repo #12

merged 56 commits into from
Jul 21, 2021

Commits on Jul 19, 2021

  1. fix incorrect testmempoolaccept doc

    glozow authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    bcc2846 View commit details
    Browse the repository at this point in the history
  2. init: remove straggling boost thread_group code

    boost::thread_group usage was removed in #21016.
    fanquake authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    c1c8f2e View commit details
    Browse the repository at this point in the history
  3. net: change assumed I2P port to 0

    * When accepting an I2P connection, assume the peer has port 0 instead
      of the default 8333 (for mainnet). It is not being sent to us, so we
      must assume something.
    * When deriving our own I2P listen CService use port 0 instead of the
      default 8333 (for mainnet). So that we later advertise it to peers
      with port 0.
    
    In the I2P protocol SAM 3.1 and older (we use 3.1) ports are not used,
    so they are irrelevant. However in SAM 3.2 and newer ports are used and
    from the point of view of SAM 3.2, a peer using SAM 3.1 seems to have
    specified port=0.
    vasild authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    3bff4ce View commit details
    Browse the repository at this point in the history
  4. net: change I2P seeds' ports to 0

    vasild authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    0d4337a View commit details
    Browse the repository at this point in the history
  5. net: distinguish default port per network

    Change `CChainParams::GetDefaultPort()` to return 0 if the network is
    I2P.
    vasild authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    91ff57a View commit details
    Browse the repository at this point in the history
  6. net: do not connect to I2P hosts on port!=0

    When connecting to an I2P host we don't specify destination port and it
    is being forced to 0 by the SAM 3.1 proxy, so if we connect to the same
    host on two different ports, that would be actually two connections to
    the same service (listening on port 0).
    
    Fixes bitcoin/bitcoin#21389
    vasild authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    a8d051e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    ab9b064 View commit details
    Browse the repository at this point in the history
  8. addrman: reset I2P ports to 0 when loading from disk

    This is a temporary change to convert I2P addresses that have propagated
    with port 8333 to ones with port 0.
    
    It would cause a problem some day if indeed some bitcoin software is
    listening on port 8333 only and rejects connections to port 0 and we are
    still using SAM 3.1 which only supports port 0. In this case we would
    replace 8333 with 0 and try to connect to such nodes.
    
    This commit should be included in 22.0 and be reverted before 23.0 is
    released.
    vasild authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    c5cbbfc View commit details
    Browse the repository at this point in the history
  9. doc: mention that we enforce port=0 in I2P

    Co-authored-by: Jon Atack <jon@atack.com>
    2 people authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    8fa6c3c View commit details
    Browse the repository at this point in the history
  10. test: previous releases: add v0.20.1

    Can be reviewed with --ignore-all-space
    Sjors authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    3909b86 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0ea7bc2 View commit details
    Browse the repository at this point in the history
  12. test: Add feature_taproot.py --previous_release

    MarcoFalke authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    b006d32 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    236d364 View commit details
    Browse the repository at this point in the history
  14. test: whitelist rpc_rawtransaction peers to speed up tests

    in my testing from 45-55 seconds to 15.
    jonatack authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    eac002f View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    049413c View commit details
    Browse the repository at this point in the history
  16. doc: Move buried deployment doc to the enum that enumerates them

    This is more visible than a comment hidden in an RPC helper function.
    MarcoFalke authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    695f01a View commit details
    Browse the repository at this point in the history
  17. Use DeploymentEnabled to hide VB deployments

    The helper was previously unused. This commit changes it to be more
    meaningful and puts it to use.
    
    See previous discussion at https://github.com/bitcoin/bitcoin/pull/19438/files#r650687320
    MarcoFalke authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    f6ef790 View commit details
    Browse the repository at this point in the history
  18. validation: make CChainState::m_mempool optional

    Since we now have multiple chainstate objects, only one of them is active at any given
    time. An active chainstate has a mempool, but there's no point to others having one.
    
    This change will simplify proposed assumeutxo semantics. See the discussion here:
    bitcoin/bitcoin#15606 (review)
    
    Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
    2 people authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    44bedb8 View commit details
    Browse the repository at this point in the history
  19. refactor: move UpdateMempoolForReorg into CChainState

    Allows fewer arguments and simplification of call sites.
    
    Co-authored-by: John Newbery <john@johnnewbery.com>
    2 people authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    78bdd7b View commit details
    Browse the repository at this point in the history
  20. refactor: no mempool arg to GetCoinsCacheSizeState

    Unnecessary argument since we can make use of this->m_mempool
    
    Co-authored-by: John Newbery <john@johnnewbery.com>
    2 people authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    bf5b8cb View commit details
    Browse the repository at this point in the history
  21. refactor: move UpdateTip into CChainState

    Makes sense and saves on arguments.
    
    Co-authored-by: John Newbery <john@johnnewbery.com>
    2 people authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    6fa9e5d View commit details
    Browse the repository at this point in the history
  22. refactor: move GetRandomNodeEvictionCandidates() to test utilities

    Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
    2 people authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    00762ec View commit details
    Browse the repository at this point in the history
  23. bench: add peer eviction protection benchmarks

    Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
    2 people authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    1c53554 View commit details
    Browse the repository at this point in the history
  24. p2p: iterate eviction protection only on networks having candidates

    in ProtectEvictionCandidatesByRatio().
    
    Thank you to Vasil Dimov, whose suggestions during a post-merge
    discussion about PR 21261 reminded me that I had done this in
    earlier versions of the PR, e.g. commits like ef411cd2.
    
    Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
    2 people authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    e1ee36d View commit details
    Browse the repository at this point in the history
  25. p2p: process more candidates per protection iteration

    for the usual case when some of the protected networks
    don't have eviction candidates, to reduce the number
    of iterations in ProtectEvictionCandidatesByRatio().
    
    Picks up an idea in ef411cd2 that I had dropped.
    jonatack authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    197f9e4 View commit details
    Browse the repository at this point in the history
  26. p2p: earlier continuation when no remaining eviction candidates

    in ProtectEvictionCandidatesByRatio().
    
    With this change, `if (n.count == 0) continue;` will be true
    if a network had candidates protected in the first iterations
    and has no candidates remaining to be protected in later iterations.
    
    Co-authored-by: Jon Atack <jon@atack.com>
    2 people authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    a4ab8b5 View commit details
    Browse the repository at this point in the history
  27. doc: Add steps for transifex to release process

    Document how to update settings on and for the transifex website before
    and after branch-off of a new release.
    laanwj authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    97e175c View commit details
    Browse the repository at this point in the history
  28. doc: Remove unnecessary steps from translations update process

    These have been integrated into the script long ago.
    laanwj authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    ca97651 View commit details
    Browse the repository at this point in the history
  29. doc: added info to bitcoin.conf doc

    bliotti authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    7c9a519 View commit details
    Browse the repository at this point in the history
  30. net: relay I2P addresses even if not reachable (by us)

    Nodes that can reach the I2P network (have set `-i2psam=`) will relay
    I2P addresses even without this patch. However, nodes that can't reach
    the I2P network will not. This was done as a precaution in
    bitcoin/bitcoin#20119 before anybody could
    connect to I2P because then, for sure, it would have been useless.
    
    Now, however, we have I2P support and a bunch of I2P nodes, so get all
    nodes on the network to relay I2P addresses to help with propagation,
    similarly to what we do with Tor addresses.
    vasild authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    cb443c7 View commit details
    Browse the repository at this point in the history
  31. test: use NODE_* constants instead of magic numbers

    We just assigned `NODE_NETWORK | NODE_WITNESS` to `nServices` a few
    lines above. Use that for verifying correctness instead of `9`.
    vasild authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    7f47efd View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    e8e04f2 View commit details
    Browse the repository at this point in the history
  33. test: make CAddress in functional tests comparable

    This way we can compare CAddress objects using `==` or even
    arrays of CAddress using `array1 == array2`.
    vasild authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    fb5a546 View commit details
    Browse the repository at this point in the history
  34. test: ensure I2P addresses are relayed

    This test would fail if `CNetAddr::IsRelayable()` returns `false` for
    I2P addresses, given that this test node does not have I2P connectivity.
    vasild authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    6b54f72 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    2b3e4db View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    fbf6c7f View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    2931431 View commit details
    Browse the repository at this point in the history
  38. Mark print-% target as phony.

    .PHONY does not take patterns (such as print-%) as prerequisites.
    Have print-% depend on FORCE and mark FORCE as phony.
    
    $ # on master
    $ make print-host
    host=x86_64-pc-linux-gnu
    $ touch print-host
    $ make print-host
    make: 'print-host' is up to date.
    $
    $ git co mark_print_as_phony
    Switched to branch 'mark_print_as_phony'
    $ make print-host
    host=x86_64-pc-linux-gnu
    $ touch FORCE
    $ make print-host
    host=x86_64-pc-linux-gnu
    gtkiller authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    7be9134 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    ca406d5 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    a225e3e View commit details
    Browse the repository at this point in the history
  41. build, qt: Drop lrelease dependency patch

    It is no longer required after switching to Qt top-level build.
    hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    4f630b0 View commit details
    Browse the repository at this point in the history
  42. build, qt: Drop translations.pro hack

    It is no longer required after switching to Qt top-level build.
    hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    c9eb85f View commit details
    Browse the repository at this point in the history
  43. build, qt: Force bootstrap while building linguist tools

    Qt lrelease tool depends on the xml module. This change guarantees that
    it is always available after being bootstrapped.
    hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    e7b75c7 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    7ebf24c View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    c899a18 View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    28f2976 View commit details
    Browse the repository at this point in the history
  47. Change ScriptPubKeyMan::Upgrade to default to return true

    If a ScriptPubKeyMan does not implement Upgrade, then using upgraewallet
    will fail unexpectedly. By changing the default to return true, then
    this error can be avoided. This is still correct because a successful
    upgrade can be that nothing happened.
    achow101 authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    ec73b07 View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    f814c9c View commit details
    Browse the repository at this point in the history
  49. Move implementations of non-template fuzz helpers

    Moved implementations of `ConsumeTxMemPoolEntry`, `ContainsSpentInput`, `ConsumeNetAddr`, and the methods(open, read, write, seek, close) of FuzzedFileProvider from test/fuzz/util.h to test/fuzz/util.cpp.
    sriramdvt authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    72374f7 View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    39649bf View commit details
    Browse the repository at this point in the history
  51. Rate limit the processing of incoming addr messages

    While limitations on the influence of attackers on addrman already
    exist (affected buckets are restricted to a subset based on incoming
    IP / network group), there is no reason to permit them to let them
    feed us addresses at more than a multiple of the normal network
    rate.
    
    This commit introduces a "token bucket" rate limiter for the
    processing of addresses in incoming ADDR and ADDRV2 messages.
    Every connection gets an associated token bucket. Processing an
    address in an ADDR or ADDRV2 message from non-whitelisted peers
    consumes a token from the bucket. If the bucket is empty, the
    address is ignored (it is not forwarded or processed). The token
    counter increases at a rate of 0.1 tokens per second, and will
    accrue up to a maximum of 1000 tokens (the maximum we accept in a
    single ADDR or ADDRV2). When a GETADDR is sent to a peer, it
    immediately gets 1000 additional tokens, as we actively desire many
    addresses from such peers (this may temporarily cause the token
    count to exceed 1000).
    
    The rate limit of 0.1 addr/s was chosen based on observation of
    honest nodes on the network. Activity in general from most nodes
    is either 0, or up to a maximum around 0.025 addr/s for recent
    Bitcoin Core nodes. A few (self-identified, through subver) crawler
    nodes occasionally exceed 0.1 addr/s.
    sipa authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    8fcb30f View commit details
    Browse the repository at this point in the history
  52. Randomize the order of addr processing

    sipa authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    795d1f2 View commit details
    Browse the repository at this point in the history
  53. Functional tests for addr rate limiting

    sipa authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    7d8dea0 View commit details
    Browse the repository at this point in the history
  54. Add logging and addr rate limiting statistics

    Includes logging improvements by Vasil Dimov and John Newbery.
    sipa authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    36c396f View commit details
    Browse the repository at this point in the history
  55. Improve tests using statistics

    jnewbery authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    e90ae3c View commit details
    Browse the repository at this point in the history
  56. addrman: detect on-disk corrupted nNew and nTried during unserialization

    Negative `nNew` or `nTried` are not possible during normal operation.
    So, if we read such values during unserialize, report addrman
    corruption.
    
    Fixes bitcoin/bitcoin#22450
    vasild authored and hebasto committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    6a898ea View commit details
    Browse the repository at this point in the history