Commit Graph

4570 Commits

Author SHA1 Message Date
Dave Collins
e54dde10e9
docs: Update for mempool v3 module. 2019-08-12 19:54:31 -05:00
Dave Collins
f1ed8d61ad
release: Introduce mempool v3 module. 2019-08-12 19:54:03 -05:00
Dave Collins
4106f792c2
mempool: Use latest major version deps.
This udpates the mempool module to use the latest module major versions
as well as the new blockchain/standard module.

The updated direct dependencies are as follows:

- github.com/decred/dcrd/blockchain/stake/v2@v2.0.1
- github.com/decred/dcrd/blockchain/standalone@v1.0.0
- github.com/decred/dcrd/blockchain/v2@v2.0.2
- github.com/decred/dcrd/chaincfg/v2@v2.2.0
- github.com/decred/dcrd/dcrutil/v2@v2.0.0
- github.com/decred/dcrd/mining/v2@v2.0.0
- github.com/decred/dcrd/txscript/v2@v2.0.0
2019-08-12 18:10:47 -05:00
Dave Collins
fe8ed953bc
release: Freeze version 2 mempool module use.
This freezes the root module usage of v2 of the mempool module by
removing the replacement and bumping the required version.  This means
building the software will still produce binaries based on the v2 module
until the v3 module is fully released.

All future releases will be moving to version 3 of the module.

Consequently, it bumps the required module versions as follows:

- github.com/decred/dcrd/mempool/v2 v2.1.0
2019-08-12 18:00:40 -05:00
Dave Collins
83c5751cee
blockchain: Prepare v2.0.1.
This removes the examples that rely on removed code in the blockchain/v2
module and serves as a base for blockchain/v2.0.1.
2019-08-12 17:54:42 -05:00
Dave Collins
e523e05b9b
docs: Update for peer v2 module. 2019-08-12 15:52:52 -05:00
Dave Collins
b726184eaf
release: Introduce peer v2 module. 2019-08-12 15:52:51 -05:00
Dave Collins
e22877abb7
peer: Use latest major version deps.
This udpates the peer module to use the latest module major versions.

The updated direct dependencies are as follows:

- github.com/decred/dcrd/txscript/v2@v2.0.0
2019-08-12 15:52:45 -05:00
Dave Collins
7ff364662e
peer: Accept hash slice for block locators.
This modifies the PushGetBlocksMsg and PushGetHeadersMsg functions to
accept a string of block loactors hashes instead of a concrete
blockchain.BlockLocator to remove the tight couping between the two
packages at the API boundary and allow callers to easily provide custom
values if desired.

It also removes the dependency on the blockchain module since it is no
longer required.
2019-08-12 15:39:49 -05:00
Dave Collins
46fa63adbd
peer: Remove deprecated Config.ChainParams field.
This removes the deprecated ChainParams field from the Config struct and
updates the tests accordingly.

It also removes the dependency on the chaincfg module since it is no
longer required.
2019-08-12 15:38:34 -05:00
Dave Collins
d81eb119a4
release: Freeze version 1 peer module use.
This freezes the root module usage of the peer module by removing the
replacement and bumping the required version.  This means building the
software will still produce binaries based on the v1 module until the v2
module is fully released.

All future releases will be moving to version 2 of the module.

Consequently, it bumps the required module versions as follows:

- github.com/decred/dcrd/peer@v1.2.0
2019-08-12 15:38:33 -05:00
Dave Collins
9f926baa61
docs: Update for connmgr v2 module. 2019-08-12 15:36:53 -05:00
Dave Collins
3c8184a8f1
release: Introduce connmgr v2 module. 2019-08-12 15:36:52 -05:00
Dave Collins
900bbf14ef
connmgr: Accept DNS seeds as string slice.
This modifies the SeedFromDNS function to accept a string of the DNS
seeds as well as the default port instead of a concrete chaincfg.Params
to remove the tight coupling between the two packages at the API
boundary and allow callers to easily provide custom values if desired.
2019-08-12 15:36:52 -05:00
Dave Collins
8801d9fa3a
release: Freeze version 1 connmgr module use.
This freezes the root module usage of the connmgr module by removing the
replacement and bumping the required version.  This means building the
software will still produce binaries based on the v1 module until the v2
module is fully released.

All future releases will be moving to version 2 of the module.

Consequently, it bumps the required module versions as follows:

- github.com/decred/dcrd/connmgr@v1.1.0
2019-08-12 15:36:48 -05:00
Dave Collins
8e0e92d676
mempool: Prepare v2.1.0.
This updates the mempool` module dependencies and serves as a base for
mempool/v2.1.0.

The updated direct dependencies in this commit are as follows:

- github.com/decred/dcrd/blockchain@v1.2.0
- github.com/decred/dcrd/blockchain/stake@v1.2.1
- github.com/decred/dcrd/chaincfg@v1.5.2
- github.com/decred/dcrd/chaincfg/chainhash@v1.0.2
- github.com/decred/dcrd/dcrec/secp256k1@v1.0.2
- github.com/decred/dcrd/dcrutil@v1.4.0
- github.com/decred/dcrd/mining@v1.1.1
- github.com/decred/dcrd/txscript@v1.1.0

The full list of updated direct dependencies since the previous
mempool/v2.0.0 release are as follows:

- github.com/decred/dcrd/blockchain@v1.2.0
- github.com/decred/dcrd/blockchain/stake@v1.2.1
- github.com/decred/dcrd/chaincfg@v1.5.2
- github.com/decred/dcrd/chaincfg/chainhash@v1.0.2
- github.com/decred/dcrd/dcrec@v1.0.0
- github.com/decred/dcrd/dcrec/secp256k1@v1.0.2
- github.com/decred/dcrd/dcrutil@v1.4.0
- github.com/decred/dcrd/mining@v1.1.1
- github.com/decred/dcrd/txscript@v1.1.0
2019-08-12 15:16:24 -05:00
Dave Collins
ab6f316821
docs: Update for mining v2 module. 2019-08-12 15:06:41 -05:00
Dave Collins
e3521b54af
release: Introduce mining v2 module. 2019-08-12 15:06:37 -05:00
Dave Collins
7570989bea
mining: Use lastest major version deps.
This udpates the mining module to use the lastest module major versions.

The updated direct dependencies are as follows:

- github.com/decred/dcrd/blockchain/stake/v2@v2.0.1
- github.com/decred/dcrd/blockchain/v2@v2.0.0
- github.com/decred/dcrd/dcrutil/v2@v2.0.0
2019-08-12 15:06:32 -05:00
Dave Collins
a0c2441051
release: Freeze version 1 mining module use.
This freezes the root module usage of the mining module by removing the
replacement and bumping the required version.  This means building the
software will still produce binaries based on the v1 module until the v2
module is fully released.

All future releases will be moving to version 2 of the module.

Consequently, it bumps the required module versions as follows:

- github.com/decred/dcrd/blockchain@v1.2.0
- github.com/decred/dcrd/mining@v1.1.1
2019-08-12 15:06:15 -05:00
Dave Collins
8bbb8b6fff
peer: Prepare v1.2.0.
This updates the peer module dependencies and serves as a base for
peer/v1.2.0.

The updated direct dependencies in this commit are as follows:

- github.com/decred/dcrd/blockchain@v1.2.0
- github.com/decred/dcrd/chaincfg@v1.5.2
- github.com/decred/dcrd/chaincfg/chainhash@v1.0.2
- github.com/decred/dcrd/txscript@v1.1.0

The full list of updated direct dependencies since the previous
peer/v1.1.0 release are as follows:

- github.com/davecgh/go-spew@v1.1.1
- github.com/decred/dcrd/blockchain@v1.2.0
- github.com/decred/dcrd/chaincfg@v1.5.2
- github.com/decred/dcrd/chaincfg/chainhash@v1.0.2
- github.com/decred/dcrd/lru@v1.0.0
- github.com/decred/dcrd/txscript@v1.1.0
- github.com/decred/go-socks@v1.0.0
2019-08-09 16:07:47 -05:00
Dave Collins
7ea2a2c5d3
connmgr: Prepare v1.1.0.
This updates the mining module dependencies and serves as a base for
connmgr/v1.1.0.

The updated direct dependencies in this commit are as follows:

- github.com/decred/dcrd/chaincfg@v1.5.2

The full list of updated direct dependencies since the previous
connmgr/v1.0.2 release are as follows:

- github.com/decred/dcrd/chaincfg@v1.5.2
2019-08-09 15:01:19 -05:00
Dave Collins
5564a0aff8
docs: Update for blockchain v2 module. 2019-08-08 13:10:22 -05:00
Dave Collins
e99b8f3810
release: Introduce blockchain v2 module. 2019-08-08 13:10:22 -05:00
Dave Collins
b9afc5c997
blockchain: Accept subsidy cache in config.
This modifies the blockchain Config to allow the caller to optionally
specify the subsidy cache to use rather than creating it internally and
forcing callers to query for it later.
2019-08-08 13:10:21 -05:00
Dave Collins
469f985f86
blockchain: Remove deprecated code.
This removes the deprecated functions along with the additional code and
tests which are no longer necessary as a result of removing the
functions.

The following is a list of exported types and functions removed along
with what they were replaced by when applicable:

- DisableLog -> UseLogger(slog.Disabled)
- BlockOneCoinbasePaysTokens -> no alternative, internal only
- IsCoinBase -> standalone.IsCoinBaseTx
- IsCoinBaseTx -> standalone.IsCoinBaseTx
- BuildMerkleTreeStore -> standalone.CalcTxTreeMerkleRoot
- BuildMsgTxMerkleTreeStore -> standalone.CalcTxTreeMerkleRoot
- SubsidyCache -> standalone.SubsidyCache
- NewSubsidyCache -> standalone.NewSubsidyCache
- CalcBlockWorkSubsidy -> standalone.SubsidyCache.CalcWorkSubsidy
- CalcStakeVoteSubsidy -> standalone.SubsidyCache.CalcStakeVoteSubsidy
- CalcBlockTaxSubsidy -> standalone.SubsidyCache.CalcTreasurySubsidy
- CoinbasePaysTax -> no alternative, internal only
- CalculateAddedSubsidy -> no alternative, internal only
- BestPrevHash -> BestSnapshot.PrevHash
- TotalSubsidy -> BestSnapshot.TotalSubsidy
- FetchSubsidyCache -> standalone.NewSubsidyCache passed to chain
- HashToBig -> standalone.HashToBig
- CompactToBig -> standalone.CompactToBig
- BigToCompact -> standalone.BigToCompact
- CalcWork -> standalone.CalcWork
- CheckProofOfWork -> standalone.CheckProofOfWork
2019-08-08 13:10:21 -05:00
Dave Collins
2dac209198
blockchain: Use lastest major version deps.
This udpates the blockchain module to use the lastest module major
versions.

While here, it also corrects a few typos and updates some test function
names to more accurately reflect their purpose.

The updated direct dependencies are as follows:

- github.com/decred/dcrd/blockchain/stake/v2@v2.0.1
- github.com/decred/dcrd/chaincfg/v2@v2.2.0
- github.com/decred/dcrd/database/v2@v2.0.0
- github.com/decred/dcrd/dcrutil/v2@v2.0.0
- github.com/decred/dcrd/txscript/v2@v2.0.0
2019-08-08 13:10:20 -05:00
Dave Collins
b943f1fd88
blockchain: Update doc.go to reflect reality. 2019-08-08 13:10:19 -05:00
Dave Collins
9b2309fa8e
release: Freeze version 1 blockchain module use.
This freezes the root module usage of the blockchain module by removing
the replacement and bumping the required version.  This means building
the software will still produce binaries based on the v1 module until
the v2 module is fully released.

All future releases will be moving to version 2 of the module.

Consequently, it bumps the required module versions as follows:

- github.com/decred/dcrd/blockchain@v1.2.0
2019-08-08 13:10:18 -05:00
Dave Collins
4968cd7ef0
mining: Prepare v1.1.1.
This updates the mining module dependencies and serves as a base for
mining/v1.1.1.

The updated direct dependencies in this commit are as follows:

- github.com/decred/dcrd/blockchain@v1.2.0
- github.com/decred/dcrd/blockchain/stake@v1.2.1
- github.com/decred/dcrd/chaincfg/chainhash@v1.0.2
- github.com/decred/dcrd/dcrutil@v1.4.0

The full list of updated direct dependencies since the previous
mining/v1.1.0 release are as follows:

- github.com/decred/dcrd/blockchain@v1.2.0
- github.com/decred/dcrd/blockchain/stake@v1.2.1
- github.com/decred/dcrd/chaincfg/chainhash@v1.0.2
- github.com/decred/dcrd/dcrutil@v1.4.0
2019-08-08 11:24:09 -05:00
Dave Collins
1159f67852
blockchain: Prepare v1.2.0.
This updates the blockchain dependencies and serves as a base for
blockchain/v1.2.0.

The updated direct dependencies in this commit are as follows:

- github.com/decred/dcrd/blockchain/stake@v1.2.1
- github.com/decred/dcrd/chaincfg@v1.5.2
- github.com/decred/dcrd/chaincfg/chainhash@v1.0.2
- github.com/decred/dcrd/database@v1.1.0
- github.com/decred/dcrd/dcrutil@v1.4.0
- github.com/decred/dcrd/gcs@v1.1.0

The full list of updated direct dependencies since the previous
blockchain/v1.1.1 release are as follows:

- github.com/decred/dcrd/blockchain/stake@v1.2.1
- github.com/decred/dcrd/blockchain/standalone@v1.0.0
- github.com/decred/dcrd/chaincfg@v1.5.2
- github.com/decred/dcrd/chaincfg/chainhash@v1.0.2
- github.com/decred/dcrd/database@v1.1.0
- github.com/decred/dcrd/dcrec@v1.0.0
- github.com/decred/dcrd/dcrec/secp256k1@v1.0.2
- github.com/decred/dcrd/dcrutil@v1.4.0
- github.com/decred/dcrd/gcs@v1.1.0
- github.com/decred/dcrd/txscript v1.1.0
2019-08-08 10:42:57 -05:00
Dave Collins
4133596ddb
blockchain: Use standalone module for work funcs.
This updates blockchain to make use of the new work functions in the
standalone module.

Finally, it also deprecates the related exported functions in the
blockchain module so they can be removed in the next major version and
rewrites them in terms of the standalone module in the mean time.
2019-08-08 10:27:26 -05:00
Dave Collins
e172790d98
blockchain: Use standalone module subsidy calcs.
This updates blockchain to make use of the new better optimized subsidy
cache and calculation functions in the the standalone module.  While
making the updates, it also does basic cleanup on some error messages.

Since the v1 chaincfg.Params does not implement the necessary interface
and moving chaincfg/v2.Params requires a major version bump, a new type
named subsidyParams is introduced which embeds v1 chaincfg.Params and
implements the interface to act as a bridge.

Also, since the SubsidyCache type is returned from blockchain, the type
is aliased and rewritten in terms of the standalone module so callers
still on the v1 module are able to interop.

Finally, this also deprecates the related exported functions in the
blockchain module so they can be removed in the next major version.
2019-08-08 10:27:25 -05:00
Dave Collins
9197eb3fdb
blockchain: Use standalone for coinbase checks.
This updates blockchain to make use of the coinbase check function in
the standalone module.

It also deprecates the related exported functions in the blockchain
module so they can be removed in the next major version and rewrites
them in terms of the standalone module in the mean time.
2019-08-08 10:27:25 -05:00
Dave Collins
e7f6edaa6d
blockchain: Use standalone module for merkle calcs.
This updates blockchain to make use of the optimized merkle root
calculation functions in the standalone module.

It also deprecates the related exported functions in the blockchain
module so they can be removed in the next major version.

Finally, the following direct dependencies are updated as required:

- github.com/decred/dcrd/blockchain/standalone@v1.0.0
2019-08-08 10:27:20 -05:00
Dave Collins
8354a310bc
main: Consume latest module minors and patches.
This updates the main module to use the latest available minor and patch
versions of all modules and reverts the recent change that incorrectly
removed all of the blake256 references from the various go.sum files.

The following required direct dependencies are bumped as follows:

- github.com/decred/dcrd/blockchain/stake@v1.2.1
- github.com/decred/dcrd/blockchain/stake/v2@v2.0.1
- github.com/decred/dcrd/certgen@v1.1.0
- github.com/decred/dcrd/chaincfg@v1.5.2
- github.com/decred/dcrd/chaincfg/chainhash@v1.0.2
- github.com/decred/dcrd/chaincfg/v2@v2.2.0
- github.com/decred/dcrd/dcrutil/v2@v2.0.0
- github.com/decred/dcrd/gcs@v1.1.0
- github.com/decred/dcrd/hdkeychain/v2@v2.0.1
- github.com/decred/dcrd/txscript/v2@v2.0.0
- github.com/decred/dcrwallet/rpc/jsonrpc/types@v1.2.0
2019-08-08 10:05:35 -05:00
Donald Adu-Poku
09f823b422 database: Separate dbs for concurrent db tests.
This updates v2 test database names to avoid conflicts when multiple
database modules are being tested
2019-08-08 08:39:50 -05:00
Nicola Larosa
1149d54cb9 multi: Use crypto/blake256.
This updates the code to make use of the new crypto/blake256 module instead of
github.com/dchest/blake256.

* change the references in the chaincfg/chainhash and gcs modules
* update chaincfg/chainhash to use the new Sum256 API
* remove references to dchest/blake256 from all go.sum files
2019-08-07 18:54:55 -05:00
Aaron Campbell
b5404408f1 txscript: Fix typo in script test data. 2019-08-07 16:24:57 -05:00
Dave Collins
82b863e88c
stake: Check minimum req outputs for votes earlier.
There is no reason to perform a bunch of additional checks when there is
no possible way a transaction can be vote due to not having at least the
minimum required number of outputs for it to possibly be one.
2019-08-07 13:26:07 -05:00
Nicola Larosa
2fa28e2a43 crypto/blake256: Add module with zero alloc funcs. 2019-08-07 10:00:01 -05:00
Dave Collins
18a2a68b8c
blockchain/standalone: Prepare v1.0.0.
This updates the documentation for the new blockchain/standalone module
along with main module dependencies to ensure it is tested as well as
uses the latest version of the code as the new module is integrated.

It also serves as a base for blockchain/stake/v1.0.0.

The new modules has the following direct dependencies:

- github.com/decred/dcrd/chaincfg/chainhash@v1.0.1
- github.com/decred/dcrd/wire@v1.2.0
2019-08-06 23:24:31 -05:00
Dave Collins
d09672d959
blockchain/standalone: Add IsCoinBaseTx.
The copies the standalone IsCoinBaseTx function from the blockchain
module to the blockchain/standalone module.

It also updates the documentation and includes comprehensive tests.
2019-08-06 21:47:50 -05:00
Dave Collins
bf2015b510
blockchain/standalone: Add subsidy calc funcs.
This adds a subsidy cache with funcs to calculate subsidies for
proof-of-work, votes, and the treasury to the blockchain/standalone
module.  Since the existing functions in blockchain are easy to use
improperly and have poor performance under certain access patterns,
rather than copying them over, this provide new implementations of
better optimized functions with less potential cases for misuse.

Note that because subsidy generation is consensus critical, great care
has been taken to ensure the same semantics are retained under the
scenarios which the consensus code invokes the functions, although the
semantics of the functions themselves have changed when compared to
their existing counterparts when called in circumstances that the
consensus code avoids as discussed below.

The existing subsidy code in blockchain assumes that it will never be
called in circumstances which would violate consensus such as with
negative block heights and when there are less than the minimum required
number of votes and consequently produces invalid subsidy values in
those types of cases.

This does not pose a problem for the existing consensus code itself
because it does, in fact, correctly avoid calling the functions in
scenarios that would produce incorrect results.  However, since these
functions are exported for external use, forcing consumers to only call
the functions under the (previously undocumented) correct scenarios is
highly error prone.

Consequently, these new functions produce results that match the
consensus behavior even if called under those circumstances which are
currently avoided.

The following is an overview of the changes to the results of the
functions as compared to their existing counterparts:

- Negative block heights now returns 0 subsidy in all cases
- Height 0 now returns 0 subsidy in all cases
- Height 1 now returns the full amount for the PoW subsidy and 0
  for the vote and treasury subsidies as compared to reduced values that
  the actual consensus rules do not use
- Heights prior to one block before the point at which voting begins now
  return 0 vote subsidy as compared to reduced values that the actual
  consensus rules ignore at those heights
- Specifying less than the minimum number of votes required for a block
  to be considered valid by consensus along with heights at or after the
  point voting begins now returns 0 PoW and Treasury subsidies as
  compared to further reduced values that the actual consensus rules
  ignore due to the block being invalid

A few other improvements include:

- All subsidy calculation funcs are now methods on the cache instance
  which means it is no longer possible to corrupt the cache by calling
  the functions with different network parameters
- The cache can no longer be made to grow indefinitely
  - Note that this is not an exploit in the existing code since the
    internal code is very restrictive in how it uses the functions as
    previously mentioned
- Improves future scalability by avoiding recalculations on all
  intervals after the max potential block subsidy has been fully reduced
  to 0
- Improve sparse access efficiency to O(log N) vs O(N)

Finally, it also adds a benchmark, updates the documentation, and includes
comprehensive tests.

The following is a before and after comparison of calculating subsidies
for various sparse intervals:

benchmark                         old ns/op    new ns/op    delta
-------------------------------------------------------------------
BenchmarkCalcSubsidyCacheSparse   56766        17243        -69.62%

benchmark                         old allocs   new allocs   delta
-------------------------------------------------------------------
BenchmarkCalcSubsidyCacheSparse   6            5            -16.67%

benchmark                         old bytes    new bytes    delta
-------------------------------------------------------------------
BenchmarkCalcSubsidyCacheSparse   1163         416          -64.23%
2019-08-06 21:19:56 -05:00
Dave Collins
bd4e5c21dc
blockchain/standalone: Add merkle root calc funcs.
This adds functions to calculate a merkle root to the
blockchain/standalone module.  Rather than copying the existing
functions from blockchain, it introduces new optimized functions that
have simpler code and are also generally easier to use.  The new
functions simply return the calculated root instead of all of the
intermediate hashes which no known callers were actually using anyway.

It also adds a basic usage example, benchmarks, updates the
documentation and includes comprehensive tests.

As can be seen by the benchmarks below, the new code isn't significantly
faster in terms of execution speed since it is still dominated by the
actual hashing, however, it does significantly reduce the number of
allocations which reduces pressure on the GC, particularly during bursty
situations such as IBD.  It also scales much better to larger numbers of
transactions.

The following is a before and after comparison of calculating merkle
roots for various numbers of leaves:

benchmark                       old ns/op    new ns/op   delta
---------------------------------------------------------------
BenchmarkCalcMerkleRoot/20      25637        24287       -5.27%
BenchmarkCalcMerkleRoot/1000    1252749      1209130     -3.48%
BenchmarkCalcMerkleRoot/2000    2601754      2343198     -9.94%
BenchmarkCalcMerkleRoot/4000    4873969      4629169     -5.02%
BenchmarkCalcMerkleRoot/8000    9831116      9270095     -5.71%
BenchmarkCalcMerkleRoot/16000   19172545     19067585    -0.55%
BenchmarkCalcMerkleRoot/32000   37980323     35746500    -5.88%

benchmark                       old allocs   new allocs  delta
----------------------------------------------------------------
BenchmarkCalcMerkleRoot/20      106          64          -39.62%
BenchmarkCalcMerkleRoot/1000    5006         3004        -39.99%
BenchmarkCalcMerkleRoot/2000    10006        6004        -40.00%
BenchmarkCalcMerkleRoot/4000    20006        12004       -40.00%
BenchmarkCalcMerkleRoot/8000    40006        24004       -40.00%
BenchmarkCalcMerkleRoot/16000   80006        48004       -40.00%
BenchmarkCalcMerkleRoot/32000   160006       96004       -40.00%

benchmark                       old bytes    new bytes   delta
----------------------------------------------------------------
BenchmarkCalcMerkleRoot/20      6896         4432        -35.73%
BenchmarkCalcMerkleRoot/1000    320688       208272      -35.05%
BenchmarkCalcMerkleRoot/2000    641072       416272      -35.07%
BenchmarkCalcMerkleRoot/4000    1281840      832272      -35.07%
BenchmarkCalcMerkleRoot/8000    2563376      1664272     -35.07%
BenchmarkCalcMerkleRoot/16000   5126448      3328272     -35.08%
BenchmarkCalcMerkleRoot/32000   10252592     6656273     -35.08%
2019-08-06 10:40:57 -05:00
Dave Collins
2c7d20442e
blockchain/standalone: Implement a new module.
This implements a new module named blockchain/standalone which aims to
provide several of the standalone functions currently available in
blockchain and ultimately replace them in the next major version.

The primary goal of offering these functions via a separate module is to
reduce the required dependencies to a minimum as compared to the
blockchain module.  It will be ideal for applications such as
lightweight clients that need to ensure basic security properties hold
and calculate appropriate vote subsidies and block explorers.

For example, some things an SPV wallet needs to prove are that the block
headers all connect together, that they satisfy the proof of work
requirements, and that a given transaction tree is valid for a given
header.

The new module currently only provides functions related to proof of
work, however, future commits will provide functions for merkle root
calculation, subsidy calculation, and coinbase transaction
identification.  It is being done in stages to help ease review since it
is consensus critical code.

Finally, it also includes comprehensive tests, full package
documentation, and basic usage examples.
2019-08-06 10:29:30 -05:00
Dave Collins
cf97a277ee
TravisCI: Recommended install for golangci-lint. 2019-08-06 10:29:29 -05:00
Dave Collins
7dc2016569
chaincfg: Add subsidy params accessor funcs.
This defines several new functions on the Params struct which return
some subsidy-related parameters.

The new functions are:

- BaseSubsidyValue
- SubsidyReductionMultiplier
- SubsidyReductionDivisor
- SubsidyReductionIntervalBlocks
- WorkSubsidyProportion
- StakeSubsidyProportion
- TreasurySubsidyProportion

This will allow the parameters to be used directly as input to an
interface in the future.
2019-08-05 00:25:40 -05:00
Dave Collins
e6bd4b1c97
docs: Update for rpcclient v4 module. 2019-07-30 12:56:44 -05:00
Dave Collins
647bd1a71a
release: Introduce rpcclient v4 module. 2019-07-30 12:56:44 -05:00