Commit Graph

14254 Commits

Author SHA1 Message Date
Jonas Schnelli 220e166e47 Move uiInterface.NotifyBlockTip signal above the core/wallet signal
- This will keep getbestblockhash more in sync with blocknotify callbacks
2020-09-30 00:35:32 +01:00
Jonas Schnelli 66515b0628 NotifyBlockTip signal: switch from hash (uint256) to CBlockIndex*
- also adds a boolean for indication if the tip update was happening during initial sync
- emit notification also during initial sync
2020-09-30 00:35:32 +01:00
Wladimir J. van der Laan 23556e690e http: Restrict maximum size of request line + headers
Prevent memory exhaustion by sending lots of data.
Also add a test to `httpbasics.py`.

Closes #6425
2020-09-30 00:35:32 +01:00
Homu 7d94064616 Auto merge of #4643 - str4d:locked-memory-manager, r=str4d
Locked memory manager

Add a pool for locked memory chunks, replacing `LockedPageManager`.

Cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#8321
- bitcoin/bitcoin#8753
- bitcoin/bitcoin#9063
- bitcoin/bitcoin#9070
- bitcoin/bitcoin#11385
- bitcoin/bitcoin#12048
  - Excludes change to benchmark.
- bitcoin/bitcoin#15117
- bitcoin/bitcoin#16161
  - Excludes Travis CI changes.
  - Includes change from bitcoin/bitcoin#13163
- bitcoin/bitcoin#15600
- bitcoin/bitcoin#18443
- Assorted small changes from:
  - bitcoin/bitcoin#9233
  - bitcoin/bitcoin#10483
  - bitcoin/bitcoin#10645
  - bitcoin/bitcoin#10969
  - bitcoin/bitcoin#11351
- bitcoin/bitcoin#19111
  - Excludes change to `src/rpc/server.cpp`
- bitcoin/bitcoin#9804
  - Only the commit for `src/key.cpp`
- bitcoin/bitcoin#9598
2020-09-29 22:18:48 +00:00
Homu 9245388bbc Auto merge of #4749 - str4d:update-config-guess-and-sub, r=str4d
depends: Update to latest config.guess & config.sub
2020-09-29 02:17:39 +00:00
Homu 94cf4a4946 Auto merge of #4558 - linuxion:master, r=str4d
[RPC] Add transaction size to JSON output

Cherry-picked from upstream PR https://github.com/bitcoin/bitcoin/pull/7072.
2020-09-28 22:40:09 +00:00
Nick abcce56fe1 [RPC] Add transaction size to JSON output
This may be useful for blockchain explorers.
2020-09-28 23:12:21 +01:00
Jack Grigg f43e3833f3 gitian: Switch from x86_64-unknown-linux-gnu to x86_64-linux-gnu
This will work regardless of how config.sub behaves, and matches what
upstream currently uses.
2020-09-28 21:36:46 +01:00
Jack Grigg bd87bcf1b4 build: Switch to x86_64-pc-linux-gnu for codecov filtering 2020-09-28 21:36:02 +01:00
Jack Grigg f52793d0d0 QA: Switch to x86_64-pc-linux-gnu for hard-coded Linux HOST
The change to config.guess for x86_64:Linux was made here:
    http://git.savannah.gnu.org/cgit/config.git/commit/?id=ca9bfb8cc75a2be1819d89c664a867785c96c9ba
2020-09-28 21:28:43 +01:00
Jack Grigg 9384b78c0f depends: Update map of GCC canonical hosts to Rust targets
The updated files now output x86_64-pc-linux-gnu on some platforms where
they previously output x86_64-unknown-linux-gnu.
2020-09-28 18:20:47 +01:00
Jack Grigg 55acaf4bc5 allocators: Apply Allocator named requirements to secure_allocator::deallocate
The named requirements for Allocator are here:
    https://en.cppreference.com/w/cpp/named_req/Allocator

It gives the following requirements for `a.deallocate(p, n)`:

> Deallocates storage pointed to `p`, which must be a value returned by
> a previous call to `allocate` that has not been invalidated by an
> intervening call to `deallocate`. `n` must match the value previously
> passed to `allocate`. Does not throw exceptions.

This explicitly excludes both calling `secure_allocator::deallocate` on
`nullptr`, and throwing exceptions of any kind. We address the former by
asserting that `p != nullptr` (because `LockedPool::free` does support
`nullptr`), and we address the latter by adding the `noexcept` keyword
(which the example C++11 allocator on the page above also uses).
2020-09-28 16:22:43 +01:00
Jack Grigg 66ac442da8 LockedPool: Make Arena::free and LockedPool::free noexcept
Attempting to free a detectably invalid pointer should terminate, as
this would be a programming error.
2020-09-28 16:20:06 +01:00
Jack Grigg fa6921c480 LockedPool: Fix LockedPool::free(nullptr) to be a no-op
It was documented as such, but nullptr is never an address within an
Arena, so it would fall through and trigger the std::runtime_error.
2020-09-28 15:46:00 +01:00
str4d b2b5cccf39
test: Fix LFSR period in comments
Verified using a Python implementation.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-09-26 00:56:20 +01:00
str4d b5ddac4b71
LockedPool: Switch to HTTPS URLs in licenses and comments
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-09-26 00:30:45 +01:00
Homu 514d868179 Auto merge of #4739 - str4d:update-leveldb, r=str4d
Update LevelDB to upstream commit f545dfabf

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7911
- bitcoin/bitcoin#7982
- bitcoin/bitcoin#8133
- bitcoin/bitcoin#8784
  - Only the missing changes.
- bitcoin/bitcoin#8826
- bitcoin/bitcoin#8613
- bitcoin/bitcoin#10544
- bitcoin/bitcoin#10633
  - Only the changes to files and code we have.
- bitcoin/bitcoin#10806
- bitcoin/bitcoin#10958
- bitcoin/bitcoin#12451
- bitcoin/bitcoin#13925
- bitcoin/bitcoin#15270

This upgrades LevelDB in the exact same commit progression as upstream, up to January 2019.
2020-09-25 16:16:37 +00:00
str4d f4c78c45b5
leveldb: Fix typo
Co-authored-by: Dimitris Apostolou <dimitris.apostolou@icloud.com>
2020-09-25 16:02:52 +01:00
str4d e2eeabe9e0
Update license headers
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-09-25 16:02:25 +01:00
Jack Grigg f5582677a6 leveldb: Assert that ssize_t is the same size as size_t on Windows
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-09-25 15:59:05 +01:00
Jack Grigg 3d79da1beb build: out-of-tree fixups
Accidentally excluded from 9cc7497692 when
backporting upstream commit 0cb0f2626e1553426e16a52fc6928d35824827f5.
2020-09-25 15:39:08 +01:00
practicalswift a3fbfe4efc Improve readability by removing redundant casts to same type (on all platforms) 2020-09-25 14:56:20 +01:00
Jeremy Rubin 94f7ae6ce8 Fix subscript[0] potential bugs in key.cpp 2020-09-25 14:54:17 +01:00
Homu e886263547 Auto merge of #4748 - rex4539:fix-typos, r=daira
Fix typos
2020-09-25 13:42:27 +00:00
Jack Grigg 8e55824119 depends: Update to latest config.guess & config.sub 2020-09-25 14:11:58 +01:00
Homu d8ab28426e Auto merge of #4747 - rex4539:fix-cargo-checksum, r=str4d
Remove reference to cargo-checksum.sh

Leftover after merging https://github.com/zcash/zcash/pull/4743.

Caused compilation warnings of the form:

```
shasum: cargo-checksum.sh: No such file or directory
```
2020-09-25 10:29:01 +00:00
Dimitris Apostolou 67ffb189b7
Fix typos 2020-09-25 10:49:57 +03:00
Dimitris Apostolou 4e1d3856ee
Remove reference to cargo-checksum.sh 2020-09-25 07:15:04 +03:00
Homu 8f15f5fcce Auto merge of #4734 - str4d:2-sodium-2-oxide, r=str4d
Replace libsodium BLAKE2b usage with blake2b_simd crate

Extracted from zcash/zcash#4654.

Also fixes a bug in the `tracing::Span` C++ class.
2020-09-24 23:41:48 +00:00
Homu 9ef15a8415 Auto merge of #4746 - str4d:remove-rust-mingw-workaround, r=ebfull
build: Remove Rust staticlib naming workaround

The bug this was working around was fixed in Rust 1.44.0. We now pin
Rust 1.44.1, so we no longer need the workaround (and in fact, it is
necessary to make this change, as rustc no longer generates the old
filename, causing our Windows cross-compile to fail).
2020-09-24 19:37:22 +00:00
Homu 256d6e33eb Auto merge of #4743 - str4d:cargo-vendor-cleanups, r=str4d
depends: Remove cargo-checksum.sh

Now that we are using `cargo vendor`, the checksum files are computed
automatically.
2020-09-24 16:07:18 +00:00
Jack Grigg 7169cfc0d8 build: Remove Rust staticlib naming workaround
The bug this was working around was fixed in Rust 1.44.0. We now pin
Rust 1.44.1, so we no longer need the workaround (and in fact, it is
necessary to make this change, as rustc no longer generates the old
filename).
2020-09-24 16:27:42 +01:00
Jack Grigg 0f3baaba71 tracing: Correctly override tracing::Span move constructors 2020-09-24 15:58:19 +01:00
Jack Grigg 02b7d2afa2 blake2b: Allow consuming partial BLAKE2b output
Some consumers were relying on the libsodium behaviour that the output
length was not checked against the configured hash output length.
blake2b_simd::Hash::as_bytes returns a correctly-sized slice, which we
were then failing to copy into the consumer's buffer. Instead of
requiring the consumer to provide a full-length buffer and then truncate
the output themselves (likely causing a double-copy, as we don't have
nice slices in C++), we instead allow the consumer to consume up to the
maximum output.
2020-09-24 15:58:19 +01:00
Jack Grigg 2d172e121f Replace libsodium's crypto_generichash_blake2b with blake2b_simd 2020-09-24 15:58:14 +01:00
Homu 31f48caf0e Auto merge of #4690 - LarryRuane:CopyPreviousWitnessesPart2, r=str4d
Flush witness data when consistent (part 2)

Closes #4680. After CWallet::ChainTipAdded() updates the witness data, it may flush it to disk (SetBestChain()); make sure the locator part is consistent with the witnesses (height).
2020-09-24 13:31:31 +00:00
Homu ad56e9c2e9 Auto merge of #4693 - daira:explicit-coercions, r=str4d
Make some conversions explicit to reduce sanitizer warnings

The warnings eliminated by this PR are of the forms, for example:
```
src/chain.h:591:16: runtime error: implicit conversion from type 'unsigned long' of value 18446744073709551615 (64-bit, unsigned) to type 'int' changed the value to -1 (32-bit, signed)
src/scalar_4x64_impl.h:130:110: runtime error: implicit conversion from type 'uint64_t' (aka 'unsigned long') of value 533633915002 (64-bit, unsigned) to type 'unsigned char' changed the value to 122 (8-bit, unsigned)
src/zcash/util.cpp:9:25: runtime error: implicit conversion from type 'uint64_t' (aka 'unsigned long') of value 1000000000 (64-bit, unsigned) to type 'std::vector<unsigned char, std::allocator<unsigned char> >::value_type' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned)
```

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-09-24 12:16:11 +00:00
Jack Grigg a554f7ccc6 depends: Remove cargo-checksum.sh
Now that we are using `cargo vendor`, the checksum files are computed
automatically.
2020-09-23 11:30:35 +01:00
Homu 49fc20aced Auto merge of #4720 - ebfull:fix-perf-regressions, r=str4d
Address some performance regressions

@str4d identified and fixed some performance regressions in our elliptic curve and proving crates, and we also changed to complete formulas in `bls12_381` to get some better performance in some cases. The result:

```
v3.1.0
"runningtime": 0.59883

before upgrading rust:
"runningtime": 0.823932

after upgrading rust:
"runningtime": 0.83004

after upgrading rust packages:
"runningtime": 0.763065
```

which gets us some of the way back to where we were.
2020-09-23 01:36:00 +00:00
MarcoFalke f3e5adc160 Pull leveldb subtree 2020-09-23 00:12:01 +01:00
Jack Grigg dd6b34250c Squashed 'src/leveldb/' changes from 524b7e36a..f545dfabf
f545dfabf Merge #18: Use utf-8 to decode filename
f8e797a05 Use utf-8 to decode filename
2fc114812 Merge #14: Fixes to allow building with msvc.
d6eab9313 Fixes to allow building with msvc.

git-subtree-dir: src/leveldb
git-subtree-split: f545dfabff4c2e9836efed094dba99a34fbc6b88
2020-09-23 00:11:45 +01:00
MarcoFalke cd819bf14b Merge leveldb subtree
Merge commit '55f90917f519aa124455bd81ab81ff67a1c7fc84' into update-leveldb
2020-09-23 00:11:16 +01:00
Jack Grigg 55f90917f5 Squashed 'src/leveldb/' changes from 64052c76c..524b7e36a
524b7e36a Merge #19: Increase maximum read-only mmap()s used from 1000 to 4096 on 64-bit systems
4874cb8d3 Increase maximum number of read-only mmap()s used from 1000 to 4096 on 64 bit systems.

git-subtree-dir: src/leveldb
git-subtree-split: 524b7e36a8e3bce6fcbcd1b5df09024283f325ba
2020-09-23 00:10:53 +01:00
MarcoFalke 7474d2cfbb Bump leveldb subtree 2020-09-23 00:10:04 +01:00
Jack Grigg b3f8c6e5f4 Squashed 'src/leveldb/' changes from c521b3ac6..64052c76c
64052c76c Merge #15: Add filename to corruption errors
135ed0fb4 Add filename to corruption errors

git-subtree-dir: src/leveldb
git-subtree-split: 64052c76c567cff3dad32d1db0ef969d97b5882f
2020-09-23 00:09:29 +01:00
Pieter Wuille 990c6d244f Update LevelDB with latest Bitcoin-specific patches 2020-09-23 00:08:46 +01:00
Jack Grigg b3b77fb758 Squashed 'src/leveldb/' changes from 196962ff0..c521b3ac6
c521b3ac6 Merge #11: fixup define checks. Cleans up some oopses from #5.
8b1cd3753 fixup define checks. Cleans up some oopses from #5.
6b1508d6d Merge #6: Fixes typo
fceb80542 Merge #10: Clean up compile-time warnings (gcc 7.1)
0ec2a343f Clean up compile-time warnings (gcc 7.1)
d4c268a35 Merge #5: Move helper functions out of sse4.2 object
8d4eb0847 Add HasAcceleratedCRC32C to port_win.h
77cfbfd25 crc32: move helper functions out of port_posix_sse.cc
4c1e9e016 silence compiler warnings about uninitialized variables
495316485 Merge #2: Prefer std::atomic over MemoryBarrier
2953978ef Fixes typo
f134284a1 Merge #1: Merge upstream LevelDB 1.20
ba8a445fd Prefer std::atomic over MemoryBarrier

git-subtree-dir: src/leveldb
git-subtree-split: c521b3ac654cfbe009c575eacf7e5a6e189bb5bb
2020-09-23 00:08:27 +01:00
Cory Fields 55b4aa1942 build: verify that the assembler can handle crc32 functions
Also, enable crc32 even if -msse4.2 wasn't added by us, as long as it works.
This allows custom flags (such as -march=native) to work as expected.
2020-09-23 00:07:48 +01:00
Dimitris Tsapakidis b892fe13f8 Fixed multiple typos
A few "a->an" and "an->a".
"Shows, if the supplied default SOCKS5 proxy" -> "Shows if the supplied default SOCKS5 proxy". Change made on 3 occurrences.
"without fully understanding the ramification of a command" -> "without fully understanding the ramifications of a command".
Removed duplicate words such as "the the".

Zcash: Only the changes to files and code that we have.
2020-09-23 00:07:48 +01:00
MarcoFalke f204f575aa Add extra LevelDB source to Makefile 2020-09-23 00:07:48 +01:00