Commit Graph

8 Commits

Author SHA1 Message Date
Dave Collins
ad02d8f300
multi: Go 1.19 doc comment formatting.
This modifies the entire repository to use the new formatting of doc
comments in the upcoming Go 1.19 release.

The primary motivating factors for this are:

- Builds check that files are formatted per gofmt and that will no
  longer be true as of Go 1.19 without these changes
- Separating all the updates into a single commit ensures these
  documentation only formatting changes do not clutter up diffs that
  actually change code

For the most part, the changes are just the automated changes suggested
by the Go 1.19 version of gofmt, but there are also a few cases where
the comments were reworded a bit to play nicely with the new formatting
requirements.

For example, the new version of gofmt reformats and collapses nested
lists where as the existing version does not.  Thus, instances of nested
lists have been changed to either eliminate them or use mixed markers
which produce expect results.
2022-07-30 04:08:58 -05:00
Dave Collins
6387f762af
progresslog: Make header logging concurrent safe.
This modifies the header progress logging function to be concurrent safe
and modifies some comments to call out that the various functions are
concurrent safe.

This isn't strictly necessary with the current code because the function
is only ever called from a single goroutine in the network sync manager,
but the logger is intended to be concurrent safe and future code will
likely make use of it from multiple goroutines.
2021-11-23 17:24:58 -06:00
jholdstock
e3f7f58a68 multi: Don't use deprecated ioutil package.
As of go 1.16, the "io/ioutil" package is deprecated. All functionality
from "io/ioutil" has been moved to either the "io" or "os" packages.
2021-09-01 06:09:37 -05:00
Dave Collins
ae4281bcfc
multi: Add chain verify progress percentage.
This modifies blockchain, progresslog, and netsync to provide a progress
percentage when logging the main chain verification process.

A new method is added to blockchain that determines the verification
progress of the current best chain based on how far along it towards the
best known header and blockchain is also modified to log the
verification progress in the initial chain state message when the
blockchain is first loaded.

In addition, the progess logger is modified to log the verification
progress instead of the timestamp of the last block and the netsync code
is updated to make use of the new verification progress func per above.

Finally, the netsync code now determines when the chain is considered
current and logs new blocks as they are connected along with their hash
and additional details.  This provides a cleaner distinction between the
initial verification and catchup phase and steady state operation.
2021-01-21 23:30:35 -06:00
Dave Collins
c9de511f8c
progresslog: Add support for header sync progress.
This modifies the progress logger to expose a new method for logging the
progress of header syncing and adds tests to ensure proper functionality.
2021-01-21 23:29:43 -06:00
Dave Collins
0aeae0cbc7
progresslog: Make logger more generic.
This modifies the progress logger to make it a bit more generic so that
it can support logging header sync progress in the future too and
modernizes the code while here.
2021-01-21 23:20:13 -06:00
Dave Collins
7a809399ab
progresslog: Add package documentation. 2020-12-14 19:20:07 -06:00
Dave Collins
6c0f08894c
progresslog: Make block progress log internal.
This splits the block progress logging used by the block manager and
dump blockchain option to a separate internal package named progresslog
and updates its code to be more consistent with the rest of the code
base along the way.

This is a part of the overall effort to decouple the block manager from
the server so it can be split out into a separate internal netsync
package.
2020-12-14 19:20:07 -06:00