-
Notifications
You must be signed in to change notification settings - Fork 292
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
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
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.
This change wraps the CPUMiner's WaitGroup reference in preparation for moving the CPUMiner under the 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.
This updates the tests to use error codes instead of the deprecated reject codes.
This removes the deprecated ErrToRejectErr function and also removes extractRejectCode since it has no other callers.
This removes the deprecated RejectCode from the TxRuleError struct and updates all of the callers accordingly.
This removes the deprecated DisableLog function since the major version has been bumped since the last release.
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
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
This adds tests for the missed and live ticket rpcs as well as the validate address rpc.
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
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.
The changes made here have been pulled into #2278, closing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on #2278
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 outlined in #2181.