This removes the deprecated getinfo method addrindex field from the
JSON-RPC API documentation.
This is part of the overall removal of the deprecated address index.
This removes support for the address index which also entails removal of
the --addrindex and --dropaddrindex flags as well as all related
indexing infrastructure.
The legacy index is now automatically dropped if it exists to ensure
clients that are upgrading are not left with unneeded data in their
databases.
This is part of the overall removal of the deprecated address index.
This removes the deprecated types for the searchrawtransactions method
along with their tests.
This is part of the overall removal of the deprecated address index.
This removes the AddrIndexer interface and related test infrastructure
since it is no longer used as of the removal of the address index code.
This is part of the overall removal of the deprecated address index.
This removes the deprecated searchrawtransactions method from the RPC
server along with associated tests and supporting code.
This is part of the overall removal of the deprecated address index.
This removes support for the deprecated searchrawtransactions method
from the RPC client.
This is part of the overall removal of the deprecated address index.
This removes the deprecated searchrawtransactions method from the
JSON-RPC API documentation.
This is part of the overall removal of the deprecated address index.
This deprecates the Checkpoints field of the chain parameters and
removes all manually-specified entries for all networks since manual
checkpoints no longer exist.
Historically, checkpoints have been manually specified and used both for
various optimizations and to protect against cheap DoS attacks by
rejecting forks deep in history. The primary motivation for manually
specifying the checkpoints was said optimizations, however, those
optimization portions have now been decoupled from checkpoints in favor
of other methods, so the only remaining use of checkpoints is the
aforementioned rejection of forks deep in history.
Thus, this reworks the old fork rejection logic to make it automatic
based on an ancestor that is two weeks worth of blocks behind the
hard-coded assumevalid block (clamped to the genesis block if necessary)
that is manually specified at each release as opposed to needing to
additionally manually specify checkpoints.
Note the distinction here between the hard-coded assumevalid block
specified at each release and the potentially overridden value specified
by a user via CLI configuration options. This is an important
distinction because old fork rejection affects consensus and thus must
not move around based on user configuration.
This approach means the user can still specify a more recent assume
valid hash or disable assume valid optimizations independently without
affecting the consensus logic while still removing the need to manually
specify additional checkpoints.
The following is a high level overview of the changes:
- Modifies the blockchain.Config struct as follows:
- Removes the LastestCheckpoint option
- Adds a AllowOldForks option
- Removes all code related to manually specified checkpoints and finding
candidates
- Removes the following errors since they are no longer used:
- ErrBadCheckpoint
- ErrCheckpointTimeTooOld
- Renames checkpointNode to rejectForksCheckpoint to make it clear that
is the only thing it applies to
- Adds logic to potentially reject forks deep in history as follows:
- Do not reject old forks if they are manually allowed or the
hard-coded assumevalid block is not specified for the network
- Automatically choose an ancestor that is two weeks worth of blocks
prior to the hard-coded assumevalid block (clamped to the genesis
block if necessary)
- Replaces --nocheckpoints CLI option with --allowoldforks
- Updates doc.go to match the changes to the CLI options
This adds a new field to the blockchain instance to store a cached
version of the number of expected blocks in two weeks to avoid repeated
calculation.
Currently, the getblockchainfo RPC implementation directly returns the
internal threshold state strings defined in blockchain. This is not
ideal since it means that any changes to the internal implementation
could inadvertently change the RPC results without being noticed.
It also means that consumers of the RPC have to import the blockchain
module solely to access those constants. Not only does that mean an
extremely heavy dependency is required just to access those constants,
the module is eventually going to be removed in favor of making the
blockchain package an internal package meaning clients will no longer
have access to it.
Consequently, this updates the getblockchaininfo RPC implementation to
decouple the agenda status strings by converting the internal blockchain
threshold state to use the new agenda status string constants defined in
the rpc/jsonrpc/types module.
This adds constants for the possible status strings in the agenda info
that is a part of the getblockchaininfo result.
This is being done with the intent of decoupling the internal blockchain
implementation of the threshold states from the RPC results.
This retroactively fixes a bug that resulted in the fee limit not being
properly enforced for revocation transactions. The exploitation risk of
this was that in a split transaction, one party could intentionally
increase the fee paid to miners for another party.
It is no longer possible to exploit this on mainnet since the automatic
revocations agenda has activated, which enforces that the fee must be
zero for revocation transactions.
The fee limit for revocation transactions was never violated on mainnet
so this logic can be safely corrected without impacting consensus. This
has been validated by running a full sync with checkpoints and assume
valid disabled.
Currently, the p2p and rpcserver handlers that deal with compact filters
essentially duplicate the logic for dealing with the associated header
proof and are also required to understand the structure of the proof in
the form of knowing the associated index. This is not ideal since there
is no guarantee that a given index will always be the same through
consensus changes.
With those points in mind, this reworks the header proof logic slightly
to consolidate it by introducing a new HeaderProof struct to the
blockchain that houses a header commitment inclusion proof and
associated proof index and updating the FilterByBlockHash method to
return the header proof along with the filter and updates the p2p and
rpcserver handlers and associated interfaces and tests accordingly.
The result is that the aforementioned p2p and rpcserver handlers for
obtaining compact filters no longer need to understand anything about
the proofs. It is also useful for any future header commitments too
since the same logic will hold true for those instances as well.
This removes the following errors that are no longer used now that there
has been a new major module version bump:
- ErrCheckpointTimeTooOld
- ErrTooManyTransactions
- ErrInvalidTxOutputs
- ErrSSRtxPayees
This adds an exported method to the block index to retrieve the best
header node under the block index mutex and updates the various call
sites that do it manually to use the newly exported function instead.
This removes the check for whether or not the block height is after the
height of the final checkpoint when deciding whether to send a vote
notification since it is no longer necessary or has any effect.
The reason it no longer has any effect is because there is a check prior
to it that ensures the the chain is considered current and the more
recent headers-first syncing means the chain will not be considered
current until the block associated with the best known header is reached
which is always ahead of any checkpoint.
This calls out the concurrency semantics for some exported query
functions to ensure callers are aware they are safe for concurrent
access to be more consistent with other exported methods in the package.
This removes the treasury and auto revocations agenda flags from the
several functions since it is now unused due to it being removed from
the stake.DetermineTxType function.
This updates stake.DetermineTxType to use the tx version to check if the
treasury agenda is active rather than relying on the agenda flag.
This is safe since the treasury agenda has activated and there are no
transactions with a transaction version greater than or equal to the
treasury transaction version in any blocks prior to the agenda
activating.
This removes the treasury agenda flag from the stake.IsSSGen function
since it is now unused due to it being removed from the stake.CheckSSGen
function.
This removes the treasury agenda flag from the stake.CheckSSGen
function since it is now unused due to it being removed from the
stake.CheckSSGenVotes function.
This updates the stake.CheckSSGenVotes function to remove the treasury
agenda check, but still retain the logic to reject vote transactions
that contain a null data script in the last output but don't have a
transaction version equal to the treasury transaction version.
This is now safe since:
- The treasury agenda has activated
- There are no transactions that violate this rule in any blocks prior
to the agenda activating
This removes the auto revocations agenda flag from the stake.IsSSRtx
function since it is now unused due to it being removed from the
stake.CheckSSRtx function.
This updates the stake.CheckSSRtx function to use the transaction
version rather than the auto revocations agenda flag to determine
whether to apply additional checks.
This is now safe since:
- The automatic revocations agenda has activated
- Consensus rules enforce that the revocation transaction version MUST
be 2 if the automatic revocations agenda is active
- There are no revocations with a transaction version greater than or
equal to 2 in any blocks prior to the agenda activating on mainnet
Upcoming changes constitute breaking public API changes to the
blockchain/stake 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 gcs
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 removes the type and associated code for the deprecated
notifyspentandmissedtickets RPC.
This is part of the overall removal of deprecated RPCs related to missed
and expired tickets.
This removes the NTSpentAndMissedTickets notification and associated
code to send the notification now that it is no longer used.
It also updates the TicketNotification struct to only include the new
tickets since it is now only used for that purpose.
This removes the deprecated notifyspentandmissedtickets 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 notifyspentandmissed method from
the RPC client.
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
existsexpiredtickets RPC.
This is part of the overall removal of deprecated RPCs related to missed
and expired tickets.
This removes the deprecated existsexpiredtickets 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 existsexpiredtickets 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 existsexpiredtickets method from the
JSON-RPC API documentation.
This is part of the overall removal of deprecated RPCs related to missed
and expired tickets.