Commit Graph

133 Commits

Author SHA1 Message Date
Dave Collins
05e66dcaca
database: Use TempDir to create temp test dirs.
This modifies several of the tests to use t.TempDir.  The directory it
creates is automatically removed when the test and all its subtests
complete.

It also changes out some of the cleanup logic for closing the database
to use t.Cleanup instead of defer to ensure the close happens during
test cleanup after the directories created by t.TempDir have been
removed.
2023-06-15 15:05:45 -05:00
Dave Collins
e3ac1b8568
database: Mark test helpers.
This marks several of the funcs that are used as helpers as test
helpers so any failures will be attributed to the caller as opposed to
the methods themselves.
2023-06-15 15:05:45 -05:00
Dave Collins
e1ac4d8ca8
database: Prepare v3.0.1.
This updates the database module dependencies, the copyright year in the
files modified since the previous release, and serves as a base for
database/v3.0.1.

The updated direct dependencies in this commit are as follows:

- github.com/decred/dcrd/chaincfg/chainhash@v1.0.4
- github.com/decred/dcrd/chaincfg@v3.2.0
- github.com/decred/dcrd/dcrutil/v4@v4.0.1
- github.com/decred/dcrd/wire@v1.6.0

The updated indirect dependencies in this commit are as follows:

- github.com/dchest/siphash@v1.2.3
- github.com/decred/base58@v1.0.5
- github.com/decred/dcrd/crypto/blake256@v1.0.1
- github.com/decred/dcrd/crypto/ripemd160@v1.0.2
- github.com/decred/dcrd/dcrec@v1.0.1
- github.com/decred/dcrd/dcrec/edwards/v2@v2.0.3
- github.com/decred/dcrd/dcrec/secp256k1/v4@v4.2.0
- github.com/decred/dcrd/txscript/v4@v4.1.0
- github.com/klauspost/cpuid/v2@v2.0.9
- lukechampine.com/blake3@v1.2.1

The full list of updated direct dependencies since the previous
database/v3.0.0 release are the same as above.

The full list of updated indirect dependencies since the previous
database/v3.0.0 release are as follows:

- github.com/agl/ed25519@v0.0.0-20170116200512-5312a6153412
- github.com/dchest/siphash@v1.2.3
- github.com/decred/base58@v1.0.5
- github.com/decred/dcrd/crypto/blake256@v1.0.1
- github.com/decred/dcrd/crypto/ripemd160@v1.0.2
- github.com/decred/dcrd/dcrec@v1.0.1
- github.com/decred/dcrd/dcrec/edwards/v2@v2.0.3
- github.com/decred/dcrd/dcrec/secp256k1/v4@v4.2.0
- github.com/decred/dcrd/txscript/v4@v4.1.0
- github.com/golang/snappy@v0.0.4
- github.com/klauspost/cpuid/v2@v2.0.9
- lukechampine.com/blake3@v1.2.1

Finally, all modules in the repository are tidied to ensure they are
updated to use the latest versions hoisted forward as a result.
2023-06-08 13:33:13 -05:00
Dave Collins
ad02d8f300
multi: Go 1.19 doc comment formatting.
This modifies the entire repository to use the new formatting of doc
comments in the upcoming Go 1.19 release.

The primary motivating factors for this are:

- Builds check that files are formatted per gofmt and that will no
  longer be true as of Go 1.19 without these changes
- Separating all the updates into a single commit ensures these
  documentation only formatting changes do not clutter up diffs that
  actually change code

For the most part, the changes are just the automated changes suggested
by the Go 1.19 version of gofmt, but there are also a few cases where
the comments were reworded a bit to play nicely with the new formatting
requirements.

For example, the new version of gofmt reformats and collapses nested
lists where as the existing version does not.  Thus, instances of nested
lists have been changed to either eliminate them or use mixed markers
which produce expect results.
2022-07-30 04:08:58 -05:00
Dave Collins
7d59dd3b69
multi: Support module graph prune and lazy load.
This bumps the go directive for all of the modules provided by the
repository to 1.17 which will allow the new module graph pruning and
lazy loading capabilities introduced in Go 1.17 to be used once the
updated modules are released.

This means that, as described by the documentation, the go.mod files for
each module now include a separate require block that includes all of
the indirect dependencies
2022-03-25 07:20:01 -05:00
JoeGruff
4481196118 ffldb: Add dbErr to error description.
Add the reason for bad inserts, updates, and deletes to the error
description and display key as hex in order to give the user more
information when the database errors. This is especially useful for
upgrades which may fail for several reasons, such as low disc space,
which the user will now be informed about.
2022-02-08 00:43:28 -06:00
Dave Collins
81ae286f23
database: Prepare v3.0.0.
This updates the database module dependencies, the copyright year in the
files modified since the previous release, and serves as a base for
database/v3.0.0.

The updated direct dependencies in this commit are as follows:

- github.com/decred/dcrd/dcrutil/v4@v4.0.0
- github.com/syndtr/goleveldb@v1.0.1-0.20210819022825-2ae1ddf74ef7

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

- github.com/decred/dcrd/chaincfg/chainhash@v1.0.3
- github.com/decred/dcrd/chaincfg/v3@v3.1.0
- github.com/decred/dcrd/dcrutil/v4@v4.0.0
- github.com/decred/dcrd/wire@v1.5.0
- github.com/decred/slog@v1.2.0
- github.com/syndtr/goleveldb@v1.0.1-0.20210819022825-2ae1ddf74ef7

Finally, all modules in the repository that depend on the module are
tidied to ensure they are updated to use the latest versions hoisted
forward as a result.
2021-11-19 23:32:36 -06:00
Dave Collins
55fb28cbbd
txscript: Prepare v4.0.0.
This updates the txscript module dependencies, the copyright year in the
files modified since the previous release, and serves as a base for
txscript/v4.0.0.

The updated direct dependencies in this commit are as follows:

- github.com/decred/dcrd/chaincfg/chainhash@v1.0.3
- github.com/decred/dcrd/chaincfg/v3@v3.1.0
- github.com/decred/dcrd/dcrec/edwards/v2@v2.0.2
- github.com/decred/dcrd/dcrec/secp256k1/v4@v4.0.1
- github.com/decred/dcrd/wire@v1.5.0
- github.com/decred/slog@v1.2.0

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

- github.com/dchest/siphash@v1.2.2
- github.com/decred/base58@v1.0.3
- github.com/decred/dcrd/chaincfg/chainhash@v1.0.3
- github.com/decred/dcrd/chaincfg/v3@v3.1.0
- github.com/decred/dcrd/crypto/blake256@v1.0.0
- github.com/decred/dcrd/dcrec/edwards/v2@v2.0.2
- github.com/decred/dcrd/dcrec/secp256k1/v4@v4.0.1
- github.com/decred/dcrd/wire@v1.5.0
- github.com/decred/slog@v1.2.0

The following direct dependencies are no longer required as compared to
the previous txscript/v3.0.0 release:

- github.com/decred/dcrd/dcrutil/v3

Finally, all modules in the repository that depend on txscript are
tidied to ensure they are updated to use the latest versions hoisted
forward as a result.
2021-11-18 23:14:01 -06:00
Dave Collins
c0fe15fa0e
stdaddr: Use txscript for opcode definitions.
This modifies the code to use the opcode definitions in txscript now
that the previous cyclic dependency no longer applies since txscript no
longer depends on stdaddr.
2021-11-18 13:15:06 -06:00
Donald Adu-Poku
0c11ab5bd9 multi: avoid using subscriber lifecycle in catchup.
This updates the index subscriber catchup function to update
subscriptions directly with notification instead of going through the
Run lifecycle process which avoids a case of receiving out of sync
index notifications while catch up is in progress.

Multiple typos in error type tests and review issues have also been
fixed in this commit.
2021-10-12 18:52:50 -05:00
Donald Adu-Poku
77033596a1 multi: integrate index subscriber.
This removes last set of references to IndexManager and integrates the
IndexSubscriber into the chain. All indexes have now been updated to
subscribe to the index subscriber for updates.
2021-10-12 18:52:50 -05:00
Dave Collins
0deef709df
database: Remove deprecated DisableLog. 2021-09-10 07:54:27 -05:00
Dave Collins
7e5fa8fe11
database: Correct README rpcclient link. 2021-09-01 10:18:45 -05:00
Matheus Degiovani
9ede6ae83e multi: Introduce database/v3 module.
This bumps the major version of the database module to v3. This is
needed because the current code already has backwards incompatible
changes.
2021-08-02 08:29:46 -05:00
Ryan Staudt
089e91c60b database: Add comment on os.MkdirAll behavior.
This adds a comment describing behavior seen in practice for os.MkdirAll
on certain less supported OSes.
2021-07-30 16:20:26 -05:00
Ryan Staudt
bdccd3e3f7 database: Add Flush to DB interface.
This adds a Flush method to the DB interface so that users of the DB
type can flush the underlying database to disk as needed.

The immediate use case for this is to allow for flushing dependencies.
For example, the block database always needs to be flushed to disk prior
to the UTXO database being flushed to disk to ensure that the UTXO
database remains in a recoverable state in the event of an unclean
shutdown.
2021-05-13 22:43:30 -05:00
Dave Collins
0fb3e7eabd
dcrutil: Convert to use new stdaddr package.
This updates VerifyMessage to use the stdaddr package for addresses
instead of the local Address type in preparation for its removal.
2021-04-15 16:58:25 -05:00
Dave Collins
4ebd135a82
multi: Round 2 prerel module release ver updates.
This modifies some recently-updated modules to use a valid prerelease
version so they can be used in require statements in consumer code that
is also under development.

Several commits are needed since there is a dependency chain that
involves transitive deps.

The updated direct dependencies are as follows:

- github.com/decred/dcrd/blockchain/stake/v4@v4.0.0-20210129181600-6ae0142d3b28
- github.com/decred/dcrd/blockchain/v4@4.0.0-20210129181600-6ae0142d3b28
- github.com/decred/dcrd/dcrutil/v4@v4.0.0-20210129181600-6ae0142d3b28
- github.com/decred/dcrd/hdkeychain/v3@v3.0.0-20210129181600-6ae0142d3b28
- github.com/decred/dcrd/txscript/v4@v4.0.0-20210129181600-6ae0142d3b28
2021-01-29 13:01:27 -06:00
Donald Adu-Poku
c8d1a003e4 multi: update database error types.
This updates the database error types to leverage
go 1.13 errors.Is/As functionality as well as confirm
to the error infrastructure best practices.
2020-12-18 13:40:32 -06:00
Donald Adu-Poku
57ffde8c30 multi: Start dcrec/secp256k1 v4 module dev cycle.
This updates the dcrec/secp256k1 module
version to v4 and updates import and dep sites.
2020-12-16 16:30:24 -06:00
Donald Adu-Poku
48e43ca109 multi: Start dcrutil v4 module dev cycle.
This updates the dcrutil module version to v4
and updates import and deps sites.
2020-12-16 16:30:24 -06:00
David Hill
c56c9ea00e
database: Fix errorlint warnings. 2020-11-30 12:34:47 -06:00
Dave Collins
20889d0842
database: Prepare v2.0.2.
This updates the database module dependencies and serves as a base for
database/v2.0.2.

The updated direct dependencies in this commit are as follows:

- github.com/decred/dcrd/chaincfg/v3@v3.0.0
- github.com/decred/dcrd/dcrutil/v3@v3.0.0
- github.com/decred/slog@v1.1.0
- github.com/syndtr/goleveldb@v1.0.1-0.20200815110645-5c35d600f0ca

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

- github.com/decred/dcrd/chaincfg/v3@v3.0.0
- github.com/decred/dcrd/dcrutil/v3@v3.0.0
- github.com/decred/dcrd/wire@v1.4.0
- github.com/decred/slog@v1.1.0
- github.com/syndtr/goleveldb@v1.0.1-0.20200815110645-5c35d600f0ca

Finally, all modules in the repository are tidied to ensure they are
updated to use the latest versions hoisted forward as a result.
2020-09-28 12:50:29 -05:00
Dave Collins
a8272f876d
dcrutil: Prepare v3.0.0.
This updates the dcrutil module dependencies and serves as a base for
dcrutil/v3.0.0.

The updated direct dependencies in this commit are as follows:

- github.com/decred/dcrd/crypto/ripemd160@v1.0.1
- github.com/decred/dcrd/dcrec/edwards/v2@v2.0.1
- github.com/decred/dcrd/dcrec/secp256k1/v3@v3.0.0

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

- github.com/decred/base58@v1.0.3
- github.com/decred/dcrd/crypto/ripemd160@v1.0.1
- github.com/decred/dcrd/dcrec/edwards/v2@v2.0.1
- github.com/decred/dcrd/dcrec/secp256k1/v3@v3.0.0
- github.com/decred/dcrd/wire@v1.4.0

Further, the following dependencies that were previously required in the
dcrutil/v2.0.1 release are no longer required:

- github.com/decred/dcrd/chaincfg/v2

Finally, all modules in the repository that depend on dcrutil are tidied
to ensure they are updated to use the latest versions hoisted forward as
a result.
2020-09-25 16:00:44 -05:00
Dave Collins
f7af0ddb01
multi: Update chaincfg dependers to wire/v1.4.0. 2020-09-25 13:50:06 -05:00
Marco Peereboom
80f5feb1db
multi: Add decentralized treasury support.
This is based on https://proposals.decred.org/proposals/c96290a but was
modified in order to deal with realities that were unknown at the time
of the specification draft.

It is large and could not really be broken apart due to the pervasive
use of the isTreasuryEnabled flag. It was primarily authored by
* Marco Peereboom <marco@peereboom.us>
* Dave Collins <davec@conformal.com>
* Matheus Degiovani <opensource@matheusd.com>

With additional contributions from
* Donald Adu-Poku <donald.adu@gmail.com>
* Jamie Holdstock <jholdstock@decred.org>

Major changes:
* Add decentralized treasury agenda, as specified in DCP0006, to all supported
  nets.
* Add functions to determine if the decentralized treasury agenda is active at
  given block.
* Add new opcode OP_TADD that is a nop in txscript but is used to tag scripts
  that credit the treasury account. This opcode is overloaded for treasurybase
  and for normal transactions.
* Add new opcode OP_TSPEND that is a nop in txscript but is used to tag scripts
  that debit the treasury account.
* Add new opcode OP_TGEN that is a nop in txscript but is used to tag P2PKH and
  P2SH outputs in a TSpend transaction.
* Add functions that detect if a transaction is a valid TAdd, TSpend
  or treasurybase transaction.
* Add error codes that return specific treasurybase/TAdd/TSpend consensus
  violations.
* Modify countSpentOutputs to deal with treasury opcodes accordingly.
* Modify indexBlock to skip treasury transactions that do not have inputs.
* Add IsTreasuryEnabled call to ChainQueryer interface.
* Add treasury logger for debugging and logging the decentralized treasury
  subsystem.
* Add IsTreasuryActive flag to BlockConnectedNtfnsData and
  BlockDisconnectedNtfnsData.
* Modify OP_SSGEN to allow an optional output that contains votes for a TSpend
  transaction hash.
* Add function that returns TSpend votes from an SSGen transaction.
* Modify CalcStakeVoteSubsidy so that treasurybase, unlike coinbase, is always
  awarded the full percentage of the assigned block reward.
* Add helper functions to do all TSpend math so that callers don't roll their
  own.
* Modify IsCoinBaseTx to not mistake a TSpend transaction as a coinbase.
* Add checkTreasuryBase function that verifies that a treasurybase is properly
  constructed and pays the right amount to the treasury account.
* Add functions to calculate treasury balance for the provided block hash/node.
* Add function that verifies if a TSpend has a valid signature.
* Add functions to determine if a TSpend is not overspending.
* Add function to determine if a TSpend has been mined on the provided chain.
* Add functions that count and verifies treasury spend votes.
* Modify connectTransaction and disconnectTransactions to deal with the various
  treasury transactions.
* Split CheckTransactionSanity in two functions
  checkTransactionSanityContextFree and checkTransactionSanityContextual. This
  is done in order to keep the decentralized treasury, which is always
  contextual, from infecting the context free checks.
* Modify checkTransactionSanityContextual to recognize and verify treasury
  transactions.
* Modify CheckTransactionSanity to deal with treasury transactions.
* Split checkBlockSanity in two functions checkBlockSanityContextFree and
  checkBlockSanityContextual. This is done in order to keep the decentralized
  treasury, which is always contextual, from infecting the context free checks.
* Modify checkBlockSanityContextual to enforce treasurybase and TAdd consensus
  checks.
* Modify checkBlockPositional by unindenting it and adding TSpend consensus
  enforcement.
* Modify checkCoinbaseUniqueHeightWithAddress to deal with the removal of the
  project subsidy from output 0.
* Add checkCoinbaseUniqueHeightWithTreasuryBase that verifies coinbase and
  treasurybase in the provided block.
* Unindent checkBlockContext.
* Modify checkTicketRedeemerCommitments and checkVoteInputs to deal with
  potential tspend votes.
* Modify CheckTransactionInputs to skip treasurybase transactions.
* Modify CheckTransactionInputs to deal with TSpend transactions. Ensure the
  provided Pi key is valid and that the signature is valid for the transaction.
  Ensure that treasury TAdd and TSpend transaction utxo can only be spent after
  coinbase maturity.
* Modify CountSigOps to deal with treasury transactions.
* Modify CountP2SHSigOps to deal with treasury transactions.
* Modify getStakeTreeFees to skip treasury transactions. Modify
  totalOutputs to subtract ValueIn 0 for TSpend and treasurybase transactions.
* Modify checkTransactionsAndConnect to deal with modified amounts.
* Add tspendChecks function that verifies an entire TSpend transaction
  validity at the point of the provided block. It ensures a TSpend is on a TVI.
  It ensures the TSpend is in the valid window. It verifies that a TSpend In
  and Out amounts match. It ensures a TSpend has the ValueIn amount encoded in
  the OP_RETURN in Out 0. It ensures a TSpend has not been mined before on this
  chain. It ensures a TSpend has the requisite votes. It ensures a TSpend is
  not overspending.
* Modify checkConnectBlock to call checkTreasuryBase and tspendChecks when
  treasury agenda is active.
* Add two tables to the database. Table "treasury" records the balance as of
  this block and balance changes that occurred in this block which will become
  active in CoinbaseMaturity blocks. Table "tspend" records all block hashes
  where a TSpend has been mined this is to detect forks and prevent a Tspend
  from being mined more than once.
* Modify handleBlockchainNotification to communicate if the treasury agenda is
  active and skip treasurybase transaction when needed.
* Add various Treasury parameters to chaincfg params.
* Add hardcoded Tspend signatures in dcr_tmux_simnet_setup.sh.
* Add notifytspend and stoptspend calls to the RPC server. notifytspend
  notifies the mempool when a TSpend transaction arrives.
* Modify commit filters V2 to recognize TAdd and TSpend transactions. It was
  possible to modify V2 instead of introducing V3 because nothing changes from
  the viewpoint of the wallet and treasury opcodes are disallowed prior to
  agenda activation.
* Modify AddMemPoolTransaction to skip TSpend transactions that would throw the
  fee estimator off.
* Add IsTreasuryAgendaActive, OnTSpendReceived and TSpendMinedOnAncestor to
  mempool.Config in order to reject/accept TSpends in the mempool.
* Modify checkPoolDoubleSpend to ignore treasurybase.
* Modify mempool.maybeAcceptTransaction to enforce treasury standardness rules.
  Don't allow TSpend transactions prior to stake validation height. Skip
  treasurybase and tspend transactions in the orphan test. Ensure a tspend is
  in a valid window. Ensure not more than 7 TSpends are active in the mempool.
  Ensure TSpend has a well-known Pi key. Ensure The provided Pi key was used to
  sign the transaction. Ensure TSpend was not mined in an ancestor block.
  Notify subscribers that a valid TSpend was received.
* Add standardCoinbaseOpReturn and standardTreasurybaseOpReturn to create an
  OP_RETURN followed by a data push that little endian encodes the height of
  the block. Then there are a number of random bytes to ensure that the
  transaction hash is always random.
* Modify createCoinbaseTx to create a coinbase that is valid when treasury is
  enabled or not. Additionally, alter the transaction version if treasury is
  enabled.
* Add createTreasuryBaseTx that creates a standard treasurybase.
* Modify maybeInsertStakeTx to recognize treasurybase and TSpend transactions.
* Modify handleTooFewVoters to call createTreasuryBaseTx when the treasury
  agenda is active. Skip copying treasurybase.
* Modify NewBlockTemplate to recognize and deal with treasury transactions.
  Skip TSpend transaction if block is not a TVI. Skip TSpend transaction if it
  is not in the proper window. Skip TSpend transaction if a TSpend does not
  have enough yes votes. Skip TSpend transaction if it overspends the treasury
  account. Skip TAdd if there are more than 20 TAdds in the block. Create
  treasurybase if required. Insert valid TAdd/TSpend transactions into stake
  tree.
* Add TreasuryBalance and IsTreasuryAgendaActive to rpcserver Chain interface.
* Add gettreasurybalance, sendfromtreasury and sendtotreasury calls to RPC
  server.
* Add notifytspend and stopnotifytspend to RPC websocket commands.
* Add simnet miner to generate large number of blocks during rpctests without
  triggering PoW difficulty increases. This is used to verify various treasury
  and tspend conditions during CI/CT.
* Modify RPC voting wallet to also vote on TSpends.
* Add json tests to verify all new opcodes and corner cases in the script
  engine.
* Modify isStakeOpcode to recognize treasury opcodes.
* Modify countSigOpsV0 to count TSpends.
* Modify handleStakeOutSign to deal with TSpends.
* Modify SignTxOutput to recognize TSpends.
* Add TSpendSignatureScript that signs a TSpend transaction.
* Add TreasuryAddTy and TreasurySpendTy types to the standard scripts.
* Add isTreasuryAddScript and isTreasurySpendScript functions that recognize
  a form of TAdd and TSpend transactions.
* Modify ExtractPkScriptAddrs to deal with TAdd and TSpend outputs.
* Add TxVersionSeqLock = 2 and TxVersionTreasury = 3 to wire. This is
  used to discriminate between treasury and non-treasury scripts.
* Rig up all functions that need the isTreasuryEnabledflag directly or
  indirectly.
* Shuffle various functions around and export them when they were needed to be
  called from other packages.
* Added and modified numerous tests to verify (hopefully) all corner cases that
  the decentralized treasury agenda has added.
2020-09-21 12:15:31 -05:00
Ryan Staudt
d31d9305a4
multi: go mod tidy cleanup and run in CI.
This updates run_tests.sh to run `go mod tidy` in CI and fail if go.mod
and/or go.sum changes.
2020-06-15 08:49:38 -05:00
Dave Collins
3fd3c74867
multi: Run go mod tidy on all modules. 2020-05-04 13:54:54 -05:00
David Hill
e26e71a9a2 multi: replace godoc.org with pkg.go.dev 2020-02-18 19:35:19 -06:00
Dave Collins
b2cef202a7
multi: Round 4 prerel module release ver updates.
This modifies all prelease modules to use the latest commit to work out
more transitive dependency issues.  Several of these are needed due to
the dependency chain.

The updated direct dependencies are as follows:

- github.com/decred/dcrd/blockchain/stake/v3@v3.0.0-20200215031403-6b2ce76f0986
- github.com/decred/dcrd/blockchain/v3@v3.0.0-20200215031403-6b2ce76f0986
- github.com/decred/dcrd/chaincfg/v3@v3.0.0-20200215031403-6b2ce76f0986
- github.com/decred/dcrd/connmgr/v3@v3.0.0-20200215031403-6b2ce76f0986
- github.com/decred/dcrd/dcrec/secp256k1/v3@v3.0.0-20200215031403-6b2ce76f0986
- github.com/decred/dcrd/dcrutil/v3@v3.0.0-20200215031403-6b2ce76f0986
- github.com/decred/dcrd/hdkeychain/v3@v3.0.0-20200215031403-6b2ce76f0986
- github.com/decred/dcrd/mempool/v4@v4.0.0-20200215031403-6b2ce76f0986
- github.com/decred/dcrd/mining/v3@v3.0.0-20200215031403-6b2ce76f0986
- github.com/decred/dcrd/txscript/v3@v3.0.0-20200215031403-6b2ce76f0986
2020-02-14 22:55:06 -06:00
Dave Collins
6b2ce76f09
multi: Round 3 prerel module release ver updates.
This modifies all prelease modules to use the latest commit to work out
more transitive dependency issues.  Several of these are needed due to
the dependency chain.

The updated direct dependencies are as follows:

- github.com/decred/dcrd/blockchain/stake/v3@v3.0.0-20200215023918-6247af01d5e3
- github.com/decred/dcrd/blockchain/v3@v3.0.0-20200215023918-6247af01d5e3
- github.com/decred/dcrd/chaincfg/v3@v3.0.0-20200215023918-6247af01d5e3
- github.com/decred/dcrd/connmgr/v3@v3.0.0-20200215023918-6247af01d5e3
- github.com/decred/dcrd/dcrec/secp256k1/v3@v3.0.0-20200215023918-6247af01d5e3
- github.com/decred/dcrd/dcrutil/v3@v3.0.0-20200215023918-6247af01d5e3
- github.com/decred/dcrd/hdkeychain/v3@v3.0.0-20200215023918-6247af01d5e3
- github.com/decred/dcrd/mempool/v4@v4.0.0-20200215023918-6247af01d5e3
- github.com/decred/dcrd/mining/v3@v3.0.0-20200215023918-6247af01d5e3
- github.com/decred/dcrd/txscript/v3@v3.0.0-20200215023918-6247af01d5e3
2020-02-14 21:14:03 -06:00
Dave Collins
6247af01d5
multi: More prerel module release version updates.
This modifies all prelease modules to use the latest version to work out
more transitive dependency issues.

The updated direct dependencies are as follows:

- github.com/decred/dcrd/blockchain/stake/v3@v3.0.0-20200215015031-3283587e6add
- github.com/decred/dcrd/blockchain/v3@v3.0.0-20200215015031-3283587e6add
- github.com/decred/dcrd/chaincfg/v3@v3.0.0-20200215015031-3283587e6add
- github.com/decred/dcrd/connmgr/v3@v3.0.0-20200215015031-3283587e6add
- github.com/decred/dcrd/dcrec/secp256k1/v3@v3.0.0-20200215015031-3283587e6add
- github.com/decred/dcrd/dcrutil/v3@v3.0.0-20200215015031-3283587e6add
- github.com/decred/dcrd/hdkeychain/v3@v3.0.0-20200215015031-3283587e6add
- github.com/decred/dcrd/mempool/v4@v4.0.0-20200215015031-3283587e6add
- github.com/decred/dcrd/mining/v3@v3.0.0-20200215015031-3283587e6add
- github.com/decred/dcrd/txscript/v3@v3.0.0-20200215015031-3283587e6add
2020-02-14 20:39:18 -06:00
Dave Collins
3283587e6a
multi: Update all prerel module release versions.
This modifies all prelease modules to use the latest version so they can
be used in require statements in consumer code that is also under
development without running into transitive dependency issues.

The updated direct dependencies are as follows:

- github.com/decred/dcrd/blockchain/stake/v3@v3.0.0-20200214194519-928737b3e580
- github.com/decred/dcrd/blockchain/v3@v3.0.0-20200214194519-928737b3e580
- github.com/decred/dcrd/connmgr/v3@v3.0.0-20200214194519-928737b3e580
- github.com/decred/dcrd/dcrutil/v3@v3.0.0-20200214194519-928737b3e580
- github.com/decred/dcrd/mempool/v4@v4.0.0-20200214194519-928737b3e580
- github.com/decred/dcrd/mining/v3@v3.0.0-20200214194519-928737b3e580
- github.com/decred/dcrd/txscript/v3@v3.0.0-20200214194519-928737b3e580
2020-02-14 19:50:31 -06:00
Dave Collins
3bdcf8b915 multi: Update to prerel module release versions.
This modifies some recently-updated modules to use a valid prerelease
version so they can be used in require statements in consumer code that
is also under development.

The updated direct dependencies are as follows:

- github.com/decred/dcrd/chaincfg/v3@v3.0.0-20200214194519-928737b3e580
- github.com/decred/dcrd/dcrec/secp256k1/v3@v3.0.0-20200214194519-928737b3e580
2020-02-14 14:08:02 -06:00
David Hill
af3b5c1684 database, fees: use latest leveldb 2020-02-06 01:56:41 -06:00
Dave Collins
85f0c09df2
secp256k1: Start v3 module dev cycle.
Upcoming changes constitute breaking public API changes to the secp256k1
module, therefore, this follows the process for introducing major API
breaks which consists of:

- Bump the major version in the go.mod of the affected module if not
  already done since the last release tag
- Add a replacement to the go.mod in the main module if not already done
  since the last release tag
- Update all imports in the repo to use the new major version as
  necessary
- Make necessary modifications to allow all other modules to use the new
  version in the same commit
- Repeat the process for any other modules the require a new major as a
  result of consuming the new major(s)
2020-01-29 13:45:59 -06:00
Dave Collins
be7ab82cf9
chaincfg: Start v3 module dev cycle.
Upcoming changes constitute breaking public API changes to the chaincfg
module, therefore, this follows the process for introducing major API
breaks which consists of:

- Bump the major version in the go.mod of the affected module if not
  already done since the last release tag
- Add a replacement to the go.mod in the main module if not already done
  since the last release tag
- Update all imports in the repo to use the new major version as
  necessary
- Make necessary modifications to allow all other modules to use the
  new version in the same commit
  - Repeat the process for any other modules the require a new major as a
    result of consuming the new major(s)
2020-01-29 13:24:14 -06:00
David Hill
da3bdf43e4 multi: switch to syndtr/goleveldb
Stay at the came commit.
2020-01-28 16:57:18 -06:00
Dave Collins
83f8020051
multi: Update to prerel module release versions.
This modifies the various modules to use a valid prerelease version so
they can be used in require statements in consumer code that is also
under development.

The updated direct dependencies are as follows:

- github.com/decred/dcrd/blockchain/stake/v3@v3.0.0-20200104000002-54b67d3474fb
- github.com/decred/dcrd/blockchain/v3@v3.0.0-20200104000002-54b67d3474fb
- github.com/decred/dcrd/connmgr/v3@v3.0.0-20200104000002-54b67d3474fb
- github.com/decred/dcrd/dcrutil/v3@v3.0.0-20200104000002-54b67d3474fb
- github.com/decred/dcrd/mempool/v4@v4.0.0-20200104000002-54b67d3474fb
- github.com/decred/dcrd/mining/v3@v3.0.0-20200104000002-54b67d3474fb
- github.com/decred/dcrd/txscript/v3@v3.0.0-20200104000002-54b67d3474fb
2020-01-08 18:52:46 -06:00
Dave Collins
b6d8ccdedf
multi: Address a bunch of lint issues. 2019-12-30 13:54:41 -06:00
David Hill
4971faff25 multi: remove whitespace 2019-11-21 18:31:30 -06:00
Dave Collins
46b4e1ce4f
database: Remove unused code. 2019-10-30 20:36:48 -05:00
David Hill
6d39abb6be dcrutil: Start v3 module dev cycle.
Several upcoming changes constitute breaking the public API.
2019-10-24 19:13:26 -05:00
Dave Collins
355b1f4f88
database: Prepare v2.0.1.
This updates the database module dependencies and serves as a base for
database/v2.0.1.

The updated direct dependencies in this commit are as follows:

- github.com/decred/dcrd/chaincfg/chainhash@v1.0.2
- github.com/decred/dcrd/chaincfg/v2@v2.3.0
- github.com/decred/dcrd/dcrutil/v2@v2.0.1
- github.com/decred/dcrd/wire@v1.3.0

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

- github.com/decred/dcrd/chaincfg/chainhash@v1.0.2
- github.com/decred/dcrd/chaincfg/v2@v2.3.0
- github.com/decred/dcrd/dcrutil/v2@v2.0.1
- github.com/decred/dcrd/wire@v1.3.0
2019-10-15 11:54:16 -05:00
Dave Collins
3e2208f8c1
build: Replace TravisCI with CI via Github actions. 2019-09-20 19:59:04 -05:00
Aaron Campbell
8be96a8729 multi: Correct typos.
Correct typos found by reading code, ispell, and creative grepping.
2019-08-22 10:20:03 -05:00
Aaron Campbell
03678bb754 multi: Correct typos.
Correct typos found by reading code and creative grepping.
2019-08-16 17:37:58 -05:00
Dave Collins
25c14e046a
main: Update to use all new major module versions.
This updates all code in the main module to use the latest major modules
versions to pull in the latest updates.

A more general high level overview of the changes is provided below,
however, there is one semantic change worth calling out independently.

The verifymessage RPC will now return an error when provided with
an address that is not for the current active network and the RPC server
version has been bumped accordingly.

Previously, it would return false which indicated the signature is
invalid, even when the provided signature was actually valid for the
other network.  Said behavior was not really incorrect since the
address, signature, and message combination is in fact invalid for the
current active network, however, that result could be somewhat
misleading since a false result could easily be interpreted to mean the
signature is actually invalid altogether which is distinct from the case
of the address being for a different network.  Therefore, it is
preferable to explicitly return an error in the case of an address on
the wrong network to cleanly separate these cases.

The following is a high level overview of the changes:

- Replace all calls to removed blockchain merkle root, pow, subsidy, and
  coinbase funcs with their standalone module equivalents
  - Introduce a new local func named calcTxTreeMerkleRoot that accepts
    dcrutil.Tx as before and defers to the new standalone func
- Update block locator handling to match the new signature required by
  the peer/v2 module
  - Introduce a new local func named chainBlockLocatorToHashes which
    performs the necessary conversion
- Update all references to old v1 chaincfg params global instances to
  use the new v2 functions
- Modify all cases that parse addresses to provide the now required
  current network params
  - Include address params with the wsClientFilter
- Replace removed v1 chaincfg constants with local constants
- Create subsidy cache during server init and pass it to the relevant
  subsystems
  - blockManagerConfig
  - BlkTmplGenerator
  - rpcServer
  - VotingWallet
- Update mining code that creates the block one coinbase transaction to
  create the output scripts as defined in the v2 params
- Replace old v2 dcrjson constant references with new types module
- Fix various comment typos
- Update fees module to use the latest major module versions and bump it v2
2019-08-13 11:22:37 -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