This removes support for the deprecated existsmissedtickets method from
the RPC client.
This is part of the overall removal of deprecated RPCs related to missed
and expired tickets.
This removes the deprecated existsmissedtickets method from the JSON-RPC
API documentation.
This is part of the overall removal of deprecated RPCs related to missed
and expired tickets.
This removes the type and associated code for the deprecated
rebroadcastmissed RPC.
This is part of the overall removal of deprecated RPCs related to missed
and expired tickets.
This removes the deprecated rebroadcastmissed method from the RPC
server.
This is part of the overall removal of deprecated RPCs related to missed
and expired tickets.
This removes the deprecated rebroadcastmissed method from the JSON-RPC
API documentation.
This is part of the overall removal of deprecated RPCs related to missed
and expired tickets.
This removes the types and associated code for the deprecated
missedtickets RPC.
This is part of the overall removal of deprecated RPCs related to missed
and expired tickets.
This removes the deprecated missedtickets method from the RPC server.
This is part of the overall removal of deprecated RPCs related to missed
and expired tickets.
This removes support for the deprecated missedtickets method from the
RPC client.
This is part of the overall removal of deprecated RPCs related to missed
and expired tickets.
This removes the deprecated missedtickets method from the JSON-RPC API
documentation.
This is part of the overall removal of deprecated RPCs related to missed
and expired tickets.
This bumps the major version of the JSON RPC server in anticipation of
upcoming changes to remove deprecated RPCs related to missed and expired
tickets.
This is part of the overall removal of deprecated RPCs related to missed
and expired tickets.
This update the test chain generator to use hard coded values for the
subsidy calcs since the chaincfg params are now deprecated and the
values are the same for all networks.
This updates wsNotificationManager queueHandler to avoid checking if the
channel is closed since it never is. The out label is also removed in
favour of doing needed cleanup on context cancellation.
This implements a subsidy cache with funcs to calculate subsidies for
proof-of-work, votes, and the treasury and includes a full suite of
tests.
It consists of ports of the related code in blockchain/standalone with
the following modifications:
- Removes the subsidy split parameters from SubsidyParams since the
chaincfg implementations are deprecated
- Uses hard-coded constants for the PoW, PoS, and treasury splits both
prior to and after the activation of DCP0010
- Removes the version 1 methods and renames the version 2 variants to
take their place:
- CalcWorkSubsidyV2 -> CalcWorkSubsidy
- CalcStakeVoteSubsidyV2 -> CalcStakeVoteSubsidy
- Consolidates the tests specific to the decentralized treasury agenda
into their counterparts
- Includes additional maintainer notes with the expected way to update
the code without needing a major module bump should it ever be
necessary
This deprecates the per-network subsidy split parameters for the
following reasons.
- They are the same on all networks so there really is no good reason to
parameterize them as such
- The subsidy calculation code can be simplified and made slightly more
efficient without the unnecessary parameterization
This reworks the tests that deal with signing random messages with
random private keys and recovering the associated public key to make
them more consistent with modern practices in the code as well as to
expand the testing methodology to include additional assurances.
Specifically, the relevant test now:
- Signs random representative hashes instead of a fixed non-hashed message
- Signs, recovers, and verifies both the compressed and uncompressed
public key variants for each iteration
- Ensures mutating a random bit in the good signature results in failure
to recover the original public key
- Ensures mutating a random bit in the message hash that was originally
signed results in failure to recover the original public key from the
good signature
This adds tests for compact signature generation and associated public
key recovery for both the positive and negative paths.
The following is a high-level overview of the changes:
- Add tests to ensure test data that was independently verified with the
Sage computer algebra system produces the expected results
- Add tests which are specifically designed to exercise all of the
recovery failure paths
This converts the error handling in compact signature recovery to be
consistent with the rest of the code base such that it returns concrete
errors that support errors.Is/As and thus are programmatically
detectable by callers.
Currently the code that rejects old block versions once the majority of
the network has upgraded is performed using a loop that iterates
backwards from latest enforced block version while checking for a
majority upgrade at each version. This is inefficient for blocks early
in the chain since it means multiple versions need to be checked when it
isn't really necessary.
This optimizes the relevant code by taking into account that the
relevant enforcement semantics reduce to the following:
- Block versions greater than or equal to the latest enforced block
version can never be rejected for being old
- Block versions must be rejected when the majority of the network has
upgraded to ANY version greater than that version
The following timing information obtained from profiling shows the
overall reduction achieved with the optimized code for mainnet:
existing: Total time to check old versions for 645603 headers: 10.61118s
optimized: Total time to check old versions for 645603 headers: 3.52555s
This adds a test to sign and verify random data in addition to the
existing tests the deal with known good data and edge conditions.
Specifically, the test:
- Generates random keys and messages with each run from a new random
seed and log that seed in the event of failure
- Signs the rand message with the random key and ensures the produced
signature verifies correctly
- Ensures mutating a random bit in each good signature results in that
mutated signature failing to verify the original message
- Ensures mutating a random bit in each message hash that was originally
signed results in the original good signature failing to verify the
new mutated message
Although the ECDSA code has been extensively tested through usage and
external fuzz testing, there are not currently any unit tests for the
non-compact signing and verification path.
This resolves that by adding signing and verification tests for both the
positive and negative paths. The following is a high-level overview of
the changes:
- Create new known good test data that is easily reproducible and has
been independently verified with the Sage computer algebra system
- The test data includes the original messages so the resulting hashes
are independently verifiable and have a known source
- The test data includes variations of signing the same data with
different keys and nonces, both deterministically generated via
RFC6979 and random, and signing different data with the same keys
- Add tests to ensure the aforementioned test data that was
independently verified produces the expected results
- Add tests which are specifically designed to exercise conditions that
lead to invalid signatures
- Add tests to help ensure the signature verification code fails to
verify edge conditions as expected by crafting signatures that are
specifically designed to hit them
This refactors the primary logic for the regular ECDSA signing code to a
separate function that accepts an arbitrary nonce. The primary
motivation is to facilitate upcoming unit tests which aim to fully test
both the positive and negative paths, however, it is also beneficial in
that it provides more flexibility for potentially using other nonce
generation mechanisms in the future should it be necessary.
Upcoming changes constitute breaking public API changes to the
rpcclient 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)
Upcoming changes constitute breaking public API changes to the
rpc/jsonrpc/types 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)
This adds a script to the contrib directory that initializes a Go
multi-module workspace and adds all of the modules provided by the dcrd
repository to it on an as needed basis. Note that workspaces require Go
1.18+.
This is useful when developing across multiple modules in the repository
and allows development environments that make use of the Go language
server (aka gopls), such as VSCode, to provide full support without also
needing to temporarily create replacements in the various go.mod files
or individually add every module.
Do note, however, that workspaces are local, so final submissions to the
repository will still require the appropriate changes to the relevant
go.mod files to ensure resolution outside of the workspace.
Finally, it also updates the README.md in the contrib directory
accordingly.
This fixes an issue with indexers wait for sync where the indexer gets
synced before a sync subcsriber is created. The sync subscriber is left
idling, waitingfor the next update which blocks the caller. The index
subscriber has been updated to periodically update sync subcribers
of all subscribed indexers to it as a result.
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
* Updated the minimum recommended Disc Space from 12 GB to 16 GB,
* Added an estimate of ~2 GB/yr
* Followed the SI style guide for units: A space is always used to separate the unit from
the number.
With the release of Go 1.18, the supported versions listed in the
README and used in the go.yml workflow should be 1.17 and 1.18.
Also update the golangci-lint to v1.45.2
Upcoming changes constitute breaking public API changes to the
blockchain 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)
The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.
This commit also refactor several cleanup logic by using `t.Cleanup`
instead of `defer`.
Reference: https://pkg.go.dev/testing#T.TempDir
Reference: https://pkg.go.dev/testing#T.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Profiling shows that around 7.5% of the time in scalar base
multiplication is attributed to duffcopy. Upon further examination,
this is the result of a combination of the range statement making copies
of the bytes and the need to construct a Jacobian point from the
individual field values stored in the in-memory byte points table.
This optimizes the function to avoid that as follows:
- Perform the conversion to Jacobian once when the affine byte table is
decompressed from the stored values
- Make use of those Jacobian points directly
- Use an indexed for loop instead of a range over the bytes
- Perform the calculation using the result variable directly instead of
via a local variable that is copied to the result
The following benchmark results show the speedup is in line with the
expected gains per the profiling results:
name old time/op new time/op delta
------------------------------------------------------------------------------
ScalarBaseMultNonConst 24.1µs ±22% 22.5µs ± 2% -6.97% (p=0.000 n=98+96)