Add minisketch subtree and integrate in build/test #21859

pull sipa wants to merge 9 commits into bitcoin:master from sipa:202105_minisketch changing 84 files +8930 −23
  1. sipa commented at 1:23 am on May 5, 2021: member

    This adds a src/minisketch subtree, taken from the master branch of https://github.com/sipa/minisketch, to prepare for Erlay implementation (see #21515). It gets configured for just supporting 32-bit fields (the only ones we’re interested in in the context of Erlay), and some code on top is added:

    • A very basic unit test (just to make sure compilation & running works; actual correctness checking is done through minisketch’s own tests).
    • A wrapper in minisketchwrapper.{cpp,h} that runs a benchmark to determine which field implementation to use.
  2. fanquake added the label Upstream on May 5, 2021
  3. sipa force-pushed on May 5, 2021
  4. sipa commented at 2:04 am on May 5, 2021: member
    @sipsorcery Could you help with adding MSVC build config here?
  5. sipa force-pushed on May 5, 2021
  6. sipsorcery commented at 7:23 am on May 5, 2021: member
    @sipa will do.
  7. MarcoFalke commented at 7:28 am on May 5, 2021: member

    From ci:

    0
    1SUMMARY: MemorySanitizer: use-of-uninitialized-value /tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/minisketch/src/fields/clmul_common_impl.h:23:23 in unsigned int (anonymous namespace)::MulWithClMulReduce<unsigned int, 32, 141u>(unsigned int, unsigned int)
    2  ORIGIN: invalid (0). Might be a bug in MemorySanitizer origin tracking.
    3    This could still be a bug in your code, too!
    
  8. sipa commented at 7:31 am on May 5, 2021: member
    @MarcoFalke I believe it is simply msan not being able to reason through the intrinsics (see src/minisketch/src/field/clmul_common_impl.h).
  9. Subawit approved
  10. in src/minisketch/src/minisketch.cpp:355 in 7faf0937cf outdated
    350+                throw;
    351+            }
    352+            sketch->Ready();
    353+        }
    354+        return (minisketch*)sketch;
    355+    } catch (std::bad_alloc& ba) {
    


    sipsorcery commented at 12:04 pm on May 5, 2021:
    ba isn’t used. Can it be removed?

    sipa commented at 7:01 pm on May 7, 2021:
    Indeed, removed.
  11. in src/minisketch/src/minisketch.cpp:348 in 7faf0937cf outdated
    343+    try {
    344+        Sketch* sketch = Construct(bits, implementation);
    345+        if (sketch) {
    346+            try {
    347+                sketch->Init(capacity);
    348+            } catch (std::bad_alloc& ba) {
    


    sipsorcery commented at 12:05 pm on May 5, 2021:
    ba isn’t used. Can it be removed?

    sipa commented at 7:01 pm on May 7, 2021:
    Indeed, removed.
  12. sipsorcery commented at 2:31 pm on May 5, 2021: member

    Attached diff adds a minisketch project to the msvc build config. I did make a few small code changes to minisketch.h and minisketch.cpp to remove a warning and change the location for a header.

    minisketch.diff.gz

  13. DrahtBot added the label Needs rebase on May 5, 2021
  14. jnewbery commented at 9:56 am on May 6, 2021: member
    Do minisketch’s own tests get run when running make check from bitcoin’s base directory? I think it’d be good to modify make check to only run the base bitcoin tests, and then have another build target (make check_all?) that also runs the subtree unit tests. Those subtrees only get updated every few months. I expect many developers run make check many times a day and it seems wasteful to rerun the same unmodified tests on the same unmodified subtrees every time.
  15. MarcoFalke commented at 10:12 am on May 6, 2021: member
    CI would need to run them, though. As this is the only place where sanitizers are run regularly.
  16. sipa force-pushed on May 7, 2021
  17. sipa force-pushed on May 7, 2021
  18. sipa force-pushed on May 7, 2021
  19. sipa force-pushed on May 7, 2021
  20. sipa force-pushed on May 7, 2021
  21. sipa force-pushed on May 7, 2021
  22. sipa force-pushed on May 7, 2021
  23. sipa force-pushed on May 7, 2021
  24. DrahtBot removed the label Needs rebase on May 7, 2021
  25. sipa force-pushed on May 7, 2021
  26. sipa force-pushed on May 7, 2021
  27. DrahtBot commented at 9:10 am on May 7, 2021: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #22646 ([POC] Tighter Univalue integration, remove --with-system-univalue by fanquake)
    • #21515 (Erlay: bandwidth-efficient transaction relay protocol by naumenkogs)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  28. MarcoFalke commented at 9:18 am on May 7, 2021: member

    Failure on arm: ./build-aux/test-driver: line 107: ./test-verify: cannot execute binary file: Exec format error

    You might have to modify the ./ci/test/wrap-qemu.sh script.

  29. sipa force-pushed on May 7, 2021
  30. sipa commented at 7:06 pm on May 7, 2021: member

    @sipsorcery Thanks, I’ve incorporated some of your changes (see https://github.com/sipa/minisketch/pull/36), and MSVC build/test works now.

    At least one issue remains: when running the minisketch tests, wine can’t find libgcc and other dlls. In minisketch’s own CI that’s worked around by passing CXXFLAGS=-static -static-libgcc -static-libstdc++, but it’s a bit ugly to pass that through to the sub-configure (a) only for the win64 cirrus build and (b) without doing that for non-minisketch targets. Anyone have a suggestion?

    • Make wine find the necessary dll’s somehow?
    • Just pass CXXFLAGS=-static -static-libgcc -static-libstdc++ in general to the win64 cirrus configure?
    • I have no idea how src/test/test_bitcoin.exe avoids this problem, but perhaps its solution is usable too?
  31. practicalswift commented at 8:22 pm on May 7, 2021: contributor

    Concept ACK

    Very nice work sipa, gmaxwell and naumenkogs!

    Is it mentioned somewhere in the documentation that Minisketch::Add is not an idempotent operation?

    In other words that …

    0sketch.Add(i);
    

    … does not have the same effect as …

    0sketch.Add(i);
    1sketch.Add(i);
    

    FWIW I couldn’t find any such note in src/minisketch/include/minisketch.h :)

  32. sipa commented at 9:10 pm on May 7, 2021: member
    @practicalswift It’s explained in https://github.com/sipa/minisketch/#readme at least, and inherent to symmetric set reconciliation. I don’t think the header file should try to explain set reconciliation in detail, but if you have specific suggestions to improve the header, feel free to PR them (in the minisketch repo).
  33. practicalswift commented at 9:57 pm on May 7, 2021: contributor

    @practicalswift It’s explained in https://github.com/sipa/minisketch/#readme at least, and inherent to symmetric set reconciliation. I don’t think the header file should try to explain set reconciliation in detail, but if you have specific suggestions to improve the header, feel free to PR them (in the minisketch repo).

    I think the following should be enough to help avoid unnecessary mistakes in calling code in the hypothetical scenario that the library user is not familiar with set reconciliation details. Submitted as https://github.com/sipa/minisketch/pull/38.

     0diff --git a/include/minisketch.h b/include/minisketch.h
     1index d73123d..23af18f 100644
     2--- a/include/minisketch.h
     3+++ b/include/minisketch.h
     4@@ -104,6 +104,8 @@ void minisketch_deserialize(minisketch* sketch, const unsigned char* input);
     5  * If the element to be added is 0 (after potentially dropping the most significant
     6  * bits), then this function is a no-op. Sketches cannot contain an element with
     7  * the value 0.
     8+ *
     9+ * Note that adding the same element a second time removes it again.
    10  */
    11 void minisketch_add_uint64(minisketch* sketch, uint64_t element);
    12
    13@@ -246,7 +248,7 @@ public:
    14         return *this;
    15     }
    16
    17-    /** See miniksetch_add_element(). */
    18+    /** See minisketch_add_uint64(). */
    19     Minisketch& Add(uint64_t element) noexcept
    20     {
    21         minisketch_add_uint64(m_minisketch.get(), element);
    
  34. sipa force-pushed on May 7, 2021
  35. sipa force-pushed on May 8, 2021
  36. sipa force-pushed on May 8, 2021
  37. sipa force-pushed on May 8, 2021
  38. practicalswift commented at 3:12 pm on May 8, 2021: contributor

    Another interface design question:

    The Minisketch constructor does not signal constructor failure by throwing.

    Is that intentional to allow for use in non-Bitcoin Core environments where using exceptions may not be an option?

    I’m a bit worried that the current design might introduce a gotcha/sharp edge which is probably best illustrated by the example below.

    To be clear: I understand there is a trade-off here and perhaps this gotcha is a price worth paying for a potentially larger user base of the library outside of Bitcoin Core, but I just want to make sure I fully understand the rationale behind the current interface design :)


    Highly optional review club style quiz (target audience: reviewers and library users :))

    After reading the documentation in include/minisketch.h a library user might write the following code:

     0constexpr size_t FIELD_SIZE = 32;
     1constexpr size_t BYTES_PER_SKETCH_CAPACITY = FIELD_SIZE / 8;
     2constexpr size_t MAX_SKETCH_CAPACITY = 8192;
     3
     4void ProcessSketchMessage(const std::vector<uint8_t>& remote_sketch_serialized) {
     5    const size_t remote_capacity = remote_sketch_serialized.size() / BYTES_PER_SKETCH_CAPACITY;
     6    if (remote_capacity > MAX_SKETCH_CAPACITY) {
     7        // Sketch too large. Skip processing.
     8        return;
     9    }
    10    Minisketch remote_sketch{FIELD_SIZE, 0, remote_capacity};
    11    if (remote_sketch_serialized.size() != remote_sketch.GetSerializedSize()) {
    12        // Unexpected sketch size. Skip processing.
    13        return;
    14    }
    15    remote_sketch.Deserialize(remote_sketch_serialized);
    16    // …
    17    // Do something useful.
    18    // …
    19}
    

    Looks quite reasonable? :)

    The library user is happy with his/her code: he/she gets the expected results when testing it using a couple of thousand normal test cases. Symmetric set reconciliation is fun! :)

    However, the library user becomes a bit sad when an attacker shows up and provides a carefully crafted input which causes a nullptr dereference.

    Review club style quiz questions:

    • What is the attacker input that caused the nullptr dereference?
    • Where does the nullptr dereference take place?
    • Did the library user miss anything of importance when reading the documentation in include/minisketch.h?
    • What is the conventional approach to construction failure and what is the “zombie object” approach? When/why is the latter approach used?
  39. sipa commented at 3:19 pm on May 8, 2021: member
    @practicalswift You mean because the construction internally OOMs? If that happens you have bigger problems, I think, as you’d generally use this with capacities of 10s to maybe 1000s. Beyond that, O(n^2) decoding cost starts to make it unusable.
  40. sipa force-pushed on May 8, 2021
  41. sipa force-pushed on May 8, 2021
  42. practicalswift commented at 5:41 pm on May 8, 2021: contributor

    You mean because the construction internally OOMs? If that happens you have bigger problems, I think, as you’d generally use this with capacities of 10s to maybe 1000s. Beyond that, O(n^2) decoding cost starts to make it unusable. @sipa No, note that the user code in the example is very careful about not processing large inputs, so memory exhaustion or excessive run-time is not the problem here.

    The if (remote_capacity > MAX_SKETCH_CAPACITY) { guards against large inputs:

     0constexpr size_t FIELD_SIZE = 32;
     1constexpr size_t BYTES_PER_SKETCH_CAPACITY = FIELD_SIZE / 8;
     2constexpr size_t MAX_SKETCH_CAPACITY = 8192;
     3
     4void ProcessSketchMessage(const std::vector<uint8_t>& remote_sketch_serialized) {
     5    const size_t remote_capacity = remote_sketch_serialized.size() / BYTES_PER_SKETCH_CAPACITY;
     6    if (remote_capacity > MAX_SKETCH_CAPACITY) {
     7        // Sketch too large. Skip processing.
     8        return;
     9    }
    10    Minisketch remote_sketch{FIELD_SIZE, 0, remote_capacity};
    11    if (remote_sketch_serialized.size() != remote_sketch.GetSerializedSize()) {
    12        // Unexpected sketch size. Skip processing.
    13        return;
    14    }
    15    remote_sketch.Deserialize(remote_sketch_serialized);
    16    // …
    17    // Do something useful.
    18    // …
    19}
    

    WARNING! Spoiler alert! WARNING!

  43. sipa commented at 5:47 pm on May 8, 2021: member

    @practicalswift You can use if (sketch) to detect if a sketch is usable, which may be the case for several reasons (field not implemented, implementation number too high or incompatible with field, illegal capacity, OOM, …).

    See https://github.com/sipa/minisketch/pull/39 for some improvements to the documentation.

  44. sipa referenced this in commit 2bec6d9bf3 on May 8, 2021
  45. sipa force-pushed on May 8, 2021
  46. sipa force-pushed on May 8, 2021
  47. practicalswift commented at 10:36 pm on May 8, 2021: contributor

    @sipa

    You can use if (sketch) to detect if a sketch is usable, which may be the case for several reasons (field not implemented, implementation number too high or incompatible with field, illegal capacity, OOM, …).

    See sipa/minisketch#39 for some improvements to the documentation.

    Thanks for updating the documentation. Now the gotcha is documented: that is better :)

    I’m aware that operator bool() can be used to check if a Minisketch object is a valid object or a zombie object: I’m just afraid that there is a real risk of “use-before-zombie-check” errors.

    My experience is that signalling constructor failure by silently creating a zombie object (instead of throwing) leads to fragile code. Most C++ programmers are used to constructors that either create a fully valid object or throw. Even if the programmer is aware that the somewhat unusual “zombie check idiom” is used it is very easy to miss checking it in at least some code path.

    See the current Erlay code txreconciliation.cpp (#21515) as an example. Not all code paths do “zombie checking” using operator bool() before using a newly created Minisketch object.

    Consider this example:

    https://github.com/bitcoin/bitcoin/blob/1d8d43ed095ef7abade4d62ddc2ede34d4a1a59b/src/txreconciliation.cpp#L559

    If we were throwing instead of creating a zombie object in case of constructor failure we wouldn’t have to worry about a potential nullptr dereference here.

    That’s why I’m curious about this interface design choice to better understand the trade-offs considered: are we intentionally avoiding throwing to allow for use in non-Bitcoin Core environments where using exceptions may not be an option, or am I missing some other reason for this design choice? :)

  48. sipa commented at 0:15 am on May 9, 2021: member
    @practicalswift Exceptions in my opinion are for exceptional situations - things that couldn’t have been reasonably prevented by the programmer (things like I/O failure, for example), as they can be deep down in a function call stack, and dealing with them along the way there is both inconvenient and pointless. Except for OOM perhaps, none of the cases where Minisketch construction fails are like this - they all indicate the programmer is doing something wrong. It wouldn’t be unreasonable to have assertions for them instead, I guess. OOM is a bit different as it is an exceptional situation, but it’s also one that can’t occur realistically (due to the size of sketches libminisketch can work with) and is almost always a nothing-can-be-done-about-this situation (you’d just terminate as ~all allocations will fail).
  49. MarcoFalke added the label Needs gitian build on May 9, 2021
  50. MarcoFalke added the label Needs Guix build on May 9, 2021
  51. practicalswift commented at 10:31 pm on May 9, 2021: contributor

    @sipa

    Assuming that we really don’t want to throw in the constructor:

    Perhaps an alternative could be to use the named constructor idiom and return std::optional<Minisketch>? (With std::nullopt being returned if a valid/usable Minisketch object could not constructed.)

    Something along the lines of:

    0class Minisketch {
    1private:
    2    Minisketch(uint32_t bits, uint32_t implementation, size_t capacity) noexcept;
    3    
    4public:
    5    static std::optional<Minisketch> Create(uint32_t bits, uint32_t implementation, size_t capacity) noexcept;
    6    
    7}
    

    To be precise the situation I’m worried about with the current design is when capacity in Minisketch(uint32_t bits, uint32_t implementation, size_t capacity) is indirectly attacker controlled via the attacker provided serialized sketch, and the programmer forgets to check the possibility of a zombie state Minisketch object before using it. Note that if capacity is 0 then an invalid zombie state Minisketch object is created, and using such an invalid Minisketch object will cause a nullptr dereference as the library is currently written.

    Note that the programmer is likely to check for a “too large” sketch: he/she is likely to intuitively understand that such a thing might be dangerous, but the fact that a “too small” sketch is dangerous too is a real gotcha IMO :)

    Exceptions in my opinion are for exceptional situations - things that couldn’t have been reasonably prevented by the programmer (things like I/O failure, for example), as they can be deep down in a function call stack, and dealing with them along the way there is both inconvenient and pointless.

    Thanks for sharing your perspective. I know you’re well aware of all the usual counterarguments, but I’m sharing some links to other perspectives for reviewers who might be unaware :)

  52. sipa commented at 10:35 pm on May 9, 2021: member

    Perhaps an alternative could be to use the named constructor idiom and return std::optional

    I think that’s rather silly, because that’s effectively what a Minisketch object already is. It is a simple wrapper around std::unique_ptr, and behaves exactly like that (except that the internal object is not accessible).

  53. practicalswift commented at 10:49 pm on May 9, 2021: contributor

    @sipa

    I think you’re missing my point.

    Perhaps my point is better explained in code.

    Executing …

    0Minisketch sketch{32, 0, /* likely to be attacker controlled */ 0};
    1sketch.GetCapacity(); // or really any operation on the invalid Minisketch zombie object
    

    … currently yields …

    0==30177==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x55a2bc704dcb bp 0x7ffe524b6070 sp 0x7ffe524b6040 T0)
    1==30177==The signal is caused by a READ memory access.
    2==30177==Hint: address points to the zero page.
    3    [#0](/bitcoin-bitcoin/0/) 0x55a2bc704dcb in Sketch::Check() const /home/thomas/bitcoin/src/minisketch/src/sketch.h:24:39
    4    [#1](/bitcoin-bitcoin/1/) 0x55a2bc704dcb in minisketch_capacity /home/thomas/bitcoin/src/minisketch/src/minisketch.cpp:368:8
    5    [#2](/bitcoin-bitcoin/2/) 0x55a2bb3fc61b in Minisketch::GetCapacity() const ./minisketch/include/minisketch.h:239:50
    6
    

    Is that how we want it to work? :)

  54. sipa commented at 11:28 pm on May 9, 2021: member

    @practicalswift I understand your point, but I don’t think there is a big difference with what you’re suggesting.

    0std::optional<Minisketch> sketch = Minisketch::Create(32, 0, 0);
    1sketch->GetCapacity();
    

    is equally going to cause problems, if the API user isn’t aware the create call can fail. And when those problems appear, it’ll be obvious where the problem is.

    Perhaps a better question is: would removing the capacity==0 edge case not solve more problems?

    EDIT: see https://github.com/sipa/minisketch/pull/40

  55. jnewbery commented at 8:07 am on May 10, 2021: member

    @sipa I haven’t read all the discussion in this PR so don’t want to weigh in on the interface design, but:

    I don’t think there is a big difference with what you’re suggesting.

    0std::optional<Minisketch> sketch = Minisketch::Create(32, 0, 0);
    1sketch->GetCapacity();
    

    is equally going to cause problems, if the API user isn’t aware the create call can fail.

    is certainly different from returning a bare object that may be in a valid or invalid state. Unwrapping an optional without first checking that it contains a value is very clearly a bug, and should be obvious to any programmer or compiler, even if they don’t know the semantics of the library function that is being called.

  56. sipa referenced this in commit ba7905f91e on May 10, 2021
  57. sipa commented at 9:13 pm on May 10, 2021: member

    @jnewbery Sure, it’s better at conveying to the API user that the call may fail. But I think that’s the wrong information: it’ll only fail when used incorrectly (*). It’s not something the user should be checking for in the first place - what would be done at runtime with that information? The only thing that needs to happen is fixing the code. Putting an optional around it adds both unnecessary overhead, and the wrong signal IMO.

    (*) I admit that capacity=0 was an edge case that could occur at runtime, and would be unexpected. Just merged https://github.com/sipa/minisketch/pull/40 to fix that, will update this PR to reflect that.

  58. practicalswift commented at 2:13 pm on May 11, 2021: contributor

    @sipa

    Thanks for addressing the capacity=0 edge case. That resolves my concern.

    I’m not particularly worried about the other two constructor failure cases (std::bad_alloc and unavailable combination of bits/implementation) since the conditions triggering them are much less likely to be under attacker control.

  59. sipa force-pushed on May 11, 2021
  60. DrahtBot removed the label Needs Guix build on May 12, 2021
  61. MarcoFalke commented at 2:59 pm on May 12, 2021: member
     0+ make -C src --jobs=1 check-symbols V=1
     1make: Entering directory '/distsrc-base/distsrc-202a89b644f0-x86_64-linux-gnu/src'
     2Checking glibc back compat...
     3CPPFILT=/root/.guix-profile/bin/x86_64-linux-gnu-c++filt /root/.guix-profile/bin/python3.8 ../contrib/devtools/symbol-check.py bitcoind  bitcoin-cli bitcoin-tx bitcoin-wallet bitcoin-util test/test_bitcoin  qt/bitcoin-qt  
     4bitcoind: export of symbol typeinfo for std::ios_base::failure[abi:cxx11] not allowed
     5bitcoind: export of symbol VTT for std::basic_ifstream<char, std::char_traits<char> > not allowed
     6bitcoind: export of symbol vtable for std::basic_streambuf<char, std::char_traits<char> > not allowed
     7bitcoind: export of symbol std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf() not allowed
     8bitcoind: export of symbol typeinfo for std::_V2::error_category not allowed
     9bitcoind: export of symbol typeinfo for std::invalid_argument not allowed
    10bitcoind: export of symbol vtable for std::basic_ifstream<char, std::char_traits<char> > not allowed
    11bitcoind: export of symbol typeinfo for std::out_of_range not allowed
    12bitcoind: export of symbol std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf() not allowed
    13bitcoind: export of symbol std::cerr not allowed
    14bitcoind: export of symbol vtable for std::basic_filebuf<char, std::char_traits<char> > not allowed
    15bitcoind: export of symbol typeinfo for std::future_error not allowed
    16bitcoind: export of symbol vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> > not allowed
    17bitcoind: export of symbol vtable for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> > not allowed
    18bitcoind: export of symbol std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf() not allowed
    19bitcoind: export of symbol typeinfo for std::logic_error not allowed
    20bitcoind: export of symbol VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> > not allowed
    21bitcoind: export of symbol std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long) not allowed
    22bitcoind: export of symbol vtable for std::future_error not allowed
    23bitcoind: export of symbol typeinfo for std::runtime_error not allowed
    24bitcoind: export of symbol std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) not allowed
    25bitcoind: export of symbol std::nothrow not allowed
    26bitcoind: export of symbol vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> > not allowed
    27bitcoind: export of symbol std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long) not allowed
    28bitcoind: export of symbol std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long) not allowed
    29bitcoind: export of symbol vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> > not allowed
    30bitcoind: export of symbol VTT for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> > not allowed
    31bitcoind: export of symbol vtable for std::bad_alloc not allowed
    32bitcoind: export of symbol typeinfo for std::bad_alloc not allowed
    33bitcoind: export of symbol std::ctype<char>::do_widen(char) const not allowed
    34bitcoind: export of symbol vtable for std::basic_ios<char, std::char_traits<char> > not allowed
    35bitcoind: export of symbol typeinfo for std::locale::facet not allowed
    36bitcoind: export of symbol vtable for std::system_error not allowed
    37bitcoind: export of symbol VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> > not allowed
    38bitcoind: export of symbol typeinfo for long not allowed
    39bitcoind: export of symbol vtable for std::ios_base::failure[abi:cxx11] not allowed
    40bitcoind: export of symbol typeinfo for short not allowed
    41bitcoind: export of symbol typeinfo for unsigned short not allowed
    42bitcoind: export of symbol std::cout not allowed
    43bitcoind: export of symbol typeinfo for void not allowed
    44bitcoind: export of symbol std::num_get<char, std::istreambuf_iterator<char, std::char_traits<char> > >::id not allowed
    45bitcoind: export of symbol void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>(char const*, char const*, std::forward_iterator_tag) not allowed
    46bitcoind: export of symbol void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) not allowed
    47bitcoind: export of symbol vtable for std::num_get<char, std::istreambuf_iterator<char, std::char_traits<char> > > not allowed
    48bitcoind: NEEDED library libstdc++.so.6 is not allowed
    49bitcoind: failed EXPORTED_SYMBOLS LIBRARY_DEPENDENCIES
    
  62. sipa commented at 6:53 pm on May 12, 2021: member
    @MarcoFalke Ok, please advise?
  63. MarcoFalke commented at 7:24 pm on May 12, 2021: member
    No idea what that failure is. The build people will have to take a look.
  64. MarcoFalke commented at 7:25 pm on May 12, 2021: member
    I am just saying that this can’t be merged (yet) because it would break the guix build.
  65. sipa commented at 7:33 pm on May 12, 2021: member

    Oh, I see. I thought it was a clarification on why it’s complaining about missing libraries (but it may well be related).

    The build people will have to take a look.

    The great miners and craftsmen of the mountain halls?

  66. sipa force-pushed on May 12, 2021
  67. sipa force-pushed on May 12, 2021
  68. sipa force-pushed on May 13, 2021
  69. sipa force-pushed on May 13, 2021
  70. sipa force-pushed on May 13, 2021
  71. practicalswift commented at 7:05 am on May 13, 2021: contributor
    cr ACK b195ae3af078a9038c7d654a267eb14b9332ae70 modulo CI green: patch looks correct, minisketch is awesome and changes are limited to Makefile.am, build_msvc/, ci/, configure.ac, src/Makefile.*, src/minisketch/, src/minisketchwrapper.cpp, src/minisketchwrapper.h, src/test/minisketch_tests.cpp and test/lint/.
  72. sipa force-pushed on May 13, 2021
  73. sipa force-pushed on May 14, 2021
  74. DrahtBot removed the label Needs gitian build on May 14, 2021
  75. MarcoFalke deleted a comment on May 14, 2021
  76. sipa force-pushed on May 15, 2021
  77. sipa referenced this in commit 4c1d32bfd4 on May 16, 2021
  78. sipa force-pushed on May 16, 2021
  79. sipa added the label Needs gitian build on May 16, 2021
  80. sipa added the label Needs Guix build on May 16, 2021
  81. sipa commented at 3:39 am on May 16, 2021: member
    @MarcoFalke Build issues resolved, I believe.
  82. practicalswift commented at 3:49 pm on May 16, 2021: contributor
    cr re-ACK 35049cf2a16a63bd1adf511e8c0ac526be5e4e8a CI now green, patch looks correct, minisketch is still awesome and changes are limited to Makefile.am, build_msvc/, ci/, configure.ac, src/Makefile.*, src/minisketch/, src/minisketchwrapper.cpp, src/minisketchwrapper.h, src/test/minisketch_tests.cpp and test/lint/.
  83. DrahtBot removed the label Needs gitian build on May 17, 2021
  84. in src/minisketchwrapper.cpp:8 in 35049cf2a1 outdated
    0@@ -0,0 +1,74 @@
    1+// Copyright (c) 2021 The Bitcoin Core developers
    2+// Distributed under the MIT software license, see the accompanying
    3+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
    4+
    5+#include <minisketchwrapper.h>
    6+
    7+#include <minisketch.h>
    8+#include <logging.h>
    9+#include <util/time.h>
    


    jnewbery commented at 10:57 am on May 20, 2021:

    Perhaps:

    0#include <logging.h>
    1#include <util/time.h>
    2
    3#include <minisketch.h>
    

    (since minisketch.h is a separate library import)

  85. in src/minisketchwrapper.cpp:14 in 35049cf2a1 outdated
     9+#include <util/time.h>
    10+
    11+#include <algorithm>
    12+#include <optional>
    13+#include <stddef.h>
    14+#include <stdint.h>
    


    jnewbery commented at 10:58 am on May 20, 2021:
    I think the c++ headers are generally preferred (cstddef and cstdint)
  86. in src/minisketchwrapper.cpp:29 in 35049cf2a1 outdated
    21+{
    22+    std::optional<std::pair<int64_t, uint32_t>> best;
    23+
    24+    uint32_t max_impl = Minisketch::MaxImplementation();
    25+    for (uint32_t impl = 0; impl <= max_impl; ++impl) {
    26+        std::vector<int64_t> benches;
    


    jnewbery commented at 10:59 am on May 20, 2021:

    Perhaps:

    0        std::array<int64_t, 11> benches;
    

    Since the capacity is known upfront?

  87. in src/minisketchwrapper.h:10 in 35049cf2a1 outdated
     5+#ifndef BITCOIN_MINISKETCHWRAPPER_H
     6+#define BITCOIN_MINISKETCHWRAPPER_H
     7+
     8+#include <minisketch.h>
     9+#include <stddef.h>
    10+#include <stdint.h>
    


    jnewbery commented at 11:00 am on May 20, 2021:

    Separate standard library imports:

    0#include <minisketch.h>
    1
    2#include <cstddef>
    3#include <cstdint>
    
  88. in src/test/minisketch_tests.cpp:10 in 35049cf2a1 outdated
     6+#include <minisketchwrapper.h>
     7+#include <random.h>
     8+#include <test/util/setup_common.h>
     9+#include <vector>
    10+
    11+#include <boost/test/unit_test.hpp>
    


    jnewbery commented at 11:01 am on May 20, 2021:
    0
    1#include <boost/test/unit_test.hpp>
    2
    3#include <vector>
    
  89. jnewbery commented at 11:13 am on May 20, 2021: member

    utACK 35049cf2a1

    Only reviewed src/minisketchwrapper and src/test/minisketch_tests. Left a few very minor comments that should be ignored unless you need to retouch this branch for any reason.

  90. DrahtBot removed the label Needs Guix build on Jun 1, 2021
  91. sipa commented at 4:06 am on June 2, 2021: member
    It appears that linking in libminisketch causes bitcoind and other binaries to suddenly export(?) libstdc++ symbols. This is beyond my skills, I humbly request the services of the Build People.
  92. TheCharlatan commented at 6:34 pm on June 3, 2021: member

    Edit: Disregard, seems to be an issue with all posted guix builds, so unrelated to minisketch.

    Didn’t find anything about libstdc++ being included in the bitcoind binary, but on Ubuntu 18.04 running ldd bitcoind on the provided guix binaries errors on:

    0./bitcoind: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./bitcoind)
    1./bitcoind: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by ./bitcoind)
    

    Running objdump -T bitcoind | grep '2\.28\|2\.29' shows the offending symbols:

    00000000000000000      DF *UND*	0000000000000000  GLIBC_2.28  fcntl64
    10000000000000000      DF *UND*	0000000000000000  GLIBC_2.29  log
    20000000000000000      DF *UND*	0000000000000000  GLIBC_2.29  pow
    30000000000000000      DF *UND*	0000000000000000  GLIBC_2.29  exp
    

    I guess these need to be wrapped in compat/glibc_compat.cpp? I’m not sure if wrapping glibc functionality is still the workaround used currently. If so, there’s a stackoverflow answer detailing the wrapping of fcntl64: https://stackoverflow.com/questions/58472958/how-to-force-linkage-to-older-libc-fcntl-instead-of-fcntl64/58472959#58472959 . I guess log, pow and exp could be wrapped in the same way log2f is currently wrapped, they are also provided by GLIBC_2.2.5 on x86_64 (though I don’t know about the other architectures, might be a different version for arm).

  93. fanquake commented at 1:14 am on June 4, 2021: member

    Edit: Disregard, seems to be an issue with all posted guix builds, so unrelated to minisketch.

    Indeed, this is #21454, which does need fixing, but is not introduced by this PR.

  94. sipa commented at 2:09 am on June 4, 2021: member

    Well, there is still something making the guix build fail, with this in guix_build.log, which isn’t in master’s build:

    0Checking glibc back compat...
    1Checking glibc back compat...
    2CPPFILT=/root/.guix-profile/bin/x86_64-linux-gnu-c++filt /root/.guix-profile/bin/python3.8 ../contrib/devtools/symbol-check.py bitcoind  bitcoin-cli bitcoin-tx bitcoin-wallet bitcoin-util test/test_bitcoin  qt/bitcoin-qt  
    3bitcoind: export of symbol typeinfo for std::ios_base::failure[abi:cxx11] not allowed
    4...
    
  95. fanquake commented at 12:35 pm on June 4, 2021: member

    Well, there is still something making the guix build fail,

    Given the symbols that are being exported, is this be some sort of C++ version/ABI incompatibility problem? Will have a closer look shortly.

  96. DrahtBot added the label Needs rebase on Jun 7, 2021
  97. sipa force-pushed on Jul 2, 2021
  98. sipa added the label Needs Guix build on Jul 2, 2021
  99. sipa commented at 11:52 pm on July 2, 2021: member
    Rebased, and updated to include https://github.com/sipa/minisketch/pull/44.
  100. DrahtBot removed the label Needs rebase on Jul 3, 2021
  101. DrahtBot removed the label Needs Guix build on Jul 3, 2021
  102. MarcoFalke added the label Needs Guix build on Jul 5, 2021
  103. MarcoFalke deleted a comment on Jul 5, 2021
  104. MarcoFalke deleted a comment on Jul 5, 2021
  105. MarcoFalke deleted a comment on Jul 5, 2021
  106. MarcoFalke deleted a comment on Jul 5, 2021
  107. sipa force-pushed on Jul 5, 2021
  108. sipa commented at 4:27 am on July 6, 2021: member

    I still get these failures in guix that I can’t explain. @dongcarl @fanquake

    0qt/bitcoin-qt: symbol operator delete[](void*, unsigned long) from unsupported version CXXABI_1.3.9
    1qt/bitcoin-qt: symbol std::basic_istream<char, std::char_traits<char> >& std::getline<char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char) from unsupported version GLIBCXX_3.4.21
    2qt/bitcoin-qt: symbol std::basic_streambuf<char, std::char_traits<char> >::pbackfail(int) from unsupported version GLIBCXX_3.4
    3qt/bitcoin-qt: symbol std::allocator<char>::allocator(std::allocator<char> const&) from unsupported version GLIBCXX_3.4
    4...
    
  109. fanquake commented at 8:58 am on July 6, 2021: member

    I still get these failures in guix that I can’t explain. @dongcarl @fanquake

    This will fix them:

     0diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh
     1index e457840d1..9092c8862 100755
     2--- a/contrib/guix/libexec/build.sh
     3+++ b/contrib/guix/libexec/build.sh
     4@@ -287,7 +287,7 @@ mkdir -p "$DISTSRC"
     5                     ${HOST_CXXFLAGS:+CXXFLAGS="${HOST_CXXFLAGS}"} \
     6                     ${HOST_LDFLAGS:+LDFLAGS="${HOST_LDFLAGS}"}
     7 
     8-    sed -i.old 's/-lstdc++ //g' config.status libtool src/univalue/config.status src/univalue/libtool
     9+    sed -i.old 's/-lstdc++ //g' config.status libtool src/univalue/config.status src/univalue/libtool src/
    10minisketch/config.status src/minisketch/libtool
    11 
    12     # Build Bitcoin Core
    13     make --jobs="$JOBS" ${V:+V=1}
    
  110. sipa force-pushed on Jul 6, 2021
  111. sipa commented at 5:46 pm on July 6, 2021: member
    @fanquake That fixed it, great!
  112. sipa commented at 5:46 pm on July 6, 2021: member
    (don’t merge this yet, as it includes the as-of-yet unmerged sipa/minisketch#44)
  113. DrahtBot added the label Needs rebase on Jul 7, 2021
  114. laanwj added this to the "Blockers" column in a project

  115. in src/minisketch/include/minisketch.h:76 in f0d322d277 outdated
    71+MINISKETCH_API minisketch* minisketch_create(uint32_t bits, uint32_t implementation, size_t capacity);
    72+
    73+/** Get the element size of a sketch in bits. */
    74+MINISKETCH_API uint32_t minisketch_bits(const minisketch* sketch);
    75+
    76+/** Get the capacity of a sketch. */
    


    ariard commented at 0:06 am on July 15, 2021:

    Reading from the fuzzy paper “Codes and Syndromes”, should one interpret the capacity as the error-correcting distance C (here instantiated as binary BCH codes) ?

    Further the documentation says the decoding is always successful when the number of elements in the set is not higher than the capacity, though in fact set size != sketch capacity, as afaiu 0 element are pruned out of the sketch, so shouldn’t documentation says that decoding can be successful even in set size > sketch capacity ?


    sipa commented at 7:15 pm on July 17, 2021:

    The distance of the implicit BCH code is 2C+1. I don’t understand the rest of what you’re trying to say.

    EDIT: I was wrong earlier; the distance is 2C+1, not C+1.

  116. in src/minisketch/include/minisketch.h:93 in f0d322d277 outdated
    88+ * integer is acceptable, regardless of field size).
    89+ *
    90+ * When seed is -1, a fixed internal value with predictable behavior is
    91+ * used. It is only intended for testing.
    92+ */
    93+MINISKETCH_API void minisketch_set_seed(minisketch* sketch, uint64_t seed);
    


    ariard commented at 0:15 am on July 15, 2021:

    IIUC, sketches are initialized by default with std::random_device. If a user has a better source of randomness rather than this implementation-defined pseudo-random number generator, it should rather rely on it ?

    If so, I think comment could be clearer about when a user should decide between default random seed and user-provided value.

  117. in src/minisketch/include/minisketch.h:121 in f0d322d277 outdated
    116+/** Add an element to a sketch.
    117+ * 
    118+ * If the element to be added is too large for the sketch, the most significant
    119+ * bits of the element are dropped. More precisely, if the element size of
    120+ * `sketch` is b bits, then this function adds the unsigned integer represented
    121+ * by the b least significant bits of `element` to `sketch`.
    


    ariard commented at 0:40 am on July 15, 2021:

    Maybe you should point out to protocoltips.md, that’s the only other documentation place where collisions and their risks are explained ?

    Zooming out, what’s the collision model we care for Erlay ? I think there was an irc discussion a while back pointing that malicious inputs provoking collisions don’t really matter as if your peer want to fail transaction announcement there is a reduction to stay silent. So it’s more about accidental collisions, what’s the probability here with 32-bit elements, (2^32 / 2^256)^(set _size) ?


    sipa commented at 7:17 pm on July 17, 2021:
  118. in src/minisketch/include/minisketch.h:248 in f0d322d277 outdated
    243+        }
    244+        return *this;
    245+    }
    246+
    247+    /** Check whether this Minisketch object is valid. */
    248+    explicit operator bool() const noexcept { return bool{m_minisketch}; }
    


    ariard commented at 0:55 am on July 15, 2021:
    nit: could be called is_valid, more Core’s nomenclature-like imo?

    sipa commented at 7:17 pm on July 17, 2021:
    This isn’t Bitcoin Core, and I think this is the the most ideomatic approach (especially with the explicit which avoids accidental conversions).
  119. in src/minisketch/include/minisketch.h:271 in f0d322d277 outdated
    266+    {
    267+        m_minisketch = std::unique_ptr<minisketch, Deleter>(minisketch_create(bits, implementation, capacity));
    268+    }
    269+
    270+    /** Create a Minisketch object sufficiently large for the specified number of elements at given fpbits.
    271+     *  It may construct an invalid object, which you may need to check for. */
    


    ariard commented at 1:01 am on July 15, 2021:
    nit: make the “may” a “must”, at least I interpret the requirement on the non-wrapped construction already as a must “Use operator bool() to check that this isn’t the case before performing any other operations”

    sipa commented at 7:20 pm on July 17, 2021:
    See the comment above, which describes the conditions under which an invalid object may be constructed. There are reasonable use cases where you don’t need to check (you already made sure the fieldsize/implementation combination is supported, and you’re ok with treating OOM as a fatal error).
  120. ariard commented at 1:02 am on July 15, 2021: member
    Let me know if you prefer I review against the source repository.
  121. fanquake commented at 5:53 am on July 16, 2021: member

    After some discussion with @theuni, we are going to take a different approach to integrating the minisketch subtree, than what is currently proposed here. The new approach will be result in a somewhat cleaner integration, remove the need for running a sub-configure, as well as ensure we are building the minisketch library only using Bitcoin Cores build options, compiler flags etc. I expect there will be a branch demoing the approach available shortly.

    It could also be expected that we will follow suit with our other subtrees.

  122. theuni commented at 2:55 pm on July 16, 2021: member
    That’s a little more definitive than I would’ve put it, but yes, my preference would be tighter integration for the reasons @fanquake mentioned. @sipa Here’s my original POC demonstrating what I had in mind, matching the approach I’ve suggested for univalue (https://github.com/bitcoin-core/univalue/pull/19). I’ve started working on a more complete version for minisketch, but I’d like to make sure you’re not opposed to doing it that way first. If you’re good with it I can finish up in the next day or two.
  123. sipa commented at 7:20 pm on July 17, 2021: member
    @theuni @fanquake Sounds good to me.
  124. sipa commented at 7:36 pm on July 17, 2021: member
    @ariard I think your comments are more useful on https://github.com/sipa/minisketch.
  125. sipa force-pushed on Jul 17, 2021
  126. DrahtBot removed the label Needs rebase on Jul 17, 2021
  127. DrahtBot added the label Needs rebase on Jul 20, 2021
  128. theuni commented at 4:29 pm on July 20, 2021: member
    @sipa Is building the non-verify version of the lib and tests sufficient for Core? Or is it useful/necessary to run the -verify version as well along with our tests?
  129. sipa commented at 7:15 pm on July 20, 2021: member
    @theuni If it’s an issue, I think non-verify is sufficient. The verify mode mostly adds algorithmic property checks, not things that I’d expect to be very architecture/build dependent.
  130. theuni commented at 8:22 pm on July 20, 2021: member

    It’s not much of an issue, it’s just kinda hacky to build everything twice, especially if it’s unlikely to be as useful as it is running in the upstream tests. I can add it back if there’s a need.

    See here for a current integration branch: https://github.com/theuni/bitcoin/commits/minisketch-split . Not sure if it’s easier for you to integrate that into this PR or for me to pull your other changes in on top of mine? I’m happy to do the latter if you’d like.

  131. in src/minisketch/src/sketch_impl.h:386 in cf4897c0ef outdated
    381+            m_field.Serialize(writer, val);
    382+        }
    383+        writer.Flush();
    384+    }
    385+
    386+    void Deserialize(const unsigned char* ptr) override
    


    GeneFerneau commented at 7:15 pm on July 30, 2021:
    May be helpful to add a fuzz harness for sketch deserialization. A large number of security bugs come from deserializing untrusted data.
  132. fanquake commented at 7:28 am on August 12, 2021: member

    I’ve put together a branch for this. It’s based off current master and includes all the latest changes from upstream minisketch, as well as integrating the changes here with @theuni’s build changes. It’s available here: https://github.com/fanquake/bitcoin/tree/minisketch_integration.

    Note that I’ve included some of the review suggestions, as well as squashed one commit (https://github.com/theuni/bitcoin/commit/2fff4ce130ee11bc075e7a50354ce92db26795c2) from Corys branch. I’ve also made some additions to Makefile.minisketch.include, and pruned some unneeded changes from 8311cea203be8b61ae04b37bd323ab2323290180. Also dropped the use of BasicTestingSetup from the added minisketch test.

    I’ve opened an issue upstream, https://github.com/sipa/minisketch/issues/46, as now that we’ve got -Wimplicit-fallthrough turned on, we either need to annotate fallthroughs, or suppress the warnings. i.e:

     0minisketch/src/minisketch.cpp:104:13: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
     1            case 2:
     2            ^
     3minisketch/src/minisketch.cpp:104:13: note: insert '[[fallthrough]];' to silence this warning
     4            case 2:
     5            ^
     6            [[fallthrough]]; 
     7minisketch/src/minisketch.cpp:104:13: note: insert 'break;' to avoid fall-through
     8            case 2:
     9            ^
    10            break; 
    
  133. Squashed 'src/minisketch/' content from commit ea986a869
    git-subtree-dir: src/minisketch
    git-subtree-split: ea986a869eaff3120aa9c0caaf01143ce51471df
    faea0b7da0
  134. Merge commit 'faea0b7da0d4cad1856cc669e65e1f643b60354c' as 'src/minisketch' 58bcf74e18
  135. build: add configure checks for minisketch
    AC_DEFINE'd values won't be passed down to minisketch because it does not
    use bitcoin-config.h. Thus we need a way to know if we should manually add
    defines for minisketch files.
    1a64c4ef2e
  136. build: add minisketch build file and include it 3f841218ff
  137. build: link minisketch into bitcoind 85ca7b955d
  138. Add MSVC build configuration for libminisketch 0f12876d66
  139. Add minisketch dependency 2e5d0cc427
  140. Add basic minisketch tests e696deae5f
  141. Add thin Minisketch wrapper to pick best implementation 238bf6e8bd
  142. fanquake commented at 4:55 am on September 16, 2021: member
    I’ve updated my branch (https://github.com/fanquake/bitcoin/tree/minisketch_integration) to be rebased on master, include the upstream minisktech changes, namely https://github.com/sipa/minisketch/pull/45 & https://github.com/sipa/minisketch/pull/47 and update our integration accordingly. Had a conflict in the MSVC config files, not 100% sure if how it’s been resolved is correct.
  143. fanquake referenced this in commit dc5ee1439f on Sep 16, 2021
  144. sipa force-pushed on Sep 17, 2021
  145. sipa commented at 3:46 pm on September 17, 2021: member
    Reviewed @fanquake’s branch, and switched to it.
  146. DrahtBot removed the label Needs rebase on Sep 17, 2021
  147. DrahtBot commented at 1:23 am on September 19, 2021: member

    Guix builds

    File commit e69cbac628bfdca4a8e4ead821190eaf5b6b3d07(master) commit d40c25adfc5a07488fdd4cd168af74ed520bac2f(master and this pull)
    SHA256SUMS.part 3a878af99efa151a...
    *-aarch64-linux-gnu-debug.tar.gz 504514ca43584dc4...
    *-aarch64-linux-gnu.tar.gz a7f1043c5be2bad7...
    *-arm-linux-gnueabihf-debug.tar.gz 01025cf9adb91f2f...
    *-arm-linux-gnueabihf.tar.gz fe378f5c927d3c18...
    *-osx-unsigned.dmg 58d3a322c88960b2...
    *-osx-unsigned.tar.gz 5f841485eaff6daf...
    *-osx64.tar.gz d55e205495c5d767...
    *-powerpc64-linux-gnu-debug.tar.gz 9a6c6812019b74bf...
    *-powerpc64-linux-gnu.tar.gz 0ee4928babe8a06f...
    *-powerpc64le-linux-gnu-debug.tar.gz 1d342c95661b5b24...
    *-powerpc64le-linux-gnu.tar.gz bd8ea614f91c2853...
    *-riscv64-linux-gnu-debug.tar.gz 5469fc63a961d097...
    *-riscv64-linux-gnu.tar.gz 1e316726edf1fe21...
    *-win-unsigned.tar.gz 1c32a6162f0f5538...
    *-win64-debug.zip e7640bc4e2145270...
    *-win64-setup-unsigned.exe 8e1ff1a0052908f7...
    *-win64.zip 4ce4c3029f41f5af...
    *-x86_64-linux-gnu-debug.tar.gz 93faa3c2bd0f0d33...
    *-x86_64-linux-gnu.tar.gz 40e4f747759f74c3...
    *.tar.gz ec27e3d27919ffdc... 76ccd2524fc79166...
    guix_build.log 31ace9d1e85bed5c... 2b355a35d6fe8e3d...
    guix_build.log.diff 440a46f08e4ab3e9...
  148. DrahtBot removed the label DrahtBot Guix build requested on Sep 19, 2021
  149. in contrib/guix/libexec/build.sh:300 in 238bf6e8bd
    296@@ -297,7 +297,7 @@ mkdir -p "$DISTSRC"
    297                     ${HOST_CXXFLAGS:+CXXFLAGS="${HOST_CXXFLAGS}"} \
    298                     ${HOST_LDFLAGS:+LDFLAGS="${HOST_LDFLAGS}"}
    299 
    300-    sed -i.old 's/-lstdc++ //g' config.status libtool src/univalue/config.status src/univalue/libtool
    301+    sed -i.old 's/-lstdc++ //g' config.status libtool src/univalue/config.status src/univalue/libtool src/minisketch/config.status src/minisketch/libtool
    


    MarcoFalke commented at 7:10 am on September 19, 2021:
     0Options used to compile and link:
     1  external signer = yes
     2  multiprocess    = no
     3  with libs       = yes
     4  with wallet     = yes
     5    with sqlite   = yes
     6    with bdb      = yes
     7  with gui / qt   = yes
     8    with qr       = yes
     9  with zmq        = yes
    10  with test       = yes
    11  with bench      = no
    12  with upnp       = yes
    13  with natpmp     = yes
    14  use asm         = yes
    15  ebpf tracing    = no
    16  sanitizers      = 
    17  debug enabled   = no
    18  gprof enabled   = no
    19  werror          = no
    20
    21  target os       = linux
    22  build os        = linux-gnu
    23
    24  CC              = x86_64-linux-gnu-gcc
    25  CFLAGS          = -pthread -pipe -O2 -O2 -g -ffile-prefix-map=/bitcoin=.
    26  CPPFLAGS        =   -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I/bitcoin/depends/x86_64-linux-gnu/include/  -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -DPROVIDE_FUZZ_MAIN_FUNCTION
    27  CXX             = x86_64-linux-gnu-g++ -std=c++17
    28  CXXFLAGS        =   -fstack-reuse=none -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection     -pipe -O2 -O2 -g -ffile-prefix-map=/bitcoin=. -fno-extended-identifiers -fvisibility=hidden
    29  LDFLAGS         = -lpthread  -Wl,-z,relro -Wl,-z,now -Wl,-z,separate-code -pie  -L/bitcoin/depends/x86_64-linux-gnu/lib -Wl,--as-needed -Wl,--dynamic-linker=/lib64/ld-linux-x86-64.so.2 -static-libstdc++ -Wl,-O2
    30  ARFLAGS         = cr
    31
    32+ sed -i.old 's/-lstdc++ //g' config.status libtool src/univalue/config.status src/univalue/libtool src/minisketch/config.status src/minisketch/libtool
    33sed: can't read src/minisketch/config.status: No such file or directory
    34sed: can't read src/minisketch/libtool: No such file or directory
    

    fanquake commented at 1:05 am on September 22, 2021:
    We can remove this now that we’ve integrated the minisketch build. Have dropped it from my branch.
  150. in src/Makefile.am:9 in 238bf6e8bd
     5@@ -6,7 +6,7 @@
     6 print-%: FORCE
     7 	@echo '$*'='$($*)'
     8 
     9-DIST_SUBDIRS = secp256k1 univalue
    10+DIST_SUBDIRS = secp256k1 minisketch univalue
    


    theuni commented at 8:10 pm on September 21, 2021:
    Pretty sure there’s no need for this since we’re building it ourselves. IIRC including it here was problematic while I was testing, but I’ve forgotten why.

    fanquake commented at 1:05 am on September 22, 2021:
    Yea this isn’t needed, and was breaking make dist. Have dropped it from my branch.
  151. fanquake commented at 1:05 am on September 22, 2021: member

    I’ve pushed some fixups to https://github.com/fanquake/bitcoin/tree/minisketch_integration (sorry @sipa). make dist(dir) and the Guix build have both been fixed. I also added a missing exclude for minisketch to the copyright header update script.

    Guix build:

     0bash-5.1# find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
     16f2f140e623e86a13c3c6723528c9241d7f195ee9b440c2b70cb48b7f897efa4  guix-build-1977a5eac1ac/output/aarch64-linux-gnu/SHA256SUMS.part
     2f143030f742955210bbaa93f72b88aed7e64168869712ae2d06d4920b4797feb  guix-build-1977a5eac1ac/output/aarch64-linux-gnu/bitcoin-1977a5eac1ac-aarch64-linux-gnu-debug.tar.gz
     3e7873892728dec8e46766a8094b8d32dd91d8b8e3cba7380750b9f0af046274f  guix-build-1977a5eac1ac/output/aarch64-linux-gnu/bitcoin-1977a5eac1ac-aarch64-linux-gnu.tar.gz
     4f15a670b0bc218ec29f8d55db2c6beb08707ffdcacc5bd950ec300ef8f1d4c3d  guix-build-1977a5eac1ac/output/arm-linux-gnueabihf/SHA256SUMS.part
     5ecc3de5d0e229782fabc4d367a2868256f34041a67af3b3ce585e2b6e0425501  guix-build-1977a5eac1ac/output/arm-linux-gnueabihf/bitcoin-1977a5eac1ac-arm-linux-gnueabihf-debug.tar.gz
     61c53d7facb75bef4541fe4076dd8f8b1b053739fbe62fc5430c8cb2fcef19160  guix-build-1977a5eac1ac/output/arm-linux-gnueabihf/bitcoin-1977a5eac1ac-arm-linux-gnueabihf.tar.gz
     7d8a9ae46890e515ec1f463745a6468dd861397d34b7ed7154f3ac67cb7b19a89  guix-build-1977a5eac1ac/output/dist-archive/bitcoin-1977a5eac1ac.tar.gz
     8ed1d14528d00211c1369067b0700534b0dd63a28c1a6d29d838d2efa4dc135ac  guix-build-1977a5eac1ac/output/powerpc64-linux-gnu/SHA256SUMS.part
     980422fc2edb2cdf44b79962697b7e465cef87bdf984e6bb95d8a54db6c1bde2c  guix-build-1977a5eac1ac/output/powerpc64-linux-gnu/bitcoin-1977a5eac1ac-powerpc64-linux-gnu-debug.tar.gz
    10e0d15a9e6a13d40d3ac8cba00edb8cc445da96414c236a9adcbcb850e3bd909b  guix-build-1977a5eac1ac/output/powerpc64-linux-gnu/bitcoin-1977a5eac1ac-powerpc64-linux-gnu.tar.gz
    11b7d2395d35c2891eed5473a085460e02842522d4aadfba2af2bcd62fe2b58a11  guix-build-1977a5eac1ac/output/powerpc64le-linux-gnu/SHA256SUMS.part
    12195239762f7eb08f1c821c90b342d18dd83bc0ab66a987afe11ce531614b37ef  guix-build-1977a5eac1ac/output/powerpc64le-linux-gnu/bitcoin-1977a5eac1ac-powerpc64le-linux-gnu-debug.tar.gz
    135b6fe49560e675a6a660c1d01c1bd7fc07650584879a93578ddabaa4e14b1a46  guix-build-1977a5eac1ac/output/powerpc64le-linux-gnu/bitcoin-1977a5eac1ac-powerpc64le-linux-gnu.tar.gz
    14edef8e58acd9f9328b8ab77631c72b727d3efe246801c219f583ab1eeff00bcb  guix-build-1977a5eac1ac/output/riscv64-linux-gnu/SHA256SUMS.part
    151d8e37a871448ed9ec6febf825521a70e0e7b26502df7022159c6e9ffbc307b3  guix-build-1977a5eac1ac/output/riscv64-linux-gnu/bitcoin-1977a5eac1ac-riscv64-linux-gnu-debug.tar.gz
    1627a616dede243cc01b1b1687fb66d627c5472c8419cc493510350f9ecaea1dd7  guix-build-1977a5eac1ac/output/riscv64-linux-gnu/bitcoin-1977a5eac1ac-riscv64-linux-gnu.tar.gz
    17f811ea4e8ae6a0e6aac962ef6445f16c4cf316e969d97cd25a9f6d98024299ff  guix-build-1977a5eac1ac/output/x86_64-apple-darwin18/SHA256SUMS.part
    183ab7a4c0c4b936033b4dc48b652478db69de3864cdb33123dd197c453baafec5  guix-build-1977a5eac1ac/output/x86_64-apple-darwin18/bitcoin-1977a5eac1ac-osx-unsigned.dmg
    194ed8e72a15af32c4d44e86b025735689fd8190f3b70ba126ab64f2049e112fe1  guix-build-1977a5eac1ac/output/x86_64-apple-darwin18/bitcoin-1977a5eac1ac-osx-unsigned.tar.gz
    20b32fca59c82d9502aaacd9521fcd8ce60c3ab177056433eb55fe6fee51fac6fd  guix-build-1977a5eac1ac/output/x86_64-apple-darwin18/bitcoin-1977a5eac1ac-osx64.tar.gz
    218e2d602f8577eb96112b3859f9b31ccdce44a202615b3d2a4f212b2406e9e2fd  guix-build-1977a5eac1ac/output/x86_64-linux-gnu/SHA256SUMS.part
    22cebad9c8b47ad0ff2a15cc6c4899b8461dd143a51127d1f538e722d373b06bd3  guix-build-1977a5eac1ac/output/x86_64-linux-gnu/bitcoin-1977a5eac1ac-x86_64-linux-gnu-debug.tar.gz
    2327c050901873acb873d6ba999d9cee3e82c7ea5b17625627f0b86bd55b0ba813  guix-build-1977a5eac1ac/output/x86_64-linux-gnu/bitcoin-1977a5eac1ac-x86_64-linux-gnu.tar.gz
    248627e3ed867fb065ac7c9080764f7fb0b1ad7359564a0948b4820dc39764b2a0  guix-build-1977a5eac1ac/output/x86_64-w64-mingw32/SHA256SUMS.part
    25461232a659284bdea174acc0f8f4462b02133a2c0f21a81d0b2af7533b12220b  guix-build-1977a5eac1ac/output/x86_64-w64-mingw32/bitcoin-1977a5eac1ac-win-unsigned.tar.gz
    269c2c1b9c94016fbbd6606a0dee55a9d7d78e9725468e0b79aa413a339fb97119  guix-build-1977a5eac1ac/output/x86_64-w64-mingw32/bitcoin-1977a5eac1ac-win64-debug.zip
    27aa344b4f6861f090477e2ba515b20bdb686735ebcfe87c32e75d1f41db8b5e42  guix-build-1977a5eac1ac/output/x86_64-w64-mingw32/bitcoin-1977a5eac1ac-win64-setup-unsigned.exe
    289a413697d21318a0930419b51cab86defff7a0a13eca6d59a3288dee00f427a0  guix-build-1977a5eac1ac/output/x86_64-w64-mingw32/bitcoin-1977a5eac1ac-win64.zip
    
  152. fanquake commented at 7:08 am on September 28, 2021: member
    Closing in favour of #23114.
  153. fanquake closed this on Sep 28, 2021

  154. fanquake removed this from the "Blockers" column in a project

  155. fanquake referenced this in commit c1fb30633b on Nov 12, 2021
  156. DrahtBot locked this on Oct 30, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-26 06:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me