This moves a test in chaincfg which belongs to chainhash package.
The test case that has been moved has already been covered in
chainhash test suite, but instead of deleting the test case it has
been moved, so to have a stronger test suite.
This changes the behavior of peer disconnection logic, such that
permanent peers are actually removed from the connection manager when
requested, instead of just being disconnected and therefore triggering a
future retry.
Previously, this prevented the addnode [addr] remove from correctly
removing permanent peers. A connection retry attempt would always be
performed.
This adds standard wire tests for MsgCFTypes. Things done in these
commit:
- Add standard wire test for MsgCFTypes
- Fix a potential bug at BtcEncode: return an error if the number
of filter types exceed the maximum number of supported filter
types (256)
- Add an extended error checking for checking malformed encoded
data return correct errors.
This updates the main module to use version 2 of the mempool module.
The following is a summary of changes:
- Update all imports to use mempool/v2
- Update module requirements to include new module and remove no longer
needed old versions
- Add an override for the v2 module so CI is always builds with the
latest code
- Update rpcserver getrawmempool to make use of new mempool
VerboseTxDescs instead of the removed RawMempoolVerbose
- Update rpcserver getrawmempool to properly return the parameter
provided for the transaction type instead of the type of variable in
the case an invalid type is provided
- Update rpcserver getrawmempool to return the supported transaction
types in the error when an invalid type is provided
Currently, there is a tight coupling between the rpcserver and the
mempool by way of the RawMempoolVerbose function returning a
dcrjson.GetRawMempoolVerboseResult.
In order to remove the tight coupling, this introduces a new type and
function to the mempool module named VerboseTxDesc and VerboseTxDescs,
respectively, which provide all of the details necessary for the
rpcserver to be able to properly generate the dcrjson response
directly.
Also, it removes the old RawMempoolVerbose function and related
dependency imports on dcrjson since it is no longer required as a part
of moving to mempool/v2.
Note that since this constitutes a major break to the API, the mepool
module version will need to be bumped to version 2.
This removes the deprecated MinHighPriority constant as part of moving
to mempool/v2.
Note that since this constitutes a major break to the API, the mepool
module version will need to be bumped to version 2.
This serves as the final release of version 1 of the mempool module.
All future releases will be moving to version 2 of the module.
Consequently, it bumps the module version as follows:
- github.com/decred/dcrd/mempool@v1.2.0
It also removes the mempool override in the root module and updates it so building the
software will still produce binaries based on the v1 module until the v2
module is fully released.
This renames the flag that indicates whether or not the script engine is
executing a pay-to-script-hash script pair to a name that more
accurately describes its behavior.
An important (and easy for implementations to miss) aspect of the
CHECKSIG opcodes is that the full signature (signature plus hash type)
that is being checked is first removed from the script prior to
calculating the signature hash against which the signature is verified.
It appears the test in the upstream btcsuite code for this was removed
during the initial Decred port instead of being converted as it should
have been.
Consequently, this converts the relevant test so it is correct for
Decred and adds it to the reference tests. Note that the first of the
two added tests is to ensure the original signature is valid prior to
testing the actual removal condition.
This updates dcrctl to use version 2 of the dcrjson module and to make
use of the new separate type definitions provided by wallet so it
continues supporting communication with dcrwallet.
This updates the rpcclient module to use version 2 of the dcrjson module
and to make use of the new separate type definitions provided by wallet
which are no longer available directly in the new dcrjson module.
Since this constitutes a major break to the API, it also bumps the
module version to version 2.
While here, it adds an override for dcrjson/v2 to the root module now to
ensure builds and CI always run the latest code outside of releases.
It should also be noted that this only introduces the new module and
does not update any external modules to make use of it yet.
Consequently, it also removes the rpcclient override in the root module
so building the software will still produce binaries based on the v1
module until this v2 module is fully released.
This removes all wallet-specific type definitions and tests from the
dcrjson module since they are being moved into their own module that
lives in the dcrwallet repository.
Since this constitutes a major break to the API, it also bumps the
module version to version 2.
This moves the definition and associated code for the newtickets
notification to the chainsvrwsntfns.go file since it is served by the
chain RPC websocket server. It also moves the associated test to the
chainsvrwsntfns_test.go file
This moves the definition and associated code for the stakedifficulty
notification to the chainsvrwsntfns.go file since it is served by the
chain RPC websocket server.
This moves the definition and associated code for the
spentandmissedtickets notification to the chainsvrwsntfns.go file since
it is served by the chain RPC websocket server. It also moves the
associated test to the chainsvrwsntfns_test.go file accordingly.
This moves the definition and associated code for the winningtickets
notification to the chainsvrwsntfns.go file since it is served by the
chain RPC websocket server. It also moves the associated test to the
chainsvrwsntfns_test.go file accordingly.
This moves the command definitions and associated types for the
createrawsstx and createrawssrtx commands to the chainsvrcmds.go file
since they are served by the chain RPC server.
This adds the active coin type to the dcrjson.WalletInfoResult.
Since watching-only wallets do not store the coin type keys, the
CoinType field is tagged as "cointype,omitempty" so that it will be
omitted when the default value of 0 is set, as is the case when the
wallet has an error of kind dcrwallet/errors.WatchingOnly.
The location of CoinType in the struct is chosen in part because it will
not change the size of the struct because of the preceding bools that
leave room in padding for a 32-bit value.
This modifies all of the modules, with the exception of the root module,
to remove all replacement directives from their go.mod files and update
the requirements and module sums accordingly.
While it is nice to be able to build and test directly from each module
directory and have it pull in the latest untagged changes when
developing, having all of the overrides in each module makes it
infeasible to use the module tools to help maintain the modules and thus
makes it quite difficult to ensure they are all independently accurate
for external consumers.
By maintaining all of the overrides in the root module and invoking all
builds and tests from it, the overrides will apply to ensure the latest
code is being built and tested.
This also modifies the tests script used with in CI to run all of the
tests from the root module accordingly.
Currently, the memory pool policy is to allow votes which double spend
the same ticket (up to a maximum amount) since it is possible that the
same ticket is selected in competing branches and thus the double spend
must be allowed and will resolve itself depending on which chain is
ultimately extended.
A side effect of that is that it also currently accepts votes with
different hashes but otherwise both spend the same ticket and vote on
the same block. This can happen when there are multiple wallets casting
the vote with different settings such as when one has been upgraded to a
new stake version while the others have not or an improperly configured
wallet where the vote choices have been set on one, but not the others.
Consequently, this modifies the policy to explicitly reject these
duplicate votes while still allowing votes on competing branches.
It also adds tests to ensure the new functionality works as expected.
This modifies the check which limits the maximum allowed votes double
spending the same ticket to exactly the specified constant instead of
one more.
It also adds tests for the max vote double spend handling to both ensure
they are accepted up until the max, rejected thereafter, and that
removing votes allows them to be accepted again.
This modifies CreateVote in the mempool test harness to accept munge
functions similar to how CreateSignedTx works. This allows the test
code to more easily mutate the transactions as desired prior to them
being signed which provides greater flexibility.
While here, it also sets the block that is being voted on to the current
best chain tip of the harness. While there is not currently anything in
the tests that relies on that behavior, it will allow future tests to
more easily create votes which involve the block being voted on.
This removes the long deprecated --getworkkey option and associated
code. This realistically should have been done before Decred was even
launched as it was deprecated in the upstream code before dcrd was ever
even started.
This makes the version string printed by the -V/--version flag
consistent with dcrd. In particular it will now include the runtime
version, OS, and architecture.