Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi: update mempool error types. #2296

Closed
wants to merge 23 commits into from

Commits on Jul 20, 2020

  1. multi: update blockchain error types.

    This updates the blockchain error types to leverage go
    1.13 errors.Is/As functionality as well as confirm to
    the error infrastructure best practices.
    dnldd committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    619cff7 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2020

  1. rpcserver: Add handleEstimateStakeDiff test.

    Because handleEstimateStakeDiff calls chain.EstimateNextStakeDifficulty
    up to four times, change testRPCChain.estimateNextStakeDifficulty to a
    function so that handlers can specify more complex return values. In
    TestHandleExtimateStakeDiff, have the test RPC chain return functions
    that return results from a queue, allowing for multiple calls with
    varying results.
    
    Use go-spew to print test result equality errors so that values of
    pointers are also printed.
    JoeGruffins authored and dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    7130600 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    276f0ef View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4cfd644 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7222f22 View commit details
    Browse the repository at this point in the history
  5. multi: Decouple blockManager from mining.

    This removes coupling between the mining code,
    blockManager, and the main configuration.
    
    This change is a step towards moving
    the mining code into its own package.
    sefbkn authored and dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    700bba8 View commit details
    Browse the repository at this point in the history
  6. multi: Hide CPUMiner WaitGroup.

    This change wraps the CPUMiner's
    WaitGroup reference in preparation for
    moving the CPUMiner under the mining
    package.
    sefbkn authored and dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    8932319 View commit details
    Browse the repository at this point in the history
  7. multi: Move mining code into mining package.

    This contains the changes necessary to move the
    mining code into the mining package.  The motivation
    behind these changes is to decouple the block template
    generation from other modules in the codebase to
    simplify extending it with new features and tests.
    sefbkn authored and dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    7f21cf1 View commit details
    Browse the repository at this point in the history
  8. mempool: Don't use deprecated reject code in tests.

    This updates the tests to use error codes instead of the deprecated
    reject codes.
    davecgh authored and dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    41a1454 View commit details
    Browse the repository at this point in the history
  9. mempool: Remove deprecated ErrToRejectErr func.

    This removes the deprecated ErrToRejectErr function and also removes
    extractRejectCode since it has no other callers.
    davecgh authored and dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    35e6176 View commit details
    Browse the repository at this point in the history
  10. mempool: Remove deprecated tx rule err reject code.

    This removes the deprecated RejectCode from the TxRuleError struct and
    updates all of the callers accordingly.
    davecgh authored and dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    6b0c890 View commit details
    Browse the repository at this point in the history
  11. mempool: Remove deprecated DisableLog func.

    This removes the deprecated DisableLog function since the major version
    has been bumped since the last release.
    davecgh authored and dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    5c5b41b View commit details
    Browse the repository at this point in the history
  12. mempool: Move to internal.

    This makes the mempool an internal package such that it will no longer
    be an exported module.  The only place its functionality is really
    needed is for the internal implementation of dcrd itself and thus having
    an unnecessary exported module significantly increases the maintenance
    burden.
    
    This is part of the overall effort to reduce the total number of modules
    and eventually get to the point it will be possible to follow semver for
    the root module.
    
    It is worth noting that there are a few constants, which will be listed
    below, that were exported from this module that callers might have
    previously relied upon.  However, due to previous discussions about the
    goal of removing the module, a code search has revealed that there are
    no known callers that still rely on them.
    
    The aforementioned constants are:
    
    - MaxStandardTxSize
    - DefaultMinRelayTxFee
    - BaseStandardVerifyFlags
    
    Overview of the major changes:
    
    - Move the following files from mempool -> internal/mempool:
      - README.md
      - doc.go
      - error.go
      - log.go
      - mempool.go
      - mempool_test.go
      - policy.go
      - policy_test.go
    - Remove mempool/go.mod and mempool/go.sum
    - Make the README.md and doc.go files match the new reality
    - Update all import paths in the repository accordingly
    - Remove the dependency from the root go.mod
    - Run go mod tidy on all modules
    davecgh authored and dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    23d86d6 View commit details
    Browse the repository at this point in the history
  13. docs: Update for removal of mempool module.

    davecgh authored and dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    f6ca67c View commit details
    Browse the repository at this point in the history
  14. mining: Move to internal.

    This makes the mining package an internal package such that it will no
    longer be an exported module.  The only place its functionality is
    really needed is for the internal implementation of dcrd itself and thus
    having an unnecessary exported module significantly increases the
    maintenance burden.
    
    This is part of the overall effort to reduce the total number of modules
    and eventually get to the point it will be possible to follow semver for
    the root module.
    
    It is worth noting that there are a few constants, which will be listed
    below, that were exported from this module that callers might have
    previously relied upon.  However, due to previous discussions about the
    goal of removing the module, a code search has revealed that there are
    no known callers that still rely on them.
    
    The aforementioned constants are:
    
    - UnminedHeight
    - MinHighPriority
    
    Overview of the major changes:
    
    - Move the following files from mining -> internal/mining:
      - README.md
      - cpuminer.go
      - doc.go
      - miningerror.go -> error.go
      - log.go
      - mining.go
      - mining_test.go
      - policy.go
      - policy_test.go
    - Remove mining/go.mod and mining/go.sum
    - Make the README.md and doc.go files match the new reality
    - Update all import paths in the repository accordingly
    - Remove the dependency from the root go.mod
    - Run go mod tidy on all modules
    davecgh authored and dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    b23f043 View commit details
    Browse the repository at this point in the history
  15. docs: Update for removal of mining module.

    davecgh authored and dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    5581551 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    c4e5c21 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    41bec0b View commit details
    Browse the repository at this point in the history
  18. build: golangci-lint v1.28.3

    dajohi authored and dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    080cdea View commit details
    Browse the repository at this point in the history
  19. rpcserver: add missed and live tickets rpc tests.

    This adds tests for the missed and live ticket rpcs
    as well as the validate address rpc.
    dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    d3437f6 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    826f2a5 View commit details
    Browse the repository at this point in the history
  21. cpuminer: Refactor code to its own package.

    This does the minimum work necessary to refactor the CPU miner code into
    its own internal package.  The idea is that separating this code into
    its own package will improve its testability and ultimately be useful to
    other parts of the codebase such as the various tests which currently
    effectively have their own stripped-down versions of this code.
    
    The API will certainly need some additional cleanup and changes to make
    it more usable outside of the specific circumstances it was originally
    designed to support (namely the generate RPC), however it is better to
    do that in future commits in order to keep the changeset as small as
    possible during this refactor.
    
    Overview of the major changes:
    
    - Create the new package
    - Move internal/mining/cpuminer.go -> internal/mining/cpuminer/cpuminer.go
    - Update mining logging to use the new cpuminer package logger
    - Rename CPUMinerConfig to Config (so it's now cpuminer.Config)
    - Rename NewCPUMiner to New (so it's now cpuminer.New)
    - Add exported BestSnapshot method to mining.BlkTmplGenerator
    - Add exported TxSource method to mining.BlkTmplGenerator
    - Update all references to the cpuminer to use the package
    - Add a skeleton README.md
    - Add a skeleton doc.go
    davecgh authored and dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    4214726 View commit details
    Browse the repository at this point in the history
  22. multi: update mempool error types.

    This updates the standalone error types to leverage go 1.13
    errors.Is/As functionality as well as conform to the error
    infrastructure best practices.
    dnldd committed Jul 24, 2020
    Configuration menu
    Copy the full SHA
    c301c0e View commit details
    Browse the repository at this point in the history