Commit graph

365 commits

Author SHA1 Message Date
Andrew Poelstra
ba8273ac94 lint: fix non-pylint linter errors
Includes fixing all the spelling mistakes that are our fault,
but not those present upstream in Core.
2021-10-15 00:20:20 +00:00
Andrew Poelstra
5fedc912ba Merge dfb3c4647a into merged_master (Elements PR ElementsProject/elements#1054) 2021-10-06 19:23:55 +00:00
Glenn Willen
a4b66a24b7 Update hardcoded PAK list for Liquid v1 2021-10-06 14:57:10 +00:00
Andrew Poelstra
ea62009330 Merge 4798e8ee2c into merged_master (Elements PR ElementsProject/elements#1052) 2021-10-02 14:06:41 +00:00
Andrew Poelstra
0628311b53 chainparams: change magic bytes for liquidv1test
This is basically a Liquid-prod-ish version of regtest. Its default magic
should not collide with that for Liquid prod.
2021-09-28 17:29:13 +00:00
Andrew Poelstra
5d8b55ce47 Merge f7f9555792 into merged_master (Elements PR ElementsProject/elements#1044) 2021-09-18 23:15:14 +00:00
Andrew Poelstra
dc31deacff Merge bc0494cc39 into merged_master (Elements PR ElementsProject/elements#1040) 2021-09-18 14:58:14 +00:00
Andrew Poelstra
f7f9555792
Merge ElementsProject/elements#1044: Define Taproot activation parameters for Liquid
3cb9612faa test: add test for Taproot activation (Andrew Poelstra)
5291c0d9d9 chainparams: add undocumented regtest/testnet only -con_taproot_signal_start option (Andrew Poelstra)
cc6b933478 add missing taproot activation params for Liquid v1 (Andrew Poelstra)
bec6bcf31b versionbits: allow specific deployments to override the signalling/threshold values (Andrew Poelstra)

Pull request description:

  Sets Taproot to start signalling around noon (California time) on Nov 1, 2021, assuming 95% of blocks are produced between now and then.

  Will activate after one week of 100% signalling. If we can pull this off on the first or second try, we will beat Bitcoin which currently looks like it will activate on Nov 16.

  **Edit:** actually, even without Speedy Trial, there is one full period (week) where Taproot will be "locked in" but not "active". So it will activate on Nov 15 at the earliest.

ACKs for top commit:
  achow101:
    ACK 3cb9612faa

Tree-SHA512: c3a80d39ba86a0d762a3057cb9c45e379c70c2daee8ff2e54978a4c32118c935c8909d872ac9f873e283441c52c1974c06268f10dc7bf9e9e000c21063ac84d7
2021-09-18 03:22:30 +00:00
Andrew Poelstra
5291c0d9d9 chainparams: add undocumented regtest/testnet only -con_taproot_signal_start option 2021-09-15 19:57:06 +00:00
Andrew Poelstra
cc6b933478 add missing taproot activation params for Liquid v1 2021-09-15 18:33:34 +00:00
Andrew Poelstra
e57b4c51ad regtest: change network magic away from liquid v1
We don't want connectivity issues between Liquid and custom test networks.
2021-09-10 17:20:20 +00:00
Andrew Poelstra
79a9c9e715 Merge 42af9596ce into merged_master (Bitcoin PR bitcoin/bitcoin#22499) 2021-08-03 17:20:06 +00:00
Andrew Poelstra
47164a1e9c Merge ddc6979b8b into merged_master (Bitcoin PR bitcoin/bitcoin#19438) 2021-07-30 16:16:50 +00:00
Andrew Poelstra
1aba12c797 Merge 0011167191 into merged_master (Bitcoin PR bitcoin/bitcoin#22135) 2021-07-21 02:29:28 +00:00
Sriram
eeddd1c8fa Update assumed chain params
Note: 10% overhead to the base value of `mainnet` in `m_assumed_blockchain_size`
2021-07-19 19:34:30 +05:30
Andrew Poelstra
2a2bbdaee3 Merge be4171679b into merged_master (Bitcoin PR bitcoin/bitcoin#21953) 2021-07-12 03:35:40 +00:00
Andrew Poelstra
1fd44e5dfc Merge ee9befe8b4 into merged_master (Bitcoin PR bitcoin/bitcoin#21584) 2021-07-09 21:14:15 +00:00
Andrew Poelstra
4126e70356 Merge 7cb0bcb681 into merged_master (Bitcoin PR #21686) 2021-06-30 17:18:35 +00:00
Andrew Poelstra
6d4961766a Merge 2cd834e6c0 into merged_master (Bitcoin PR #21377) 2021-06-30 16:24:18 +00:00
Andrew Poelstra
4fc0789649 Merge 4ad83a9597 into merged_master (Bitcoin PR #21592) 2021-06-29 22:48:06 +00:00
Anthony Towns
ea68b3a572 [move-only] Rename versionbitsinfo to deploymentinfo 2021-06-30 08:19:12 +10:00
Andrew Poelstra
0f1cc86783 Merge 9be7fe4849 into merged_master (Bitcoin PR #21560) 2021-06-29 19:13:43 +00:00
Andrew Poelstra
020de0b30c Merge 66daf4cb3b into merged_master (Bitcoin PR #21567) 2021-06-29 02:31:41 +00:00
Andrew Poelstra
5a654c9bab Merge 9017d55e7c into merged_master (Bitcoin PR #15946) 2021-06-24 02:56:40 +00:00
Andrew Poelstra
89db5e68a5 Merge cd66d8b1d8 into merged_master (Bitcoin PR #20429) 2021-06-24 02:44:14 +00:00
Andrew Poelstra
61a241c5ca Merge 92fee79dab into merged_master (Bitcoin PR #19806)
Looks like James hardcoded a couple hashes in hard-to-find places, which
caused a unit test to fail. I just changed the hash (which covers UTXO
data which naturally will be different for us on account of our differently
formatted CTxOuts).

TODO: determine how Assumeutxo interacts with the fact that we don't save
out nonces in our normal UTXO serialization. Probably we will need to remove
the nonce from the CCoinStats serialization to avoid having inconsistent
hashes across nodes, since these hashes are now checked in assumeutxo?
2021-06-23 23:36:26 +00:00
Andrew Poelstra
756863ce67 Merge d9a4738c9d into merged_master (Bitcoin PR #20660) 2021-06-14 14:02:07 +00:00
Kiminuo
5f23531926 CRegTestParams: Use args instead of gArgs. 2021-06-02 22:36:48 +02:00
MarcoFalke
fa91994b1b
fuzz: Add utxo_snapshot target 2021-05-16 11:34:27 +02:00
MarcoFalke
fa5668bfb3
refactor: Use type-safe assumeutxo hash
This avoids accidentally mixing it up with other hashes (like block
hashes).
2021-05-11 10:40:40 +02:00
MarcoFalke
0000007709
refactor: Remove unused code 2021-05-11 10:39:44 +02:00
Glenn Willen
b47c279ee1 Fix compilation errors after rebase onto master 2021-04-29 15:00:54 -07:00
Andrew Chow
f979b3237f Add mainnet and testnet taproot activation params 2021-04-14 22:53:54 -04:00
fanquake
2cd834e6c0
Merge #21377: Speedy trial support for versionbits
ffe33dfbd4 chainparams: drop versionbits threshold to 90% for mainnnet and signet (Anthony Towns)
f054f6bcd2 versionbits: simplify state transitions (Anthony Towns)
55ac5f568a versionbits: Add explicit NEVER_ACTIVE deployments (Anthony Towns)
dd07e6da48 fuzz: test versionbits delayed activation (Anthony Towns)
dd85d5411c tests: test versionbits delayed activation (Anthony Towns)
73d4a70639 versionbits: Add support for delayed activation (Anthony Towns)
9e6b65f6fa tests: clean up versionbits test (Anthony Towns)
5932744450 tests: test ComputeBlockVersion for all deployments (Anthony Towns)
63879f0a47 tests: pull ComputeBlockVersion test into its own function (Anthony Towns)

Pull request description:

  BIP9-based implementation of "speedy trial" activation specification, see https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html

  Edge cases are tested by fuzzing added in #21380.

ACKs for top commit:
  instagibbs:
    tACK https://github.com/bitcoin/bitcoin/pull/21377/commits/ffe33dfbd4c3b11e3475b022b6c1dd077613de79
  jnewbery:
    utACK ffe33dfbd4
  MarcoFalke:
    review ACK ffe33dfbd4 💈
  achow101:
    re-ACK ffe33dfbd4
  gmaxwell:
    ACK ffe33dfbd4
  benthecarman:
    ACK ffe33dfbd4
  Sjors:
    ACK ffe33dfbd4
  jonatack:
    Initial approach ACK ffe33dfbd4 after a first pass of review, building and testing each commit, mostly looking at the changes and diffs. Will do a more high-level review iteration. A few minor comments follow to pick/choose/ignore.
  ariard:
    Code Review ACK ffe33df

Tree-SHA512: f79a7146b2450057ee92155cbbbcec12cd64334236d9239c6bd7d31b32eec145a9781c320f178da7b44ababdb8808b84d9d22a40e0851e229ba6d224e3be747c
2021-04-15 10:04:14 +08:00
Anthony Towns
ffe33dfbd4 chainparams: drop versionbits threshold to 90% for mainnnet and signet 2021-04-12 12:59:04 +10:00
Anthony Towns
55ac5f568a versionbits: Add explicit NEVER_ACTIVE deployments
Previously we used deployments that would timeout prior to Bitcoin's
invention, which allowed the deployment to still be activated in unit
tests. This switches those deployments to be truly never active.
2021-04-12 11:14:49 +10:00
Anthony Towns
73d4a70639 versionbits: Add support for delayed activation 2021-04-12 11:14:49 +10:00
MarcoFalke
fa732bccb3
test: Use compressed keys in TestChain100Setup
coinbaseKey.MakeNewKey(true); creates a compressed key and there is no reason
for the deterministic setup to use uncompressed ones.
2021-04-08 08:58:44 +02:00
Glenn Willen
6d19c44bd0 Add liquidv1test chainparams. 2021-04-07 15:59:22 -07:00
Glenn Willen
188283eecb Change stray uses of global gArgs to args in CCustomParams 2021-04-07 15:55:44 -07:00
W. J. van der Laan
9be7fe4849
Merge #21560: net: Add Tor v3 hardcoded seeds
b2ee8b207d net: Deserialize hardcoded seeds from BIP155 blob (W. J. van der Laan)
9b29d5df7f contrib: Add explicit port numbers for testnet seeds (W. J. van der Laan)
2a257de113 contrib: Add a few TorV3 seed nodes (W. J. van der Laan)
06030f7a42 contrib: generate-seeds.py generates output in BIP155 format (W. J. van der Laan)

Pull request description:

  Closes #20239 and mitigates my node's problem in #21351.

  - Add a few hardcoded seeds for TorV3
    - As the [bitcoin-seeder](https://github.com/sipa/bitcoin-seeder) doesn't collect TorV3 addresses yet, I have extracted these from my own node using [a script](https://gist.github.com/laanwj/b3d7b01ef61ce07c2eff0a72a6b90183) and added them manually. This is intended to be a temporary stop gap until 22.0's seeds update.

  - Change hardcoded seeds to variable length BIP155 binary format.
    - It is stored as a single serialized blob in a byte array, instead of pseudo-IPv6 address slots. This is more flexible and, assuming most of the list is IPv4, more compact.
    - Only the (networkID, addr, port) subset (CService). Services and time are construed on the fly as before.

  - Change input format for `nodes_*.txt`.
    - Drop legacy `0xAABBCCDD` format for IPv4. It is never generated by `makeseeds.py`.
    - Stop interpreting lack of port as default port, interpret it as 'no port', to accomodate I2P and other port-less protocols (not handled in this PR). An explicit port is always generated by `makeseeds.py` so in practice this makes no difference right now.

  A follow-up to this PR could do the same for I2P.

ACKs for top commit:
  jonatack:
    ACK b2ee8b207d

Tree-SHA512: 11a6b54f9fb0192560f2bd7b218f798f86c1abe01d1bf37f734cb88b91848124beb2de801ca4e6f856e9946aea5dc3ee16b0dbb9863799e42eec1b239d40d59d
2021-04-06 10:47:51 +02:00
W. J. van der Laan
b2ee8b207d net: Deserialize hardcoded seeds from BIP155 blob
Switch from IPv6 slot-based format to more compact and flexible BIP155
format.
2021-04-05 14:00:48 +02:00
glozow
8fa74aeb5b [doc] correct comment in chainparams
There are more than 3 networks.
2021-04-01 08:35:34 -07:00
Andrew Poelstra
1670bdfa0b ci: fix benchmarks, fuzztests and unit tests
Includes a memory leak in the checkqueue unit test (but not in
the actual code). WE really need to switch our checkqueue to use
std::unique_pointer rather than bare pointers. But this would be
invasive enough that I want to do it in a followup PR.

Also pretty-much disable the validation_flush_cache unit test.
This is a stupid and irritating test which tries to unit-test
exact memory usage of std containers. It already has at least
one "remove wrong assumptions" update upstream and after many
tries I was unable to change all the magic numbers in a way
that'd consistently pass CI for Elements.

Also adds a couple ubsan suppressions about perfectly-legitimate
conversions of integer types.
2021-03-26 17:33:05 +00:00
Andrew Poelstra
59076ca8f3 Merge 0c82c2743b into merged_master (Elements PR #970) 2021-03-26 00:27:13 +00:00
Andrew Poelstra
d89112072c Merge 3b8e4070c8 into merged_master (Elements PR #958)
Conflicts due to change of error state formatting upstream.
2021-03-26 00:21:11 +00:00
Steven Roose
70390ee638
Specify the dynafed epoch length for liquidv1 2021-03-11 17:34:37 +00:00
Jonas Schnelli
9017d55e7c
Merge #15946: Allow maintaining the blockfilterindex when using prune
84716b134e Add "index/blockfilterindex -> validation -> index/blockfilterindex" to expected circular dependencies (Jonas Schnelli)
ab3a0a2fb9 Add functional test for blockfilterindex in prune-mode (Jonas Schnelli)
c286a22f7b Add debug startup parameter -fastprune for more effective pruning tests (Jonas Schnelli)
5e112269c3 Avoid pruning below the blockfilterindex sync height (Jonas Schnelli)
00d57ff768 Avoid accessing nullpointer in BaseIndex::GetSummary() (Jonas Schnelli)
6abe9f5b11 Allow blockfilter in conjunction with prune (Jonas Schnelli)

Pull request description:

  Maintaining the blockfilterindexes in prune mode is possible and may lead to efficient p2p based rescans of wallets (restore backups, import/sweep keys) beyond the prune height (rescans not part of that PR).

  This PR allows running the blockfilterindex(es) in conjunction with pruning.
  * Bitcoind/Qt will shutdown during startup when missing block data has been detected ([re]enable `-blockfilterindex` when we already have pruned)
  * manual block pruning is disabled during blockfilterindex sync
  * auto-pruning is delayed during blockfilterindex sync

  ToDos:
  * [x] Functional tests

ACKs for top commit:
  fjahr:
    Code review ACK 84716b1
  ryanofsky:
    Code review ACK 84716b134e. Only changes since last review were suggested new FindFilesToPrune argument and test.
  benthecarman:
    tACK 84716b134e

Tree-SHA512: 91d832c6c562c463f7ec7655c08956385413a99a896640b9737bda0183607fac530435d03d87c3c0e70c61ccdfe73fe8f3639bc7d26d33ca7e60925ebb97d77a
2021-02-18 09:40:42 +01:00
MarcoFalke
cd66d8b1d8
Merge #20429: refactor: replace (sizeof(a)/sizeof(a[0])) with C++17 std::size
e829c9afbf refactor: replace sizeof(a)/sizeof(a[0]) by std::size (C++17) (Sebastian Falbesoner)
365539c846 refactor: init vectors via std::{begin,end} to avoid pointer arithmetic (Sebastian Falbesoner)
63d4ee1968 refactor: iterate arrays via C++11 range-based for loops if idx is not needed (Sebastian Falbesoner)

Pull request description:

  This refactoring PR picks up the idea of #19626 and replaces all occurences of `sizeof(x)/sizeof(x[0])` (or `sizeof(x)/sizeof(*x)`, respectively) with the now-available C++17 [`std::size`](https://en.cppreference.com/w/cpp/iterator/size)  (as [suggested by sipa](https://github.com/bitcoin/bitcoin/pull/19626#issuecomment-666487228)), making the macro `ARRAYLEN` obsolete.

  As preparation for this, two other changes are done to eliminate `sizeof(x)/sizeof(x[0])` usage:
  * all places where arrays are iterated via an index are changed to use C++11 range-based for loops If the index' only purpose is to access the array element (as [suggested by MarcoFalke](https://github.com/bitcoin/bitcoin/pull/19626#discussion_r463404541)).
  * `std::vector` initializations are done via `std::begin` and `std::end` rather than using pointer arithmetic to calculate the end (also [suggested by MarcoFalke](https://github.com/bitcoin/bitcoin/pull/20429#discussion_r567418821)).

ACKs for top commit:
  practicalswift:
    cr ACK e829c9afbf: patch looks correct
  fanquake:
    ACK e829c9afbf
  MarcoFalke:
    review ACK e829c9afbf 🌩

Tree-SHA512: b01d32c04b9e04d562b7717cae00a651ec9a718645047a90761be6959e0cc2adbd67494e058fe894641076711bb09c3b47a047d0275c736f0b2218e1ce0d193d
2021-02-18 07:53:37 +01:00
Jonas Schnelli
c286a22f7b Add debug startup parameter -fastprune for more effective pruning tests 2021-02-16 10:26:17 +01:00