Commit Graph

6315 Commits

Author SHA1 Message Date
Dave Collins
af533c170a
rpc/jsonrpc/types: Remove getinfo addrindex field.
This removes the deprecated addrindex field from the getinforesult type.

This is part of the overall removal of the deprecated address index.
2022-05-19 17:08:07 -05:00
Dave Collins
55154501b7
rpcserver: Remove getinfo addrindex field.
This removes the deprecated getinfo method addrindex field from the
RPC server.

This is part of the overall removal of the deprecated address index.
2022-05-19 17:08:07 -05:00
Dave Collins
3c351a372b
docs: Update indexers readme for removed indexes. 2022-05-19 17:08:06 -05:00
Dave Collins
9618f1c118
docs: Update indexers readme module path. 2022-05-19 17:08:06 -05:00
Dave Collins
e0a8f01cb0
docs: Remove getinfo addrindex field JSON-RPC API.
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.
2022-05-19 17:08:06 -05:00
Dave Collins
d8051da345
server/indexers: Remove address index support.
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.
2022-05-19 17:08:05 -05:00
Dave Collins
df83eeccf9
rpc/jsonrpc/types: Remove searchrawtransactions.
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.
2022-05-19 17:08:05 -05:00
Dave Collins
dca095f9ba
rpcserver: Remove unused AddrIndexer interface.
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.
2022-05-19 17:08:04 -05:00
Dave Collins
30db38e7d7
rpcserver: Remove searchrawtransactions.
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.
2022-05-19 17:08:04 -05:00
Dave Collins
a32fab1663
rpcclient: Remove searchrawtransactions.
This removes support for the deprecated searchrawtransactions method
from the RPC client.

This is part of the overall removal of the deprecated address index.
2022-05-19 17:08:03 -05:00
Dave Collins
100701c9e9
docs: Remove searchrawtransactions JSON-RPC API.
This removes the deprecated searchrawtransactions method from the
JSON-RPC API documentation.

This is part of the overall removal of the deprecated address index.
2022-05-19 17:07:59 -05:00
Dave Collins
55ac703b41
chaincfg: Deprecate Checkpoints and remove entries.
This deprecates the Checkpoints field of the chain parameters and
removes all manually-specified entries for all networks since manual
checkpoints no longer exist.
2022-05-19 13:03:30 -05:00
Dave Collins
7575f46971
chaincfg: Deprecate LatestCheckpointHeight.
This method is no longer used since manual checkpoints no longer exist.
2022-05-19 13:03:29 -05:00
Dave Collins
cdadd9874a
multi: Rework old fork rejection logic.
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
2022-05-19 13:03:29 -05:00
Dave Collins
13d44674ad
blockchain: Avoid repeated blks in 2 weeks calc.
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.
2022-05-19 13:03:28 -05:00
Dave Collins
d4a0310073
findcheckpoints: Remove utility.
This utility is no longer be necessary since the manual checkpoint logic
is being reworked in upcoming commits.
2022-05-19 13:03:27 -05:00
Dave Collins
f31191a8c8
rpcserver: Decouple agenda info status strings.
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.
2022-05-18 20:43:52 -05:00
Dave Collins
1fe440d0a6
rpc/jsonrpc/types: Add agenda status constants.
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.
2022-05-18 20:43:51 -05:00
Ryan Staudt
46305c7bf5 blockchain: Fix revocation fee limit bug.
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.
2022-05-17 01:08:29 -05:00
Dave Collins
974f80d1e5
multi: Consolidate header proof logic.
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.
2022-05-14 17:28:50 -05:00
Dave Collins
39db46a4a5
blockchain: Remove unused errors.
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
2022-05-14 03:18:42 -05:00
Dave Collins
bbccddf959
blockchain: Optimize stake node pruning.
This optimizes the logic that prunes stake nodes when connecting blocks
to make use of the best known header instead of the latest known
checkpoint.
2022-05-13 02:13:26 -05:00
Dave Collins
68fc0c5d4e
blockchain: Consolidate best header access.
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.
2022-05-13 02:13:25 -05:00
Dave Collins
69b653d305
blockchain: Export block index flush.
This exports the block index flush function to make it more consistent
with the other funcs that are safe for concurrent access.
2022-05-13 02:13:21 -05:00
Dave Collins
bc06c8da71
server: Remove unnecessary vote ntfn check.
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.
2022-05-11 18:38:40 -05:00
Dave Collins
21be8a629e
blockchain: Comment concurrency semantics.
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.
2022-05-11 18:08:32 -05:00
Dave Collins
d1417864ab
docs: Add release notes for v1.7.2. 2022-05-11 17:59:00 -05:00
Dave Collins
bf162712d9
multi: Ensure newline at end of file. 2022-05-09 19:38:24 -05:00
Ryan Staudt
1aa1afce5d multi: Remove agenda flags from several funcs.
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.
2022-05-08 11:47:32 -05:00
Ryan Staudt
e0fe9a8cad multi: Remove agenda flags from DetermineTxType.
This removes the treasury and auto revocations agenda flags from the
stake.DetermineTxType since they are no longer used.
2022-05-08 11:47:32 -05:00
Ryan Staudt
c93605d294 stake: Tx ver as agenda proxy in DetermineTxType.
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.
2022-05-08 11:47:32 -05:00
Ryan Staudt
065222e2bc multi: Remove treasury flag from several funcs.
This removes the treasury agenda flag from the several functions since
it is now unused due to it being removed from the stake.IsSSGen
function.
2022-05-08 11:47:32 -05:00
Ryan Staudt
5b8b1f7b3d multi: Remove treasury flag from IsSSGen.
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.
2022-05-08 11:47:32 -05:00
Ryan Staudt
df64b960e8 multi: Remove treasury flag from CheckSSGen.
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.
2022-05-08 11:47:32 -05:00
Ryan Staudt
e587ae33e1 multi: Remove treasury flag from CheckSSGenVotes.
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
2022-05-08 11:47:32 -05:00
Ryan Staudt
50684f8152 multi: Remove auto revoc flag from IsSSRtx.
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.
2022-05-08 11:47:32 -05:00
Ryan Staudt
608db3f648 multi: Remove auto revoc flag from CheckSSRtx.
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
2022-05-08 11:47:32 -05:00
Ryan Staudt
4b16a87b26 stake: Set test vote transactions as version 1.
This updates several test vote transactions to be version 1, since that
is the actual version that is currently used.
2022-05-08 11:47:32 -05:00
Ryan Staudt
c3680d0ce0 blockchain/stake: Start v5 module dev cycle.
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)
2022-05-08 11:47:32 -05:00
Ryan Staudt
1f3a261031 gcs: Start v4 module dev cycle.
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)
2022-05-08 11:47:32 -05:00
Dave Collins
0969534132
jsonrpc/types: Remove notifyspentandmissedtickets.
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.
2022-04-30 00:16:26 -05:00
Dave Collins
4261708051
blockchain: Remove unused NTSpentAndMissedTickets.
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.
2022-04-30 00:16:26 -05:00
Dave Collins
34924e83f5
rpcserver: Remove notifyspentandmissedtickets RPC.
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.
2022-04-30 00:16:25 -05:00
Dave Collins
4521b760ee
rpcclient: Remove notifyspentandmissedtickets.
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.
2022-04-30 00:16:25 -05:00
Dave Collins
f13d03cf3a
docs: Remove (notify)spentandmissed JSON-RPC API.
This removes the deprecated notifyspentandmissedtickets method and
associated spentandmissedtickets notification from the JSON-RPC API
documentation.
2022-04-30 00:16:24 -05:00
Dave Collins
44226d30fd
jsonrpc/types: Remove existsexpiredtickets.
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.
2022-04-30 00:16:24 -05:00
Dave Collins
e509a691d5
blockchain: Remove unused CheckExpiredTickets.
This removes the CheckExpiredTicket and CheckExpiredTickets methods from
blockchain now that they are no longer used.
2022-04-30 00:16:23 -05:00
Dave Collins
0ac6cbe825
rpcserver: Remove existsexpiredtickets RPC.
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.
2022-04-30 00:16:23 -05:00
Dave Collins
c19282ba4f
rpcclient: Remove existsexpiredtickets.
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.
2022-04-30 00:16:22 -05:00
Dave Collins
5f8936c7fb
docs: Remove existsexpiredtickets JSON-RPC API.
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.
2022-04-30 00:16:22 -05:00