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 improves the accuracy of the comment on the IsTreasuryVoteInterval
function and also makes all code related to it more consistent with the
rest of the codebase.
This renames CalculateTSpendExpiry to CalcTSpendExpiry so it is more
consistent with all the other funcs in the package which are prefixed
with Calc and updates the comment accordingly along with correcting some
typos.
It also updates all of the callers in the repo accordingly.
This fixes a race that occurs when running TestHandleTSpendVotes test
cases in parallel. It fixes the race by specifying a new *dcrutil.Block
per test since *dcrutil.Block can't be safely shared across goroutines.
This updates the hdkeychain module dependencies, the copyright year in
the files modified since the previous release, and serves as a base for
hdkeychain/v3.0.0.
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
The full list of updated direct dependencies since the previous
hdkeychain/v2.1.0 release are as follows:
- github.com/decred/base58@v1.0.3
- github.com/decred/dcrd/chaincfg/v3@v3.0.0
- github.com/decred/dcrd/crypto/blake256@v1.0.0
- github.com/decred/dcrd/crypto/ripemd160@v1.0.1
- github.com/decred/dcrd/dcrec/secp256k1/v3@v3.0.0
- github.com/decred/dcrd/dcrutil/v3@v3.0.0
Further, the following dependencies that were required in the previous
hdkeychain/v2.1.0 release are no longer required:
- github.com/decred/dcrd/chaincfg/chainhash
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 existing code for calculating treasury spend window values, namely
CalculateTSpendWindowStart and CalculateTSpendWindowEnd, has a couple of
footguns:
- The starting value calculation returns totally invalid values without
an error when provided with a expiry that is prior to the first voting
window
- Expiry values that are invalid for the start calc are valid for the
end calc even though they should not be
As a result, the code for handling the error paths in the rpc server and
mining code produces error messages that don't make sense in some cases
because they blindly print the start value without checking the error.
To remove the aforementioned footguns and also address the incorrect
error messages, the following overview of changes are made:
- Replaces the CalculateTSpendWindowStart and CalculateTSpendWindowEnd
functions with a single combined CalcTSpendWindow function that
properly checks for expiries before the first possible voting interval
- Modifies the returned errors to match the new reality
- Shortens the prefix to Calc to match the rest of the function names in
the package
- Updates the incorrect error handling paths to avoid reporting the
values that are not guaranteed to be meaningful and modifies the error
messages to be more consistent
- Adds a comprehensive set of tests for the new function
Note that in addition to addressing the aforementioned issues, this
approach has at least a couple of other benefits:
- It is more efficient to have a single function with a single bounds
check
- Almost all callers outside of the tests need both the start and end
value anyway, so it allows more compact code
Finally, this updates all callers in the repository accordingly.
This modifies the IsCoinBaseTx function to retain the existing semantics
regarding coinbase detection logic once the treasury agenda activates.
Specifically, the existing consensus logic regarding the fast heuristic
for detecting whether or not a transaction is likely to be coinbase has
no restrictions regarding the number of outputs nor the the lengths of
the scripts.
Later, once a coinbase is actually validated by consensus, it is
required to have a payout to the treasury as well as a provably-prunable
output that identifies the block height.
This means that it is technically possible for a miner to create a
coinbase that burns coins if they so choose, even though, in practice,
it is exceedingly unlikely.
Since the new treasury spend transaction type looks similar enough to
existing coinbase transactions, they are also detected as coinbases
under the existing code.
To combat this, the new treasury code introduces logic which consists of
exempting transactions that look like treasury spends from being
identified as a coinbase. Unfortunately, the logic reports that a
transaction is not a coinbase when _any_ of the conditions that lead up
to the transaction being identified as a treasury spend are met instead
of when _all_ of the conditions are met.
The result is that the aforementioned semantics are changed which should
not be the case.
This resolves that by modifying the logic accordingly such that the
heuristic retains the same semantics for all transactions that are not
specifically identified to likely be a treasury spend.
It also adds tests to ensure the new behavior works as intended bringing
the test coverage of the function back up to 100%.
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.
The purpose of the standalone module is to avoid extra dependencies.
The treasury work unfortunately went against that goal and introduced a
dependency on txscript. This remedies that by defining the necessary
opcodes directly which is perfectly acceptable because they are used in
consensus code and thus can't be changed without a vote.
This should fix consumers requiring the rpcclient module at dcrd
master. Previously, this would fail, due to various undefined
treasury types, which has not been released.
This updates the txscript module dependencies and serves as a base for
txscript/v3.0.0.
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
The full list of updated direct dependencies since the previous
txscript/v2.1.0 release are as follows:
- github.com/dchest/siphash@v1.2.1
- github.com/decred/dcrd/chaincfg/v3@v3.0.0
- 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/dcrutil/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 that depend on txscript 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 rpc/jsonrpc/types module dependencies, the copyright
year in the files modified since the previous release, and serves as a
base for rpc/jsonrpc/types/v2.1.0.
The updated direct dependencies in this commit are as follows:
- github.com/decred/dcrd/dcrjson@v3.1.0
The full list of updated direct dependencies since the previous
rpc/jsonrpc/types/v2.0.0 release are as follows:
- github.com/decred/dcrd/dcrjson@v3.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 removes the need to RLock() the blockchain index when calling
tSpendCountVotes() and sumPastTreasuryExpenditure() by switching the
lookupNode call for a direct reference to the parent node while
iterating the chain backwards.
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.
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 modifies the example to make use of mock parameters instead of
actual parameters from chaincfg in order to avoid the otherwise
unnecessary dependency on it.
This cleans up the tests for verify message and also modifies them to
use the available mock parameters to avoid an otherwise unnecessary dep
on chaincfg.
This updates the chaincfg module dependencies and serves as a base for
chaincfg/v3.0.0.
The updated direct dependencies in this commit are as follows:
- github.com/decred/dcrd/wire@v1.4.0
The full list of updated direct dependencies since the previous
chaincfg/v2.3.0 release are as follows:
- github.com/decred/dcrd/wire@v1.4.0
Further, the following dependencies that were previously required in the
previous chaincfg/v2.3.0 release are no longer required:
- github.com/decred/dcrd/dcrec/edwards/v2
- github.com/decred/dcrd/dcrec/secp256k1/v2
This modifies the initial configuration error handling logic to avoid a
bunch of duplicate code and fix some cases that were not logging the
errors as expected.
It accomplishes this by consolidating the error reporting in a single
place in the caller and introducing a custom error type which signals
that the usage message should be suppressed in order to retain the
primary behavior the originally was the reason for the prints being in
the config function to begin with.
Also, the application name is passed into the function now since it is
needed in both places.
The standard library HTTP server writes all errors using standard error
by default when and error logger is not configured. Currently, an error
logger is not being set which means the errors completely bypass the
logging system.
Since the required error logger must be from the standard library
logging package and a custom logger is used instead, this creates a shim
to forward the log messages from a standard lib logger to the RPC server
logger and configures the HTTP server to use it accordingly.
This updates the connmgr module dependencies and serves as a base for
connmgr/v3.0.0.
The updated direct dependencies in this commit are as follows:
- github.com/decred/dcrd/wire@v1.4.0
- github.com/decred/slog@v1.1.0
The full list of updated direct dependencies since the previous
connmgr/v2.1.0 release are as follows:
- github.com/decred/dcrd/wire@v1.4.0
- github.com/decred/slog@v1.1.0
This updates the addrmgr module dependencies, the copyright year in the
files modified since the previous release, and serves as a base for
addrmgr/v1.2.0.
The updated direct dependencies in this commit are as follows:
- github.com/decred/dcrd/wire@v1.4.0
- github.com/decred/slog@v1.1.0
The full list of updated direct dependencies since the previous
addrmgr/v1.1.0 release are as follows:
- github.com/decred/dcrd/wire@v1.4.0
- github.com/decred/slog@v1.1.0
This updates the minimum known chain work values for the main and test
networks as follows:
mainnet: 0x00000000000000000000000000000000000000000013e6909b5a73128d52fc6f
testnet: 0x000000000000000000000000000000000000000000000000e41955f181d00f59
This adds checkpoints at the following heights:
mainnet:
- 237310
- 277940
- 318020
- 340120
- 362120
- 404170
- 424170
- 444170
- 464170
- 483600
testnet:
- 148320
- 213120
- 347140
- 411940
- 476740
- 515730
Note that this also includes some historical checkpoints to limit the
size of the gaps between each checkpoint to be around 3 months max.
This is being done because recent optimizations have sped up processing
to the point that larger gaps can trigger peers to get banned during IBD
in some cases.
This adds functionality to proactively evict SigCache entries when they
are nearly guaranteed to no longer be useful. It accomplishes this by
evicting entries related to transactions in the block that is 2 levels
deep from a newly processed block.
Proactively evicting entries reduces the likelihood of the SigCache
reaching maximum capacity quickly and then relying on random eviction,
which may randomly evict entries that are still useful.
This adds a uint64 short transaction hash to sigcache entries. This can
be used to proactively evict entries from the sigcache based on the
transaction that they are associated with.
This defines a shortTxHash method that generates a short 64-bit hash
from the standard 128-bit hash. It accomplishes this by using the
SipHash-2-4 hash function.
This is being introduced to track the transaction associated with a
signature cache entry at a reduced memory overhead.
This adds assertions to the existing treasury rpctest to verify that
treasury base transactions have the correct value even when the block
containing them has less than the maximum allowed of vote (SSGen)
transactions.
This adds the ability for the voting wallet to limit the total number of
votes issued, which is useful for some testing scenarios involving
blocks with less than the maximum number of votes.
Due to how the rpctest VotingWallet is currently structured
(specifically, the fact that it only tracks the absolute minimum amount
of tickets to advance the chain) it can't keep advancing the chain
indefinitely after limiting the number of votes for some blocks.
This is less than ideal, but sufficient for the tests that will be
introduced in future commits.
This adds assertions in the TestTreasury rpctest that verify the correct
behavior of the recently introduced gettreasuryspendvotes rpc command.
It also serves to ensure vote tallying of the underlying blockchain
corresponds to the expected ones.
The new gettreasuryspendvotes rpc command is useful to keep track of the
voting progress of treasury spend transactions as well as to query for
the status of old tspends.
When invoked without any parameters, the command tallies the vote counts
for all tspends currently in the node's mempool up to the current tip
block.
The first parameter ("Blocks") can be used to limit the block up to
which the tallies are performed, which is useful for historical queries.
The second parameter ("TSpends") can be used to narrow down the list of
tspends that should be queried. It can be used to query for tspends that
have already been mined.
A set of unit tests ensures proper behavior for the new command.