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

Add cconnman definition #9

Open
wants to merge 91 commits into
base: master_for_merge
Choose a base branch
from
Open

Commits on Sep 22, 2021

  1. Combine common error strings for different options so translations ca…

    …n be shared and reused
    
    (cherry picked from commit 5e10922)
    luke-jr authored and zancas committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    ac7d4f2 View commit details
    Browse the repository at this point in the history
  2. net: require lookup functions to specify all arguments

    To make it clear where DNS resolves are happening
    
    (cherry picked from commit e9fc71e)
    theuni authored and zancas committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    bce272e View commit details
    Browse the repository at this point in the history
  3. net: manually resolve dns seed sources

    Note: Some seeds aren't actually returning an IP for their name entries, so
    they're being added to addrman with a source of [::].
    
    This commit shouldn't change that behavior, for better or worse.
    
    (cherry picked from commit a98cd1f)
    theuni authored and zancas committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    00aacce View commit details
    Browse the repository at this point in the history
  4. net: resolve outside of storage structures

    Rather than allowing CNetAddr/CService/CSubNet to launch DNS queries, require
    that addresses are already resolved.
    
    This greatly simplifies async resolve logic, and makes it harder to
    accidentally leak DNS queries.
    
    (cherry picked from commit 3675699)
    theuni authored and zancas committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    116216a View commit details
    Browse the repository at this point in the history
  5. net: disable resolving from storage structures

    CNetAddr/CService/CSubnet can no longer resolve DNS.
    
    (cherry picked from commit d39f5b4)
    theuni authored and zancas committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    3b6ba67 View commit details
    Browse the repository at this point in the history
  6. Introduce enum ServiceFlags for service flags

    (cherry picked from commit ee06e04)
    sipa authored and zancas committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    0dc2dd1 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    252add6 View commit details
    Browse the repository at this point in the history
  8. remove SetServices

    zancas committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    0381cc1 View commit details
    Browse the repository at this point in the history
  9. Revert changes from CserviceFlags cherry-pick to prefer zcash logic a…

    …round use of nServices
    zancas committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    4ba4a98 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1ed0798 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    697b75f View commit details
    Browse the repository at this point in the history
  12. Removed extranious lines

    AloeareV committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    d8c19e5 View commit details
    Browse the repository at this point in the history
  13. net: Split resolving out of CNetAddr

    (cherry picked from commit 31d6b1d)
    theuni authored and zancas committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    fe18507 View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2021

  1. net: Split resolving out of CService

    (cherry picked from commit f96c7c4)
    theuni authored and zancas committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    a74c05d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7cdd185 View commit details
    Browse the repository at this point in the history
  3. net: Split resolving out of CSubNet

    (cherry picked from commit b6c3ff3)
    theuni authored and zancas committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    e86ca8c View commit details
    Browse the repository at this point in the history
  4. net: Add direct tests for new CSubNet constructors

    (cherry picked from commit 1017b8a)
    theuni authored and zancas committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    852667b View commit details
    Browse the repository at this point in the history
  5. net: move CNetAddr/CService/CSubNet out of netbase

    (cherry picked from commit 21e5b96)
    theuni authored and zancas committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    b8dfb90 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    cb5276d View commit details
    Browse the repository at this point in the history
  7. net: narrow include scope after moving to netaddress

    Net functionality is no longer needed for CAddress/CAddrman/etc. now that
    CNetAddr/CService/CSubNet are dumb storage classes.
    
    (cherry picked from commit 21ba407)
    theuni authored and zancas committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    5af609b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    cee24f2 View commit details
    Browse the repository at this point in the history
  9. net: Have LookupNumeric return a CService directly

    Also fix up a few small issues:
    - Lookup with "badip:port" now sets the port to 0
    - Don't allow assert to have side-effects
    
    (cherry picked from commit 8945384)
    theuni authored and zancas committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    e9d3ded View commit details
    Browse the repository at this point in the history
  10. net: fixup nits

    (cherry picked from commit 9e9d644)
    theuni authored and zancas committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    4e6139b View commit details
    Browse the repository at this point in the history
  11. test: add two edge case tests for CSubNet

    (cherry picked from commit ccef5d7)
    vasild authored and zancas committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    c3d9824 View commit details
    Browse the repository at this point in the history
  12. scripted-diff: Replace NET_TOR with NET_ONION

    -BEGIN VERIFY SCRIPT-
    
    sed --in-place'' --expression='s/NET_TOR/NET_ONION/g' $(git grep -I --files-with-matches 'NET_TOR')
    
    -END VERIFY SCRIPT-
    
    The --in-place'' hack is required for sed on macOS to edit files in-place without passing a backup extension.
    
    (cherry picked from commit 07c493f)
    wodry authored and zancas committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    6b6fe5c View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    4739dd9 View commit details
    Browse the repository at this point in the history
  14. net: improve encapsulation of CNetAddr

    Do not access `CNetAddr::ip` directly from `CService` methods.
    
    This improvement will help later when we change the type of
    `CNetAddr::ip` (in the BIP155 implementation).
    
    Co-authored-by: Carl Dong <[email protected]>
    (cherry picked from commit bc74a40)
    vasild authored and zancas committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    37a229f View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2021

  1. net: document enum Network

    (cherry picked from commit 100c64a)
    vasild authored and zancas committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    adfda67 View commit details
    Browse the repository at this point in the history
  2. net: add an internal subnet for representing unresolved hostnames

    We currently do two resolves for dns seeds: one for the results, and one to
    serve in addrman as the source for those addresses.
    
    There's no requirement that the source hostname resolves to the stored
    identifier, only that the mapping is unique. So rather than incurring the
    second lookup, combine a private subnet with a hash of the hostname.
    
    The resulting v6 ip is guaranteed not to be publicy routable, and has only a
    negligible chance of colliding with a user's internal network (which would be
    of no consequence anyway).
    
    (cherry picked from commit 7f31762)
    theuni authored and zancas committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    a172625 View commit details
    Browse the repository at this point in the history
  3. net: document enum Network

    (cherry picked from commit 100c64a)
    vasild authored and zancas committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    9118880 View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2021

  1. Add Slice: a (pointer, size) array view that acts like a container

    (cherry picked from commit 833bc08)
    sipa authored and zancas committed Sep 28, 2021
    Configuration menu
    Copy the full SHA
    7843095 View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2021

  1. Configuration menu
    Copy the full SHA
    592c4f5 View commit details
    Browse the repository at this point in the history
  2. netaddress: Update CNetAddr for ORCHIDv2

    The original ORCHID prefix was deprecated as of 2014-03, the new
    ORCHIDv2 prefix was allocated by RFC7343 as of 2014-07. We did not
    consider the original ORCHID prefix routable, and I don't see any reason
    to consider the new one to be either.
    
    (cherry picked from commit 8be3f30)
    dongcarl authored and zancas committed Sep 29, 2021
    Configuration menu
    Copy the full SHA
    e0c2d75 View commit details
    Browse the repository at this point in the history
  3. net: extract conditional to bool CNetAddr::IsHeNet

    and remove redundant public declaration
    
    (cherry picked from commit c90b9a2)
    jonatack authored and zancas committed Sep 29, 2021
    Configuration menu
    Copy the full SHA
    59f5e0d View commit details
    Browse the repository at this point in the history
  4. CNetAddr: Add IsBindAny method to check for INADDR_ANY

    (cherry picked from commit d6a1287)
    luke-jr authored and zancas committed Sep 29, 2021
    Configuration menu
    Copy the full SHA
    6978a56 View commit details
    Browse the repository at this point in the history
  5. Introduce new serialization macros without casts

    This new approach uses a static method which takes the object as
    a argument. This has the advantage that its constness can be a
    template parameter, allowing a single implementation that sees the
    object as const for serialization and non-const for deserialization,
    without casts.
    
    More boilerplate is included in the new macro as well.
    
    (cherry picked from commit ca33451)
    sipa authored and AloeareV committed Sep 29, 2021
    Configuration menu
    Copy the full SHA
    16bf88f View commit details
    Browse the repository at this point in the history
  6. Avoid dereference-of-casted-pointer

    (cherry picked from commit 0aadc11)
    sipa authored and AloeareV committed Sep 29, 2021
    Configuration menu
    Copy the full SHA
    7e5f970 View commit details
    Browse the repository at this point in the history
  7. Support serialization as another type without casting

    This adds a READWRITEAS(type, obj) macro which serializes obj as if it
    were casted to (const type&) when const, and to (type&) when non-const.
    
    This makes it usable in serialization code that uses a single
    implementation for both serialization and deserializing, which doesn't
    know the constness of the object involved.
    
    (cherry picked from commit 818dc74)
    sipa authored and AloeareV committed Sep 29, 2021
    Configuration menu
    Copy the full SHA
    9574c9f View commit details
    Browse the repository at this point in the history
  8. Convert addrdb/addrman to new serialization

    (cherry picked from commit 9250a08)
    sipa authored and AloeareV committed Sep 29, 2021
    Configuration menu
    Copy the full SHA
    df92b74 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    1fdbee0 View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2021

  1. Introduce CHashVerifier to hash read data

    This is necessary later, when we drop the nVersion field from the undo
    data. At that point deserializing and reserializing the data won't
    roundtrip anymore, and thus that approach can't be used to verify
    checksums anymore.
    
    With this CHashVerifier approach, we can deserialize while hashing the
    exact serialized form that was used. This is both more efficient and
    more correct in that case.
    
    (cherry picked from commit e484652)
    sipa authored and zancas committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    6853b12 View commit details
    Browse the repository at this point in the history
  2. Deduplicate addrdb.cpp and use CHashWriter/Verifier

    (cherry picked from commit cf68a48)
    sipa authored and zancas committed Sep 30, 2021
    Configuration menu
    Copy the full SHA
    842a004 View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2021

  1. Support deserializing into temporaries

    Currently, the READWRITE macro cannot be passed any non-const temporaries, as
    the SerReadWrite function only accepts lvalue references.
    
    Deserializing into a temporary is very common, however. See for example
    things like 's >> VARINT(n)'. The VARINT macro produces a temporary wrapper
    that holds a reference to n.
    
    Fix this by accepting non-const rvalue references instead of lvalue references.
    We don't propagate the rvalue-ness down, as there are no useful optimizations
    that only apply to temporaries.
    
    Then use this new functionality to get rid of many (but not all) uses of the
    'REF' macro (which casts away constness).
    
    (cherry picked from commit 172f5fa)
    sipa authored and zancas committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    5226970 View commit details
    Browse the repository at this point in the history
  2. Add static_assert to prevent VARINT(<signed value>)

    Using VARINT with signed types is dangerous because negative values will appear
    to serialize correctly, but then deserialize as positive values mod 128.
    
    This commit changes the VARINT macro to trigger an error by default if called
    with an signed value, and updates broken uses of VARINT to pass a special flag
    that lets them keep working with no change in behavior.
    
    (cherry picked from commit 499d95e)
    ryanofsky authored and zancas committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    b3cb42e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5ce2ff2 View commit details
    Browse the repository at this point in the history
  4. Add a generic approach for (de)serialization of objects using code in…

    … other classes
    
    This adds the (internal) Wrapper class, and the Using function that uses it. Given
    a class F that implements Ser(stream, const object&) and Unser(stream, object&)
    functions, this permits writing e.g. READWRITE(Using<F>(object)).
    
    (cherry picked from commit ca62563)
    sipa authored and zancas committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    9d3926d View commit details
    Browse the repository at this point in the history
  5. Convert VARINT to the formatter/Using approach

    ( cherry-picked _MANUALLY_ from 2f1b2f4 )
    zancas committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    ba78d2a View commit details
    Browse the repository at this point in the history
  6. Get rid of VARINT default argument

    This removes the need for the GNU C++ extension of variadic macros.
    
    (cherry picked from commit 0e0fa27)
    sipa authored and zancas committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    44ad5f7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a3c3641 View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2021

  1. prevector: add C++11-like data() method

    This returns a pointer to the beginning of the vector's data.
    
    (cherry picked from commit 47314e6)
    laanwj authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    1f01432 View commit details
    Browse the repository at this point in the history
  2. serialize: Deprecate begin_ptr / end_ptr

    Implement `begin_ptr` and `end_ptr` in terms of C++11 code,
    and add a comment that they are deprecated.
    
    Follow-up to developer notes update in 654a211.
    
    (cherry picked from commit f00705a)
    laanwj authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    ee86a23 View commit details
    Browse the repository at this point in the history
  3. Refactor: Removed begin/end_ptr functions.

    (cherry picked from commit 8c1dbc5)
    kallewoof authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    84e90c3 View commit details
    Browse the repository at this point in the history
  4. Add native support for serializing char arrays without FLATDATA

    Support is added to serialize arrays of type char or unsigned char directly,
    without any wrappers. All invocations of the FLATDATA wrappers that are
    obsoleted by this are removed.
    
    This includes a patch by Russell Yanofsky to make char casting type safe.
    
    The serialization of CSubNet is changed to serialize a bool directly rather
    than though FLATDATA. This makes the serialization independent of the size
    of the bool type (and will use 1 byte everywhere).
    
    (cherry picked from commit a7c45bc)
    sipa authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    3d3a50a View commit details
    Browse the repository at this point in the history
  5. Support serializing Span<unsigned char> and use that instead of FLATDATA

    (cherry picked from commit 9272d70)
    sipa authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    dcf3af8 View commit details
    Browse the repository at this point in the history
  6. Add FORMATTER_METHODS, similar to SERIALIZE_METHODS, but for formatters

    (cherry picked from commit ca34c5c)
    sipa authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    490dbe8 View commit details
    Browse the repository at this point in the history
  7. Add a constant for the maximum vector allocation (5 Mbyte)

    (cherry picked from commit 37d800b)
    sipa authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    0779a93 View commit details
    Browse the repository at this point in the history
  8. Add custom vector-element formatter

    This allows a very compact notation for serialization of vectors whose
    elements are not serialized using their default encoding.
    
    (cherry picked from commit abf8624)
    sipa authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    c0d7b94 View commit details
    Browse the repository at this point in the history
  9. Make std::vector and prevector reuse the VectorFormatter logic

    (cherry picked from commit 3cd8ab9)
    sipa authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    5639a85 View commit details
    Browse the repository at this point in the history
  10. Convert CCompactSize to proper formatter

    (cherry picked from commit 3ca574c)
    sipa authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    0f4e0e2 View commit details
    Browse the repository at this point in the history
  11. Make VectorFormatter support stateful formatters

    (cherry picked from commit 56dd9f0)
    ryanofsky authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    76c1a61 View commit details
    Browse the repository at this point in the history
  12. Add CustomUintFormatter

    (cherry picked from commit e574fff)
    sipa authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    a1570c8 View commit details
    Browse the repository at this point in the history
  13. Merge BigEndian functionality into CustomUintFormatter

    (cherry picked from commit 769ee5f)
    sipa authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    4c40a08 View commit details
    Browse the repository at this point in the history
  14. Extend CustomUintFormatter to support enums

    Extracted by Pieter Wuille from a comment by Russ Yanofsky, see
    bitcoin/bitcoin#18317 (comment).
    
    (cherry picked from commit 6f9a1e5)
    ryanofsky authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    8f45716 View commit details
    Browse the repository at this point in the history
  15. Add SER_READ and SER_WRITE for read/write-dependent statements

    Extracted and extended by Pieter Wuille from a comment by Russ
    Yanofsky (see
    bitcoin/bitcoin#18317 (comment)).
    
    (cherry picked from commit d06fedd)
    ryanofsky authored and AloeareV committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    7be79e4 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2021

  1. Convert everything except wallet/qt to new serialization

    (only picked changes to tests and netaddress.h, other changes are
    outside the scope of this cherry-pick)
    
    (cherry picked from commit 4eb5643)
    sipa authored and AloeareV committed Oct 5, 2021
    Configuration menu
    Copy the full SHA
    bcb6822 View commit details
    Browse the repository at this point in the history
  2. Do not shadow variables in networking code

    (cherry picked from commit b7c349d)
    paveljanik authored and AloeareV committed Oct 5, 2021
    Configuration menu
    Copy the full SHA
    3b37250 View commit details
    Browse the repository at this point in the history
  3. net: save the network type explicitly in CNetAddr

    Before this change, we would analyze the contents of `CNetAddr::ip[16]`
    in order to tell which type is an address. Change this by introducing a
    new member `CNetAddr::m_net` that explicitly tells the type of the
    address.
    
    This is necessary because in BIP155 we will not be able to tell the
    address type by just looking at its raw representation (e.g. both TORv3
    and I2P are "seemingly random" 32 bytes).
    
    As a side effect of this change we no longer need to store IPv4
    addresses encoded as IPv6 addresses - we can store them in proper 4
    bytes (will be done in a separate commit). Also the code gets
    somewhat simplified - instead of
    `memcmp(ip, pchIPv4, sizeof(pchIPv4)) == 0` we can use
    `m_net == NET_IPV4`.
    
    Co-authored-by: Carl Dong <[email protected]>
    (cherry picked from commit bcfebb6)
    vasild authored and AloeareV committed Oct 5, 2021
    Configuration menu
    Copy the full SHA
    535736c View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2021

  1. net: don't accept non-left-contiguous netmasks

    A netmask that contains 1-bits after 0-bits (the 1-bits are not
    contiguous on the left side) is invalid [1] [2].
    
    The code before this PR used to parse and accept such
    non-left-contiguous netmasks. However, a coming change that will alter
    `CNetAddr::ip` to have flexible size would make juggling with such
    netmasks more difficult, thus drop support for those.
    
    [1] https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#Subnet_masks
    [2] https://tools.ietf.org/html/rfc4632#section-5.1
    
    (cherry picked from commit 1ea57ad)
    vasild authored and zancas committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    164e5ca View commit details
    Browse the repository at this point in the history
  2. net: improve encapsulation of CNetAddr

    Do not access `CNetAddr::ip` directly from `CService` methods.
    
    This improvement will help later when we change the type of
    `CNetAddr::ip` (in the BIP155 implementation).
    
    Co-authored-by: Carl Dong <[email protected]>
    (cherry picked from commit bc74a40)
    vasild authored and AloeareV committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    96b8700 View commit details
    Browse the repository at this point in the history
  3. net: Minor accumulated cleanups

    (cherry picked from commit 2c084a6)
    tjps authored and AloeareV committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    56fe29f View commit details
    Browse the repository at this point in the history
  4. fix uninitialized read when stringifying an addrLocal

    Reachable from either place where SetIP is used when our best-guess
    addrLocal for a peer is IPv4, but the peer tells us it's reaching us at
    an IPv6 address.
    
    In that case, SetIP turns an IPv4 address into an IPv6 address without
    setting the scopeId, which is subsequently read in GetSockAddr during
    CNetAddr::ToStringIP and passed to getnameinfo. Fix by ensuring every
    constructor initializes the scopeId field with something.
    
    (cherry picked from commit b7b36de)
    kazcw authored and AloeareV committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    e3b7de0 View commit details
    Browse the repository at this point in the history
  5. Do not increment nAttempts by more than one for every Good connection.

    This slows the increase of the nAttempts in addrman while partitioned,
     even if the node hasn't yet noticed the partitioning.
    
    (cherry picked from commit 6182d10)
    gmaxwell authored and AloeareV committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    100ec9a View commit details
    Browse the repository at this point in the history
  6. Add more methods to Span class

    This introduces a rudimentary begin(), end(), operator[], and subspan to Span.
    
    (cherry picked from commit 29943a9)
    sipa authored and zancas committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    e95cfc8 View commit details
    Browse the repository at this point in the history
  7. Make VerifyWitnessProgram use a Span stack

    This allows for very cheap transformations on the range of elements that
    are to be passed to ExecuteWitnessScript.
    
    (cherry picked from commit 2b0fcff)
    sipa authored and zancas committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    52c2d88 View commit details
    Browse the repository at this point in the history
  8. Support conversion between Spans of compatible types

    (cherry picked from commit 0fbde48)
    sipa authored and zancas committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    2011192 View commit details
    Browse the repository at this point in the history
  9. Make Span size type unsigned

    This matches a change in the C++20 std::span proposal.
    
    (cherry picked from commit 1f790a1)
    sipa authored and zancas committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    e846576 View commit details
    Browse the repository at this point in the history
  10. Make pointer-based Span construction safer

    This prevents constructing a Span<A> given two pointers into an array
    of B (where B is a subclass of A), at least without explicit cast to
    pointers to A.
    
    (cherry picked from commit bb3d38f)
    sipa authored and zancas committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    bdf76be View commit details
    Browse the repository at this point in the history
  11. Add Span constructors for arrays and vectors

    (cherry picked from commit ab303a1)
    sipa authored and zancas committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    5d47b41 View commit details
    Browse the repository at this point in the history
  12. Add sanity check asserts to span when -DDEBUG

    (cherry picked from commit 26acc8d)
    sipa authored and zancas committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    0131c53 View commit details
    Browse the repository at this point in the history
  13. Add MakeUCharSpan, to help constructing Span<[const] unsigned char>

    Based on a suggestion by Russell Yanofsky.
    
    (cherry picked from commit e63dcc3)
    sipa authored and zancas committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    86eef2b View commit details
    Browse the repository at this point in the history
  14. doc: Document Span pitfalls

    (cherry picked from commit 3502a60)
    sipa authored and zancas committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    3c6bfde View commit details
    Browse the repository at this point in the history
  15. span: Add Span::empty() and use it in script/descriptor

    (cherry picked from commit fa2ae0a)
    MarcoFalke authored and zancas committed Oct 6, 2021
    Configuration menu
    Copy the full SHA
    941b4c4 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2021

  1. Added feeler connections increasing good addrs in the tried table.

    Tests if addresses are online or offline by briefly connecting to them. These short lived connections are referred to as feeler connections. Feeler connections are designed to increase the number of fresh online addresses in tried by selecting and connecting to addresses in new. One feeler connection is attempted on average once every two minutes.
    
    This change was suggested as Countermeasure 4 in
    Eclipse Attacks on Bitcoin’s Peer-to-Peer Network, Ethan Heilman,
    Alison Kendler, Aviv Zohar, Sharon Goldberg. ePrint Archive Report
    2015/263. March 2015.
    
    (cherry picked from commit dbb1f64)
    EthanHeilman authored and zancas committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    c97e882 View commit details
    Browse the repository at this point in the history
  2. upgrades former 3 arg call to OpenNetwork connection to _NOT_ count a…

    …ttempts. THIS NEEDS REVIEW
    zancas committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    c2f6816 View commit details
    Browse the repository at this point in the history
  3. Add test-before-evict discipline to addrman

    Changes addrman to use the test-before-evict discipline in which an
    address is to be evicted from the tried table is first tested and if
    it is still online it is not evicted.
    
    Adds tests to provide test coverage for this change.
    
    This change was suggested as Countermeasure 3 in
    Eclipse Attacks on Bitcoin’s Peer-to-Peer Network, Ethan Heilman,
    Alison Kendler, Aviv Zohar, Sharon Goldberg. ePrint Archive Report
    2015/263. March 2015.
    
    (cherry picked from commit e68172e)
    Ethan Heilman authored and zancas committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    9f18d85 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b527735 View commit details
    Browse the repository at this point in the history
  5. Add asmap utility which queries a mapping

    The scripts for creating a compact IP->ASN mapping are here:
    https://github.com/sipa/asmap
    
    Co-authored-by: Pieter Wuille <[email protected]>
    (cherry picked from commit 8feb4e4)
    naumenkogs authored and zancas committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    4af446f View commit details
    Browse the repository at this point in the history
  6. net: Create CConnman to encapsulate p2p connections

    (cherry picked from commit cd16f48)
    theuni authored and zancas committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    6290aa4 View commit details
    Browse the repository at this point in the history
  7. net: Move socket binding into CConnman

    (cherry picked from commit 02137f1)
    theuni authored and zancas committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    095fd31 View commit details
    Browse the repository at this point in the history
  8. net: Add rpc error for missing/disabled p2p functionality

    (cherry picked from commit d7349ca)
    theuni authored and zancas committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    cbac756 View commit details
    Browse the repository at this point in the history
  9. net: move OpenNetworkConnection into CConnman

    (cherry picked from commit b1a5f43)
    theuni authored and zancas committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    09f2477 View commit details
    Browse the repository at this point in the history