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

[P2P] Refactor/consolidate P2P modules #576

Merged
merged 90 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
337ee8f
refactor: move peer and url conversion to `p2p/utils` pkg
bryanchriswhite Mar 18, 2023
206b647
refactor: move and rename `network.setupHost` to `utils.PopulateLibp2…
bryanchriswhite Mar 17, 2023
d8e6fa5
chore: move protocol package into P2P module
bryanchriswhite Mar 9, 2023
09f4ac8
refactor: consolidate libp2p & P2P modules
bryanchriswhite Mar 17, 2023
ec98ead
refactor: consolidate libp2p and stdnetwork networks
bryanchriswhite Mar 20, 2023
6f159c0
refactor: consolidate P2P changelogs
bryanchriswhite Mar 23, 2023
e5c43f1
chore: delete remains of libp2p module
bryanchriswhite Mar 23, 2023
00c7f2b
chore: remove libp2p module dir from mockgen make target
bryanchriswhite Mar 18, 2023
6d20681
chore: cleanup debug CLI, post libp2p module deletion
bryanchriswhite Mar 18, 2023
b16d2d0
chore: cleanup `Node`, post libp2p module deletion
bryanchriswhite Mar 18, 2023
c5c767e
refactor: remove `UseLibp2p` config field
bryanchriswhite Mar 20, 2023
bd950af
chore: add libp2p mock generator for `host.Host`
bryanchriswhite Mar 18, 2023
10aa7d9
refactor: move `shared/p2p` pkg into `p2p/types`
bryanchriswhite Mar 23, 2023
304c4cd
chore: add `package` flag to `Network` mockgen call
bryanchriswhite Mar 18, 2023
2d65acc
chore: use `net.DefaultResolver` in `getPeerIP`
bryanchriswhite Mar 18, 2023
d0c881e
refactor: P2P module tests
bryanchriswhite Mar 18, 2023
499f97e
refactor: raintree network
bryanchriswhite Mar 18, 2023
177f1c1
refactor: raintree tests
bryanchriswhite Mar 23, 2023
498229a
chore: remove unused `Transport` interface and related
bryanchriswhite Mar 18, 2023
b757af8
chore: update changelog
bryanchriswhite Mar 18, 2023
2770f41
Merge remote-tracking branch 'pokt/main' into refactor/consolidate-p2…
bryanchriswhite Mar 28, 2023
1e120cb
test: port libp2p network test to stdnetwork pkg
bryanchriswhite Mar 28, 2023
8bf12e7
chore: un-name error return
bryanchriswhite Mar 28, 2023
a981bf0
fix: stdnetwork libp2p peerstore sync
bryanchriswhite Mar 28, 2023
311d7fc
chore: unexport `utils.defaultPeerTTL`
bryanchriswhite Mar 28, 2023
a97dbb1
chore: remove unused pubsub pieces
bryanchriswhite Mar 28, 2023
e060ba7
chore: update deps, remove go-libp2p-pubsub
bryanchriswhite Mar 28, 2023
957ebbb
chore: rename `readStreamTimeout`
bryanchriswhite Mar 28, 2023
b89fc48
chore: add issue numbers to TECHDEBT comments
bryanchriswhite Mar 28, 2023
a188138
chore: call setup after considering options
bryanchriswhite Mar 28, 2023
c42412e
refactor: `p2pModule#startHost()` not to reuse closed host
bryanchriswhite Mar 28, 2023
343c7cf
refactor: `p2pModule#setupDependencies`:
bryanchriswhite Mar 28, 2023
8cd52c7
chore: add missing godoc comments
bryanchriswhite Mar 28, 2023
b7c690d
refactor: `p2pModule#HandleNetworkData` to return an error
bryanchriswhite Mar 28, 2023
f78bd39
test: assign `genesisMock` to a var
bryanchriswhite Mar 28, 2023
0e2a1d5
test: improve test lifecycle
bryanchriswhite Mar 28, 2023
7ca40de
test: fix genesis mock, use all test validators
bryanchriswhite Mar 28, 2023
3b6253e
test: factor out test service URL
bryanchriswhite Mar 28, 2023
111ae0a
chore: improve debug & error logging
bryanchriswhite Mar 28, 2023
4b3f1c0
test: improve raintree network test
bryanchriswhite Mar 28, 2023
bd278b2
chore: use `context.TODO()`
bryanchriswhite Mar 28, 2023
a26e641
chore: update changelog
bryanchriswhite Mar 28, 2023
dab3215
chore: add `RainTreeConfig` struct
bryanchriswhite Mar 30, 2023
b2f0cd0
chore: add `#Create()` & use new config struct
bryanchriswhite Mar 30, 2023
f094347
chore: refactor tests to use `RainTreeConfig`
bryanchriswhite Mar 30, 2023
e2ec506
chore: remove unnecessary debug log line
bryanchriswhite Mar 30, 2023
67ae3c7
fix: `context.TODO()`
bryanchriswhite Mar 30, 2023
5d625d8
chore: improve `rainTreeNetwork` struct comments
bryanchriswhite Mar 30, 2023
024ce95
Merge remote-tracking branch 'pokt/main' into refactor/consolidate-p2…
bryanchriswhite Mar 30, 2023
f87722c
chore: update changelog
bryanchriswhite Mar 30, 2023
a4f4357
chore: improve TECHDEBT comment
bryanchriswhite Mar 30, 2023
c09aa70
Merge remote-tracking branch 'pokt/main' into HEAD
bryanchriswhite Mar 31, 2023
348a698
refactor: rename `#startHost` to `#setupHost` for consistency
bryanchriswhite Mar 31, 2023
8249db9
fix: `RainTreeConfig#isValid()` checks `host` != nil
bryanchriswhite Mar 31, 2023
e08f024
fix: move `#setupNetwork()` call into `#Start()`
bryanchriswhite Mar 31, 2023
4207744
chore: update `p2pModule` struct field order/comments
bryanchriswhite Mar 31, 2023
c761647
chore: enforce `RainTreeNetwork` implements `modules.IntegratableModule`
bryanchriswhite Mar 31, 2023
2585196
Temp reference commit by Olshansky
Olshansk Apr 11, 2023
3f82c0d
Merge remote-tracking branch 'pokt/main' into refactor/consolidate-p2…
bryanchriswhite Apr 12, 2023
2185906
chore: improve logging
bryanchriswhite Apr 12, 2023
55c8a66
fix: stream / resource limit bug
bryanchriswhite Apr 12, 2023
9d68e1d
revert: max conn count config
bryanchriswhite Apr 12, 2023
41ddffd
wip: debugging k8s/tilt localnet
bryanchriswhite Apr 12, 2023
4cf437d
Merge remote-tracking branch 'pokt/main' into refactor/consolidate-p2…
bryanchriswhite Apr 12, 2023
bb07e7e
use pod IP for POCKET_P2P_HOSTNAME
okdas Apr 12, 2023
c869310
chore: update/improve comments
bryanchriswhite Apr 13, 2023
b74d289
chore: remove unnecessary multierror usage
bryanchriswhite Apr 13, 2023
a449d37
chore: improve error log messaging
bryanchriswhite Apr 13, 2023
6bb54ae
test: pass `*testing.T` to `getPeerstore` helper
bryanchriswhite Apr 13, 2023
9573730
chore: remove `use_libp2p` from k8s config
bryanchriswhite Apr 13, 2023
5be78e6
chore: `RainTreeConfig#isValid()` returns multierr
bryanchriswhite Apr 13, 2023
e1f9c50
chore: group imports
bryanchriswhite Apr 13, 2023
847409b
fix: re-evaluate options on p2p module `#Start()`
bryanchriswhite Apr 13, 2023
39d16cd
chore: update changelog
bryanchriswhite Apr 13, 2023
10f3117
fix: test helper & add TECHDEBT comment
bryanchriswhite Apr 14, 2023
7033668
chore: add TECHDEBT comment
bryanchriswhite Apr 14, 2023
c7aaeb0
chore: improve comments
bryanchriswhite Apr 14, 2023
df787e4
fix: module restart `WithHost` (again)
bryanchriswhite Apr 14, 2023
fe0b979
chore: simplify log
bryanchriswhite Apr 14, 2023
517b940
chore: tidy type assertions
bryanchriswhite Apr 14, 2023
cf140ab
Merge remote-tracking branch 'pokt/main' into refactor/consolidate-p2…
bryanchriswhite Apr 14, 2023
55123e2
chore: update changelog
bryanchriswhite Apr 14, 2023
d8187ce
Merge remote-tracking branch 'pokt/main' into refactor/consolidate-p2…
bryanchriswhite Apr 15, 2023
b09e98c
chore: remove `use_libp2p` from validator chart
bryanchriswhite Apr 17, 2023
c3f9255
chore: update validator chart P2P hostname config
bryanchriswhite Apr 17, 2023
7e9343b
add generated helm docs
invalid-email-address Apr 17, 2023
b99e81c
chore: update changelog
bryanchriswhite Apr 17, 2023
09d173a
switch to new dns introduced with helm charts
okdas Apr 17, 2023
1668e11
Merge remote-tracking branch 'pokt/main' into refactor/consolidate-p2…
bryanchriswhite Apr 17, 2023
90cf45e
chore: update changelog
bryanchriswhite Apr 17, 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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ mockgen: clean_mocks ## Use `mockgen` to generate mocks used for testing purpose
go generate ./${modules_dir}
echo "Mocks generated in ${modules_dir}/mocks"

$(eval DIRS = p2p libp2p persistence)
$(eval DIRS = p2p persistence)
for dir in $(DIRS); do \
echo "Processing $$dir mocks..."; \
find $$dir/types/mocks -type f ! -name "mocks.go" -exec rm {} \;; \
Expand Down
36 changes: 12 additions & 24 deletions app/client/cli/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ import (
"os"

"github.com/manifoldco/promptui"
"github.com/pokt-network/pocket/libp2p"
"github.com/spf13/cobra"
"google.golang.org/protobuf/types/known/anypb"

"github.com/pokt-network/pocket/logger"
"github.com/pokt-network/pocket/p2p"
"github.com/pokt-network/pocket/p2p/providers/current_height_provider"
rpcCHP "github.com/pokt-network/pocket/p2p/providers/current_height_provider/rpc"
"github.com/pokt-network/pocket/p2p/providers/peerstore_provider"
rpcABP "github.com/pokt-network/pocket/p2p/providers/peerstore_provider/rpc"
typesP2P "github.com/pokt-network/pocket/p2p/types"
"github.com/pokt-network/pocket/runtime"
"github.com/pokt-network/pocket/runtime/defaults"
"github.com/pokt-network/pocket/shared/messaging"
"github.com/pokt-network/pocket/shared/modules"
sharedP2P "github.com/pokt-network/pocket/shared/p2p"
"github.com/spf13/cobra"
"google.golang.org/protobuf/types/known/anypb"
)

// TECHDEBT: Lowercase variables / constants that do not need to be exported.
Expand Down Expand Up @@ -105,13 +105,17 @@ func NewDebugCommand() *cobra.Command {

setValueInCLIContext(cmd, busCLICtxKey, bus)

// TECHDEBT: simplify after P2P module consolidation.
var err error
p2pMod, err = getP2PModule(runtimeMgr)
mod, err := p2p.Create(bus)
if err != nil {
logger.Global.Fatal().Err(err).Msg("Failed to create p2p module")
}

var ok bool
p2pMod, ok = mod.(modules.P2PModule)
if !ok {
logger.Global.Fatal().Msgf("unexpected P2P module type: %T", mod)
}

Comment on lines +108 to +118
Copy link
Contributor Author

@bryanchriswhite bryanchriswhite Apr 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB: While mod's interface does define #Start(), it does not define other members of modules.P2Pmodule (e.g. #Send()) which are called on the global var p2pMod in other functions in this module.

if err := p2pMod.Start(); err != nil {
logger.Global.Fatal().Err(err).Msg("Failed to start p2p module")
}
Expand Down Expand Up @@ -265,7 +269,7 @@ func sendDebugMessage(cmd *cobra.Command, debugMsg *messaging.DebugMessage) {
}

// fetchPeerstore retrieves the providers from the CLI context and uses them to retrieve the address book for the current height
func fetchPeerstore(cmd *cobra.Command) (sharedP2P.Peerstore, error) {
func fetchPeerstore(cmd *cobra.Command) (typesP2P.Peerstore, error) {
bus, ok := getValueFromCLIContext[modules.Bus](cmd, busCLICtxKey)
if !ok || bus == nil {
return nil, errors.New("retrieving bus from CLI context")
Expand Down Expand Up @@ -293,22 +297,6 @@ func fetchPeerstore(cmd *cobra.Command) (sharedP2P.Peerstore, error) {
return pstore, nil
}

func getP2PModule(runtimeMgr *runtime.Manager) (p2pModule modules.P2PModule, err error) {
bus := runtimeMgr.GetBus()

var mod modules.Module
if runtimeMgr.GetConfig().UseLibP2P {
mod, err = libp2p.Create(bus)
} else {
mod, err = p2p.Create(bus)
}
if err != nil {
return nil, err
}

return mod.(modules.P2PModule), nil
}

// sendConsensusNewHeightEventToP2PModule mimicks the consensus module sending a ConsensusNewHeightEvent to the p2p module
// This is necessary because the debug client is not a validator and has no consensus module but it has to update the peerstore
// depending on the changes in the validator set.
Expand Down
4 changes: 4 additions & 0 deletions app/client/doc/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.28] - 2023-04-14

- Refactor debug CLI post P2P module re-consolidation

## [0.0.0.27] - 2023-04-07

- Add Query Command
Expand Down
1 change: 1 addition & 0 deletions build/deployments/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ services:
- "seccomp:unconfined"
environment:
- POCKET_RPC_USE_CORS=true
- LIBP2P_DEBUG=info
# Uncomment to enable the pprof server
# - PPROF_ENABLED=true
# Uncomment to enable DLV debugging
Expand Down
6 changes: 6 additions & 0 deletions build/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.0.34] - 2023-04-14

- Removed runtime/configs.Config#UseLibp2p field
- Use pod IP for validator DNS resolution tilt localnet
- Add `LIBP2P_DEBUG` env var

## [0.0.0.33] - 2023-04-13

- Add persistent txIndexerPath to node configs
Expand Down
4 changes: 4 additions & 0 deletions build/localnet/manifests/cli-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ spec:
# Any host that is visible and connected to the cluster can be arbitrarily selected as the RPC host
- name: RPC_HOST
value: v1-validator001
# TECHDEBT(#678): debug client requires hostname to participate
# in P2P networking.
- name: POCKET_P2P_HOSTNAME
value: "127.0.0.1"
Comment on lines +81 to +82
Copy link
Contributor Author

@bryanchriswhite bryanchriswhite Apr 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this to resolve this error when using the debug cli in the tilt localnet (however, the value isn't actually used by the debug CLI):

{"level":"fatal","error":"parsing multiaddr from config: resolving peer IP for hostname: : resolving peer IP for hostname: , lookup : no such host","time":"2023-04-13T07:21:23Z","message":"Failed to create p2p module"}
command terminated with exit code 1

I read this as, it tried to resolve DNS for an empty string

I hypothesize that the reason this is necessary in tilt and not in docker compose is because the config manifest has p2p.is_empty_connection_type: false and is common to both the validator and the debug cli manifests. I'm attempting to set POCKET_P2P_IS_CONNECTION_EMPTY but it didn't seem to work straight away. 🤔

  - name: POCKET_P2P_IS_EMPTY_CONNECTION_TYPE
    value: "true"

(Thoughts on this one @okdas?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Isn't is_empty_connection_type only used for testing? The CLI still needs a non-empty connection type (i.e. TLS) to communicate with the network.

  2. W/e solution we decide to go with, adding comments in the yaml file next to the config saying "it's a hack or needed because of Y" would help

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryanchriswhite I think you don't see that behavior on docker-compose because by default CLI uses client1.json as a main config:

configPath = runtime.GetEnv("CONFIG_PATH", "build/config/config1.json")

Which has node1.consensus set as a hostname.

I need to look deeper to figure out why it tries to resolve the empty host string when the value is 127.0.0.1, I wonder what'd happen if the value was localhost. I'd vote for 0.0.0.0 as a default value.

I think requiring such parameters (hostname, Postgres, etc.) is counterintuitive when the user only needs to use CLI. In the current v0 world, users often use CLI to query pocket RPC endpoints to get the latest height, information about nodes, etc. We definitely should not require unnecessary configs. I'll see if such a ticket exists to add more information or create a new one tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@okdas Apologies for any confusion, to be clear, setting POCKET_P2P_HOSTNAME to 127.0.0.1 does resolve the error, I just wasn't confident that it was the correct or even temporarily acceptable solution. Given your improved explanation for the behavior, it seems like a change need to be made in the code rather than the configs. It shouldn't be necessary for the debug client to specify a hostname that it doesn't use (see #678).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment added:

    # TECHDEBT(#678): debug client requires hostname to participate
    # in P2P networking.
  - name: POCKET_P2P_HOSTNAME
    value: "127.0.0.1"

Copy link
Contributor Author

@bryanchriswhite bryanchriswhite Apr 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Olshansk

  1. Isn't is_empty_connection_type only used for testing? The CLI still needs a non-empty connection type (i.e. TLS) to communicate with the network.

runtime/configs.P2PConfig#ConnectionType is only used to inform the listen address that is provided to the libp2p host. In the debug client case, we use libp2p.NoListenAddrs but at some other point, we try to construct a self service URL from the P2P config and parse it as a multiaddr anyways.

  1. W/e solution we decide to go with, adding comments in the yaml file next to the config saying "it's a hack or needed because of Y" would help

👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

volumeMounts:
# IMPROVE: should probably go in /etc/pocket and have Viper read from there as a default path
- mountPath: /var/pocket/config
Expand Down
2 changes: 1 addition & 1 deletion build/localnet/manifests/configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ data:
{
"root_directory": "/go/src/github.com/pocket-network",
"private_key": "",
"use_libp2p": false,
"consensus": {
"max_mempool_bytes": 500000000,
"pacemaker_config": {
Expand Down Expand Up @@ -36,6 +35,7 @@ data:
},
"p2p": {
"port": 42069,
"hostname": "",
Copy link
Contributor Author

@bryanchriswhite bryanchriswhite Apr 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rationale

image

Is there an issue for this / should there be?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, just add a comment with the rationale

Copy link
Contributor Author

@bryanchriswhite bryanchriswhite Apr 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Unfortunately I don't think it's possible to add a comment inline with the JSON as that would produce invalid JSON. Comments were introduced in JSON5, which has been slow to catch on 😅

This seems to be fairly conventional at this point as there are other env vars which are being set to empty string, presumably for the same reason. Perhaps this would be better represented in the docs?

"use_rain_tree": true,
"is_empty_connection_type": false,
"private_key": "0ca1a40ddecdab4f5b04fa0bfed1d235beaa2b8082e7554425607516f0862075dfe357de55649e6d2ce889acf15eb77e94ab3c5756fe46d3c7538d37f27f115e",
Expand Down
4 changes: 3 additions & 1 deletion build/localnet/templates/v1-validator-template.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ spec:
- name: POCKET_PERSISTENCE_NODE_SCHEMA
value: validator${VALIDATOR_NUMBER}
- name: POCKET_P2P_HOSTNAME
value: "v1-validator${VALIDATOR_NUMBER}"
valueFrom:
fieldRef:
fieldPath: status.podIP
volumeMounts:
- name: config-volume
mountPath: /configs
Expand Down
11 changes: 5 additions & 6 deletions consensus/debugging.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ func (m *consensusModule) resetToGenesis(_ *messaging.DebugMessage) error {

func (m *consensusModule) printNodeState(_ *messaging.DebugMessage) {
state := m.GetNodeState()
m.logger.Debug().
Fields(map[string]any{
"step": state.Step,
"height": state.Height,
"round": state.Round,
}).Msg("Node state")
m.logger.Debug().Fields(map[string]any{
"step": typesCons.StepToString[typesCons.HotstuffStep(state.Step)],
"height": state.Height,
"round": state.Round,
}).Msg("Node state")
}

func (m *consensusModule) triggerNextView(_ *messaging.DebugMessage) {
Expand Down
4 changes: 4 additions & 0 deletions consensus/doc/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.47] - 2023-04-14

- Debug logging improvements

## [0.0.0.46] - 2023-04-13

- Utilise the `TxResult` protobuf from `shared/core/types`
Expand Down
24 changes: 7 additions & 17 deletions consensus/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,11 @@ func protoHash(m proto.Message) string {

func (m *consensusModule) sendToLeader(msg *typesCons.HotstuffMessage) {
leaderId := m.leaderId
m.logger.Debug().Fields(
map[string]any{
"src": m.nodeId,
"dst": leaderId,
"height": msg.GetHeight(),
"step": msg.GetStep(),
"round": msg.GetRound(),
},
).Msg("✉️ About to try sending hotstuff message ✉️")

loggingFields := hotstuffMsgToLoggingFields(msg)
loggingFields["src"] = m.nodeId
loggingFields["dst"] = leaderId
m.logger.Debug().Fields(loggingFields).Msg("✉️ About to try sending hotstuff message ✉️")

// TODO: This can happen due to a race condition with the pacemaker.
if leaderId == nil {
Expand Down Expand Up @@ -183,13 +179,7 @@ func (m *consensusModule) sendToLeader(msg *typesCons.HotstuffMessage) {
// Star-like (O(n)) broadcast - send to all nodes directly
// INVESTIGATE: Re-evaluate if we should be using our structured broadcast (RainTree O(log3(n))) algorithm instead
func (m *consensusModule) broadcastToValidators(msg *typesCons.HotstuffMessage) {
m.logger.Info().Fields(
map[string]any{
"height": m.CurrentHeight(),
"step": m.step,
"round": m.round,
},
).Msg("📣 Broadcasting message 📣")
m.logger.Info().Fields(hotstuffMsgToLoggingFields(msg)).Msg("📣 Broadcasting message 📣")

anyConsensusMessage, err := codec.GetCodec().ToAny(msg)
if err != nil {
Expand Down Expand Up @@ -301,6 +291,6 @@ func hotstuffMsgToLoggingFields(msg *typesCons.HotstuffMessage) map[string]any {
return map[string]any{
"height": msg.GetHeight(),
"round": msg.GetRound(),
"step": msg.GetStep(),
"step": typesCons.StepToString[msg.GetStep()],
}
}
2 changes: 1 addition & 1 deletion consensus/module_consensus_pacemaker.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (m *consensusModule) ResetRound(isNewHeight bool) {
func (m *consensusModule) ReleaseUtilityUnitOfWork() error {
utilityUnitOfWork := m.utilityUnitOfWork
if utilityUnitOfWork == nil {
m.logger.Debug().Msg("Try to release utilityUnitOfWork is nil...")
m.logger.Debug().Msg("Try to release a nil utilityUnitOfWork... Ideally this should not happen")
return nil
}
if err := utilityUnitOfWork.Release(); err != nil {
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ require (
github.com/korovkin/limiter v0.0.0-20230307205149-3d4b2b34c99d
github.com/labstack/echo/v4 v4.9.1
github.com/libp2p/go-libp2p v0.25.1
github.com/libp2p/go-libp2p-pubsub v0.9.2
github.com/looplab/fsm v1.0.1
github.com/manifoldco/promptui v0.9.0
github.com/mitchellh/mapstructure v1.5.0
Expand Down Expand Up @@ -110,7 +109,6 @@ require (
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect
github.com/huin/goupnp v1.0.3 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,6 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru/v2 v2.0.1 h1:5pv5N1lT1fjLg2VQ5KWc7kmucp2x/kvFOnxuVTqZ6x4=
github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/vault/api v1.9.0 h1:ab7dI6W8DuCY7yCU8blo0UCYl2oHre/dloCmzMWg9w8=
Expand Down Expand Up @@ -529,8 +527,6 @@ github.com/libp2p/go-libp2p v0.25.1 h1:YK+YDCHpYyTvitKWVxa5PfElgIpOONU01X5UcLEwJ
github.com/libp2p/go-libp2p v0.25.1/go.mod h1:xnK9/1d9+jeQCVvi/f1g12KqtVi/jP/SijtKV1hML3g=
github.com/libp2p/go-libp2p-asn-util v0.2.0 h1:rg3+Os8jbnO5DxkC7K/Utdi+DkY3q/d1/1q+8WeNAsw=
github.com/libp2p/go-libp2p-asn-util v0.2.0/go.mod h1:WoaWxbHKBymSN41hWSq/lGKJEca7TNm58+gGJi2WsLI=
github.com/libp2p/go-libp2p-pubsub v0.9.2 h1:CoWrvqtIbk+8iTLk1yCN8zODMgBSCqRgyVCvHaGJx8Y=
github.com/libp2p/go-libp2p-pubsub v0.9.2/go.mod h1:RYA7aM9jIic5VV47WXu4GkcRxRhrdElWf8xtyli+Dzc=
github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA=
github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0=
github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM=
Expand Down
47 changes: 0 additions & 47 deletions libp2p/docs/CHANGELOG.md

This file was deleted.

Loading