* [NOD-532] Change chain to DAG in the root package.
* [NOD-532] Change chain to DAG in checkpoints.go.
* [NOD-532] Change chain to DAG in blockdag.
* [NOD-532] Change chain to DAG in cmd.
* [NOD-532] Change chain to DAG in dagconfig.
* [NOD-532] Change chain to DAG in database.
* [NOD-532] Change chain to DAG in mempool.
* [NOD-532] Change chain to DAG in mempool.
* [NOD-532] Change chain to DAG in netsync.
* [NOD-532] Change chain to DAG in rpcclient.
* [NOD-532] Change chain to DAG in server.
* [NOD-532] Change chain to DAG in txscript.
* [NOD-532] Change chain to DAG in util.
* [NOD-532] Change chain to DAG in wire.
* [NOD-532] Remove block heights in dagio.go examples.
* [NOD-532] Rename fakeChain to fakeDAG.
* [NOD-532] Fix comments, remove unused EnableBCInfoHacks flag.
* [NOD-532] Fix comments and variable names.
* [NOD-532] Fix comments.
* [NOD-532] Fix merge errors.
* [NOD-532] Formatted project.
* [NOD-494] Updated main README.md
* [NOD-494] Updated blockdag/README.md
* [NOD-494] Aligned text length in main README.md
* [NOD-494] Updated most remaining packages READMEs + deleted util/coinset
* [NOD-494] Update integration README
* [NOD-494] Did a final pass over all readmes
* [NOD-494] Updated README for DNSSeeder with more info on how to create a functioning setup
* [NOD-494] Remove all double spaces from readmes
* [NOD-494] Minor fixes in READMEs + update license to kaspanet developers
* [NOD-494] Add backtick around ecc and util in hdkeychain README
* [NOD-487] Implement a mechanism to gracefully shut down after a panic.
* [NOD-487] Fixed bad log.
* [NOD-487] Removed unused import.
* [NOD-487] Convert panic handlers from anonymous functions to methods.
* [NOD-256] Add error log
* [NOD-256] Add error log
* [NOD-256] Fix typo and comment
* [NOD-256] Remove btclog dir
* [NOD-256] Format project
* [NOD-256] Add error log files
* [NOD-256] Add an option to add a log file to write into to an existing backend logger
* [NOD-256] Get rid of redundant logs initialization
* [NOD-256] rename initLogRotators to initLog
* [NOD-256] Get rid ExampleSignTxOutput and convert ExampleBlockDAG_ProcessBlock to a regular test
* [NOD-256] Show error message if os.Exiting from initLog
* [NOD-234] Added an IsCurrent check to handleGetBlockTemplate.
* [NOD-234] Removed IsCurrent check from handleGetBlockTemplateRequest. Added an explanation for why we're checking the chainHeight.
* [NOD-234] Added ShouldMineOnGenesis to the IsCurrent check.
* [NOD-234] Flipped && operands to fail fast.
* [NOD-222] Added constant: UnacceptedBlueScore.
* [NOD-222] Made it so that block transactions always have UnacceptedBlueScore.
* [NOD-222] Implemented updating unaccepted UTXO entries with accepted ones in the virtual.
* [NOD-222] Fixed an unclear comment.
* [NOD-222] Fixed diffFromAcceptanceData not receiving the right blue score.
* [NOD-222] Fixed various issues with the implementation. It appears to work now.
* [NOD-222] Removed debug logs.
* [NOD-222] Fixed tests that relied on utxoCollection.String().
* [NOD-222] Fixed TestChainedTransactions.
* [NOD-222] Fixed tests that relied on GetVirtualFromParentsForTest.
* [NOD-222] Fixed having identical entries in toAdd and toRemove.
* [NOD-222] Fixed logic in diffFrom that I previously broke.
* [NOD-222] Fixed a wrong check.
* [NOD-222] Figured out the magical invocation to make everything work.
* [NOD-222] Fixed blockDB tests.
* [NOD-222] Removed debug method.
* [NOD-222] Fixed comments related to setting coinbase maturity to 0.
* [NOD-222] Fixed a typo in a comment.
* [NOD-222] Added a comment that explains the new addition in GetVirtualFromParentsForTest.
* [NOD-222] Added a comment to DiffUTXOSet.Get().
* [NOD-222] Fixed a nuance in DiffUTXOSet.containsInputs.
* [NOD-222] Replaced nonsense in GetVirtualFromParentsForTest with diffFromAcceptanceData.
* [NOD-222] Renamed newVirtualUTXO -> newVirtualPastUTXO.
* [NOD-222] Fixed a comment.
* [NOD-222] Extracted checking utxoCollection with blueScore to a method.
* [NOD-222] Added tests where the same entry is in both toAdd and toRemove.
* [NOD-222] Used Add/RemoveEntry inside diffFromAcceptedTx.
* [NOD-222] Removed superfluous test for UnacceptedBlueScore.
* [NOD-222] Added/Updated comments.
* [NOD-222] Added tests to TestUTXODiffRules.
* [NOD-222] Added appropriate protection against impossible "from"s in diffFrom.
* [NOD-222] Added a comment explaining why we diffFrom acceptanceData in verifyAndBuildUTXO.
* [NOD-222] Fixed comments and equal() in utxoset.
* [NOD-208] Added blockBlueScore to UTXOEntry.
* [NOD-208] Added blueBlockScore to NewUTXOEntry.
* [NOD-208] Fixed compilation errors in policy, utxoset, and dag tests.
* [NOD-208] Changed validateBlockRewardMaturity and CheckTransactionInputsAndCalulateFee to use blueScore.
* [NOD-208] Changed CalcBlockSubsidy to use blueScore.
* [NOD-208] Changed SequenceLockActive to use blueScore.
* [NOD-208] Removed ExtractCoinbaseHeight.
* [NOD-208] Removed reference to block height in ensureNoDuplicateTx.
* [NOD-208] Changed IsFinalizedTransaction to use blueScore.
* [NOD-208] Fixed merge errors.
* [NOD-208] Made UTXOEntry serialization use blueScore.
* [NOD-208] Changed CalcPriority and calcInputValueAge to use blueScore.
* [NOD-208] Changed calcSequenceLock to use blueScore.
* [NOD-208] Removed blockChainHeight from UTXOEntry.
* [NOD-208] Fixed compilation errors in feeEstimator. Fixed a bug in the test pool hardness.
* [NOD-208] Fixed oldestChainBlockWithBlueScoreGreaterThan not handling an extreme case.
* [NOD-208] Fixed TestDiffFromTx.
* [NOD-208] Got rid of priority and support of free transactions.
* [NOD-208] Fixed TestProcessTransaction.
* [NOD-208] Fixed TestTxFeePrioHeap.
* [NOD-208] Fixed TestAddrIndex and TestFeeEstimatorCfg.
* [NOD-208] Removed unused rateLimit parameter from ProcessTransaction.
* [NOD-208] Fixed tests that rely on CreateTxChain.
* [NOD-208] Fixed tests that rely on CreateSignedTxForSubnetwork.
* [NOD-208] Fixed TestFetchTransaction.
* [NOD-208] Fixed TestHandleNewBlock. Fixed HandleNewBlock erroneously processing fee transactions.
* [NOD-208] Fixed TestTxIndexConnectBlock.
* [NOD-208] Removed the use of Height() from the fee estimator.
* [NOD-208] Removed unused methods from rpcwebsocket.go.
* [NOD-208] Removed Height from util.Block.
* [NOD-208] Removed ErrForkTooOld. It doesn't make sense in a DAG.
* [NOD-208] Made blockHeap use blueScore instead of height.
* [NOD-208] Removed fee estimator.
* [NOD-208] Removed DAG.Height.
* [NOD-208] Made TestAncestorErrors test chainHeight instead of height.
* [NOD-208] Fixed a couple of comments that were still speaking about block height.
* [NOD-208] Replaced all uses of HighestTipHash with SelectedTipHash.
* [NOD-208] Remove blockNode highest and some remaining erroneous uses of height.
* [NOD-208] Fixed a couple of comments. Fixed outPoint -> outpoint merge error.
* [NOD-208] Fixed a couple more comments.
* [NOD-208] Used calcMinRequiredTxRelayFee instead of DefaultMinRelayTxFee for mempool tests.
* [NOD-208] Renamed mempool Config BestHeight to DAGChainHeight.
* [NOD-208] Fixed a bug in oldestChainBlockWithBlueScoreGreaterThan. Made calcSequenceLock use the node's selected parent chain rather than the virtual block's.
* [NOD-208] Removed chainHeight from blockNode String().
Renamed checkpointsByHeight to checkpointsByChainHeight and prevCheckpointHeight to prevCheckpointChainHeight.
Removed reference to chainHeight in blockIndexKey.
Fixed comments in dagio.go.
* [NOD-208] Removed indexers/blocklogger.go, as no one was using it.
* [NOD-208] Made blocklogger.go log blueScore instead of height.
* [NOD-208] Fixed typo.
* [NOD-208] Fixed comments, did minor renaming.
* [NOD-208] Made a "common sense" wrapper around sort.Search.
* [NOD-208] Fixed comment in SearchSlice.
* [NOD-142] Updated util.FastLog2Floor to work on uint64
* [NOD-142] Convert height and chainHeight to uint64
* [NOD-142] A couple fixes in comments of TestFastLog2Floor
* [NOD-142] Make spendableOutOffset uint64 too
* [NOD-58] Replace lastBlock with selected tip in version message (#210)
* [NOD-58] Replace lastBlock with selected tip in version message
* [NOD-58] Fix typo in comment
* [NOD-58] Add mutex to SelectedTipHash
* [NOD-58] Remove redundant comment
* [NOD-58] Remove wantStartingHeight from peerStats
* [NOD-58] Remove lock from SelectedTipHash
* Nod 53 change getheaders message to handle new block locator (#213)
* [NOD-53] Change getheaders message to handle the new block locator mechanism
* [NOD-53] Use heap in locateHeaders
* [NOD-53] Create a constructor for each heap direction
* [NOD-57] Check if a node is synced only by timestamps (#214)
* [NOD-60] implement isSyncCandidate (#218)
* [NOD-60] Implement isSyncCandidate
* [NOD-60] Fix typo
* [NOD-65] Fix netsync related tests and remove fields optionality from… (#220)
* [NOD-65] Fix netsync related tests and remove fields optionality from msgversion
* [NOD-65] gofmt rpcserver.go
* [NOD-65] add missing test for verRelayTxFalse
* [NOD-62] Change getblocks message to handle the new block locator mechanism (#219)
* [NOD-62] Change getblocks message to handle the new block locator mechanism
* [NOD-62] Add locateBlockNodes function
* [NOD-68] Adjust orphan parents requesting for a DAG (#222)
* [NOD-68] Adjust orphan parents requesting for a DAG
* [NOD-68] add sendInvsFromRequestedQueue and trigger it when requested blocks slice is empty, or immediatly if we're not in sync mode
* [NOD-68] Prevent duplicates from entering to state.requestQueue and add wrapping locks to addBlocksToRequestQueue
* [NOD-68] Fix Lock -> Unlock in sendInvsFromRequestedQueue
* [NOD-74] Starts syncing again when the current sync peer is done (#225)
* [NOD-74] Starts syncing again when the current sync peer is done
* [NOD-74] Unlock mtx before netsync is restarted
* [NOD-74] Fix name isSyncPeerFree -> isWaitingForBlocks
* [NOD-75] fixing netsync bugs (#227)
* [NOD-74] Starts syncing again when the current sync peer is done
* [NOD-74] Unlock mtx before netsync is restarted
* [NOD-75] Fixing netsync bugs
* [NOD-80] Request block data from block propagation just after you are… (#231)
* [NOD-80] Request block data from block propagation just after you are current
* [NOD-80] Fix adding to both queues in addInvToRequestQueue
* [NOD-81] Start to mine on top of genesis iff all peers selected tip is genesis (#232)
* [NOD-81] Start to mine on top of genesis only if all of your peers' selected tip is genesis
* [NOD-81] Explain forAllPeers/forAllOutboundPeers shouldContinue behaviour in comments
* [NOD-81] Add forAllInboundPeers and add return values for forAllPeers/forAllOutboundPeers/forAllInboundPeers functions
* [NOD-16] Add pushSet to the BlockHeap type
* [NOD-16] Fixed syntax error
* [NOD-56] Created devnet
* [NOD-56] Fixed tests
* [NOD-56] Fixed go vet errors
* [NOD-56] Added TestSolveGenesisBlock function
* [NOD-56] Created command line tool for solving genesis blocks
* [DEV-376] Changed any instance of %v in format strings with a more specific format token
* [DEV-376] Fixed some more wrong formatting strings + removed redundant
cast
* [DEV-376] Added fmt.Sprintf where it was missing
* [DEV-376] use %s for util.Amount, to invoke .String()
* [DEV-376] Some more fixes in format strings
* [DEV-376] fixed mruinvmap_test to expect the correct behaviour
* [DEV-333] Added subnetwork to local peer version message.
* [DEV-333] Fixed broken references.
* [DEV-333] Added serialization/deserialization of the version message.
* [DEV-333] Added rejection for peers with wrong subnetwork.
* [DEV-333] Fixed bad comment.
* [DEV-333] Renamed ChainParams to DAGParams.
* [DEV-333] Fixed partial nodes disconnecting from full nodes.
* [DEV-333] chain -> DAG
* [DEV-333] Possibly fixed outbound msgVersion rules.
* [DEV-333] Combined the two incompatible subnetwork cases into one if.
* [DEV-333] Reformatted the condition.
* [DEV-169] add to BlockDAG TipHashes() and HighestTipHash() and remove Tiphashes() and SelectedTipHash from VirtualBlock
* [DEV-169] move highest node logic to separate method of blockset
* [DEV-75] Removed fetchEntryByHash, which was no longer used.
* [DEV-75] Removed a few functions in manager.go that weren't used by anything.
* [DEV-75] checkConnectBlock will soon not accept a utxoViewpoint, so removed the call to view.Tip() so that it could be deleted.
* [DEV-75] Got rid of tips in UtxoViewpoint.
* [DEV-75] Added the full UTXO set to the virtual block.
* [DEV-75] Implemented UTXO-wrangling when adding a new block.
* [DEV-75] Added isCoinbase to utxoEntry creation.
* [DEV-75] Added blockHeight to utxoEntry creation.
* Implemented fetching the fullUTXOSet from the database.
* [DEV-75] Simplified DAGState because almost all of the state in it was unnecessary. Also got rid of dbDAGState.
* [DEV-75] Made the process around adding a new block, UTXO-wise, much safer.
* [DEV-75] Implemented melding the virtual UTXO diff to the database.
* [DEV-75] Fixed utxoSet loading from the wrong bucket.
* [DEV-75] Began pruning utxoviewpoint.go. Replaced FetchUtxoEntry with a fullUTXOSet-based GetUTXOEntry.
* [DEV-75] Removed fetchUtxos.
* [DEV-75] Moved GetUTXOEntry into the virtual block.
* [DEV-75] Updated IndexManager to not use utxoViewpoints.
* [DEV-75] Fixed some bad login in restoreUTXO involving nodeDiffs.
* [DEV-75] Got rid of the UTXO spend journal, which wasn't used anywhere.
* [DEV-75] Moved some STXO-related validation logic out of connectToDAG and into checkConnectBlock.
* [DEV-75] Renamed UtxoXxx to UTXOXxx. Removed a bunch of methods that were no longer used by anything.
* [DEV-75] Another Utxo -> UTXO rename.
* [DEV-75] Removed IsModified from UTXOView, which was not used anywhere.
* [DEV-75] Renamed nodeDiff to provisionalNode. Added a bunch of comments.
* [DEV-75] Removed the test for genesis in pastUTXO, since it can never happen.
* [DEV-75] Wrote tests for errors in pastUTXO.
* [DEV-75] Wrote tests for errors in restoreUTXO.
* [DEV-75] Improved testErrorThroughPatching.
* [DEV-75] Wrote tests for errors in verifyAndBuildUTXO.
* [DEV-75] Used TipHashes instead of tips().hashes(), fixed comments in a few places, and brought back an error return that I erroneously removed.
* [DEV-75] Removed UTXO set logs.
* [DEV-75] Recreated add/remove/contains functions for utxoCollection.
* [DEV-75] Changed newUTXOEntry to use an object initializer.
* [DEV-75] Changed the UTXO bucket version to 1.
* Added a comment that clarifies that the index is not initialized before initDAGState is called.
* [DEV-75] Renamed GetVirtualBlock to VirtualBlock.
* [DEV-75] Removed superfluous variables.
* [DEV-75] Combined connectBlockToParents with updateParentsDiffs.
* [DEV-75] Removed another superfluous variable.
* [DEV-75] In pastUTXO, first fetch transactions from the database and only then add them.
* [DEV-75] Reworded the comment for commit().
* [DEV-75] Made all the connectUTXO subfunctions not BlockDAG methods.
* [DEV-75] Updated the comment for connectUTXO.
* [DEV-75] Updated the comment explaining why we're creating provisionalNodes.
* [DEV-75] Removed a couple of unnecessary calls to toProvisionalNode.
* [DEV-75] Renamed connectUTXO to applyUTXOChanges.
* [DEV-75] Replaced allProvisionalNodes with provisionalNodeSet, an object that holds provisionalNodes for this particular call to applyUTXOChanges.
* [DEV-75] Changed createProvisionalNode to accept a boolean "withParents" instead of relying on the caller to supply the node's parents or an empty set.
* [DEV-75] Made most applyUTXOChanges subfunctions be methods on provisionalNode.
* [DEV-75] Fixed a couple of bad comments.
* [DEV-75] Added descriptive error messages to callers of applyUTXOChanges.
* [DEV-75] Fixed weird English.
* [DEV-75] Replaced DAGState with a slice of DAG tip hashes.
* [DEV-75] In createProvisionalNode, changed withParents to withRelatives to avoid certain kinds of attacks.
* [DEV-75] Renamed createdProvisionalNode to newProvisionalNode.
* [DEV-75] Added precalculating the amount of transactions inside a new block's blue set.
* [DEV-75] Pruned unnecessary variable.
* [DEV-97] Moved github.com/daglabs/btcutil into github.com/daglabs/btcd/btcutil.
* [DEV-97] Updated Gopkg.toml to no longer refer to btcutil.
* [DEV-97] Renamed btcutil to util.
* [DEV-82] break down main to packages
* [DEV-82] separate rpcserver and server
* [DEV-82] Fixed Windows-related code that failed to compile.
* [DEV-82] remove params.go and use only dagconfig.Params
* [DEV-82] fix log.go license
* [DEV-62] add phantom constructs to blocknode
* [DEV-62] add phantom constructs to blocknode
* [DEV-72] write blues()
* [DEV-72] write blues()
* [DEV-72] write blues()
* [DEV-62] add comments to new phantom constructs in blocknode
* Fixed dbIndexConnectBlock. (#33)
* Fixed dbIndexConnectBlock.
* Removed redundant check in storeFilter.
* Created a new method to BlockHeader: IsGenesis.
* [DEV-71] Implement BlockHeap (#35)
* [DEV-71] Implemented BlockHeap.
* [DEV-71] Removed irrelevant comment.
* [DEV-71] Renamed variables in Pop() and split Less() to multiple lines.
* [DEV-72] write blues()
* [DEV-72] write blues()
* [DEV-72] write blues()
* [DEV-72] write blues tests
* [DEV-72] write blues tests
* [DEV-72] remove relevant past
* [DEV-72] write blues tests
* [DEV-72] write blues tests
* [DEV-72] write blues tests
* [DEV-72] write functions to order blockSet by hash and write blue tests
* [DEV-72] add secret mining and censorship attack tests
* [DEV-72] remove prints
* [DEV-72] remove K from dagconfig.Params
* [DEV-72] remove K from dagconfig.Params
* [DEV-72] change blueScore to uint64
* [DEV-72] block V was missing, so renamed w -> v, x -> w etc
* [DEV-72] use node.String instead of %v
* [DEV-72] block V was missing, so renamed w -> v, x -> w etc
* [DEV-72] add K to dagconfig.Params, and add expected reds to all phantom tests
* [DEV-72] set K=10 and add comments to phantom and phantom tests
* [DEV-72] fix formatting and add comments to TestPhantom
* [DEV-72] fix grammar
* [DEV-65] Renamed BestState to State and GetSnapshot to GetCurrentState.
* [DEV-65] Implemented State and SelectedTip, updated dagState (the serializable version of State), and updated State creations.
* [DEV-65] Fixed references to GetCurrentState and fixed tests.
* [DEV-40] Created a new method AreEquals for comparing hash slices. Updated mining package to work with primitive DAG.
* [DEV-65] Renamed State to DAGState, corrected comments, created a new thread-safe method setDAGState, fixed broken references I missed.
* [DEV-65] Converted dagState (the object) to dbDAGState, and made it serialize/deserialize into/out of JSON.
* [DEV-65] Renamed Txns to Txs and fixed a couple of comments.
* [DEV-65] Renamed some more "Txns" and removed some dead code.
* [DEV-40] Fixed formatting errors...
* [DEV-40] Reworded confusing test failure messages.
* [DEV-40] Fixed merge error.
* [DEV-40] Fixed style for AreEqual and TestAreEqual.
* [DEV-65] Renamed BestState to State and GetSnapshot to GetCurrentState.
* [DEV-65] Implemented State and SelectedTip, updated dagState (the serializable version of State), and updated State creations.
* [DEV-65] Fixed references to GetCurrentState and fixed tests.
* [DEV-65] Renamed State to DAGState, corrected comments, created a new thread-safe method setDAGState, fixed broken references I missed.
* [DEV-65] Converted dagState (the object) to dbDAGState, and made it serialize/deserialize into/out of JSON.
* [DEV-65] Renamed Txns to Txs and fixed a couple of comments.
* [DEV-65] Renamed some more "Txns" and removed some dead code.
The btclog package has been changed to defining its own logging
interface (rather than seelog's) and provides a default implementation
for callers to use.
There are two primary advantages to the new logger implementation.
First, all log messages are created before the call returns. Compared
to seelog, this prevents data races when mutable variables are logged.
Second, the new logger does not implement any kind of artifical rate
limiting (what seelog refers to as "adaptive logging"). Log messages
are outputted as soon as possible and the application will appear to
perform much better when watching standard output.
Because log rotation is not a feature of the btclog logging
implementation, it is handled by the main package by importing a file
rotation package that provides an io.Reader interface for creating
output to a rotating file output. The rotator has been configured
with the same defaults that btcd previously used in the seelog config
(10MB file limits with maximum of 3 rolls) but now compresses newly
created roll files. Due to the high compressibility of log text, the
compressed files typically reduce to around 15-30% of the original
10MB file.
The github markdown interpreter has been changed such that it no longer
allows spaces in between the brackets and parenthesis of links and now
requires a newline in between anchors and other formatting. This
updates all of the markdown files accordingly.
While here, it also corrects a couple of inconsistencies in some of the
README.md files.
This simplifies the code based on the recommendations of the gosimple
lint tool.
Also, it increases the deadline for the linters to run to 10 minutes and
reduces the number of threads that is uses. This is being done because
the Travis environment has become increasingly slower and it also seems
to be hampered by too many threads running concurrently.
This modifies the blockNode and BestState structs in the blockchain
package to store hashes directly instead of pointers to them and updates
callers to deal with the API change in the exported BestState struct.
In general, the preferred approach for hashes moving forward is to store
hash values in complex data structures, particularly those that will be
used for cache entries, and accept pointers to hashes in arguments to
functions.
Some of the reasoning behind making this change is:
- It is generally preferred to avoid storing pointers to data in cache
objects since doing so can easily lead to storing interior pointers
into other structs that then can't be GC'd
- Keeping the hash values directly in the block node provides better
cache locality
This does the minimum work necessary to refactor the CPU miner code into
its own 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 cpuminer.go -> 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)
- Update all references to the cpuminer to use the package
- Add a skeleton README.md