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

[Utility] Foundational bugs, tests, code cleanup and improvements (1 / 2) #503

Merged
merged 66 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
8993edf
WIP - just looking through code
Olshansk Jan 26, 2023
58543f0
Merge branch 'main' into issue/443-consolidate-utility-messages
Olshansk Jan 26, 2023
d42af7d
Delete DoubleSign
Olshansk Jan 26, 2023
05b369f
Removed all the message double signing stuff
Olshansk Jan 26, 2023
6f652ac
Moved utility tests alongside their acutal files
Olshansk Jan 26, 2023
75f2f8e
Reducing scope of context & utility structs
Olshansk Jan 26, 2023
feecc82
Delete PersistenceRWContext
Olshansk Jan 26, 2023
aae0713
Minro cleanup to default values in utility/module_test.go
Olshansk Jan 26, 2023
642c9a4
Move ActorTypes into a shared library
Olshansk Jan 27, 2023
a0cbeb7
WIP - Cleaning up code as I move through transactions.go and its depe…
Olshansk Jan 27, 2023
d34f5ca
Update codec
Olshansk Jan 27, 2023
3ecfb5c
Moved constants into a separate file
Olshansk Jan 27, 2023
01163f2
Fixed all calls to GetStoreAndHeight
Olshansk Jan 27, 2023
5c5b14d
Cleaned up gov.go
Olshansk Jan 27, 2023
8f962a6
Removed shared num_utils from the utility package
Olshansk Jan 28, 2023
0feb32a
Minor upates to some of the utility type files
Olshansk Jan 29, 2023
d4ae7da
Propogate error in string to int conversion
Olshansk Jan 29, 2023
926d35b
Cleaned up message.go
Olshansk Jan 29, 2023
0366f3e
Review tx.go and split tx_result.go into a separate file
Olshansk Jan 29, 2023
62ca5be
Moved TransactionResult into tx_result.go
Olshansk Jan 29, 2023
f551e10
Reviewed account.go and account_test.go
Olshansk Jan 29, 2023
1d92544
Upadting actor.go in progress
Olshansk Jan 29, 2023
7049909
Fixed broken tests
Olshansk Jan 29, 2023
eb54700
Introduces module shared proto types and remove the UnstakingActor in…
Olshansk Jan 29, 2023
d6c3eae
s/address/addr in actor.go
Olshansk Jan 29, 2023
c144e18
Deleted getLatestBlockHeight
Olshansk Jan 29, 2023
f03af89
Reviewer actor.go but actor_test.go is still in progress
Olshansk Jan 30, 2023
d845844
Merge branch 'main' into issue/443-consolidate-utility-messages
Olshansk Jan 30, 2023
7f9091c
Merge with main
Olshansk Feb 7, 2023
f573fae
All unit tests passing again
Olshansk Feb 7, 2023
a3d2d47
Re-reviewer account and account_test.go
Olshansk Feb 7, 2023
60b8030
Mostly passing actor_test.go
Olshansk Feb 8, 2023
e84feb9
Merge branch 'main' into issue/443-consolidate-utility-messages
Olshansk Feb 8, 2023
699de80
Cleaning up actor_test.go
Olshansk Feb 8, 2023
d2624b2
One unit test still failing
Olshansk Feb 9, 2023
00db25a
Fixed bug in persistence
Olshansk Feb 9, 2023
568140b
Self review
Olshansk Feb 9, 2023
c9681e6
Reduce scope of internal functions
Olshansk Feb 9, 2023
c3114e8
minor followup fix
Olshansk Feb 9, 2023
1108b85
All tests passing
Olshansk Feb 9, 2023
dd816e4
Linter nits
Olshansk Feb 9, 2023
d0b142c
Merge with main
Olshansk Feb 9, 2023
c11b901
Fix persitence test
Olshansk Feb 9, 2023
084b8b9
Update go_lint
Olshansk Feb 9, 2023
f0902cc
Added send_local_tx
Olshansk Feb 9, 2023
407a447
Add TODOs to the development/README
Olshansk Feb 9, 2023
1f96171
Update utility/application.go
Olshansk Feb 12, 2023
cc7385b
[P2P] Logger module registration in p2p and network bugfix (#502)
deblasis Feb 10, 2023
decf7b4
Update deps
Olshansk Feb 12, 2023
8fb056a
Remove ICodec
Olshansk Feb 12, 2023
6ebaf86
Add comment to GetHashStringFromBytes
Olshansk Feb 12, 2023
78af99e
Clarify modules/types/README
Olshansk Feb 12, 2023
d94f0ab
Update comment in unstaking_actor.proto
Olshansk Feb 12, 2023
dde0731
s/withBus/setBus
Olshansk Feb 12, 2023
e0336ea
Update comments
Olshansk Feb 12, 2023
7b0f8c0
Reply to remaining comments
Olshansk Feb 12, 2023
1bf9830
Merge branch 'main' into issues/475/utility_module_foundation
Olshansk Feb 13, 2023
8ef29da
s/transaction/tx
Olshansk Feb 13, 2023
56c9a14
Typo in GetMinimumBlockHeightQuery
Olshansk Feb 13, 2023
de2b264
Merge branch 'main' into issues/475/utility_module_foundation
Olshansk Feb 14, 2023
b8d5a94
Add comment to Transaction
Olshansk Feb 14, 2023
6733ec4
Removed redundant ActorTypes array
Olshansk Feb 14, 2023
a267a4e
Remove CodecType
Olshansk Feb 14, 2023
d88bc18
Update all the changelogs
Olshansk Feb 14, 2023
f829d5c
Merge branch 'main' into issues/475/utility_module_foundation
Olshansk Feb 14, 2023
91ae601
Update changelogs dates
Olshansk Feb 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ go_clean_deps: ## Runs `go mod tidy` && `go mod vendor`

.PHONY: go_lint
go_lint: ## Run all linters that are triggered by the CI pipeline
golangci-lint run ./...
docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.51.1 golangci-lint run -v

.PHONY: gofmt
gofmt: ## Format all the .go files in the project in place.
Expand Down Expand Up @@ -222,15 +222,15 @@ mockgen: clean_mocks ## Use `mockgen` to generate mocks used for testing purpose
$(eval modules_dir = "shared/modules")
go generate ./${modules_dir}
echo "Mocks generated in ${modules_dir}/mocks"

$(eval DIRS = p2p persistence)
for dir in $(DIRS); do \
echo "Processing $$dir mocks..."; \
find $$dir/types/mocks -type f ! -name "mocks.go" -exec rm {} \;; \
go generate ./${dir_name}/...; \
echo "$$dir mocks generated in $$dir/types/mocks"; \
done

# TODO(team): Tested locally with `protoc` version `libprotoc 3.19.4`. In the near future, only the Dockerfiles will be used to compile protos.

.PHONY: protogen_show
Expand All @@ -248,9 +248,10 @@ PROTOC_SHARED = $(PROTOC) -I=./shared
.PHONY: protogen_local
protogen_local: go_protoc-go-inject-tag ## Generate go structures for all of the protobufs
# Shared
$(PROTOC) -I=./shared/core/types/proto --go_out=./shared/core/types ./shared/core/types/proto/*.proto
$(PROTOC) -I=./shared/messaging/proto --go_out=./shared/messaging ./shared/messaging/proto/*.proto
$(PROTOC) -I=./shared/codec/proto --go_out=./shared/codec ./shared/codec/proto/*.proto
$(PROTOC) -I=./shared/core/types/proto --go_out=./shared/core/types ./shared/core/types/proto/*.proto
$(PROTOC) -I=./shared/modules/types/proto --go_out=./shared/modules/types ./shared/modules/types/proto/*.proto
$(PROTOC) -I=./shared/messaging/proto --go_out=./shared/messaging ./shared/messaging/proto/*.proto
$(PROTOC) -I=./shared/codec/proto --go_out=./shared/codec ./shared/codec/proto/*.proto

# Runtime
$(PROTOC) -I=./runtime/configs/types/proto --go_out=./runtime/configs/types ./runtime/configs/types/proto/*.proto
Expand All @@ -260,8 +261,6 @@ protogen_local: go_protoc-go-inject-tag ## Generate go structures for all of the

# Persistence
$(PROTOC_SHARED) -I=./persistence/indexer/proto --go_out=./persistence/indexer ./persistence/indexer/proto/*.proto
$(PROTOC_SHARED) -I=./persistence/proto --go_out=./persistence/types ./persistence/proto/*.proto
protoc-go-inject-tag -input="./persistence/types/*.pb.go"

# Utility
$(PROTOC_SHARED) -I=./utility/types/proto --go_out=./utility/types ./utility/types/proto/*.proto
Expand Down Expand Up @@ -497,3 +496,7 @@ check_cross_module_imports: ## Lists cross-module imports
echo "-----------------------"
echo "runtime:\n"
grep ${exclude_common} --exclude-dir=runtime -r "github.com/pokt-network/pocket/runtime" || echo "✅ OK!"

.PHONY: send_local_tx
send_local_tx: ## A hardcoded send tx to make LocalNet debugging easier
p1 --path_to_private_key_file=build/pkeys/val1.json Account Send 6f66574e1f50f0ef72dff748c3f11b9e0e89d32a 67eb3f0a50ae459fecf666be0e93176e92441317 1000
4 changes: 2 additions & 2 deletions app/client/cli/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func prepareTxBytes(msg typesUtil.Message, pk crypto.Ed25519PrivateKey) ([]byte,
Nonce: fmt.Sprintf("%d", crypto.GetNonce()),
}

signBytes, err := tx.SignBytes()
signBytes, err := tx.SignableBytes()
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -163,7 +163,7 @@ func validateStakeAmount(amount string) error {
}

sr := big.NewInt(stakingRecommendationAmount)
if typesUtil.BigIntLessThan(am, sr) {
if converters.BigIntLessThan(am, sr) {
fmt.Printf("The amount you are staking for is below the recommendation of %d POKT, would you still like to continue? y|n\n", sr.Div(sr, oneMillion).Int64())
if !confirmation(pwd) {
return fmt.Errorf("aborted")
Expand Down
2 changes: 1 addition & 1 deletion app/client/doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.0.0.10] - 2023-02-07

- Added GITHUB_WIKI tags where it was missing
- Added GH_WIKI tags where it was missing

## [0.0.0.9] - 2023-02-06

Expand Down
4 changes: 2 additions & 2 deletions docs/demos/iteration_3_end_to_end_tx.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

The first video of this demo can be accessed [here](https://drive.google.com/file/d/1IOrzq-XJP04BJjyqPPpPu873aSfwrnur/view?usp=sharing).

<img width="842" alt="Screenshot 2022-12-05 at 9 02 28 PM" src="https://user-images.githubusercontent.com/1892194/205820691-26e801e4-ff79-4132-a7a1-358860ca2335.png">
![Demo Goals](https://user-images.githubusercontent.com/1892194/205820691-26e801e4-ff79-4132-a7a1-358860ca2335.png)

### Features

Expand Down Expand Up @@ -91,7 +91,7 @@ select * from pool;

### Available Commands

Show all the commands available in the CLI:
Show all the commands available in the CLI by running `p1` or:

```bash
go run app/client/*.go
Expand Down
17 changes: 17 additions & 0 deletions docs/development/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Please note that this repository is under very active development and breaking c
- [Running LocalNet](#running-localnet)
- [\[Advanced\] Kubernetes](#advanced-kubernetes)
- [\[Basic\] Docker Compose](#basic-docker-compose)
- [TODO: Improvements to be added by the core team](#todo-improvements-to-be-added-by-the-core-team)
- [Profiling](#profiling)
- [Code Organization](#code-organization)
- [Maintaining Documentation](#maintaining-documentation)
Expand Down Expand Up @@ -217,6 +218,22 @@ make client_start && make client_connect
✔ TriggerNextView # Let it rip!
```

9. Send a transaction (and trigger the next view)

```bash
make send_local_tx
```

### TODO: Improvements to be added by the core team

A lot of features have been added since this doc was first added. See `docs/demo`. We should update it to:

1. Show k8s LocalNet
2. Add more details related to transactions
3. Add details related to the keybase
4. Add state sync tooling
5. Add P2P tooling

### Profiling

If you need to profile the node for CPU and/or memory usage, you can use the `pprof` tool.
Expand Down
13 changes: 8 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ require (
require (
github.com/benbjohnson/clock v1.3.0
github.com/celestiaorg/smt v0.2.1-0.20220414134126-dba215ccb884
github.com/deepmap/oapi-codegen v1.12.4
github.com/dgraph-io/badger/v3 v3.2103.2
github.com/getkin/kin-openapi v0.107.0
github.com/jackc/pgconn v1.13.0
Expand Down Expand Up @@ -63,7 +64,9 @@ require (
)

require (
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jackc/puddle/v2 v2.1.2 // indirect
Expand All @@ -76,7 +79,7 @@ require (
github.com/rogpeppe/go-internal v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.10.0 // indirect
golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7 // indirect
golang.org/x/sync v0.1.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gotest.tools v2.2.0+incompatible // indirect
)
Expand Down Expand Up @@ -114,12 +117,12 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/tools v0.1.12 // indirect
golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect
golang.org/x/tools v0.3.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
29 changes: 20 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,22 @@ github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/ProtonMail/go-ecvrf v0.0.1 h1:wv45+kZ0mG4G9oSTMjAlbgKqa4tPbNr4WLoCWqz5/bo=
github.com/ProtonMail/go-ecvrf v0.0.1/go.mod h1:fhZbiRYn62/JGnBG2NGwCx0oT+gr/+I5R/hwiyAFpAU=
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
github.com/celestiaorg/smt v0.2.1-0.20220414134126-dba215ccb884 h1:iRNKw2WmAbVgGMNYzDH5Y2yY3+jyxwEK9Hc5pwIjZAE=
github.com/celestiaorg/smt v0.2.1-0.20220414134126-dba215ccb884/go.mod h1:/sdYDakowo/XaxS2Fl7CBqtuf/O2uTqF2zmAUFAtAiw=
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
Expand Down Expand Up @@ -106,6 +110,8 @@ github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/deepmap/oapi-codegen v1.12.4 h1:pPmn6qI9MuOtCz82WY2Xaw46EQjgvxednXXrP7g5Q2s=
github.com/deepmap/oapi-codegen v1.12.4/go.mod h1:3lgHGMu6myQ2vqbbTXH2H1o4eXFTGnFiDaOaKKl5yas=
github.com/dgraph-io/badger/v3 v3.2103.2 h1:dpyM5eCJAtQCBcMCZcT4UBZchuTJgCywerHHgmxfxM8=
github.com/dgraph-io/badger/v3 v3.2103.2/go.mod h1:RHo4/GmYcKKh5Lxu63wLEMHJ70Pac2JqZRYGhlyAo2M=
github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8=
Expand Down Expand Up @@ -226,6 +232,8 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
Expand Down Expand Up @@ -296,6 +304,7 @@ github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
Expand Down Expand Up @@ -459,6 +468,7 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU=
github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw=
github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
Expand All @@ -481,8 +491,9 @@ github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljT
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4=
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
Expand Down Expand Up @@ -560,8 +571,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -626,8 +637,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7 h1:ZrnxWX62AgTKOSagEqxvb3ffipvEDX2pl7E1TdqLqIc=
golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -714,8 +725,8 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs=
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20220411224347-583f2d630306 h1:+gHMid33q6pen7kv9xvT+JRinntgeXO2AeZVd0AWD3w=
golang.org/x/time v0.0.0-20220411224347-583f2d630306/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
Expand Down Expand Up @@ -768,8 +779,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.3.0 h1:SrNbZl6ECOS1qFzgTdQfWXZM9XBkiA6tkFrH9YSTPHM=
golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
4 changes: 4 additions & 0 deletions logger/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.0.6] - 2023-02-09

- `loggerModule` type-checking for `modules.Module`

## [0.0.0.5] - 2023-02-07

- Added GITHUB_WIKI tags where it was missing
Expand Down
2 changes: 2 additions & 0 deletions logger/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"github.com/rs/zerolog"
)

var _ modules.Module = &loggerModule{}

type loggerModule struct {
zerolog.Logger
bus modules.Bus
Expand Down
5 changes: 5 additions & 0 deletions p2p/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.0.25] - 2023-02-09

- Updated logging initialization and passing to the network component instead of using the global logger
- Fixed incorrect use of `bus.GetLoggerModule()` in `stdnetwork.go` since it's never initialized when running the debug CLI

## [0.0.0.24] - 2023-02-06

- Address legacy linter errors from `golangci-lint`
Expand Down
4 changes: 3 additions & 1 deletion p2p/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,15 @@ func (m *p2pModule) GetModuleName() string {
}

func (m *p2pModule) Start() error {
logger.Global.Info().Msg("Starting network module")
m.logger = logger.Global.CreateLoggerForModule(m.GetModuleName())
m.logger.Info().Msg("Starting network module")

addrbookProvider := getAddrBookProvider(m)
currentHeightProvider := getCurrentHeightProvider(m)

cfg := m.GetBus().GetRuntimeMgr().GetConfig()

// TODO: pass down logger
if cfg.P2P.UseRainTree {
m.network = raintree.NewRainTreeNetwork(m.address, m.GetBus(), addrbookProvider, currentHeightProvider)
} else {
Expand Down
Loading