Skip to content

dcrd v1.8.0

Compare
Choose a tag to compare
@davecgh davecgh released this 13 Jun 20:15
· 356 commits to master since this release
release-v1.8.0
84df486

This is a new major release of dcrd. Some of the key highlights are:

  • Two new consensus vote agendas which allow stakeholders to decide whether or
    not to activate support for the following:
    • Changing the Proof-of-Work hashing algorithm to BLAKE3 and the difficulty algorithm to ASERT
    • Changing the Proof-of-Work and Proof-of-Stake subsidy split from 10%/80% to 1%/89%
  • Separation of block hash from Proof-of-Work hash
  • BLAKE3 CPU mining support
  • Initial sync time reduced by about 20%
  • Runtime memory management optimizations
  • Faster cryptographic signature validation
  • Low fee transaction rejection
  • Unspent transaction output set size reduction
  • No more checkpoints
  • Improved network protocol message responsiveness
  • Header proof commitment hash storage
  • Address index removal
  • Several CLI options deprecated
  • Various updates to the RPC server:
    • Total coin supply output correction
    • More stable global communication over WebSockets
    • Winning ticket notifications when unsynced mining on test networks
    • Several other notable updates, additions, and removals related to the JSON-RPC API
  • Infrastructure improvements
  • Miscellaneous network and protocol optimizations
  • Quality assurance changes

For those unfamiliar with the voting process in Decred, all code needed in order to support each of the aforementioned consensus changes is already included in this release, however it will remain
dormant until the stakeholders vote to activate it.

For reference, the consensus change work was originally proposed and approved for initial implementation via the following Politeia proposal:

The following Decred Change Proposals (DCPs) describe the proposed changes in detail and provide full technical specifications:

Upgrade Required

It is extremely important for everyone to upgrade their software to this latest release even if you don't intend to vote in favor of the agenda. This particularly applies to PoW miners as failure to upgrade will result in lost rewards after block height 777240. That is estimated to be around June 29th, 2023.

Downgrade Warning

The database format in v1.8.0 is not compatible with previous versions of the software. This only affects downgrades as users upgrading from previous versions will see a one time database migration.

Once this migration has been completed, it will no longer be possible to downgrade to a previous version of the software without having to delete the database and redownload the chain.

The database migration typically takes around 4-6 minutes on HDDs and 2-3 minutes on SSDs.

Notable Changes

Two New Consensus Change Votes

Two new consensus change votes are now available as of this release. After upgrading, stakeholders may set their preferences through their wallet.

Change PoW to BLAKE3 and ASERT

The first new vote available as of this release has the id blake3pow.

The primary goals of this change are to:

  • Increase decentralization of proof of work mining by obsoleting the current specialized hardware (ASICs) that is only realistically available to the existing highly centralized mining monopoly
  • Improve the proof of work mining difficulty adjustment algorithm responsiveness
  • Provide more equal profitability to steady state PoW miners versus hit and run miners

See the following for more details:

Change PoW/PoS Subsidy Split to 1/89 Vote

The second new vote available as of this release has the id changesubsidysplitr2.

The proposed modification to the subsidy split in tandem with the change to the PoW hashing function is intended to break up the mining cartel and further improve decentralization of the issuance process.

See the following for more details:

Separation of Block Hash from Proof-of-Work Hash

A new Proof-of-Work (PoW) hash that is distinct from the existing block hash is now used for all consensus rules related to PoW verification.

Block hashes have historically served multiple roles which include those related to proof of work (PoW). As of this release, the roles related to PoW are now solely the domain of the new PoW hash.

Some key points related to this change are:

  • The new PoW hash will be exactly the same as the existing block hash for all blocks prior to the activation of the stakeholder vote to change the PoW hashing algorithm
  • The block hash continues to use the existing hashing algorithm
  • The block hash will no longer have the typical pattern of leading zeros upon activation of the PoW hashing algorithm
  • The PoW hash will have the typical pattern of leading zeros both before and after the activation of the new PoW hashing algorithm

BLAKE3 CPU Mining Support

The internal CPU miner has been significantly optimized to provide much higher hash rates, especially when using multiple cores, and now automatically mines using the BLAKE3 algorithm when the blake3pow agenda is active.

Initial Sync Time Reduced by About 20%

The amount of time it takes to complete the initial chain synchronization process with default settings has been reduced by about 20% versus the previous release.

Runtime Memory Management Optimizations

The way memory is managed has been optimized to provide performance enhancements to both steady-state operation as well as the initial chain sync process.

The primary benefits are:

  • Lower maximum memory usage during transient periods of high demand
  • Approximately a 10% reduction to the duration of the initial sync process
  • Significantly reduced overall total memory allocations (~42%)
  • Less overall CPU usage for the same amount of work

Faster Cryptographic Signature Validation

Similar to the previous release, this release further improves some aspects of the underlying crypto code to increase its execution speed and reduce the number of memory allocations. The overall result is a 52% reduction in allocations and about a 1% reduction to the verification time for a single signature.

The primary benefits are:

  • Improved vote times since blocks and transactions propagate more quickly throughout the network
  • Approximately a 4% reduction to the duration of the initial sync process

Low Fee Transaction Rejection

The default transaction acceptance and relay policy is no longer based on priority and instead now immediately rejects all transactions that do not pay the minimum required fee.

This provides a better user experience for transactions that do not pay enough fees.

For some insight into the motivation for this change, prior to the introduction of support for child pays for parent (CPFP), it was possible for transactions to essentially become stuck forever if they didn't pay a high enough fee for miners to include them in a block.

In order to prevent this, a policy was introduced that allowed relaying transactions that do not pay enough fees based on a priority calculated from the fee as well as the age of coins being spent. The result is that the priority slowly increased over time as the coins aged to ensure such transactions would eventually be relayed and mined. In order to prevent abuse the behavior could otherwise allow, the policy also included additional rate-limiting of these types of transactions.

While the policy served its purpose, it had some downsides such as:

  • A confusing user experience where transactions that do not pay enough fees and also are not old enough to meet the dynamically changing priority requirements are rejected due to having insufficient priority instead of not paying enough fees as the user might expect
  • The priority requirements dynamically change over time which leads to non-deterministic behavior and thus ultimately results in what appear to be intermittent/transient failures to users

The policy is no longer necessary or desirable given such transactions can now use CPFP to increase the overall fee of the entire transaction chain thereby ensuring they are mined.

Unspent Transaction Output Set Size Reduction

The set of all unspent transaction outputs (UTXO set) no longer contains unspendable treasurybase outputs.

A treasurybase output is a special output that increases the balance of the decentralized treasury account which requires stakeholder approval to spend funds. As a result, they do not operate like normal transaction outputs and therefore are never directly spendable.

Removing these unspendable outputs from the UTXO set reduces its overall size.

No More Checkpoints

This release introduces a new model for deciding when to reject old forks to make use of the hard-coded assumed valid block that is updated with each release to a recent block thereby removing the final remaining usage of checkpoints.

Consequently, the --nocheckpoints command-line option and separate findcheckpoints utility have been removed.

Improved Network Protocol Message Responsiveness (getheaders/getcfilterv2)

All protocol message requests for headers (getheaders) and version 2 compact filters (getcfilterv2) will now receive empty responses when there is not any available data or the peer is otherwise unwilling to serve the data for a variety of reasons.

For example, a peer might be unwilling to serve data because they are still performing the initial sync or temporarily no longer consider themselves synced with the network due to recently coming back online after being unable to communicate with the network for a long time.

This change helps improve network robustness by preventing peers from appearing unresponsive or stalled in such cases.

Header Proof Commitment Hash Storage

The individual commitment hashes covered by the commitment root field of the header of each block are now stored in the database for fast access. This provides better scaling for generating and serving inclusion proofs as more commitments are added to the header proof in future upgrades.

Address Index Removal (--addrindex, --dropaddrindex)

The previously deprecated optional address index that could be enabled via --addrindex and removed via --dropaddrindex is no longer available. All of the information previously provided from the address index, and much more, is available via dcrdata.

Several CLI Options Deprecated

The following CLI options no longer have any effect and are now deprecated:

  • --norelaypriority
  • --limitfreerelay
  • --blockminsize
  • --blockprioritysize

They will be removed in a future release.

RPC Server Changes

The RPC server version as of this release is 8.0.0.

Total Coin Supply Output Correction (getcoinsupply)

The total coin supply reported by getcoinsupply will now correctly include the coins generated as a part of the block reward for the decentralized treasury as intended.

As a result, the amount reported will now be higher than it was previously. It is important to note that this issue was only an RPC display issue and did not affect consensus in any way.

More Stable Global Communication over WebSockets

WebSocket connections now have longer timeouts and remain connected through transient network timeouts. This significantly improves the stability of high-latency connections such as those communicating across multiple continents.

Winning Ticket Notifications when Unsynced Mining on Test Networks (winningtickets)

Clients that subscribe to receive winningtickets notifications via WebSockets with notifywinningtickets will now also receive the notifications on test networks prior to being fully synced when the --allowunsyncedmining CLI option is provided.

See the following for API details:

Transaction Fee Priority Fields on Mempool RPC Deprecated (getrawmempool)

Due to the removal of the policy related to low fee transaction priority, the startingpriority and currentpriority fields of the results of the verbose output of the getrawmempool RPC are now deprecated. They will always be set to 0 and are scheduled to be removed in a future version.

See the getrawmempool JSON-RPC API Documentation for API details.

Removal of Raw Transaction Search RPC (searchrawtransactions)

The deprecated searchrawtransactions RPC, which could previously be used to obtain all transactions that either credit or debit a given address via RPC is no longer available.

Callers that wish to access details related to addresses are encouraged to use dcrdata instead.

Removal of Address Index Status Field on Info RPC (getinfo)

The addrindex field of the getinfo RPC is no longer available.

See the getinfo JSON-RPC API Documentation for API details.

Removal of Missed and Expired Ticket RPCs

Now that missed and expired tickets are automatically revoked by the consensus rules, all RPCs related to querying and requesting notifications for missed and expired tickets are no longer available.

In particular, the following deprecated RPCs are no longer available:

  • missedtickets
  • rebroadcastmissed
  • existsmissedtickets
  • existsexpiredtickets
  • notifyspentandmissedtickets

Updates to Work RPC (getwork)

The getwork RPC will now return an error message immediately if block template generation is temporarily unable to generate a template indicating the reason. Previously, the RPC would block until a new template was eventually generated which could potentially be an exceedingly long time.

Additionally, cancelling a getwork invocation before the work has been fully generated will now cancel the underlying request which allows the RPC server to immediately service other queued work requests.

See the getwork JSON-RPC API Documentation for API details.

Changelog

This release consists of 439 commits from 18 contributors which total to 408 files changed, 25840 additional lines of code, and 22871 deleted lines of code.

All commits since the last release may be viewed on GitHub here.

Protocol and network:

Transaction relay (memory pool):

Mining:

RPC:

dcrd command-line flags and configuration:

dcrd server runtime interface changes:

findcheckpoint utility changes:

Documentation:

Contrib changes:

Developer-related package and module changes:

Developer-related module management:

Testing and Quality Assurance:

Misc:

Code Contributors (alphabetical order):

  • Abirdcfly
  • Dave Collins
  • David Hill
  • Donald Adu-Poku
  • Eng Zer Jun
  • Jamie Holdstock
  • JoeGruff
  • Jonathan Chappelow
  • Josh Rickmar
  • Julian Y
  • Matheus Degiovani
  • Ryan Staudt
  • Sef Boukenken
  • arjundashrath
  • matthawkins90
  • norwnd
  • peterzen
  • 刘昆