Commit Graph

68 Commits

Author SHA1 Message Date
Kris Nuttycombe cc2fd60617 Make all CCoinsView methods pure-virtual. 2023-02-15 13:58:46 -07:00
Kris Nuttycombe 3cec519ce4 scripted-diff: Update Zcash copyrights to 2023
-BEGIN VERIFY SCRIPT-
for party in "The Zcash developers" "The Bitcoin Core developers" "Bitcoin Developers"; do
  sed -i"" -e "s#Copyright (c) \([0-9]\{4\}\)\(-[0-9]\{4\}\)\? $party#Copyright (c) \1-2023 $party#" COPYING
  sed -i"" -e "s#\(.*\)\([0-9]\{4\}\)\(-[0-9]\{4\}\)\, $party#\1\2-2023, $party#" contrib/debian/copyright
done

sed -i"" -e "s/define(_COPYRIGHT_YEAR, [0-9]\{4\})/define(_COPYRIGHT_YEAR, 2023)/" configure.ac
sed -i"" -e "s/#define COPYRIGHT_YEAR [0-9]\{4\}/#define COPYRIGHT_YEAR 2023/" src/clientversion.h

git grep "^// Copyright (c) .* The Zcash developers" \
  | awk -F ':' '{print $1}' \
  | xargs -I {} sed -i"" -e "s#// Copyright (c) \([0-9]\{4\}\)\(-[0-9]\{4\}\)\? The Zcash developers#// Copyright (c) \1-2023 The Zcash developers#" {}
-END VERIFY SCRIPT-
2023-01-23 11:31:54 -07:00
Daira Hopwood fb66589022 Declare `CBlockTreeDB::Read*` methods as `const` when they are trivially so.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-11-21 18:24:45 +00:00
Daira Hopwood aee8d5c0ec Avoid storing the Equihash solution in a CBlockIndex object once it has been written
to the leveldb database.

Co-authored-by: Jack Grigg <thestr4d@gmail.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-11-21 18:24:45 +00:00
Kris Nuttycombe 28040f9ce4 scripted-diff: Add 2016-2022 copyright headers for files added/modified in 2016
-BEGIN VERIFY SCRIPT-
grep -l "Copyright" $(grep -L "The Zcash developers" $(git diff --name-only --diff-filter=ACM bitcoin-v0.11.2..94f427a211bb337200c29a1e19be0f5ad2f171b0 -- src/ test/ zcutil/ qa/)) | xargs -I {} sed -i"" -e "s#\(\(.*\)Copyright (c) .* The Bitcoin Core developers\)#\1\n\2Copyright (c) 2016-2022 The Zcash developers#" {}
-END VERIFY SCRIPT-
2022-05-11 17:23:09 -06:00
Kris Nuttycombe f49f4c73d8 Rename OrchardMerkleTree -> OrchardMerkleFrontier
Remove IncrementalSinsemillaTree; this will be replaced by
a more full-featured OrchardWallet type which embeds the
incremental merkle tree used in wallet operations.
2021-11-23 07:27:34 -07:00
Kris Nuttycombe 437b8c488a Orchard changes to coins & consensus. 2021-06-23 16:06:30 -06:00
Jack Grigg cf480fe402 Add ZIP 221 logic to block index
CBlockHeader.hashFinalSaplingRoot has been renamed to hashLightClient.

CBlockIndex now stores:
- hashLightClient as from the block header
- hashFinalSaplingRoot, which is accurate for all blocks prior to
  Heartwood activation, and all blocks from Heartwood activation onward
  that are connected at some point to the main chain in ConnectBlock().
- hashChainHistoryRoot, which is null prior to Heartwood activation, and
  set per ZIP 221 from Heartwood activation.

The new block index fields are only written to disk for client version
2.1.2 and above, which will be the first Heartwood-aware clients (even
if Heartwood doesn't have an activation height).
2020-04-08 08:49:01 +12:00
NikVolf cf247bc655 push/pop history with tests
Co-authored-by: Jack Grigg <jack@z.cash>
2020-04-08 08:49:01 +12:00
MeshCollider d7c62cdd4f Consistent parameter names in txdb.h 2020-03-07 10:21:59 +03:00
practicalswift b841318ce8
Replace boost::function with std::function (C++11) 2020-02-04 19:54:25 -07:00
Larry Ruane 2e505df351 add timestampindex related RPC getblockhashes 2019-08-08 14:35:07 -06:00
Daira Hopwood bc909a7a7f Replace http with https: in links to the MIT license.
Also change MIT/X11 to just MIT, since no distinction was intended.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2019-07-18 15:26:01 +01:00
Wladimir J. van der Laan 3647f0a7b1
Break circular dependency main ↔ txdb
Break the circular dependency between main and txdb by:

- Moving `CBlockFileInfo` from `main.h` to `chain.h`. I think this makes
  sense, as the other block-file stuff is there too.

- Moving `CDiskTxPos` from `main.h` to `txdb.h`. This type seems
  specific to txdb.

- Pass a functor `insertBlockIndex` to `LoadBlockIndexGuts`. This leaves
  it up to the caller how to insert block indices.

Zcash: This does not actually break the circular dependency for us yet, as we
still need to pull in bitcoin/bitcoin#7756 and bitcoin/bitcoin#7904.
2019-05-23 17:48:24 +01:00
Larry Ruane 7fb8088288 add -timestampindex for bitcore insight block explorer 2019-04-26 08:44:56 -06:00
Larry Ruane 3d018ab556 add -spentindex changes for bitcore insight block explorer 2019-04-23 11:06:23 -06:00
Larry Ruane 6cf0e50b56 add -addressindex changes for bitcore insight block explorer 2019-03-28 12:03:48 -06:00
Eirik Ogilvie-Wigley 4fc309f0f5 Rename Merkle Trees to include sprout or sapling 2018-08-01 10:31:09 -06:00
Sean Bowe 27616b9a04 Add support for Sapling anchors in coins/txdb. 2018-05-07 14:37:46 -06:00
Sean Bowe 18322f074c Introduce support for GetBestAnchor(SAPLING). 2018-05-07 13:46:06 -06:00
Sean Bowe 008f4ee8e7 Rename GetAnchorAt to GetSproutAnchorAt. 2018-05-07 13:46:06 -06:00
Sean Bowe 08f0728884 Rename hashAnchor to hashSproutAnchor. 2018-05-07 13:46:06 -06:00
Sean Bowe d455828fdc Specifically describe anchors as Sprout anchors. 2018-05-07 13:46:06 -06:00
Sean Bowe 28d20bdb11 Rename NullifierType to ShieldedType. 2018-05-07 13:46:06 -06:00
Eirik Ogilvie-Wigley 9669920f75 Rename nullifier caches and maps to indicate sprout nullifiers 2018-04-25 11:26:38 -06:00
Eirik Ogilvie-Wigley 708c87f16d Add enum for nullifier type 2018-04-24 09:57:14 -06:00
Eirik Ogilvie-Wigley 685e936c31 Add sapling nullifier set 2018-04-24 09:57:14 -06:00
Jeff Garzik e3da7a572d
leveldbwrapper file rename to dbwrapper.* 2018-04-03 20:40:54 +01:00
Jeff Garzik f345c41ec4
leveldbwrapper symbol rename: Remove "Level" from class, etc. names 2018-04-03 20:40:54 +01:00
Jack Grigg f5007d8912
When rewinding, remove insufficiently-validated blocks
If a block is insufficiently-validated against a particular branch ID, then we
cannot guarantee that even the block header will be valid under the actual
consensus rules the node will want to apply. Instead require that the blocks are
completely re-validated, by removing them from the block index (which is
equivalent to reducing their validity to BLOCK_VALID_UNKNOWN).
2018-04-03 10:58:31 +01:00
Simon 5befbed4bc Fixes #2793. Backport commit f33afd3 to increase dbcache default. 2018-01-15 23:17:34 -08:00
Jack Grigg c66c731adf
Add a benchmark for calling ConnectBlock on a block with many inputs
Requires placing block-107134.tar.gz (containing the block, and a fake CoinsDB
containing its inputs) into the base directory of the repository. This can be
generated using qa/zcash/create_benchmark_archive.py (see the script for usage
details).

To facilitate generation of the fake CoinsDB, an additional field 'valueZat' has
been added to 'getrawtransaction' containing the integer number of zatoshis
instead of a decimal number of ZEC.

Closes #2355.
2017-05-18 11:03:46 +12:00
Sean Bowe b78daf7de7 Change `serial` to `nf` in txdb. 2016-07-18 10:07:30 -06:00
Sean Bowe bb64be52fe Rename mapSerials to mapNullifiers. 2016-07-18 10:06:18 -06:00
Sean Bowe d889a287ae Rename CSerialsMap to CNullifiersMap. 2016-07-18 10:06:18 -06:00
Sean Bowe 616f8d05af Rename GetSerial to GetNullifier. 2016-07-18 10:06:18 -06:00
Sean Bowe 1760b3cd88 Deprecate the old tree and remove old tree tests from the test suite. 2016-04-28 16:07:52 -06:00
Sean Bowe 434f328446 Integrate new incremental merkle tree implementation into consensus. 2016-04-28 16:07:52 -06:00
Sean Bowe a897db652f Reorganizing the zerocash tree. 2016-02-15 15:28:20 -07:00
Sean Bowe 45d6bee945 Add mapSerials infrastructure to CCoinsView.
This adds the TXDB/CCoinsViewCache primitives necessary for
writing consensus rules for mapSerials later.
2016-01-19 14:36:04 -07:00
Sean Bowe 9f25631d50 Add mapAnchors infrastructure to CCoinsView.
This adds the TXDB/CCoinsViewCache primitives necessary for
writing consensus rules for mapAnchors later.
2016-01-19 14:36:04 -07:00
Pieter Wuille b3ed4236be Cache tweak and logging improvements 2015-05-11 17:58:14 -07:00
Michael Ford 63e4c9cd35 Fix clang compile warnings intriduced in #5681 2015-03-29 19:45:05 +08:00
Jorge Timón 8a893c949b Includes: Do not include main.h from any other header 2015-03-24 17:23:32 +01:00
sandakersmann f914f1a746
Added "Core" to copyright headers
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Pieter Wuille 63d1ae5556 Do all block index writes in a batch 2014-11-25 16:26:35 +01:00
Michael Ford fa94b9d562
Convert remaining comments in /src to doxygen format
- Update comments in checkpoints to be doxygen compatible
- Update comments in checkqueue to be doxygen compatible
- Update coins to be doxygen compatible
- Fix comment typo in crypter.h
- Update licenses/copyright dates

Closes #5325 #5184 #5183 #5182
2014-11-21 14:44:21 +01:00
Pavel Janík 84738627ce Fix all header defines 2014-11-03 16:16:40 +01:00
Pieter Wuille c9d1a81ce7 Get rid of CCoinsView's SetCoins and SetBestBlock.
All direct modifications are now done through ModifyCoins, and BatchWrite is
used for pushing batches of queued modifications up, so we don't need the
low-level SetCoins and SetBestBlock anymore in the top-level CCoinsView class.
2014-09-23 22:29:21 +02:00
Daniel Kraft a3dc587a62 Make appropriate getter-routines "const" in CCoinsView.
Mark the "Get"/"Have" routines in CCoinsView and subclasses as "const".
2014-08-26 11:29:18 +02:00