This updates dcrctl to use version 2 of the dcrjson module and to make
use of the new separate type definitions provided by wallet so it
continues supporting communication with dcrwallet.
This makes the version string printed by the -V/--version flag
consistent with dcrd. In particular it will now include the runtime
version, OS, and architecture.
This introduces a new internal package named version to house the
version information and updates the various code to use it. This allows
both dcrd and dcrctl to make use of the package so the version
information only needs to be bumped in one place and also ensure that
any link-time overrides to the pre-release and/or build metadata apply
to both.
Also, while here, include the OS and architecture in the version log at
start of day as well as the output from the version CLI flag.
This marks the start of a new release process as compared to previous
releases.
Instead of bumping the version just before a release and releasing from
the master branch, as has been done up to this point, the minor (or
major when necessary) will now be bumped on the master branch at the
beginning of a release cycle. In addition, the pre-release portion of
the semantic version is now the string "pre" to help make it more
obvious that the master branch represents a pre-release build of work
leading up to the next release.
When a new release is prepared, a new release branch will be created
that has a naming scheme of "release-vX.Y", where X is the major and Y
is the minor. Any additional commits needed to prepare the release
leading up to a release candidate will be cherry-picked to the release
branch, and all tags for releases and release candidates will be created
against that.
This implies that should any additional patch releases be necessary, the
relevant commits will also be cherry-picked to the release branch as
needed, followed by a new release candidate for the patch release and
the eventual patch release.
This adds a new testnet3 network with new genesis block, block one
ledger, treasury address, and network magic.
All consensus rules that were voted in by testnet2 are automatically
active on the new testnet3 without having to vote them in again.
Consequently, there are no consensus vote agendas defined for it.
This removes the funcs which were used to override the test network name
as they were inherited from the upstream code and, once testnet v2 was
introduced, were no longer needed, but unfortunately weren't removed
accordingly.
This modifies the ProcessBlock function in the blockchain package to
return the fork length for the connected block and updates all callers
and tests accordingly. Several of the internal functions which
ProcessBlock calls are also updated in order to bubble the necessary
information back up so it can be returned. It does not make any
behavioral changes.
This is being done to better expose information about the position of
the block within the chain to callers without them having to make
additional queries.
This modifies all packages within the repository to the use the Decred
fork of btclog which has been renamed to slog and updates the dependency
files accordingly.
This corrects an issue introduced by commit
c6f9474348 which resulted in empty paths
that were cleaned and expanded being transformed into "." instead of
having no effect as intended.
This fixes the behavior of expanding ~ on Windows and macOS, as well
as adding support for ~otheruser to expand to the home directory of
otheruser.
Modify the default sample config to reflect the change in the meaning
of ~ on Windows, and the unintended meaning of ~ on macOS. Include
defaults for all 3 of the major operating system classes since
uncommenting the default Unix option on macOS or Windows would change
the blockchain data directory to a non-default location.
This modifies the BestState struct 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 structs provides better
cache locality
This modifies the IsSStx, IsSSGen, and IsSSRtx functions to only return
a bool and introduces CheckSStx, CheckSSGen, and CheckSSRtx to return
the actual error as needed by consensus.
This is being done because "is" functions are much nicer to use when
they don't return an error and the callers that use them almost never
care why they aren't of the type, they just want to determine if they
are. In the few cases where the caller does care, they can use of the
new check functions.
While here, also update the comments to call out what the more common
names for the transaction types are and to add comments to the test
functions for consistency.
Finally, it updates all callers in the repo accordingly.
This merge commit adds the following code from the
github.com/decred/dcrutil package into a new
github.com/decred/dcrd/dcrutil package:
* Address handling
* Amount type
* AppDataDir func
* bitflags functions
* Block wrapper type
* Hash160 func
* Tx wrapper type
* WIF type
as well as all tests for this code.
The old github.com/decred/dcrutil/hdkeychain package has also been
merged and moved to github.com/decred/dcrd/dcrutil/hdkeychain.
dcrd packages have been updated to use the new packages and the dep
files have been updated for this change.
Contains the following upstream commits:
- 42a4366ba8
- This is a NOOP since it has already previously been applied
- 77913ad2e8
Most of the changes related to this merge have already previously
applied, so this primarily just minimizes the differences versus
upstream.
This option allows one to specify a different option for the wallet
rpc server it will connect to. This is primarily meant to be used in
the config file so that a single dcrctl.conf may be used in the
situation where the wallet is on one host and dcrd is on another host.
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.
dcrctl does not require dcrd so it should not keep complaining about
it missing. Just skip automatic configuration if dcrd's configuration
is missing, but still set it up in the future if one appears and dcrctl
is still lacking a configuration file.
By default, put 'dev' in the prerelease field.
For release builds we can add 'release' with the build scripts.
Update comment for current (post 1.5) usage on ldflags -X while there.
The problem of securely prompting for secrets and not leaving secrets in shell
history can be solved in better ways, such as implementing a tool to read a
secret and write it back to standard output, allowing the secret to be piped to
dcrctl. Luckily dcrctl already supports this feature!
No (official) tool exists so far, but the workflow would look like this:
promptsecret | dcrctl --wallet walletpassphrase - 60
While here removing unneeded deps from the glide files, also throw in an
unrelated dcrrpcclient dep update.