Commit Graph

17048 Commits

Author SHA1 Message Date
Alex Morcos 45355e85d0 Rewrite CreateNewBlock
Use the score index on the mempool to only add sorted txs in order.  Remove much of the validation while building the block, relying on mempool to be consistent and only contain txs that can be mined.
The mempool is assumed to be consistent as far as not containing txs which spend non-existent outputs or double spends, and scripts are valid.  Finality of txs is still checked (except not coinbase maturity, assumed in mempool).
Still TestBlockValidity in case mempool consistency breaks and return error state if an invalid block was created.
Unit tests are modified to realize that invalid blocks can now be constructed if the mempool breaks its consistency assumptions and also updated to have the right fees, since the cached value is now used for block construction.

Conflicts:
	src/miner.cpp

(cherry picked from commit bitcoin/bitcoin@553cad94e2)

Zcash: Merged in our changes.
2022-12-20 11:41:04 +00:00
Alex Morcos f18c96d7ae Expose FormatStateMessage
(cherry picked from commit bitcoin/bitcoin@5f12263302)
2022-12-20 08:57:33 +00:00
Alex Morcos 0d9a5442eb Make accessing mempool parents and children public
(cherry picked from commit bitcoin/bitcoin@1f09287c66)
2022-12-20 08:57:33 +00:00
Mark Friedenbach 38e319a88f Prevent block.nTime from decreasing
Under some circumstances it is possible for there to be a significant,
discontinuous jump in a node's clock value. On mining nodes, this can
result in block templates which are no longer valid due to time-based
nLockTime constraints. UpdateTime() is modified so that it will never
decrease a block's nLockTime, thereby preventing such invalidations.

(cherry picked from commit bitcoin/bitcoin@ef8dfe41d1)

Zcash: Updated CreateNewBlock_validity test and wallet_1941 RPC test to
ensure we satisfy the future timestamp soft fork rule.
2022-12-20 08:56:15 +00:00
Jack Grigg 1018ebd002 test: Handle mining slow start inside `CreateNewBlock_validity`
This partially reverts zcash/zcash@4f4a8c3c88
and correctly handles the mining slow start without repeatedly calling
CreateNewBlock.
2022-12-20 08:06:39 +00:00
Suhas Daftuar ca514c655c Fix mempool package tracking edge case
CalculateMemPoolAncestors was always looping over a transaction's inputs
to find in-mempool parents.  When adding a new transaction, this is the
correct behavior, but when removing a transaction, we want to use the
ancestor set that would be calculated by walking mapLinks (which should
in general be the same set, except during a reorg when the mempool is
in an inconsistent state, and the mapLinks-based calculation would be the
correct one).

(cherry picked from commit bitcoin/bitcoin@60de0d5826)
2022-12-19 05:38:49 +00:00
Suhas Daftuar ef14b8ba60 Add test showing bug in mempool packages
(cherry picked from commit bitcoin/bitcoin@598b25d5ee)
2022-12-19 05:38:49 +00:00
Suhas Daftuar b63c58500a Track transaction packages in CTxMemPoolEntry
Associate with each CTxMemPoolEntry all the size/fees of descendant
mempool transactions.  Sort mempool by max(feerate of entry, feerate
of descendants).  Update statistics on-the-fly as transactions enter
or leave the mempool.

Also add ancestor and descendant limiting, so that transactions can
be rejected if the number or size of unconfirmed ancestors exceeds
a target, or if adding a transaction would cause some other mempool
entry to have too many (or too large) a set of unconfirmed in-
mempool descendants.

(cherry picked from commit bitcoin/bitcoin@5add7a74a6)

Zcash:
- Mempool methods were adapted to our mempool changes.
- Default ancestor and descendant size limits were double to account for
  our larger block size.
- The mempool_packages RPC test fee was adapted to account for our
  emissions curve (which results in a smaller per-block reward that
  needs to be split into smaller shards for sequential transactions.
- Includes some modifications to account for us backporting
  bitcoin/bitcoin@f3fe83673e early in
  zcash/zcash#5269.
2022-12-19 05:38:43 +00:00
Greg Pfeil 3a7433b844
Merge pull request #6303 from sellout/missing-newline
Fix a missing newline in the RPC docs
2022-12-12 19:12:48 -07:00
Greg Pfeil 1f401b39cc Fix a missing newline in the RPC docs 2022-12-12 15:01:21 -10:00
Kris Nuttycombe 4bc92bf7cb
Merge pull request #6242 from sellout/transaction-strategy
Add operations to TransactionStrategy
2022-12-12 09:22:25 -07:00
Kris Nuttycombe 80a1366a05
Merge pull request #6265 from sellout/any_taddr-sans-coinbase
Don’t select transparent coinbase with ANY_TADDR
2022-12-12 09:18:32 -07:00
Kris Nuttycombe 121f84c122
Merge pull request #6300 from daira/tl-expected-followup
tl::expected follow-up to address @str4d's comments
2022-12-12 08:17:55 -07:00
Daira Hopwood 619456a4f4 tl::expected follow-up to address @str4d's comments.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-12-09 01:36:45 +00:00
Daira Hopwood 11d5639049
Merge pull request #6138 from daira/tl-expected
Add tl::expected and some examples of its use
2022-12-08 22:19:57 +00:00
Daira Hopwood d502714326 Refactor HaveShieldedRequirements to use tl::expected (example with a void T)
and rename it to CheckShieldedRequirements.

Signed-off-by: Daira Hopwood <jacaranda.org>
2022-12-08 20:53:54 +00:00
Daira Hopwood 4de0d85abf The std::expected proposal has unnecessary instances of undefined behaviour
for operator->, operator*, and error(). Make these into assertion failures
(this still conforms to the proposal).

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-12-08 20:53:54 +00:00
Daira Hopwood 7472b0dbca Add tl::expected. refs #4816
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-12-08 20:53:54 +00:00
Kris Nuttycombe 8b16094f66
Merge pull request #6284 from janisozaur/patch-1
Update debian/compat to version 13
2022-12-08 13:08:22 -07:00
Kris Nuttycombe 26df6834ca
Merge pull request #6243 from sellout/extract-memo
Factor out memo parsing from asyncrpcoperation_sendmany
2022-12-08 13:07:33 -07:00
Greg Pfeil 54ecf53619
Update src/wallet/asyncrpcoperation_sendmany.cpp
Co-authored-by: Kris Nuttycombe <kris.nuttycombe@gmail.com>
2022-12-07 15:22:11 -07:00
Greg Pfeil 69d7f5b5fd
Merge pull request #6298 from sellout/docker-entrypoint
Fix a minor bug in docker/entrypoint.sh
2022-12-07 15:14:05 -07:00
Greg Pfeil 747a6b6acc Add release notes 2022-12-07 12:31:07 -07:00
Greg Pfeil cf720fcf0f Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-12-07 12:31:07 -07:00
Greg Pfeil 7e6c53323a Improve PrivacyPolicy comments
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-12-07 11:09:27 -07:00
Greg Pfeil 6a7b67c06d Fix a minor bug in docker/entrypoint.sh
Fixes #6297.
2022-12-06 17:18:18 -07:00
Greg Pfeil 4cff6f80c6 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-12-06 15:23:55 -07:00
Kris Nuttycombe 9c600a5582 Factor out memo parsing from asyncrpcoperation_sendmany 2022-12-06 15:23:55 -07:00
Greg Pfeil 196af70eaa
Merge pull request #6294 from sellout/appease-shellcheck
Appease ShellCheck
2022-12-06 15:08:43 -07:00
Greg Pfeil 7cb61508b1 Defer fixing docker/entrypoint.sh lint failure 2022-12-06 13:46:00 -07:00
Greg Pfeil 4946316537 Appease ShellCheck
ShellCheck has started failing in CI. My guess is that the ubuntu-latest runner
now uses a `/bin/sh` that is actually Bash.

- excludes checksec.sh, as it’s not our code
- fixes lints in other files
2022-12-06 10:46:43 -07:00
Daira Hopwood e870334d04
Merge pull request #6267 from rex4539/typos
Fix typos
2022-12-06 17:39:20 +00:00
str4d 826e0dccb1
Merge pull request #6273 from sellout/utfcpp-include
Put utf8.h in the correct place
2022-12-06 00:08:03 +00:00
str4d 22c4653d6e
Merge pull request #6285 from daira/merge-5.3.2
Merge hotfix-v5.3.2 back to master
2022-12-05 23:55:04 +00:00
Daira Hopwood 346131a6d1 Merge branch 'hotfix-v5.3.2' of github.com:zcash/zcash 2022-12-05 22:33:17 +00:00
Daira Hopwood 184cb6d580
Merge pull request #6281 from daira/release-v5.3.2
Release v5.3.2
2022-12-05 19:02:40 +00:00
Michał Janiszewski e80cd4dd19
Update debian/compat to version 13
Compat version 13 is currently the recommended one.

An important change introduced in 10 was change of default to target parallel builds

5d1bb29841/debhelper.pod (compatibility-levels)
2022-12-04 23:54:07 +01:00
Daira Hopwood ed0089d876 make-release.py: Updated release notes and changelog for 5.3.2. 2022-12-03 19:58:44 +00:00
Daira Hopwood dd47391112 make-release.py: Updated manpages for 5.3.2. 2022-12-03 19:58:44 +00:00
Daira Hopwood f7697dbdf3 make-release.py: Versioning changes for 5.3.2. 2022-12-03 19:49:32 +00:00
Daira Hopwood 72cef60175 Postpone updates.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-12-03 19:47:30 +00:00
Greg Pfeil e1b5bd26ea
Merge pull request #6276 from zcash/revert-6231-headers-first-rebirth
Revert "Headers-first fix" to avoid a memory usage regression on IBD
2022-12-03 12:30:44 -07:00
Daira Hopwood 35700b9d65 Add release notes for the IBD memory spike issue.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-12-03 17:52:12 +00:00
Daira Hopwood 08f86a4db8 Revert "Headers-first fix" 2022-12-03 17:52:12 +00:00
Greg Pfeil 5f0681a601 Update failing tests after fixing ANY_TADDR behavior 2022-12-02 22:30:45 -07:00
Greg Pfeil 7abdade2cc Don’t select transparent coinbase with ANY_TADDR
This also includes the “Insufficient funds” suffixes on dust threshold
failures.

Fixes #6262
2022-12-02 22:30:45 -07:00
Greg Pfeil 4e76a216d6 Put utf8.h in the correct place
Both CMake and Nix want it to be here, so I obliged.
2022-12-02 22:10:26 -07:00
str4d 4a4ae4d3e2
Merge pull request #6274 from zcash/version-5.3.1
Merge 5.3.1 release branch back into `master`
2022-12-03 03:15:41 +00:00
Kris Nuttycombe bcb9753f43
Merge pull request #6272 from zcash/release-v5.3.1
Release v5.3.1
2022-12-02 09:31:13 -07:00
Daira Hopwood 0972ffd785 make-release.py: Updated release notes and changelog for 5.3.1. 2022-12-02 02:46:42 +00:00