This modifies the database upgrade code in blockchain to properly create
the buckets needed to house the decentralized treasury information.
It is done in a such a way that it will correct any upgrades that have
already taken place before this code is active.
This prevents an issue with the way that children are added to the
priority queue when building mining templates. In particular, it
ensures the child has already had priority item built for it before
adding to the prioirty queue since it is possible that the child has not
yet been seen under certain circumstances such as when there are
complicated transaction graphs of unconfirmed transactions.
This moves BgBlkTmplGenerator and the related logic to a separate file,
mining/bgblktmplgenerator.go.
This is part of an effort to split mining into several files to make the
package easier to navigate, and in preparation of adding additional test
coverage.
This moves the interfaces that are defined by mining to a separate file,
mining/interface.go.
This is part of an effort to split mining into several files to make the
package easier to navigate, and in preparation of adding additional test
coverage.
This moves txPriorityQueue and the related logic to a separate file,
mining/txpriorityqueue.go. Additionally, it moves the txPriorityQueue
tests to mining/txpriorityqueue_tests.go.
This is part of an effort to split mining into several files to make the
package easier to navigate, and in preparation of adding additional test
coverage.
This modifies the registration function to return an error as expected
in the case the same method type is registered more than once and adds
code to return an error when the parameter type is already registered
for some other method type.
The current code allowed the same method type to be registered again so
long as it had the same parameter type associated with it, which is not
desirable since it might have been registered with a different set of
flags and the new registration would simply be ignored.
This updates the blockchain module dependencies, the copyright year in
the files modified since the previous release, and serves as a base for
blockchain/v3.0.0.
The updated direct dependencies in this commit are as follows:
- github.com/decred/dcrd/blockchain/stake/v3@v3.0.0
- github.com/decred/dcrd/blockchain/standalone/v2@v2.0.0
- github.com/decred/dcrd/chaincfg/v3@v3.0.0
- github.com/decred/dcrd/dcrec/secp256k1/v3@v3.0.0
- github.com/decred/dcrd/dcrutil/v3 v3.0.0
- github.com/decred/dcrd/gcs/v2@v2.1.0
- github.com/decred/dcrd/txscript/v3@v3.0.0
The full list of updated direct dependencies since the previous
blockchain/v2.1.0 release are as follows:
- github.com/decred/dcrd/blockchain/stake/v3@v3.0.0
- github.com/decred/dcrd/blockchain/standalone/v2@v2.0.0
- github.com/decred/dcrd/chaincfg/v3@v3.0.0
- github.com/decred/dcrd/database/v2@v2.0.2
- github.com/decred/dcrd/dcrec/secp256k1/v3@v3.0.0
- github.com/decred/dcrd/dcrutil/v3 v3.0.0
- github.com/decred/dcrd/gcs/v2@v2.1.0
- github.com/decred/dcrd/txscript/v3@v3.0.0
- github.com/decred/dcrd/wire@v1.4.0
- github.com/decred/slog@v1.1.0
Finally, all modules in the repository are tidied to ensure they are
updated to use the latest versions hoisted forward as a result.
This updates the docs/README.md file, module hierarchy graphviz, and
module hierarchy diagram to reflect the new module version and the
removal of the chaincfg dependency.
This implements a complete rewrite of the gencerts tool, making the
tool suitable not only for generating server certificates, but client
keypairs as well. The following functionality is added:
* Local hostnames and interfaces are not automatically included in the
certificate. This allows clients to generate certificates which do
not leak their network interfaces to remote servers.
* The certificate and key names must be explicitly provided on the
command line after all flags. This allows clients to generate
keypairs with names like "client.pem" and "client.pem.key", rather
than the tool only generating files named "rpc.cert" and "rpc.key".
* The key algorithm may be specified to be any of P-256, P-384, P-521,
or Ed25519. The default algorithm is P-521, matching the previous
gencerts implementation.
The certificate creation code has been added directly to gencerts
rather than modifying the certgen package, since this package is used
by dcrd, dcrwallet, and other Decred servers to automatically generate
keys with all local interfaces pre-included.
This updates the rpcclient module dependencies, the copyright year in
the files modified since the previous release, and serves as a base for
rpcclient/v6.0.0.
The updated direct dependencies in this commit are as follows:
- github.com/decred/dcrd/dcrjson/v3@v3.1.0
- github.com/decred/dcrd/dcrutil/v3@v3.0.0
- github.com/decred/dcrd/gcs/v2@v2.1.0
- github.com/decred/dcrd/rpc/jsonrpc/types/v2@v2.1.0
The full list of updated direct dependencies since the previous
rpcclient/v5.0.1 release are as follows:
- github.com/decred/dcrd/dcrjson/v3@v3.1.0
- github.com/decred/dcrd/dcrutil/v3@v3.0.0
- github.com/decred/dcrd/gcs/v2@v2.1.0
- github.com/decred/dcrd/rpc/jsonrpc/types/v2@v2.1.0
- github.com/decred/dcrd/wire@v1.4.0
- github.com/decred/slog@v1.1.0
- github.com/gorilla/websocket@v1.4.2
Finally, all modules in the repository are tidied to ensure they are
updated to use the latest versions hoisted forward as a result.
This updates the docs/README.md file, module hierarchy graphviz, and
module hierarchy diagram to reflect the new module version.
It also updates the rpcclient/README.md file to reference the correct
major version on the documentation site.
This updates the blockchain and mempool packages for the recent
conversion to the new preferred error infrastructure to finish a TODO
that was mean to take advantage of it as well as address some other nits
such as comments that weren't updated properly and test formatting.
This updates the peer module dependencies, the copyright year in the
files modified since the previous release, and serves as a base for
peer/v2.2.0.
The updated direct dependencies in this commit are as follows:
- github.com/decred/dcrd/lru@v1.1.0
- github.com/decred/dcrd/txscript/v3@v3.0.0
The full list of updated direct dependencies since the previous
peer/v2.1.0 release are as follows:
- github.com/decred/dcrd/lru@v1.1.0
- github.com/decred/dcrd/txscript/v3@v3.0.0
- github.com/decred/dcrd/wire@v1.4.0
- github.com/decred/slog@v1.1.0
Finally, all modules in the repository are tidied to ensure they are
updated to use the latest versions hoisted forward as a result.
This modifies the mining prioritization logic to sort transactions by an aggregate fee based on a transaction’s ancestors in the mempool.
This modifies the mining prioritization logic to sort transactions by an
aggregate fee based on a transaction’s ancestors in the mempool.
Currently, the mining code prioritizes transactions by fee and only
includes them in the block template if they have no dependencies. When
a transaction is included in the block template, it is removed as a
dependency from transactions that depend on it, making those dependent
transactions eligible for block template inclusion.
Aggregating ancestor statistics for large graphs of transactions in the
mempool may have high computational costs. Performing this aggregation
in the block template generator would delay miners requesting a block
template since all of the aggregation would need to occur for each
transaction, at once. To solve this problem, the complexity is spread
over time such that the transaction statistics are updated with mempool
event hooks. Since the mempool is not locked during the entirety of
template generation, a mining view interface is exposed to safely
interact with a snapshot of the mempool.
The biggest risk in terms of performance are reorgs where transactions
with many descendants are added back to the mempool. The number of
transactions added to the mempool in this way is limited by the block
size and proof of work, but the mempool has no restrictions on the
number of ancestors tracked for a given transaction.
A potential - and not implemented - solution to this reorg problem would
be to establish a limit on the number of ancestors a transaction may
have in the mempool.
This updates the blockchain and mempool error types to
leverage go 1.13 errors.Is/As functionality as well as confirm to
the error infrastructure best practices.
This updates the gcs module dependencies, the copyright year in the
files modified since the previous release, and serves as a base for
gcs/v2.1.0.
The updated direct dependencies in this commit are as follows:
- github.com/decred/dcrd/blockchain/stake/v3@v3.0.0
The full list of updated direct dependencies since the previous
gcs/v2.0.1 release are as follows:
- github.com/decred/dcrd/blockchain/stake/v3@v3.0.0
- github.com/decred/dcrd/txscript/v3@v3.0.0
- github.com/decred/dcrd/wire@v1.4.0
Finally, all modules in the repository are tidied to ensure they are
updated to use the latest versions hoisted forward as a result.
This updates the blockchain/stake module dependencies, the copyright
year in the files modified since the previous release, and serves as a
base for blockchain/stake/v3.0.0.
The updated direct dependencies in this commit are as follows:
- github.com/decred/dcrd/database/v2@v2.0.2
- github.com/decred/dcrd/txscript/v3@v3.0.0
The full list of updated direct dependencies since the previous
blockchain/stake/v2.0.2 release are as follows:
- github.com/decred/dcrd/chaincfg/v3@v3.0.0
- github.com/decred/dcrd/database/v2@v2.0.2
- github.com/decred/dcrd/dcrec/secp256k1/v3@v3.0.0
- github.com/decred/dcrd/dcrutil/v3@v3.0.0
- github.com/decred/dcrd/txscript/v3@v3.0.0
- github.com/decred/dcrd/wire@v1.4.0
- github.com/decred/slog@v1.1.0
Finally, all modules in the repository are tidied to ensure they are
updated to use the latest versions hoisted forward as a result.
This updates the docs/README.md file, module hierarchy graphviz, and
module hierarchy diagram to reflect the new module version and the
removal of the chaincfg dependency.
This updates the map of known wallet RPC methods to match the latest
reality so a more useful error message is returned to the user in the
case they attempt to issue wallet commands to the dcrd RPC server
instead of the wallet one.
This corrects the code to return the expected RPC error in the case the
requested method is one known to be a wallet method or known to be
intentionally unimplemented.
Since dcrjson was updated to work with types instead of strings, parsing
a method that is not registered now fails, so the special error returns
are now handled there as opposed to the old approach of adding handlers
for certain method names which just returned the appropriate error.
This allows the standardCmdResult method to be simplified since it no
longer needs to include the logic for dealing with special handlers and
therefore it is updated accordingly.
Finally, the special handlers are removed since they are no longer
needed.
Previously you couldn't run simnet without --rejectnonstd so the rpctest
harness setup was left without this.
This ended up letting a bug slip through that would prevent tadds being
added to mempools and relayed through the network.
This updates the server configuration of the mempool to allow
transactions with the treasury transaction version to ensure they are
able to relay properly when/if the treasury agenda becomes active.
It also updates the test configuration to use the constant instead of a
hard-coded number.
This updates the simnet environment documentation for the changes that
prevent creating block templates for blocks that would lead to ticket
exhaustion.
This converts the series of checks that rejects old block versions once
a majority of the network has upgraded to a loop.
When there were only a few this didn't matter, but as the number grows,
it is nicer to only need to change the number in a single place.
This add the code necessary to reject old block versions once the
upgrade process to reach the block versions necessary to start the
treasury HFV has a super majority.
This modifies the mining template creation logic to make use of the new
ability to check if the template would result in an unrecoverable chain
due to inevitable ticket exhaustion along with an associated new mining
rule error.
This adds a new function named checkTicketExhaustion which will return
a new rule error if extending a given block with another block that contains a
specified number of tickets will result in an unrecoverable chain due to
inevitable ticket exhaustion along with tests to ensure proper
functionality.
The approach taken is such that it should be easy to use in a future
consensus change gated behind a vote if that is ultimately desired,
which I personally think would be a good idea.
An exported variant is also provided that takes the hash of the block to
extend for use by external callers such as the mining template code.
This removes a now unneeded check for unmineable transactions due to
block disapproval from the template generation code.
Previously this check was meant to ensure that the list of transactions
considered for inclusion in a block template did not include
transactions with an input referencing a regular transaction from a
parent disapproved block.
However this check is redudant due to check executed earlier in the
template building loop that asserts all inputs are valid utxos
according to the PoV of the parent block and taking into account whether
the new block being created will approve or disapprove it.
The check being removed had a bug due to the dcrutil.Tx being duplicated
without also copying the internal tree, which caused transactions to
later fail to be added to the template due to an unknown tree being
used.
This adds AdvanceToHeight to the chaingen harness to allow advancing the
chain to an arbitrary height while controlling the number of tickets
purchased per block after the first coinbase maturity.
This updates the copyright year in the files modified in the
blockchain/standalone module since the previous release and serves as a
base for blockchain/standalone/v2.0.0.
The full list of updated direct dependencies since the previous
blockchain/standalone/v1.1.0 release are as follows:
- github.com/decred/dcrd/wire@v1.4.0
This updates the docs/README.md file, module hierarchy graphviz, and
module hierarchy diagram to reflect the new module version and the
removal of the chaincfg dependency.