Skip to content

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Oct 1, 2021

It's been 5 years since using LTO was first suggested for use when building Bitcoin Core, and it's time to revisit it again. Compilers, and their LTO implementations, have matured, and Bitcoin Core has come a long way in terms of pruning dependencies which may have proved troublesome (i.e Boost previously had issues when using LTO). We'll have even less Boost code after moving to std::filesystem (#20744).

Experimenting with LTO came up on IRC last night:

sipa: jamesob: i'm interested in knowing whether "-flto" and/or "-fdata-sections -ffunction-sections -Wl,--gc-sections" are possible/beneficial with our current compiler suite; what would be a good way to have your test infrastructure benchmark things?

So this PR just adds the bare minimum to make it easier to configure, compile and perform some bench-marking using -flto. This PR doesn't do anything depends wise, however if we decide this is what we want to do, I'll expand the changes here.

I had previously had a PR open (#18605) to perform link time garbage collection (-ffunction-sections -fdata-sections & -Wl,--gc-sections), however moving straight to using LTO would be preferable.

Note that our minimum required set of compilers, GCC 8.1 and Clang 7, all support the -flto option.

Related #18579.
Previous discussion: #10616, #14277.
Previous related PRs: #10800 (-flto), #16791 (ThinLTO).

Guix build:

bash-5.1# find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
1f3a7c5be4169aaa444b481d3e65a7bb72da9007fee6e6c416ded2e70f97374b  guix-build-68e5aafde3e8/output/aarch64-linux-gnu/SHA256SUMS.part
fa8f4cf223d9aaf0b2c1ef55ce61256a19cd1ad7f42b99d0b98c9a52fe6ad8ba  guix-build-68e5aafde3e8/output/aarch64-linux-gnu/bitcoin-68e5aafde3e8-aarch64-linux-gnu-debug.tar.gz
9a9967078cd1849b4e85db619e1f55d305c6d44e9e013067c0e8d62c1ba54087  guix-build-68e5aafde3e8/output/aarch64-linux-gnu/bitcoin-68e5aafde3e8-aarch64-linux-gnu.tar.gz
18c71f30722102baaf3dfda67f7c7aac38723510b142e8df8ee7063c5d499368  guix-build-68e5aafde3e8/output/arm-linux-gnueabihf/SHA256SUMS.part
0854cc0d17c045a118df2a24e4cf36d727e7e7e2dea37c2492ee21b71cb79b4b  guix-build-68e5aafde3e8/output/arm-linux-gnueabihf/bitcoin-68e5aafde3e8-arm-linux-gnueabihf-debug.tar.gz
215256897dde4e8412ed60473376c694a80c5479fb08039107fb62435f2816ef  guix-build-68e5aafde3e8/output/arm-linux-gnueabihf/bitcoin-68e5aafde3e8-arm-linux-gnueabihf.tar.gz
5fad0d9d12bc514ec46ed5d66fd29b7da1376a4a69c3b692936f1ab2356e2f85  guix-build-68e5aafde3e8/output/dist-archive/bitcoin-68e5aafde3e8.tar.gz
4f32989d4ab1946048ca7caee9a983fa875be262282562f5a3e040f4bf92158e  guix-build-68e5aafde3e8/output/powerpc64-linux-gnu/SHA256SUMS.part
ae45df309ae8ada52891efac0a369a69fed4ab93847a7bc4150a62230df4c8d7  guix-build-68e5aafde3e8/output/powerpc64-linux-gnu/bitcoin-68e5aafde3e8-powerpc64-linux-gnu-debug.tar.gz
0ced227de15cb578567131271e2effe80681b4d7a436c92bf1caec735a576fa4  guix-build-68e5aafde3e8/output/powerpc64-linux-gnu/bitcoin-68e5aafde3e8-powerpc64-linux-gnu.tar.gz
26fc5d2ccc1bc17ee0a146cacada6f4909d90c136ae640c8337332adce414ee0  guix-build-68e5aafde3e8/output/powerpc64le-linux-gnu/SHA256SUMS.part
9956b544d90a62a8ba9fc9dc6b6b7f0efe193357332ec19e88053a89d4aab37e  guix-build-68e5aafde3e8/output/powerpc64le-linux-gnu/bitcoin-68e5aafde3e8-powerpc64le-linux-gnu-debug.tar.gz
be8e39ceea1d36086ce5fa93bfb138c68d3bdf0dd6950b192dfa27a65cce3836  guix-build-68e5aafde3e8/output/powerpc64le-linux-gnu/bitcoin-68e5aafde3e8-powerpc64le-linux-gnu.tar.gz
a7755edc394972885c4c77a7798007e5ba4126b177c4ff6224275c4fb8f3b1c4  guix-build-68e5aafde3e8/output/riscv64-linux-gnu/SHA256SUMS.part
b6d252993d8aae7582ad6385fe53c61c54c284c68ece6cb2b2d1ac9554e06139  guix-build-68e5aafde3e8/output/riscv64-linux-gnu/bitcoin-68e5aafde3e8-riscv64-linux-gnu-debug.tar.gz
bb4860f3bbd815f800333124ff901d880741792ab47097f49bda3a6931144da0  guix-build-68e5aafde3e8/output/riscv64-linux-gnu/bitcoin-68e5aafde3e8-riscv64-linux-gnu.tar.gz
3dd17deed5c5935fb28b62dfc7afca5caab0d67862cdcbf3337edae73e1d0c4c  guix-build-68e5aafde3e8/output/x86_64-apple-darwin19/SHA256SUMS.part
fa2d68c54fda0816188c81ce2201a77340b82645da2ffe412526f92c297a82df  guix-build-68e5aafde3e8/output/x86_64-apple-darwin19/bitcoin-68e5aafde3e8-osx-unsigned.dmg
f6e5accdcd201f522b6426e4d8cc9b3643d4d43a57d268fa0e79ea9a34cfac01  guix-build-68e5aafde3e8/output/x86_64-apple-darwin19/bitcoin-68e5aafde3e8-osx-unsigned.tar.gz
4e5a127df957d1c73b65925d685f6620e7bc5667efcb6dcd98be76effc22fc12  guix-build-68e5aafde3e8/output/x86_64-apple-darwin19/bitcoin-68e5aafde3e8-osx64.tar.gz
56ccd216a69acafacbdc6bae0bdcc1faa50b6a51be1aebfa7068206c88b3241a  guix-build-68e5aafde3e8/output/x86_64-linux-gnu/SHA256SUMS.part
77b93dd5fad322636853e5b0244ffafd97cc97f3b4b4ee755d5f830b75d77d13  guix-build-68e5aafde3e8/output/x86_64-linux-gnu/bitcoin-68e5aafde3e8-x86_64-linux-gnu-debug.tar.gz
1feda932fc127b900316a232432b91e46e57ee12a81e12a7d888fdc3296219c1  guix-build-68e5aafde3e8/output/x86_64-linux-gnu/bitcoin-68e5aafde3e8-x86_64-linux-gnu.tar.gz
aa7c53ab4164b3736049065c3c24391fc5bd7f26b4bda4aa877c378f0636a125  guix-build-68e5aafde3e8/output/x86_64-w64-mingw32/SHA256SUMS.part
5e76148e67aef7e91e70074bfadc08e94373449ac3b966f4343b04d230c778fd  guix-build-68e5aafde3e8/output/x86_64-w64-mingw32/bitcoin-68e5aafde3e8-win-unsigned.tar.gz
34123e3d818beeb70113caeda66945bc7cb9d9e987515d5b149bd17b4b38da90  guix-build-68e5aafde3e8/output/x86_64-w64-mingw32/bitcoin-68e5aafde3e8-win64-debug.zip
2bba7f40a2b23c6ea3d47c4f564ab54201bf27f7f57103a98cc9bceea4e70c4d  guix-build-68e5aafde3e8/output/x86_64-w64-mingw32/bitcoin-68e5aafde3e8-win64-setup-unsigned.exe
0e7e124144af4a92a4344cf70a3b7c06fbd2b8782aee7ede7263893afa3a5ef0  guix-build-68e5aafde3e8/output/x86_64-w64-mingw32/bitcoin-68e5aafde3e8-win64.zip

@laanwj
Copy link
Member

laanwj commented Oct 1, 2021

Concept ACK, conditional on that we are going to try make this be default for the release binaries (I don't mean in this PR). I'm generally not a fan of configure options that simply add cflags/linkerflags, but I think that's something for which to make an exception.

I had previously had a PR open to perform link time garbage collection (-ffunction-sections -fdata-sections -Wl,--gc-sections), in #18605, however moving straight to using LTO would be preferable.

Agree. Function/data garbage collection is mostly an executable size concern, it doesn't, besides possibly better (and sometimes worse!) cache access patterns, affect performance.

@fanquake
Copy link
Member Author

fanquake commented Oct 1, 2021

Concept ACK, conditional on that we are going to try make this be default for the release binaries

I've added --enable-lto to the configure for the Guix build, so it's easier for anyone to test/run those now as well.

EDIT: Looks like this will need some changes to the Guix toolchains.

@sipa
Copy link
Member

sipa commented Oct 1, 2021

Is there a possibility to use -flto=jobserver? That makes GCC use make's parallel scheduler (so the argument to -j is available for multiple parallel compilations). It requires the linker's command in Makefile to be prepended with +.

Alternatively, some way of setting N for -flto=N. Doing the entire LTO stage single-threadedly (the default, I think) would be very slow, especially on machines with lots of cores.

Of course, none of this is a requirement to evaluate whether we want LTO or not.

@laanwj
Copy link
Member

laanwj commented Oct 1, 2021

EDIT: Looks like this will need some changes to the Guix toolchains.

Which reminds me—should we enable lto for the depends build as well? I guess it's another separate decision, but it would allow for the most optimization opportunities.

@practicalswift
Copy link
Contributor

Concept ACK

Some LTO results from measurements made back in 2018 can be found in #14277 :)

@jamesob
Copy link
Contributor

jamesob commented Oct 1, 2021

Concept ACK

@sipa
Copy link
Member

sipa commented Oct 1, 2021

There seems to be a patch for automake to support -flto=jobserver, but it's not yet accepted: https://www.mail-archive.com/automake-patches@gnu.org/msg07973.html

@martinus
Copy link
Contributor

martinus commented Oct 1, 2021

I ran all of the benchmarks with clang++ 12.0.1, g++ 11.1.0 with and without --enable-lto on my Intel i7-8700. Some benchmarks results change quite a lot, and I also didn't expect that clang++ and g++ can behave so differently. But microbenchmark results should always be taken with a grain of salt.

clang++ ns/op clang++ lto ns/op g++ ns/op g++ lto ns/op benchmark
44,850,331.00 41,649,957.00 45,752,245.00 44,851,254.00 AddrManAdd
115,908,612.00 108,865,250.00 118,227,091.00 115,271,712.00 AddrManAddThenGood
343,083.67 317,334.33 357,469.33 362,177.00 AddrManGetAddr
185.81 169.72 192.36 187.05 AddrManSelect
389,690.00 369,410.50 392,837.50 432,549.00 AssembleBlock
clang++ ns/byte clang++ lto ns/byte g++ ns/byte g++ lto ns/byte benchmark
110.74 111.10 69.79 70.17 Base58CheckEncode
18.69 23.26 24.59 24.62 Base58Decode
76.33 77.01 41.60 42.04 Base58Encode
9.05 8.63 9.56 9.16 Bech32Decode
19.08 18.32 19.37 20.05 Bech32Encode
clang++ ns/op clang++ lto ns/op g++ ns/op g++ lto ns/op benchmark
157.37 152.55 172.30 174.80 BenchLockedPool
4.09 2.50 4.38 5.02 BenchTimeDeprecated
24.05 20.26 24.00 20.58 BenchTimeMillis
21.95 20.16 22.97 20.63 BenchTimeMillisSys
2.21 0.31 1.56 0.63 BenchTimeMock
62,958,650.00 62,619,805.00 59,419,903.00 62,824,850.00 BlockToJsonVerbose
25,195,748.00 25,594,730.00 30,520,213.00 30,058,971.00 BlockToJsonVerboseWrite
1,028,430.00 1,084,184.00 1,233,630.00 1,286,939.00 BnBExhaustion
clang++ ns/job clang++ lto ns/job g++ ns/job g++ lto ns/job benchmark
902.03 812.48 822.47 814.88 CCheckQueueSpeedPrevectorJob
clang++ ns/op clang++ lto ns/op g++ ns/op g++ lto ns/op benchmark
329.16 298.86 354.83 347.61 CCoinsCaching
clang++ ns/byte clang++ lto ns/byte g++ ns/byte g++ lto ns/byte benchmark
1.98 1.93 1.93 1.92 CHACHA20_1MB
1.97 1.94 1.97 1.95 CHACHA20_256BYTES
2.06 2.04 2.07 2.06 CHACHA20_64BYTES
5.58 5.54 5.54 5.51 CHACHA20_POLY1305_AEAD_1MB_ENCRYPT_DECRYPT
2.74 2.79 2.77 2.76 CHACHA20_POLY1305_AEAD_1MB_ONLY_ENCRYPT
7.02 6.95 7.61 7.61 CHACHA20_POLY1305_AEAD_256BYTES_ENCRYPT_DECRYPT
3.53 3.47 3.82 3.78 CHACHA20_POLY1305_AEAD_256BYTES_ONLY_ENCRYPT
11.51 11.25 13.91 14.06 CHACHA20_POLY1305_AEAD_64BYTES_ENCRYPT_DECRYPT
5.80 5.68 6.94 6.95 CHACHA20_POLY1305_AEAD_64BYTES_ONLY_ENCRYPT
clang++ ns/op clang++ lto ns/op g++ ns/op g++ lto ns/op benchmark
547,191.50 542,479.50 559,722.50 552,408.50 CoinSelection
349,819,707.00 339,765,062.00 307,623,521.00 286,347,434.00 ComplexMemPool
clang++ ns/elem clang++ lto ns/elem g++ ns/elem g++ lto ns/elem benchmark
183.01 171.14 159.75 159.41 ConstructGCSFilter
clang++ ns/block clang++ lto ns/block g++ ns/block g++ lto ns/block benchmark
6,413,984.00 6,106,104.00 6,165,040.00 6,470,182.00 DeserializeAndCheckBlockTest
5,317,655.00 5,157,372.00 5,142,803.00 5,225,309.00 DeserializeBlockTest
clang++ ns/op clang++ lto ns/op g++ ns/op g++ lto ns/op benchmark
7,837,080.00 7,805,025.00 7,807,746.00 7,867,452.00 DuplicateInputs
10,777.09 8,604.29 13,273.04 10,657.84 EvictionProtection0Networks250Candidates
16,693.46 12,104.46 17,841.92 14,626.06 EvictionProtection1Networks250Candidates
22,453.76 18,138.77 23,554.42 20,238.65 EvictionProtection2Networks250Candidates
3,773.30 3,281.87 4,258.64 3,979.64 EvictionProtection3Networks050Candidates
10,160.02 8,873.71 10,910.08 10,462.54 EvictionProtection3Networks100Candidates
24,539.60 20,099.13 26,483.08 23,736.26 EvictionProtection3Networks250Candidates
1.78 2.18 1.77 1.77 FastRandom_1bit
10.25 10.22 9.49 9.20 FastRandom_32bit
clang++ ns/byte clang++ lto ns/byte g++ ns/byte g++ lto ns/byte benchmark
3.21 3.20 3.18 3.19 HASH_1MB
5.02 4.88 5.01 4.99 HASH_256BYTES
10.50 10.02 10.52 10.41 HASH_64BYTES
clang++ ns/elem clang++ lto ns/elem g++ ns/elem g++ lto ns/elem benchmark
43,724.23 23,583.33 28,537.38 26,545.66 MatchGCSFilter
clang++ ns/op clang++ lto ns/op g++ ns/op g++ lto ns/op benchmark
24,054.61 23,268.32 24,299.66 23,389.98 MempoolEviction
clang++ ns/leaf clang++ lto ns/leaf g++ ns/leaf g++ lto ns/leaf benchmark
142.35 139.38 138.71 238.02 MerkleRoot
clang++ ns/op clang++ lto ns/op g++ ns/op g++ lto ns/op benchmark
6,416.92 6,543.58 8,118.72 8,013.09 MuHash
5,345.43 5,501.68 7,129.37 6,946.70 MuHashDiv
5,370.88 5,496.21 7,062.38 6,948.19 MuHashMul
1,050.07 1,031.97 1,028.19 978.20 MuHashPrecompute
clang++ ns/byte clang++ lto ns/byte g++ ns/byte g++ lto ns/byte benchmark
0.79 0.79 0.83 0.83 POLY1305_1MB
0.87 0.88 0.89 0.89 POLY1305_256BYTES
1.08 1.08 1.09 1.09 POLY1305_64BYTES
clang++ ns/op clang++ lto ns/op g++ ns/op g++ lto ns/op benchmark
233.72 218.40 229.82 229.67 PrePadded
4.96 8.15 15.31 15.00 PrevectorClearNontrivial
5.65 5.43 4.55 4.54 PrevectorClearTrivial
327.33 316.28 114.71 123.24 PrevectorDeserializeNontrivial
17.38 16.27 10.55 14.19 PrevectorDeserializeTrivial
10.30 7.97 7.23 7.04 PrevectorDestructorNontrivial
10.27 7.32 7.32 7.19 PrevectorDestructorTrivial
2.28 3.98 7.58 7.53 PrevectorResizeNontrivial
2.74 2.73 2.14 2.26 PrevectorResizeTrivial
clang++ ns/byte clang++ lto ns/byte g++ ns/byte g++ lto ns/byte benchmark
2.54 2.56 2.52 2.53 RIPEMD160
clang++ ns/op clang++ lto ns/op g++ ns/op g++ lto ns/op benchmark
443.48 427.45 441.40 441.89 RegularPadded
537.25 486.07 493.83 431.17 RollingBloom
32,004.94 33,067.62 35,217.81 33,502.58 RollingBloomReset
10,805,603.00 10,352,368.00 10,300,251.00 10,862,213.00 RpcMempool
clang++ ns/byte clang++ lto ns/byte g++ ns/byte g++ lto ns/byte benchmark
1.92 1.85 1.87 1.88 SHA1
3.21 3.19 3.18 3.19 SHA256
2.05 2.04 2.04 3.58 SHA256D64_1024
7.37 6.88 7.20 7.16 SHA256_32b
4.11 4.03 4.01 4.02 SHA3_256_1M
3.07 2.96 2.94 4.42 SHA512
clang++ ns/op clang++ lto ns/op g++ ns/op g++ lto ns/op benchmark
29.88 29.51 28.23 28.05 SipHash_32b
10.09 9.84 8.68 8.97 Trig
83,430.64 77,216.85 83,367.50 88,736.58 VerifyNestedIfScript
96,481.36 94,740.30 97,176.62 96,895.70 VerifyScriptBench
37,446.16 38,476.75 40,102.65 36,176.27 WalletBalanceClean
254,368.50 241,829.00 278,516.50 262,199.75 WalletBalanceDirty
18,055.69 18,901.00 19,411.54 17,680.53 WalletBalanceMine
36,783.80 38,399.57 39,947.21 36,207.50 WalletBalanceWatch

@sipa
Copy link
Member

sipa commented Oct 1, 2021

@martinus Man, that's a wildly inconsistent set of differences... I don't see anything really dramatic, though.

@martinus
Copy link
Contributor

martinus commented Oct 2, 2021

I've now calculated the geometric mean of all the benchmark results:

geomean of runtime (lower is better) compiler
500.60 clang++
470.27 clang++ lto
501.78 g++
498.56 g++ lto

So on average clang++ seems to benefit in the benchmarks, but for g++ the change is not significant. I'd say one needs to do more real world benchmarks to see if it's a benefit.

One other interesting observeration: When compiling with --enable-lto g++ seems to be able to detect more problems. E.g. it found this:

In member function 'operator=',
    inlined from 'Seed' at test/util/setup_common.cpp:66:33,
    inlined from 'SeedInsecureRand' at ./test/util/setup_common.h:61:13,
    inlined from '__ct_base ' at test/util/setup_common.cpp:105:21:
random.cpp:702:19: warning: 'D.34682.bitbuf' may be used uninitialized [-Wmaybe-uninitialized]
  702 |     bitbuf = from.bitbuf;
      |                   ^
test/util/setup_common.cpp: In member function '__ct_base ':
test/util/setup_common.cpp:66:33: note: '<anonymous>' declared here
   66 |     ctx = FastRandomContext(seed);

The FastRandomContext(const uint256& seed) constructor does not initialize the uint64_t bitbuf member, and in FastRandomContext& operator=(FastRandomContext&& from) noexcept; the uninitialized variable is copied with bitbuf = from.bitbuf; which technically is undefined behavior.

@practicalswift
Copy link
Contributor

One other interesting observeration: When compiling with --enable-lto g++ seems to be able to detect more problems. E.g. it found this:

In member function 'operator=',
    inlined from 'Seed' at test/util/setup_common.cpp:66:33,
    inlined from 'SeedInsecureRand' at ./test/util/setup_common.h:61:13,
    inlined from '__ct_base ' at test/util/setup_common.cpp:105:21:
random.cpp:702:19: warning: 'D.34682.bitbuf' may be used uninitialized [-Wmaybe-uninitialized]
  702 |     bitbuf = from.bitbuf;
      |                   ^
test/util/setup_common.cpp: In member function '__ct_base ':
test/util/setup_common.cpp:66:33: note: '<anonymous>' declared here
   66 |     ctx = FastRandomContext(seed);

The FastRandomContext(const uint256& seed) constructor does not initialize the uint64_t bitbuf member, and in FastRandomContext& operator=(FastRandomContext&& from) noexcept; the uninitialized variable is copied with bitbuf = from.bitbuf; which technically is undefined behavior.

Great find @martinus!

Enabling more intelligent compiler reasoning is a very good reason for LTO :)

After some testing I can confirm that the uninitialized read above is reachable from testing code.

Can be verified by applying the following patch:

diff --git a/src/random.cpp b/src/random.cpp
index 174f4cef3..73e946783 100644
--- a/src/random.cpp
+++ b/src/random.cpp
@@ -693,13 +693,30 @@ FastRandomContext::FastRandomContext(bool fDeterministic) noexcept : requires_se
     rng.SetKey(seed.begin(), 32);
 }

+// Force Valgrind use-of-uninitialized memory (UUM) violation if `o` is uninitialized.
+//
+// As suggested by @guidovranken in https://github.com/bitcoin/bitcoin/issues/22064
+template<typename T>
+void ForceValgrindWarningIfUninitialized(const T& o) {
+    static_assert(std::is_trivially_copyable<T>::value);
+    FILE* f = fopen("/dev/null", "wb");
+    fwrite(&o, sizeof(o), 1, f);
+    fclose(f);
+}
+
 FastRandomContext& FastRandomContext::operator=(FastRandomContext&& from) noexcept
 {
+    ForceValgrindWarningIfUninitialized(from.requires_seed);
     requires_seed = from.requires_seed;
+    ForceValgrindWarningIfUninitialized(from.rng);
     rng = from.rng;
+    ForceValgrindWarningIfUninitialized(from.bytebuf);
     std::copy(std::begin(from.bytebuf), std::end(from.bytebuf), std::begin(bytebuf));
+    ForceValgrindWarningIfUninitialized(from.bytebuf_size);
     bytebuf_size = from.bytebuf_size;
+    ForceValgrindWarningIfUninitialized(from.bitbuf);
     bitbuf = from.bitbuf;
+    ForceValgrindWarningIfUninitialized(from.bitbuf_size);
     bitbuf_size = from.bitbuf_size;
     from.requires_seed = true;
     from.bytebuf_size = 0;

And running valgrind src/test/test_bitcoin -t addrman_tests/addrman_simple:

==22209== Memcheck, a memory error detector
…
Running 1 test case...
==22209== Syscall param write(buf) points to uninitialised byte(s)
==22209==    at 0x736A264: write (write.c:27)
==22209==    by 0x72E522C: _IO_file_write@@GLIBC_2.2.5 (fileops.c:1203)
==22209==    by 0x72E6FC0: new_do_write (fileops.c:457)
==22209==    by 0x72E6FC0: _IO_do_write@@GLIBC_2.2.5 (fileops.c:433)
==22209==    by 0x72E637F: _IO_file_close_it@@GLIBC_2.2.5 (fileops.c:136)
==22209==    by 0x72D83F6: fclose@@GLIBC_2.2.5 (iofclose.c:53)
==22209==    by 0xDA86B7: ForceValgrindWarningIfUninitialized<unsigned char [64]> (random.cpp:704)
==22209==    by 0xDA86B7: FastRandomContext::operator=(FastRandomContext&&) (random.cpp:713)
==22209==    by 0x9CFD67: Seed(FastRandomContext&) (setup_common.cpp:66)
==22209==    by 0x9D066B: SeedInsecureRand (setup_common.h:61)
==22209==    by 0x9D066B: BasicTestingSetup::BasicTestingSetup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<char const*, std::allocator<char const*> > const&) (setup_common.cpp:105)
==22209==    by 0x3AB6BE: addrman_simple (addrman_tests.cpp:166)
…

@martinus
Copy link
Contributor

martinus commented Oct 4, 2021

I ran a few -reindex-chainstate benchmarks overnight on my Intel i7 CPU:

Running -assumevalid=00000000000000000002a23d6df20eecec15b21d32c75833cce28f113de888b7 -reindex-chainstate -stopatheight=400000 -dbcache=4000

user [sec] system [sec] total [sec] total relativ compiler
1863.15 69.09 1932.24 100.00% g++
1852.46 68.42 1920.88 99.41% g++ lto
1827.73 69.73 1897.46 98.20% clang++
1788.40 70.35 1858.75 96.20% clang++ lto

Running -assumevalid=0 -reindex-chainstate -stopatheight=400000 -dbcache=4000

user [sec] system [sec] total [sec] total relative compiler
35243.08 158.50 35401.58 100.00% g++
35491.77 154.54 35646.30 100.69% g++ lto
32663.09 158.60 32821.68 92.71% clang++
32184.18 154.70 32338.88 91.35% clang++ lto

My takeaways:

  • --enable-lto seems to make g++ 11.1.0 builds slightly slower (but the change is not significant)
  • --enable-lto makes clang++ 12.0.1 builds slightly faster
  • clang 12.0.1 optimizes significantly better than g++ 11.1, especially when validating scripts (-asumevalid=0) This is in line with what this phoronix article found

martinus added a commit to martinus/bitcoin that referenced this pull request Oct 4, 2021
Building with `--enable-lto`in bitcoin#23152 produced a `-Wmaybe-uninitialized`
warning in FastRandomContext. This commit initializes all members where
they are defined.

The `FastRandomContext(const uint256& seed)` constructor does not
initialize the `uint64_t bitbuf` member, and in
`FastRandomContext& operator=(FastRandomContext&& from) noexcept;` the
uninitialized variable is copied with `bitbuf = from.bitbuf;` which
technically is undefined behavior. This happens in `setup_common.cpp`
in the line `ctx = FastRandomContext(seed);`.
martinus added a commit to martinus/bitcoin that referenced this pull request Oct 4, 2021
Building in bitcoin#23152 produces two -Wmaybe-uninitialized warnings in the
fuzz code. As far as I can say these are false positives, but
initializing them doesn't hurt and gets rid of the warnings.
@fanquake fanquake force-pushed the experiment_with_lto branch from 0f9fccc to 7a47588 Compare October 4, 2021 06:22
@fanquake
Copy link
Member Author

fanquake commented Oct 4, 2021

@martinus thanks for the testing so far.

For more benchmarking / testing, I've added an additional commit which adds a --enable-thin-lto flag. Note that this is Clang only, and will run with much more parallelism than fat LTO.

I've also added a commit that will partially fix using LTO in the Guix builds. After discussing with @dongcarl , we've realized that using the gcc-* wrappers for ar, ranlib etc is "better" when using LTO, as the required --plugin arguments will be setup automatically. I've successfully completed a x86_64-linux-gnu Guix build, with LTO, with this change.

@@ -237,7 +237,7 @@ mkdir -p "$OUTDIR"
###########################

# CONFIGFLAGS
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests --disable-fuzz-binary"
CONFIGFLAGS="--enable-lto --enable-reduce-exports --disable-bench --disable-gui-tests --disable-fuzz-binary"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no runtime benefit can be observed with recent gcc, it would be surprising to see a benefit of lto with gcc-8. Lto might not be worth it for the release binaries unless they are also switched to use clang?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not slower, something could still be said for smaller binaries.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I think what would still be interesting is to build the depends with -lto too, so that calls into dependencies can be optimized, and this might be able to shave off big parts of Qt.

@sipa
Copy link
Member

sipa commented Oct 5, 2021

For GCC 8 it may be useful to try enabling -flto-odr-type-merging; that may detect certain calling mismatches (if -Wodr is enabled as well, but it is by default). In later GCCs the option disappeared; not sure why.

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 6, 2021

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

Conflicts

No conflicts as of last run.

@jamesob
Copy link
Contributor

jamesob commented Oct 6, 2021

ACK 7a47588

I tested/benched both --enable-lto and --enable-thin-lto with clang-12 and lld. Though gcc-9 supports LTO, apparently lld doesn't know how to work with gcc, so I didn't test that.

The differences I saw for a mid-chain 40,000 block IBD weren't as dramatic as I expected based on the results above. The dbcache here is the default (pretty low at 300), so I'll try rerunning with a much higher dbcache to see if that makes a difference. In any case, this changeset obviously works.

Worth noting that the assumevalid value (000000000000000000176c192f42ad13ab159fdb20198b87e7ba3c001e47b876) I use here straddles the run, since its height is 522,000.

Edit: just to be clear, these results show that LTO (or, really, clang-compiled binaries) are somehow marginally slower in this test than gcc. Kinda weird?


ibd local range 500000 540000

bench name command
ibd.local.range.500000.540000 bitcoind -dbcache=300 -debug=coindb -debug=bench -listen=0 -connect=0 -addnode=127.0.0.1:8888 -prune=9999999 -printtoconsole=0 -assumevalid=000000000000000000176c192f42ad13ab159fdb20198b87e7ba3c001e47b876

lto-clang-12 vs. thin-lto-clang-12 vs. gcc-9 (master) vs. clang-12 (master) (absolute)

bench name x lto-clang-12 thin-lto-clang-12 gcc-9 (master) clang-12 (master)
build.make.8.total_secs 1 582.0000 (± 0.0000) 515.0000 (± 0.0000) 469.0000 (± 0.0000) 349.0000 (± 0.0000)
build.make.8.peak_rss_KiB 1 6124560.0000 (± 0.0000) 1843432.0000 (± 0.0000) 1865844.0000 (± 0.0000) 956092.0000 (± 0.0000)
build.make.8.cpu_kernel_secs 1 61.4100 (± 0.0000) 61.3100 (± 0.0000) 116.7600 (± 0.0000) 59.8800 (± 0.0000)
build.make.8.cpu_user_secs 1 3063.3200 (± 0.0000) 3809.7000 (± 0.0000) 3530.8800 (± 0.0000) 2654.3400 (± 0.0000)
ibd.local.range.500000.540000.total_secs 2 4593.6784 (± 98.6011) 4662.5669 (± 81.0513) 4526.9569 (± 122.6671) 4656.9325 (± 173.6344)
ibd.local.range.500000.540000.peak_rss_KiB 2 2468266.0000 (± 26734.0000) 2269640.0000 (± 154632.0000) 2275648.0000 (± 157012.0000) 2288716.0000 (± 117284.0000)
ibd.local.range.500000.540000.cpu_kernel_secs 2 650.9050 (± 3.0050) 642.1900 (± 7.9500) 649.1850 (± 1.7650) 662.6350 (± 7.7250)
ibd.local.range.500000.540000.cpu_user_secs 2 13794.1000 (± 0.4800) 13864.0600 (± 35.5200) 14426.4950 (± 3.7650) 14008.0250 (± 13.4050)

lto-clang-12 vs. thin-lto-clang-12 vs. gcc-9 (master) vs. clang-12 (master) (relative)

bench name x lto-clang-12 thin-lto-clang-12 gcc-9 (master) clang-12 (master)
build.make.8.total_secs 1 1.668 1.476 1.344 1.000
build.make.8.peak_rss_KiB 1 6.406 1.928 1.952 1.000
build.make.8.cpu_kernel_secs 1 1.026 1.024 1.950 1.000
build.make.8.cpu_user_secs 1 1.154 1.435 1.330 1.000
ibd.local.range.500000.540000.total_secs 2 1.015 1.030 1.000 1.029
ibd.local.range.500000.540000.peak_rss_KiB 2 1.088 1.000 1.003 1.008
ibd.local.range.500000.540000.cpu_kernel_secs 2 1.014 1.000 1.011 1.032
ibd.local.range.500000.540000.cpu_user_secs 2 1.000 1.005 1.046 1.016

@martinus
Copy link
Contributor

martinus commented Oct 6, 2021

I think the numbers are actually not too different from mine. lto-clang-12 uses the least amount of CPU, and gcc-9 the most. I think that's the important metrics here, the actual runtime difference could be due to random chance (e.g. waiting for leveldb writes).

@maflcko
Copy link
Member

maflcko commented Oct 8, 2021

/bin/sh ../libtool  --tag=CXX --preserve-dup-deps  --mode=link x86_64-w64-mingw32-g++ -std=c++17  -fstack-reuse=none -Wstack-protector -fstack-protector-all -fcf-protection=full      -flto -fPIE -pipe -O2 -O2 -g -fno-ident -fno-extended-identifiers -fvisibility=hidden -Wl,--exclude-libs,ALL  -Wl,--enable-reloc-section -Wl,--dynamicbase -Wl,--nxcompat -Wl,--high-entropy-va -pie   -flto -all-static -pthread -lpthread -L/bitcoin/depends/x86_64-w64-mingw32/lib -Wl,--no-insert-timestamp -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1 -o bitcoin-cli.exe bitcoin_cli-bitcoin-cli.o bitcoin-cli-res.o libbitcoin_cli.a univalue/libunivalue.la libbitcoin_util.a crypto/libbitcoin_crypto_base.a crypto/libbitcoin_crypto_sse41.a crypto/libbitcoin_crypto_avx2.a crypto/libbitcoin_crypto_shani.a -L/bitcoin/depends/x86_64-w64-mingw32/lib -lboost_system-mt-s-x64 -lboost_filesystem-mt-s-x64 -L/bitcoin/depends/x86_64-w64-mingw32/lib -levent -lws2_32 -lssp -liphlpapi -lshlwapi -lws2_32 -ladvapi32 -luuid -loleaut32 -lole32 -lcomctl32 -lshell32 -lwinmm -lcomdlg32 -lgdi32 -luser32 -lkernel32 
libtool: link: x86_64-w64-mingw32-g++ -std=c++17 -fstack-reuse=none -Wstack-protector -fstack-protector-all -fcf-protection=full -flto -fPIE -pipe -O2 -O2 -g -fno-ident -fno-extended-identifiers -fvisibility=hidden -Wl,--exclude-libs -Wl,ALL -Wl,--enable-reloc-section -Wl,--dynamicbase -Wl,--nxcompat -Wl,--high-entropy-va -pie -flto -static -pthread -Wl,--no-insert-timestamp -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1 -o bitcoin-cli.exe bitcoin_cli-bitcoin-cli.o bitcoin-cli-res.o  -lpthread -L/bitcoin/depends/x86_64-w64-mingw32/lib libbitcoin_cli.a univalue/.libs/libunivalue.a libbitcoin_util.a crypto/libbitcoin_crypto_base.a crypto/libbitcoin_crypto_sse41.a crypto/libbitcoin_crypto_avx2.a crypto/libbitcoin_crypto_shani.a -lboost_system-mt-s-x64 -lboost_filesystem-mt-s-x64 -levent -lws2_32 /gnu/store/c1mhzb9f961bdc9z4jbsn44c8fk2an5y-gcc-cross-x86_64-w64-mingw32-8.4.0/x86_64-w64-mingw32/lib/libssp.a -liphlpapi -lshlwapi -lws2_32 -ladvapi32 -luuid -loleaut32 -lole32 -lcomctl32 -lshell32 -lwinmm -lcomdlg32 -lgdi32 -luser32 -lkernel32 -pthread
x86_64-w64-mingw32-ld: libbitcoin_util_a-request.o (symbol from plugin):(.gnu.linkonce.t._ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEaSERKS7_+0x0): multiple definition of `std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::operator=(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)'; univalue/.libs/libunivalue.a(libunivalue_la-univalue.o):/gnu/store/c1mhzb9f961bdc9z4jbsn44c8fk2an5y-gcc-cross-x86_64-w64-mingw32-8.4.0/include/c++/bits/vector.tcc:186: first defined here
x86_64-w64-mingw32-ld: libbitcoin_util_a-request.o (symbol from plugin):(.gnu.linkonce.t._ZNSt6vectorI8UniValueSaIS0_EEaSERKS2_+0x0): multiple definition of `std::vector<UniValue, std::allocator<UniValue> >::operator=(std::vector<UniValue, std::allocator<UniValue> > const&)'; univalue/.libs/libunivalue.a(libunivalue_la-univalue.o):/gnu/store/c1mhzb9f961bdc9z4jbsn44c8fk2an5y-gcc-cross-x86_64-w64-mingw32-8.4.0/include/c++/bits/vector.tcc:186: first defined here
x86_64-w64-mingw32-ld: libbitcoin_util_a-system.o (symbol from plugin):(.gnu.linkonce.t._ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_8UniValueESt10_Select1stIS9_ESt4lessIS5_ESaIS9_EE24_M_get_insert_unique_posERS7_+0x0): multiple definition of `std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue> > >::_M_get_insert_unique_pos(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'; univalue/.libs/libunivalue.a(libunivalue_la-univalue.o):/gnu/store/c1mhzb9f961bdc9z4jbsn44c8fk2an5y-gcc-cross-x86_64-w64-mingw32-8.4.0/include/c++/bits/stl_tree.h:2051: first defined here
x86_64-w64-mingw32-ld: libbitcoin_util_a-system.o (symbol from plugin):(.gnu.linkonce.t._ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_8UniValueESt10_Select1stIS9_ESt4lessIS5_ESaIS9_EE8_M_eraseEPSt13_Rb_tree_nodeIS9_E+0x0): multiple definition of `std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue> > >::_M_erase(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue> >*)'; univalue/.libs/libunivalue.a(libunivalue_la-univalue.o):/gnu/store/c1mhzb9f961bdc9z4jbsn44c8fk2an5y-gcc-cross-x86_64-w64-mingw32-8.4.0/include/c++/bits/stl_tree.h:1873: first defined here
x86_64-w64-mingw32-ld: libbitcoin_util_a-system.o (symbol from plugin):(.gnu.linkonce.t._ZNSt6vectorI8UniValueSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_+0x0): multiple definition of `void std::vector<UniValue, std::allocator<UniValue> >::_M_realloc_insert<UniValue const&>(__gnu_cxx::__normal_iterator<UniValue*, std::vector<UniValue, std::allocator<UniValue> > >, UniValue const&)'; univalue/.libs/libunivalue.a(libunivalue_la-univalue.o):/gnu/store/c1mhzb9f961bdc9z4jbsn44c8fk2an5y-gcc-cross-x86_64-w64-mingw32-8.4.0/include/c++/bits/vector.tcc:413: first defined here
x86_64-w64-mingw32-ld: libbitcoin_util_a-settings.o (symbol from plugin):(.gnu.linkonce.t._ZNSt6vectorI8UniValueSaIS0_EE15_M_range_insertIN9__gnu_cxx17__normal_iteratorIPKS0_S2_EEEEvNS5_IPS0_S2_EET_SB_St20forward_iterator_tag+0x0): multiple definition of `void std::vector<UniValue, std::allocator<UniValue> >::_M_range_insert<__gnu_cxx::__normal_iterator<UniValue const*, std::vector<UniValue, std::allocator<UniValue> > > >(__gnu_cxx::__normal_iterator<UniValue*, std::vector<UniValue, std::allocator<UniValue> > >, __gnu_cxx::__normal_iterator<UniValue const*, std::vector<UniValue, std::allocator<UniValue> > >, __gnu_cxx::__normal_iterator<UniValue const*, std::vector<UniValue, std::allocator<UniValue> > >, std::forward_iterator_tag)'; univalue/.libs/libunivalue.a(libunivalue_la-univalue.o):/gnu/store/c1mhzb9f961bdc9z4jbsn44c8fk2an5y-gcc-cross-x86_64-w64-mingw32-8.4.0/include/c++/bits/vector.tcc:672: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:5912: bitcoin-cli.exe] Error 1
make[2]: Leaving directory '/distsrc-base/distsrc-1571f1a82883-x86_64-w64-mingw32/src'
make[1]: *** [Makefile:16291: all-recursive] Error 1
make[1]: Leaving directory '/distsrc-base/distsrc-1571f1a82883-x86_64-w64-mingw32/src'
make: *** [Makefile:821: all-recursive] Error 1

@fanquake fanquake force-pushed the experiment_with_lto branch from 7a47588 to c621df2 Compare October 8, 2021 08:16
@fanquake
Copy link
Member Author

fanquake commented Oct 8, 2021

For GCC 8 it may be useful to try enabling -flto-odr-type-merging; that may detect certain calling mismatches (if -Wodr is enabled as well, but it is by default). In later GCCs the option disappeared; not sure why.

I've added this. In newer GCC, in regards to this option I see:

-flto-odr-type-merging Does nothing. Preserved for backward compatibility.

Looks like it was removed when -Wodr became enabled by default. See gcc-mirror/gcc@686a56a.

Also added -flto-report.

And I think what would still be interesting is to build the depends with -lto too, so that calls into dependencies can be optimized, and this might be able to shave off big parts of Qt.

I've added -flto to some FLAGS in depends.

In regards to Guix. The Linux HOSTS are all building.

The macOS build is failing (cross-compiling outside Guix works). See full output here:

Undefined symbols for architecture x86_64:
  "RandomInit()", referenced from:
      _main in lto.o
  "SetupChainParamsBaseOptions(ArgsManager&)", referenced from:
      _main in lto.o
  "ArgsManager::AddArg(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, OptionsCategory const&)", referenced from:
      _main in lto.o
  "ArgsManager::AddCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _main in lto.o
  "HelpRequested(ArgsManager const&)", referenced from:
      _main in lto.o
  "SetupHelpOptions(ArgsManager&)", referenced from:
      _main in lto.o
  "FormatFullVersion()", referenced from:
      _main in lto.o
  "SetupEnvironment()", referenced from:
      _main in lto.o
<trim>

The mingw-w64 is failing with:

/bin/sh ../libtool  --tag=CXX --preserve-dup-deps  --mode=link x86_64-w64-mingw32-g++ -std=c++17  -fstack-reuse=none -Wstack-protector -fstack-protector-all -fcf-protection=full      -flto -fPIE -pipe -O2 -O2 -g -fno-ident -fno-extended-identifiers -fvisibility=hidden -Wl,--exclude-libs,ALL  -Wl,--enable-reloc-section -Wl,--dynamicbase -Wl,--nxcompat -Wl,--high-entropy-va -pie   -flto -all-static -pthread -lpthread -L/bitcoin/depends/x86_64-w64-mingw32/lib -Wl,--no-insert-timestamp -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1 -o bitcoin-cli.exe bitcoin_cli-bitcoin-cli.o bitcoin-cli-res.o libbitcoin_cli.a univalue/libunivalue.la libbitcoin_util.a crypto/libbitcoin_crypto_base.a crypto/libbitcoin_crypto_sse41.a crypto/libbitcoin_crypto_avx2.a crypto/libbitcoin_crypto_shani.a -L/bitcoin/depends/x86_64-w64-mingw32/lib -lboost_system-mt-s-x64 -lboost_filesystem-mt-s-x64 -L/bitcoin/depends/x86_64-w64-mingw32/lib -levent -lws2_32 -lssp -liphlpapi -lshlwapi -lws2_32 -ladvapi32 -luuid -loleaut32 -lole32 -lcomctl32 -lshell32 -lwinmm -lcomdlg32 -lgdi32 -luser32 -lkernel32 
libtool: link: x86_64-w64-mingw32-g++ -std=c++17 -fstack-reuse=none -Wstack-protector -fstack-protector-all -fcf-protection=full -flto -fPIE -pipe -O2 -O2 -g -fno-ident -fno-extended-identifiers -fvisibility=hidden -Wl,--exclude-libs -Wl,ALL -Wl,--enable-reloc-section -Wl,--dynamicbase -Wl,--nxcompat -Wl,--high-entropy-va -pie -flto -static -pthread -Wl,--no-insert-timestamp -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1 -o bitcoin-cli.exe bitcoin_cli-bitcoin-cli.o bitcoin-cli-res.o  -lpthread -L/bitcoin/depends/x86_64-w64-mingw32/lib libbitcoin_cli.a univalue/.libs/libunivalue.a libbitcoin_util.a crypto/libbitcoin_crypto_base.a crypto/libbitcoin_crypto_sse41.a crypto/libbitcoin_crypto_avx2.a crypto/libbitcoin_crypto_shani.a -lboost_system-mt-s-x64 -lboost_filesystem-mt-s-x64 -levent -lws2_32 /gnu/store/c1mhzb9f961bdc9z4jbsn44c8fk2an5y-gcc-cross-x86_64-w64-mingw32-8.4.0/x86_64-w64-mingw32/lib/libssp.a -liphlpapi -lshlwapi -lws2_32 -ladvapi32 -luuid -loleaut32 -lole32 -lcomctl32 -lshell32 -lwinmm -lcomdlg32 -lgdi32 -luser32 -lkernel32 -pthread
x86_64-w64-mingw32-ld: libbitcoin_util_a-request.o (symbol from plugin):(.gnu.linkonce.t._ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEaSERKS7_+0x0): multiple definition of `std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::operator=(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)'; univalue/.libs/libunivalue.a(libunivalue_la-univalue.o):/gnu/store/c1mhzb9f961bdc9z4jbsn44c8fk2an5y-gcc-cross-x86_64-w64-mingw32-8.4.0/include/c++/bits/vector.tcc:186: first defined here
x86_64-w64-mingw32-ld: libbitcoin_util_a-request.o (symbol from plugin):(.gnu.linkonce.t._ZNSt6vectorI8UniValueSaIS0_EEaSERKS2_+0x0): multiple definition of `std::vector<UniValue, std::allocator<UniValue> >::operator=(std::vector<UniValue, std::allocator<UniValue> > const&)'; univalue/.libs/libunivalue.a(libunivalue_la-univalue.o):/gnu/store/c1mhzb9f961bdc9z4jbsn44c8fk2an5y-gcc-cross-x86_64-w64-mingw32-8.4.0/include/c++/bits/vector.tcc:186: first defined here
x86_64-w64-mingw32-ld: libbitcoin_util_a-system.o (symbol from plugin):(.gnu.linkonce.t._ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_8UniValueESt10_Select1stIS9_ESt4lessIS5_ESaIS9_EE24_M_get_insert_unique_posERS7_+0x0): multiple definition of `std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue> > >::_M_get_insert_unique_pos(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'; univalue/.libs/libunivalue.a(libunivalue_la-univalue.o):/gnu/store/c1mhzb9f961bdc9z4jbsn44c8fk2an5y-gcc-cross-x86_64-w64-mingw32-8.4.0/include/c++/bits/stl_tree.h:2051: first defined here
x86_64-w64-mingw32-ld: libbitcoin_util_a-system.o (symbol from plugin):(.gnu.linkonce.t._ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_8UniValueESt10_Select1stIS9_ESt4lessIS5_ESaIS9_EE8_M_eraseEPSt13_Rb_tree_nodeIS9_E+0x0): multiple definition of `std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue> > >::_M_erase(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue> >*)'; univalue/.libs/libunivalue.a(libunivalue_la-univalue.o):/gnu/store/c1mhzb9f961bdc9z4jbsn44c8fk2an5y-gcc-cross-x86_64-w64-mingw32-8.4.0/include/c++/bits/stl_tree.h:1873: first defined here
x86_64-w64-mingw32-ld: libbitcoin_util_a-system.o (symbol from plugin):(.gnu.linkonce.t._ZNSt6vectorI8UniValueSaIS0_EE17_M_realloc_insertIJRKS0_EEEvN9__gnu_cxx17__normal_iteratorIPS0_S2_EEDpOT_+0x0): multiple definition of `void std::vector<UniValue, std::allocator<UniValue> >::_M_realloc_insert<UniValue const&>(__gnu_cxx::__normal_iterator<UniValue*, std::vector<UniValue, std::allocator<UniValue> > >, UniValue const&)'; univalue/.libs/libunivalue.a(libunivalue_la-univalue.o):/gnu/store/c1mhzb9f961bdc9z4jbsn44c8fk2an5y-gcc-cross-x86_64-w64-mingw32-8.4.0/include/c++/bits/vector.tcc:413: first defined here
x86_64-w64-mingw32-ld: libbitcoin_util_a-settings.o (symbol from plugin):(.gnu.linkonce.t._ZNSt6vectorI8UniValueSaIS0_EE15_M_range_insertIN9__gnu_cxx17__normal_iteratorIPKS0_S2_EEEEvNS5_IPS0_S2_EET_SB_St20forward_iterator_tag+0x0): multiple definition of `void std::vector<UniValue, std::allocator<UniValue> >::_M_range_insert<__gnu_cxx::__normal_iterator<UniValue const*, std::vector<UniValue, std::allocator<UniValue> > > >(__gnu_cxx::__normal_iterator<UniValue*, std::vector<UniValue, std::allocator<UniValue> > >, __gnu_cxx::__normal_iterator<UniValue const*, std::vector<UniValue, std::allocator<UniValue> > >, __gnu_cxx::__normal_iterator<UniValue const*, std::vector<UniValue, std::allocator<UniValue> > >, std::forward_iterator_tag)'; univalue/.libs/libunivalue.a(libunivalue_la-univalue.o):/gnu/store/c1mhzb9f961bdc9z4jbsn44c8fk2an5y-gcc-cross-x86_64-w64-mingw32-8.4.0/include/c++/bits/vector.tcc:672: first defined here
collect2: error: ld returned 1 exit status

@DrahtBot
Copy link
Contributor

Guix builds

File commit 5b7210c
(master)
commit dfe4547
(master and this pull)
SHA256SUMS.part c79a21dc3da6e71b...
*-aarch64-linux-gnu-debug.tar.gz 108b2ef989bd0d35...
*-aarch64-linux-gnu.tar.gz a5bacdca50e2c3f0...
*-arm-linux-gnueabihf-debug.tar.gz b21f70b81f75b1f6...
*-arm-linux-gnueabihf.tar.gz 6c79c07aa1d2df22...
*-osx-unsigned.dmg e15275439c514402...
*-osx-unsigned.tar.gz 23080798bd4790d0...
*-osx64.tar.gz f4afcac2e217616d...
*-powerpc64-linux-gnu-debug.tar.gz 7bb92bb01f337a75...
*-powerpc64-linux-gnu.tar.gz 085787f59f3c1a58...
*-powerpc64le-linux-gnu-debug.tar.gz 2732fa036e1ba621...
*-powerpc64le-linux-gnu.tar.gz 495e1c10d8950c1a...
*-riscv64-linux-gnu-debug.tar.gz 82c896f2e942879b...
*-riscv64-linux-gnu.tar.gz ebc9d158e7fe286e...
*-win-unsigned.tar.gz 4a871e218e240ccb...
*-win64-debug.zip 0ac6d7beea9e7a67...
*-win64-setup-unsigned.exe 73d5ba8460a67851...
*-win64.zip 104adfb4cd021131...
*-x86_64-linux-gnu-debug.tar.gz 896c0ecaefff84eb...
*-x86_64-linux-gnu.tar.gz 9cc9de13c910b2a4...
*.tar.gz 0d51a99bd81f38ec... fb63f940b09474e5...
guix_build.log 463c2d4bbaa53638... 902025a013b42081...
guix_build.log.diff f2c8d8610e11556c...

Co-authored-by: Cory Fields <cory-nospam-@coryfields.com>
Co-authored-by: Elichai Turkel <elichai.turkel@gmail.com>
@fanquake fanquake force-pushed the experiment_with_lto branch from d33237e to 68e5aaf Compare November 16, 2021 01:45
@fanquake
Copy link
Member Author

I've rebased this, and reduced the changes back to just adding the --enable-lto configure option (-flto). I think merging this as is, is still useful for now, so that developers can experiment/benchmark. LTO is still opt in, and there are no changes to release builds.

I plan on adding proper LTO support to depends as a follow up.

@DrahtBot
Copy link
Contributor

Guix builds

File commit b869a78
(master)
commit da6e638
(master and this pull)
SHA256SUMS.part 954f517d6d32db0e... 6cc1eec935c0042e...
*-aarch64-linux-gnu-debug.tar.gz af2097467f36eabf... 3dcc0de6160f7c35...
*-aarch64-linux-gnu.tar.gz e69d087ccde8efd6... 77067d14556e109e...
*-arm-linux-gnueabihf-debug.tar.gz a0c73a2842d9fa8f... 2dcdcb1a2ea8ce99...
*-arm-linux-gnueabihf.tar.gz c4cc98770c06329b... c57d5c94ca3f85fe...
*-osx-unsigned.dmg 62a4e08899b352be... 54a32ff64a9f2d24...
*-osx-unsigned.tar.gz b93bb0e47ecc8b95... 1fa5ad953c9c2af1...
*-osx64.tar.gz c69f867438a8af21... 8e80cc616af98cb8...
*-powerpc64-linux-gnu-debug.tar.gz 2498043e265ec068... 75165af3e6ecaaaf...
*-powerpc64-linux-gnu.tar.gz 9432dd894f7360c8... 7dcd9732be03f2ae...
*-powerpc64le-linux-gnu-debug.tar.gz 65ed6dc046debc24... 809b49fa06cee5da...
*-powerpc64le-linux-gnu.tar.gz 9ab401045d52eea9... a37c138df3d55bee...
*-riscv64-linux-gnu-debug.tar.gz 2fac51b0a508c378... 22f2b9f5eae333e0...
*-riscv64-linux-gnu.tar.gz e1ec62b871a1f4e4... 0b423013c33d5a77...
*-win-unsigned.tar.gz cbbac77f2a64bfcc... c6ebb35599df0f4e...
*-win64-debug.zip ff35db2f0d6ab21b... 4241c2f5e90c6951...
*-win64-setup-unsigned.exe 90d58bf173f12b26... 93cd680dfbf4317d...
*-win64.zip d97a69c639cd5e58... 22322ace7cf4fdd7...
*-x86_64-linux-gnu-debug.tar.gz 65fe6d9d2c6d0f99... 40dc193eea66d1e5...
*-x86_64-linux-gnu.tar.gz fd13a09d2d862e25... 32fee564ee128f26...
*.tar.gz 06dea90135016d53... 61d1906bb2485b61...
guix_build.log a53270b21d20dcea... a9ff2d0d3c723d30...
guix_build.log.diff 912a22ba51f64849...

@laanwj
Copy link
Member

laanwj commented Nov 18, 2021

Code review ACK 68e5aaf
(but see below)

@laanwj
Copy link
Member

laanwj commented Nov 18, 2021

I tried running a build with --enable-lto on Ubuntu 20.04, with clang 13 and get the following errors during link:

/usr/bin/ld: minisketch/libminisketch.a: error adding symbols: archive has no index; run ranlib to add one
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)

With gcc 9.3.0 I get the following error:

/usr/bin/ld: /tmp/bitcoin-tx.PKYwxw.ltrans1.ltrans.o: in function `VerifyWitnessProgram(CScriptWitness const&, int, std::vector<unsigned char, std::allocator<unsigned char> > const&, unsigned int, BaseSignatureChecker const&, ScriptError_t*, bool) [clone .constprop.0]':
./build/src/./src/pubkey.cpp:230: undefined reference to `secp256k1_xonly_pubkey_parse'
/usr/bin/ld: /tmp/bitcoin-tx.PKYwxw.ltrans1.ltrans.o:./build/src/./src/pubkey.cpp:232: undefined reference to `secp256k1_xonly_pubkey_tweak_add_check'

martinus added a commit to martinus/bitcoin that referenced this pull request Nov 18, 2021
Building with `--enable-lto`in bitcoin#23152 produced a `-Wmaybe-uninitialized`
warning in FastRandomContext. This commit fixes the move constructor:
There was undefined behavior due to uninitialized copy, and
uninitialized reads in bytebuf.

The `FastRandomContext(const uint256& seed)` constructor did not
initialize the `uint64_t bitbuf` member, and in
`FastRandomContext& operator=(FastRandomContext&& from) noexcept;` the
uninitialized variable was copied with `bitbuf = from.bitbuf;` which
technically is undefined behavior. This happens in `setup_common.cpp`
in the line `ctx = FastRandomContext(seed);`.
@fanquake
Copy link
Member Author

with clang 13 and get the following errors during link:

Builds with Apple Clang are working ok, but I see the same issue with LLVM Clang 13. Will take a look.

With gcc 9.3.0 I get the following error:

Interesting. Anything non-standard about your build? I've completed builds using this branch with GCC 10.3.0 and 9.3.0.

@fanquake
Copy link
Member Author

but I see the same issue with LLVM Clang 13. Will take a look.

The issue is using ranlib rather than llvm-ranlib. When I use llvm-ranlib-13 (with clang-13) building with LTO works fine.

We should be able to override the ranlib used during configure, using RANLIB=llvm-ranlib-*, but that doesn't currently work because of our use of AC_PATH_TOOL. Going to fix this up.

@laanwj
Copy link
Member

laanwj commented Nov 19, 2021

Interesting. Anything non-standard about your build? I've completed builds using this branch with GCC 10.3.0 and 9.3.0.

I've retried on Ubuntu 20.04 with just

../configure --with-incompatible-bdb --enable-lto
make -j4

No flag overrides. The only thing special isthat it's an out-of-tree build. It still fails in the linking step.

  CXXLD    bitcoin-wallet
/usr/bin/ld: /tmp/bitcoin-tx.OJq2ei.ltrans1.ltrans.o: in function `VerifyWitnessProgram(CScriptWitness const&, int, std::vector<unsigned char, std::allocator<unsigned char> >
 const&, unsigned int, BaseSignatureChecker const&, ScriptError_t*, bool) [clone .constprop.0]':
./build/src/./src/pubkey.cpp:230: undefined reference to `secp256k1_xonly_pubkey_parse'
/usr/bin/ld: /tmp/bitcoin-tx.OJq2ei.ltrans1.ltrans.o:./build/src/./src/pubkey.cpp:232: undefined reference to `secp256k1_xonly_pubkey_tweak_add_check'
/usr/bin/ld: /tmp/bitcoin-tx.OJq2ei.ltrans4.ltrans.o: in function `XOnlyPubKey::VerifySchnorr(uint256 const&, Span<unsigned char const>) const':
./build/src/./src/pubkey.cpp:210: undefined reference to `secp256k1_xonly_pubkey_parse'
…

It could still be the environment I can retry in a fresh VM.

Edit: that works, fine, will try to find out what is different.
Edit.2: there was some local crap in the source directory interfering (leftover stale .deps directories, to be specific). So no issue with this PR at all.

@fanquake
Copy link
Member Author

fanquake commented Nov 25, 2021

This currently works for GCC 9.x+, no change to release builds, still completely opt in. I'm planning on following up with improved support for Clang, and depends support shortly, but am going to merge this now.

@fanquake fanquake merged commit 681b25e into bitcoin:master Nov 25, 2021
@fanquake fanquake deleted the experiment_with_lto branch November 25, 2021 12:24
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Nov 25, 2021
68e5aaf build: add `--enable-lto` configuration option (fanquake)

Pull request description:

  It's been 5 years since using LTO was first suggested for use when building Bitcoin Core, and it's time to revisit it again. Compilers, and their LTO implementations, have matured, and Bitcoin Core has come a long way in terms of pruning dependencies which may have proved troublesome (i.e Boost previously had issues when using LTO). We'll have even less Boost code after moving to `std::filesystem` (bitcoin#20744).

  Experimenting with LTO came up on IRC last night:
  > sipa: jamesob: i'm interested in knowing whether "-flto" and/or "-fdata-sections -ffunction-sections -Wl,--gc-sections" are possible/beneficial with our current compiler suite; what would be a good way to have your test infrastructure benchmark things?

  So this PR just adds the bare minimum to make it easier to configure, compile and perform some bench-marking using `-flto`. This PR doesn't do anything depends wise, however if we decide this is what we want to do, I'll expand the changes here.

  I had previously had a PR open (bitcoin#18605) to perform link time garbage collection (`-ffunction-sections -fdata-sections` & `-Wl,--gc-sections`), however moving straight to using LTO would be preferable.

  Note that our minimum required set of compilers, GCC 8.1 and Clang 7, all support the `-flto` option.

  Related bitcoin#18579.
  Previous discussion: bitcoin#10616, bitcoin#14277.
  Previous related PRs: bitcoin#10800 (`-flto`), bitcoin#16791 (ThinLTO).

  Guix build:
  ```bash
  bash-5.1# find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
  1f3a7c5be4169aaa444b481d3e65a7bb72da9007fee6e6c416ded2e70f97374b  guix-build-68e5aafde3e8/output/aarch64-linux-gnu/SHA256SUMS.part
  fa8f4cf223d9aaf0b2c1ef55ce61256a19cd1ad7f42b99d0b98c9a52fe6ad8ba  guix-build-68e5aafde3e8/output/aarch64-linux-gnu/bitcoin-68e5aafde3e8-aarch64-linux-gnu-debug.tar.gz
  9a9967078cd1849b4e85db619e1f55d305c6d44e9e013067c0e8d62c1ba54087  guix-build-68e5aafde3e8/output/aarch64-linux-gnu/bitcoin-68e5aafde3e8-aarch64-linux-gnu.tar.gz
  18c71f30722102baaf3dfda67f7c7aac38723510b142e8df8ee7063c5d499368  guix-build-68e5aafde3e8/output/arm-linux-gnueabihf/SHA256SUMS.part
  0854cc0d17c045a118df2a24e4cf36d727e7e7e2dea37c2492ee21b71cb79b4b  guix-build-68e5aafde3e8/output/arm-linux-gnueabihf/bitcoin-68e5aafde3e8-arm-linux-gnueabihf-debug.tar.gz
  215256897dde4e8412ed60473376c694a80c5479fb08039107fb62435f2816ef  guix-build-68e5aafde3e8/output/arm-linux-gnueabihf/bitcoin-68e5aafde3e8-arm-linux-gnueabihf.tar.gz
  5fad0d9d12bc514ec46ed5d66fd29b7da1376a4a69c3b692936f1ab2356e2f85  guix-build-68e5aafde3e8/output/dist-archive/bitcoin-68e5aafde3e8.tar.gz
  4f32989d4ab1946048ca7caee9a983fa875be262282562f5a3e040f4bf92158e  guix-build-68e5aafde3e8/output/powerpc64-linux-gnu/SHA256SUMS.part
  ae45df309ae8ada52891efac0a369a69fed4ab93847a7bc4150a62230df4c8d7  guix-build-68e5aafde3e8/output/powerpc64-linux-gnu/bitcoin-68e5aafde3e8-powerpc64-linux-gnu-debug.tar.gz
  0ced227de15cb578567131271e2effe80681b4d7a436c92bf1caec735a576fa4  guix-build-68e5aafde3e8/output/powerpc64-linux-gnu/bitcoin-68e5aafde3e8-powerpc64-linux-gnu.tar.gz
  26fc5d2ccc1bc17ee0a146cacada6f4909d90c136ae640c8337332adce414ee0  guix-build-68e5aafde3e8/output/powerpc64le-linux-gnu/SHA256SUMS.part
  9956b544d90a62a8ba9fc9dc6b6b7f0efe193357332ec19e88053a89d4aab37e  guix-build-68e5aafde3e8/output/powerpc64le-linux-gnu/bitcoin-68e5aafde3e8-powerpc64le-linux-gnu-debug.tar.gz
  be8e39ceea1d36086ce5fa93bfb138c68d3bdf0dd6950b192dfa27a65cce3836  guix-build-68e5aafde3e8/output/powerpc64le-linux-gnu/bitcoin-68e5aafde3e8-powerpc64le-linux-gnu.tar.gz
  a7755edc394972885c4c77a7798007e5ba4126b177c4ff6224275c4fb8f3b1c4  guix-build-68e5aafde3e8/output/riscv64-linux-gnu/SHA256SUMS.part
  b6d252993d8aae7582ad6385fe53c61c54c284c68ece6cb2b2d1ac9554e06139  guix-build-68e5aafde3e8/output/riscv64-linux-gnu/bitcoin-68e5aafde3e8-riscv64-linux-gnu-debug.tar.gz
  bb4860f3bbd815f800333124ff901d880741792ab47097f49bda3a6931144da0  guix-build-68e5aafde3e8/output/riscv64-linux-gnu/bitcoin-68e5aafde3e8-riscv64-linux-gnu.tar.gz
  3dd17deed5c5935fb28b62dfc7afca5caab0d67862cdcbf3337edae73e1d0c4c  guix-build-68e5aafde3e8/output/x86_64-apple-darwin19/SHA256SUMS.part
  fa2d68c54fda0816188c81ce2201a77340b82645da2ffe412526f92c297a82df  guix-build-68e5aafde3e8/output/x86_64-apple-darwin19/bitcoin-68e5aafde3e8-osx-unsigned.dmg
  f6e5accdcd201f522b6426e4d8cc9b3643d4d43a57d268fa0e79ea9a34cfac01  guix-build-68e5aafde3e8/output/x86_64-apple-darwin19/bitcoin-68e5aafde3e8-osx-unsigned.tar.gz
  4e5a127df957d1c73b65925d685f6620e7bc5667efcb6dcd98be76effc22fc12  guix-build-68e5aafde3e8/output/x86_64-apple-darwin19/bitcoin-68e5aafde3e8-osx64.tar.gz
  56ccd216a69acafacbdc6bae0bdcc1faa50b6a51be1aebfa7068206c88b3241a  guix-build-68e5aafde3e8/output/x86_64-linux-gnu/SHA256SUMS.part
  77b93dd5fad322636853e5b0244ffafd97cc97f3b4b4ee755d5f830b75d77d13  guix-build-68e5aafde3e8/output/x86_64-linux-gnu/bitcoin-68e5aafde3e8-x86_64-linux-gnu-debug.tar.gz
  1feda932fc127b900316a232432b91e46e57ee12a81e12a7d888fdc3296219c1  guix-build-68e5aafde3e8/output/x86_64-linux-gnu/bitcoin-68e5aafde3e8-x86_64-linux-gnu.tar.gz
  aa7c53ab4164b3736049065c3c24391fc5bd7f26b4bda4aa877c378f0636a125  guix-build-68e5aafde3e8/output/x86_64-w64-mingw32/SHA256SUMS.part
  5e76148e67aef7e91e70074bfadc08e94373449ac3b966f4343b04d230c778fd  guix-build-68e5aafde3e8/output/x86_64-w64-mingw32/bitcoin-68e5aafde3e8-win-unsigned.tar.gz
  34123e3d818beeb70113caeda66945bc7cb9d9e987515d5b149bd17b4b38da90  guix-build-68e5aafde3e8/output/x86_64-w64-mingw32/bitcoin-68e5aafde3e8-win64-debug.zip
  2bba7f40a2b23c6ea3d47c4f564ab54201bf27f7f57103a98cc9bceea4e70c4d  guix-build-68e5aafde3e8/output/x86_64-w64-mingw32/bitcoin-68e5aafde3e8-win64-setup-unsigned.exe
  0e7e124144af4a92a4344cf70a3b7c06fbd2b8782aee7ede7263893afa3a5ef0  guix-build-68e5aafde3e8/output/x86_64-w64-mingw32/bitcoin-68e5aafde3e8-win64.zip
  ```

ACKs for top commit:
  laanwj:
    Code review ACK 68e5aaf

Tree-SHA512: 5c25249cc178b9d54159e268390c974b739df9458d773e23c14b14d808f87f7afe314058b3c068601a9132042321973b0c9b6f81becb925665eca2738ae9a613
@bitcoin bitcoin locked and limited conversation to collaborators Nov 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants