You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
1. Simplify `PeerstoreProvider` interface
2. Extend it to support retrieval of the unstaked actor peerstore
3. Implement the extended interface in `persistencePeerstoreProvider`
### Before
```mermaid
classDiagram
class InterruptableModule {
<<interface>>
Start() error
Stop() error
}
class IntegratableModule {
<<interface>>
+SetBus(bus Bus)
+GetBus() Bus
}
class InitializableModule {
<<interface>>
+GetModuleName() string
+Create(bus Bus, opts ...Option) (Module, error)
}
class Module {
<<interface>>
}
Module --|> InitializableModule
Module --|> IntegratableModule
Module --|> InterruptableModule
class PeerstoreProvider {
<<interface>>
+GetStakedPeerstoreAtHeight(height int) (Peerstore, error)
+GetP2PConfig() *P2PConfig
}
class persistencePeerstoreProvider
class rpcPeerstoreProvider
persistencePeerstoreProvider --|> PeerstoreProvider
rpcPeerstoreProvider --|> PeerstoreProvider
PeerstoreProvider --|> Module
```
### After
```mermaid
classDiagram
class IntegratableModule {
<<interface>>
+GetBus() Bus
+SetBus(bus Bus)
}
class PeerstoreProvider {
<<interface>>
+GetStakedPeerstoreAtHeight(height int) (Peerstore, error)
+GetUnstakedPeerstore() (Peerstore, error)
}
class persistencePeerstoreProvider
class rpcPeerstoreProvider
class p2pModule
class unstakedPeerstoreProvider {
<<interface>>
+GetUnstakedPeerstore() (Peerstore, error)
}
persistencePeerstoreProvider --|> PeerstoreProvider
persistencePeerstoreProvider --> p2pModule : from Bus
rpcPeerstoreProvider --> p2pModule : from Bus
p2pModule --|> unstakedPeerstoreProvider
rpcPeerstoreProvider --|> PeerstoreProvider
rpcPeerstoreProvider --|> Module
PeerstoreProvider --|> IntegratableModule
class Module {
<<interface>>
}
Module --|> InitializableModule
Module --|> IntegratableModule
Module --|> InterruptableModule
```
## Issue
Realted:
- #810
Dependants:
- #505
- #806
## Type of change
Please mark the relevant option(s):
- [ ] New feature, functionality or library
- [ ] Bug fix
- [ ] Code health or cleanup
- [ ] Major breaking change
- [ ] Documentation
- [ ] Other <!-- add details here if it a different type of change -->
## List of changes
- Replaced embedded `modules.Module` with simpler
`modules.IntegratableModule` in `PeerstoreProvider` interface
- Removed unused `PeerstoreProvider#GetP2PConfig()` method
- Added `PeerstoreProvider#GetUnstakedPeerstore()` method
- Added `p2pPeerstoreProvider` implementation of `PeerstoreProvider`
interface
- Added `Factory` generic type
## Testing
- [ ] `make develop_test`; if any code changes were made
- [x] `make test_e2e` on [k8s
LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md);
if any code changes were made
- [ ] `e2e-devnet-test` passes tests on
[DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd);
if any code was changed
- [x] [Docker Compose
LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md);
if any major functionality was changed or introduced
- [x] [k8s
LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md);
if any infrastructure or configuration changes were made
<!-- REMOVE this comment block after following the instructions
If you added additional tests or infrastructure, describe it here.
Bonus points for images and videos or gifs.
-->
## Required Checklist
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added, or updated, [`godoc` format
comments](https://go.dev/blog/godoc) on touched members (see:
[tip.golang.org/doc/comment](https://tip.golang.org/doc/comment))
- [ ] I have tested my changes using the available tooling
- [ ] I have updated the corresponding CHANGELOG
### If Applicable Checklist
- [ ] I have updated the corresponding README(s); local and/or global
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added, or updated,
[mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding
README(s)
- [ ] I have added, or updated, documentation and
[mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*`
if I updated `shared/*`README(s)
0 commit comments