Skip to content
Merged
Show file tree
Hide file tree
Changes from 96 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
fe24824
refactor: unicast router
bryanchriswhite Jun 19, 2023
1277859
chore: cleanup TODOs
bryanchriswhite Jun 22, 2023
871af48
chore: add background message
bryanchriswhite Jun 16, 2023
013c433
chore: add `Router#Close()`
bryanchriswhite Jun 22, 2023
4f998ee
chore: separate raintree & bg protocol IDs
bryanchriswhite Jun 22, 2023
1c9c18c
chore: generate `PocketEnvelope` nonce in `PackMessage()`
bryanchriswhite Jun 22, 2023
f9a0c10
refactor: add `Handler` to router config validation
bryanchriswhite Jun 22, 2023
0bdffbd
refactor: raintree router
bryanchriswhite Jun 22, 2023
2b40776
refactor: background router
bryanchriswhite Jun 22, 2023
213f294
refactor: integrate bg router
bryanchriswhite Jun 22, 2023
437afc8
refactor: staked actor router peer discovery
bryanchriswhite Jun 22, 2023
43cf671
test: post-refactor updates
bryanchriswhite Jun 22, 2023
4b19d8f
Merge remote-tracking branch 'pokt/main' into refactor/unicast-router
bryanchriswhite Jun 22, 2023
cf886a7
Merge branch 'refactor/unicast-router' into feat/integrate-bg-router
bryanchriswhite Jun 22, 2023
048e306
fix: gofmt
bryanchriswhite Jun 23, 2023
e09f8b2
fix: typo; rename `IntegratableModule` to `IntegrableModule`
bryanchriswhite Jun 23, 2023
7b73420
refactor: rename `InitializableModule` to `InjectableModule`
bryanchriswhite Jun 23, 2023
398e947
chore: remove `InjectableModule#Create()` as `Moudle` also embeds `Mo…
bryanchriswhite Jun 23, 2023
6a20445
chore: add `Submodule` interface type
bryanchriswhite Jun 23, 2023
d7278b8
Merge remote-tracking branch 'pokt/main' into refactor/unicast-router
bryanchriswhite Jun 23, 2023
acc1d59
Merge branch 'refactor/unicast-router' into feat/integrate-bg-router
bryanchriswhite Jun 23, 2023
ec0fbca
refactor: peerstore providers as submodules
bryanchriswhite Jun 23, 2023
4645401
docs: update module readme
bryanchriswhite Jun 23, 2023
b83b3c3
refactor: `Bus#RegisterModule()` to take a `Submodule` (subset of `Mo…
bryanchriswhite Jun 23, 2023
db07d19
refactor: `ModuleRegistry` to use `InjectableModule` instead of `Module`
bryanchriswhite Jun 23, 2023
d17f323
chore: remove unused P2P config field & option in `rpcPeerstoreProvider`
bryanchriswhite Jun 23, 2023
c55a437
Merge branch 'feat/integrate-bg-router' into chore/introduce-submodule
bryanchriswhite Jun 23, 2023
106b181
fix: `treeStore` submodule, post-merge
bryanchriswhite Jun 23, 2023
f8d7f21
chore: remove unused `nonceDebugger` & cleanup imports in `rainTreeRo…
bryanchriswhite Jun 23, 2023
51cd2d9
chore: simplify
bryanchriswhite Jun 23, 2023
cec1403
[chore] add details about submodules and bus registration
dylanlott Jun 23, 2023
9ab2a5d
chore: fix typo in comment
bryanchriswhite Jun 26, 2023
dce1bac
chore: add debug log
bryanchriswhite Jun 26, 2023
8dc2852
chore: fix field comment out of place
bryanchriswhite Jun 26, 2023
a6d4b52
fix: imports
bryanchriswhite Jun 26, 2023
87d1fa9
Merge branch 'refactor/unicast-router' into feat/integrate-bg-router
bryanchriswhite Jun 26, 2023
d24407b
chore: bootstrap refactor / TECHDEBT
bryanchriswhite Jun 26, 2023
70ca573
fix: imports
bryanchriswhite Jun 26, 2023
8467f3a
chore: remove unused field
bryanchriswhite Jun 26, 2023
ce48583
chore: fix typo in comment
bryanchriswhite Jun 26, 2023
70ab94c
chore: add debug log
bryanchriswhite Jun 26, 2023
4db402e
chore: fix field comment out of place
bryanchriswhite Jun 26, 2023
8bc24a9
chore: bootstrap refactor / TECHDEBT
bryanchriswhite Jun 26, 2023
93144cf
fix: imports
bryanchriswhite Jun 26, 2023
11bc8fa
Merge branch 'feat/integrate-bg-router' into chore/introduce-submodule
bryanchriswhite Jun 26, 2023
c3bc4c7
chore: cleanup unused test utils
bryanchriswhite Jun 27, 2023
fcb480e
docs: update readme + review feedback
bryanchriswhite Jun 27, 2023
3fdada6
chore: comment cleanup
bryanchriswhite Jun 28, 2023
39a7877
chore: add submodule TECHDEBT comments
bryanchriswhite Jun 28, 2023
049cbf5
chore: add missing godoc comments
bryanchriswhite Jun 28, 2023
79a1c6e
chore: cleanup unused garbage
bryanchriswhite Jun 28, 2023
a7c4bf6
fix: return error
bryanchriswhite Jun 28, 2023
904f17b
Merge remote-tracking branch 'pokt/main' into refactor/unicast-router
bryanchriswhite Jun 28, 2023
70b020b
Merge branch 'refactor/unicast-router' into feat/integrate-bg-router
bryanchriswhite Jun 28, 2023
8a54f1a
chore: router logging improvements
bryanchriswhite Jun 28, 2023
6795c96
fix: interim background router bootstrapping
bryanchriswhite Jun 28, 2023
0a3fac1
fix: `p2pModule#Send()` routing logic
bryanchriswhite Jun 28, 2023
b8f9a1a
chore: improve variable naming
bryanchriswhite Jun 28, 2023
de63d6d
chore: improve comments
bryanchriswhite Jun 28, 2023
1282e1a
chore: improve debug logging
bryanchriswhite Jun 28, 2023
5793b7f
chore: return early
bryanchriswhite Jun 28, 2023
95a3948
chore: add TECHDEBT comment
bryanchriswhite Jun 29, 2023
7cdc9e7
Merge remote-tracking branch 'pokt/main' into HEAD
bryanchriswhite Jun 29, 2023
fe42ab3
test: fix raintree message target test
bryanchriswhite Jun 29, 2023
60cd2bd
docs: update P2P readme
bryanchriswhite Jun 29, 2023
8354d79
docs: update table of contents
bryanchriswhite Jun 29, 2023
f7b0202
docs: tweak P2P readme
bryanchriswhite Jun 29, 2023
d2f33a4
chore: add godoc comment
bryanchriswhite Jun 29, 2023
b527d91
chore: remove warning log
bryanchriswhite Jun 29, 2023
73da86c
chore: convert `DISCUSS_THIS_COMMIT` to `TECHDEBT`
bryanchriswhite Jun 29, 2023
05f8f91
Merge branch 'feat/integrate-bg-router' into chore/introduce-submodule
bryanchriswhite Jun 30, 2023
8a3155b
docs: README updates
bryanchriswhite Jun 30, 2023
bf96542
Merge remote-tracking branch 'pokt/main' into feat/integrate-bg-router
bryanchriswhite Jun 30, 2023
54d8d99
Merge branch 'feat/integrate-bg-router' into chore/introduce-submodule
bryanchriswhite Jun 30, 2023
5fbc1ec
refactor: rename `IntegratableModule` to `IntegrableModule` (upstream)
bryanchriswhite Jun 30, 2023
4602283
fix: typo
bryanchriswhite Jul 3, 2023
65a8c94
chore: review suggestion improvements
bryanchriswhite Jul 4, 2023
1985fab
chore: update generic type parameter constraint on bus helper
bryanchriswhite Jul 4, 2023
519db25
fix: gofmt
bryanchriswhite Jul 4, 2023
632b999
Merge branch 'feat/integrate-bg-router' into chore/introduce-submodule
bryanchriswhite Jul 4, 2023
7e7e6e7
docs: README improvements (review feedback)
bryanchriswhite Jul 4, 2023
f3437cb
docs: add architecture design language section
bryanchriswhite Jul 4, 2023
4f87921
chore: background router comment and var name cleanup
bryanchriswhite Jul 4, 2023
86a83d8
refactor: peerstore provider submodule name var
bryanchriswhite Jul 5, 2023
67b051b
fixup: refactor: peerstore providers as a submodules
bryanchriswhite Jul 5, 2023
c113a36
chore: review feedback improvements
bryanchriswhite Jul 6, 2023
3356f63
chore: add issue # to TECHDEBT comment
bryanchriswhite Jul 6, 2023
157ecb6
docs: update TOC
bryanchriswhite Jul 6, 2023
30cf145
chore: add TODO README
bryanchriswhite Jul 6, 2023
40628c4
docs: improve legend definitions
bryanchriswhite Jul 6, 2023
8c0b8c3
docs: clarify broadcast table
bryanchriswhite Jul 6, 2023
2a5e7f3
Merge branch 'feat/integrate-bg-router' into chore/introduce-submodule
bryanchriswhite Jul 6, 2023
daa8b74
docs: README edits
bryanchriswhite Jul 6, 2023
2237389
chore: improve TECHDEBT comments
bryanchriswhite Jul 6, 2023
c48e210
chore: simplify
bryanchriswhite Jul 6, 2023
c99d18b
Minor formatting
Olshansk Jul 6, 2023
5a4cc80
docs: fix mistake in peer discovery section
bryanchriswhite Jul 7, 2023
3e997f5
test: improve background router validation test
bryanchriswhite Jul 7, 2023
abd4789
chore: add error log
bryanchriswhite Jul 7, 2023
8c6ac68
fix: unstaked actor bootstrapping FSM transition
bryanchriswhite Jul 7, 2023
b76efdf
fix: goimports
bryanchriswhite Jul 7, 2023
66afa18
Merge remote-tracking branch 'pokt/main' into feat/integrate-bg-router
bryanchriswhite Jul 7, 2023
dd73031
Merge branch 'feat/integrate-bg-router' into chore/introduce-submodule
bryanchriswhite Jul 7, 2023
225f889
Merge remote-tracking branch 'pokt/main' into chore/introduce-submodule
bryanchriswhite Jul 11, 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 @@ -297,7 +297,7 @@ protogen_local: go_protoc-go-inject-tag ## Generate go structures for all of the
$(PROTOC_SHARED) -I=./consensus/types/proto --go_out=./consensus/types ./consensus/types/proto/*.proto

# P2P
$(PROTOC_SHARED) -I=./p2p/raintree/types/proto --go_out=./p2p/types ./p2p/raintree/types/proto/*.proto
$(PROTOC_SHARED) -I=./p2p/types/proto --go_out=./p2p/types ./p2p/types/proto/*.proto

# echo "View generated proto files by running: make protogen_show"

Expand Down
1 change: 1 addition & 0 deletions app/client/cli/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cli

import (
"fmt"

"github.com/spf13/cobra"

"github.com/pokt-network/pocket/app/client/cli/flags"
Expand Down
4 changes: 3 additions & 1 deletion app/client/cli/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ func fetchPeerstore(cmd *cobra.Command) (typesP2P.Peerstore, error) {
return nil, errors.New("retrieving bus from CLI context")
}
modulesRegistry := bus.GetModulesRegistry()
pstoreProvider, err := modulesRegistry.GetModule(peerstore_provider.ModuleName)
// TECHDEBT(#810, #811): use `bus.GetPeerstoreProvider()` after peerstore provider
// is retrievable as a proper submodule
pstoreProvider, err := modulesRegistry.GetModule(peerstore_provider.PeerstoreProviderSubmoduleName)
if err != nil {
return nil, errors.New("retrieving peerstore provider")
}
Expand Down
20 changes: 11 additions & 9 deletions app/client/cli/helpers/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,26 @@ func P2PDependenciesPreRunE(cmd *cobra.Command, _ []string) error {
bus := runtimeMgr.GetBus()
SetValueInCLIContext(cmd, BusCLICtxKey, bus)

setupPeerstoreProvider(*runtimeMgr, flags.RemoteCLIURL)
if err := setupPeerstoreProvider(*runtimeMgr, flags.RemoteCLIURL); err != nil {
return err
}
setupCurrentHeightProvider(*runtimeMgr, flags.RemoteCLIURL)
setupAndStartP2PModule(*runtimeMgr)

return nil
}

func setupPeerstoreProvider(rm runtime.Manager, rpcURL string) {
bus := rm.GetBus()
modulesRegistry := bus.GetModulesRegistry()
pstoreProvider := rpcPSP.Create(
rpcPSP.WithP2PConfig(rm.GetConfig().P2P),
rpcPSP.WithCustomRPCURL(rpcURL),
)
modulesRegistry.RegisterModule(pstoreProvider)
func setupPeerstoreProvider(rm runtime.Manager, rpcURL string) error {
// Ensure `PeerstoreProvider` exists in the modules registry.
if _, err := rpcPSP.Create(rm.GetBus(), rpcPSP.WithCustomRPCURL(rpcURL)); err != nil {
return err
}
return nil
}

func setupCurrentHeightProvider(rm runtime.Manager, rpcURL string) {
// TECHDEBT(#810): simplify after current height provider is refactored as
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think we'll be able to get rid of the entire "provider" paradigm once this is done?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't have a definitive answer yet, I still have to make some time to think it through holistically.

Copy link
Collaborator

Choose a reason for hiding this comment

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

My 2 POKT: We can replace providers with submoduels altogether. It's a DI approach and providers were created before the module design was mature.

// a submodule.
bus := rm.GetBus()
modulesRegistry := bus.GetModulesRegistry()
currentHeightProvider := rpcCHP.NewRPCCurrentHeightProvider(
Expand Down
2 changes: 1 addition & 1 deletion consensus/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/pokt-network/pocket/shared/messaging"
)

// publishNewHeightEvent publishes a new height event to the bus so that other interested IntegratableModules can react to it if necessary
// publishNewHeightEvent publishes a new height event to the bus so that other interested IntegrableModules can react to it if necessary
func (m *consensusModule) publishNewHeightEvent(height uint64) {
newHeightEvent, err := messaging.PackMessage(&messaging.ConsensusNewHeightEvent{Height: height})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion consensus/leader_election/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type LeaderElectionModule interface {
var _ LeaderElectionModule = &leaderElectionModule{}

type leaderElectionModule struct {
base_modules.IntegratableModule
base_modules.IntegrableModule
base_modules.InterruptableModule
}

Expand Down
4 changes: 2 additions & 2 deletions consensus/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
)

type consensusModule struct {
base_modules.IntegratableModule
base_modules.IntegrableModule

privateKey cryptoPocket.Ed25519PrivateKey

Expand Down Expand Up @@ -209,7 +209,7 @@ func (m *consensusModule) GetModuleName() string {
}

func (m *consensusModule) SetBus(pocketBus modules.Bus) {
m.IntegratableModule.SetBus(pocketBus)
m.IntegrableModule.SetBus(pocketBus)
if m.paceMaker != nil {
m.paceMaker.SetBus(pocketBus)
}
Expand Down
2 changes: 1 addition & 1 deletion consensus/pacemaker/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type Pacemaker interface {
}

type pacemaker struct {
base_modules.IntegratableModule
base_modules.IntegrableModule
base_modules.InterruptableModule

pacemakerCfg *configs.PacemakerConfig
Expand Down
2 changes: 1 addition & 1 deletion ibc/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
var _ modules.IBCModule = &ibcModule{}

type ibcModule struct {
base_modules.IntegratableModule
base_modules.IntegrableModule

cfg *configs.IBCConfig
logger *modules.Logger
Expand Down
2 changes: 1 addition & 1 deletion logger/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
var _ modules.Module = &loggerModule{}

type loggerModule struct {
base_modules.IntegratableModule
base_modules.IntegrableModule
base_modules.InterruptableModule

zerolog.Logger
Expand Down
Loading