All notable changes to this module will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Replaced
RPC_HOST
withPOCKET_REMOTE_CLI_URL
or--pocket-remote-cli-url
where appropriate
- Replaced embedded
modules.Module
with simplermodules.IntegratableModule
inPeerstoreProvider
interface - Removed unused
PeerstoreProvider#GetP2PConfig()
method - Added
PeerstoreProvider#GetUnstakedPeerstore()
method - Added temporary
unstakedPeerstoreProvider
interface - Renamed
NewRPCPeerstoreProvider()
andNewPersistencePeerstoreProvider()
toCreate()
(per package)
- Moved nonce field from RainTreeMessage to PocketEnvelope protobuf types
- Formalize NonceDeduper (and related) types
- Move NonceDeduper (and related types) from p2p/raintree to p2p/utils pkg
- Move NonceDeduper usage out of RainTreeRouter and into p2pModule
- Added
Handler
field toRainTreeConfig
&BackgroundConfig
- Refactored
rainTreeRouter
logging methods - Renamed
rainTreeRouter#HandleNetworkData()
to#handleRainTreeMsg()
- Renamed
p2pModule#handleNetworkData()
to#handlePocketEnvelope()
- Added -tags=test to all test make targets
- Fixed mockdns usage in
TestP2PModule_Insecure_Error
test - Moved message handling from p2p module to router
- Use the shared codec module when marshaling the data sent over the wire
- Introduce a hacky workaround to cast a
uint32
to astring
since it is being passed in as ajson.Number
through some codeflow
- Removed unused
Transport
interface - Moved and renamed
raintree.RainTreeConfig
toutil.RouterConfig
- Renamed
protocol.DefaultTopicStr
toprotocol.BackgroundTopicStr
- Added
protocol.PeerDiscoveryNamespace
- Added kademlia peer discovery baseline test
- Added background router (kad + gossipsub)
- Updated P2P README
- Extracted a couple of shared helpers (e.g.
stringLogArrayMarshaler
,MarshalZerologArray
)
- Renamed
Network
interface toRouter
- Shortened
Router#NetworkBroadcast
to#Broadcast
- Shortened
Router#NetworkSend
to#Send
- Shortened
Router#networkSendInternal
to#sendInternal
- Shortened
Router#networkBroadcastAtLevel
to#broadcastAtLevel
- Renamed
rainTreeNetwork
torainTreeRouter
- Renamed
rainTreeNetwork
method receivers - Renamed
p2pModule#network
to#router
- Renamed
p2pModule#setupNetwork()
to#setupRouter()
- Renamed config var in
rainTreeRouter#Create
- Renamed router logger
- Renamed
NewRainTreeNetwork()
toNewRainTreeRouter()
- Refactored peers_manager_test.go
- Refactored network_test.go
- Simplified p2p module/router config handoff
- Updated debug logging
- Removed unneeded
stdnetwork
package - Removed unneeded
use_rain_tree
P2P config field
- Removed unneeded
stdnetwork
package - Removed unneeded
use_rain_tree
P2P config field
- Added rainTeeFactory type & compile-time enforcement
- Refactor
mockdns
test helpers
- Add test to exercise
sortedPeersView#Add()
and#Remove()
- Fix raintree add/remove index
- Added a test which asserts that transport encryption is required (i.e. unencrypted connections are refused)
- Moved peer & url conversion utils to
p2p/utils
package - Refactor
getPeerIP
to usenet.DefaultResolver
for easier testing - Moved & refactor libp2p
host.Host
setup util top2p/utils
- Consolidated Libp2p & P2P
modules.Module
implementations - Consolidated Libp2p & P2P
stdnetwork
typesP2P.Network
implementations - Refactored raintree
typesP2P.Network
implementation to use libp2p - Moved
shared/p2p
package intop2p/types
packages - Removed
Trnasport
interface and implementations - Removed
ConnectionFactory
type and related members - Added libp2p
host.Host
mock generator - Refactor raintree constructor function signature to use new
RainTreeConfig
struct
- Wrap IPv6 address in square brackets as per RFC3986 §3.2.2
- Improve URL validation and error handling in Libp2pMultiaddrFromServiceURL function
- Switched mock generation to use reflect mode for effected interfaces (
modules.ModuleFactoryWithOptions
embedders)
- Variable name and comment improvements
- Updated errors on Send from fatal to recoverable
- Updated
PeerstoreProvider
to ignore gracefully peers that are not resolvable/reachable
- Add log for
StateMachineTransitionEvent
- Refactored P2P module to use new P2P interfaces
- Moved
typesP2P.AddrBookMap
tosharedP2P.PeerAddrMap
and refactor to implement the newPeerstore
interface - Factored
SortedPeerManager
out ofraintree.peersManager
and addpeerManager
interface - Refactored
raintree.peersManager
to useSortedPeerManager
and implementPeerManager
interface - Refactored
stdnetwork.Network
implementation to use P2P interfaces - Refactored
getAddrBookDelta
to be a member ofPeerList
- Refactored
AddrBookProvider
to use new P2P interfaces - Renamed
AddrBookProvider
toPeerstoreProvider
- Refactored
typesP2P.Network
to use new P2P interfaces - Refactored
typesP2P.Transport
to embedio.ReadWriteCloser
- Renamed
NetworkPeer#Dialer
toNetworkPeer#Transport
for readability and consistency - Refactored
typesP2P.NetworkPeer
to implement the newPeer
interface
- Add TECHDEBT comments
- Added embedded
modules.InitializableModule
to the P2PAddrBookProvider
interface so that it can be dependency injected as amodules.Module
via the bus registry.
- replace
consensus_port
withport
in P2P config - update default P2P config
port
to from8080
to42069
- Renamed package names and parameters to reflect changes in the rest of the codebase
- Update logger value references with pointers
- Added basic
bootstrap
nodes support - Reacting to
ConsensusNewHeightEventType
andStateMachineTransitionEventType
to update the address book and current height and determine if a bootstrap is needed
- Deprecated
debugAddressBookProvider
- Added
rpcAddressBookProvider
to source the address book from the RPC server - Leveraging
bus
for dependency injection of theaddressBookProvider
andcurrentHeightProvider
- Deprecated
debugCurrentHeightProvider
- Added
rpcCurrentHeightProvider
to source the current height from the RPC server - Fixed raintree to use the
currentHeightProvider
instead of consensus (that was what we wanted to avoid in the first place) - Added
getAddrBookDelta
to calculate changes to the address book between heights and update the internal state and componentry accordingly
- Modules embed
base_modules.IntegratableModule
andbase_modules.InterruptableModule
for DRYness - Updated tests
- Updated logging initialization and passing to the network component instead of using the global logger
- Fixed incorrect use of
bus.GetLoggerModule()
instdnetwork.go
since it's never initialized when running the debug CLI
- Address legacy linter errors from
golangci-lint
- Changed log lines to utilize new logger module.
- Using the generic
mempool.GenericFIFOSet
as anonceDeduper
- Added tests for
nonceDeduper
to ensure that it behaves as expected.
- Updated
TestRainTreeAddrBookUtilsHandleUpdate
andtestRainTreeMessageTargets
to correct incorrect expected and actual value placements.
- Updated
P2PConfig#IsEmptyConnectionType
bool toP2PConfig#ConnectionType
enum
- Rewrite
interface{}
toany
- Add a lock to the mempool to avoid parallel messages which has caused the node to crash in the past
- Updated module constructor to accept a
bus
and not aruntimeMgr
anymore - Registering module with the
bus
viaRegisterModule
method - Updated tests and mocks accordingly
- Sorting
validatorIds
intestRainTreeCalls
- Added missing
Close()
call topersistenceReadContext
- Refactored
AddrBookProvider
to support multiple implementations - Added
CurrentHeightProvider
- Dependency injection of the aforementioned provider into the module creation (used by the debug-client)
- Updated implementation to use the providers
- Updated tests and mocks
ActorsToAddrBook
now skips actors that are not validators since they don't have a serviceUrl generic parameter
- Updated to use the new centralized config and genesis handling
- Updated to use the new
Actor
struct undercoreTypes
- Updated tests and mocks
- Added missing
max_mempool_count
in config (it was causing P2P instabilities in LocalNet)
ValidatorMapToAddrBook
renamed toActorToAddrBook
ValidatorToNetworkPeer
renamed toActorToNetworkPeer
- Bugfix for [#401]
- Fixed typo in 'peers_manager.go'
- mempool cap is now configurable via P2PConfig. Tests implement the mock accordingly.
- Introduced the concept of a
addrbookProvider
that abstracts the fetching and the mapping fromActor
toNetworkPeer
- Temporary hack to allow access to the
addrBook
to the debug client (will be removed in an upcoming PR already in the works for issues #203 and #331) - Transport related functions are now in the
transport
package - Updated tests to source the
addrBook
from theaddrbookProvider
and thereforePersistence
- Updated Raintree network constructur with dependency injection
- Updated stdNetwork constructur with dependency injection
- Improved documentation for the
peersManager
- Raintree mempool cannot grow unbounded anymore. It's now bounded by a constant limit and when new nonces are inserted the oldest ones are removed.
- Raintree is now capable of fetching the address book for a previous height and to instantiate an ephemeral
peersManager
with it.
- Removed topic from messaging
- Updated README to reference the python simulator as a learning references and unit test generation tool
- Added a RainTree unit test for 12 nodes using the simulator in https://github.com/pokt-network/rain-tree-sim/blob/main/python
- Add a telemetry
send
event within the contextRainTree
network module that is triggered during network writes - Change the
RainTree
testing framework counting method to simulate real reads/writes from the network - Improve documentation related to the
RainTree
testing framework & how the counters are computed
#235 Config and genesis handling
- Updated to use
RuntimeMgr
- Updated tests and mocks
- Removed some cross-module dependencies
- Don't ignore the exit code of
m.Run()
in the unit tests
[TECHDEBT] AddrBook management optimization and refactoring #246
- Added
peersManager
andtarget
in order to abstract away and eliminate redundant computations - Refactored debug logging in
getTarget
to print first and second target on the same line - Refactored
AddPeerToAddrBook
to use an event-driven approach in order to leverage sorted data structures - Added
RemovePeerToAddrBook
making use of the same pattern - Improved performance of
AddPeerToAddrBook
andRemovePeerToAddrBook
by making the implementations O(n) - Updated
stdnetwork
to use a map instead of a slice
Encapsulate structures previously in shared #163
- Ensured proto structures implement shared interfaces
P2PConfig
uses shared interfaces in order to acceptMockP2PConfig
intest_artifacts
- Moved connection_type to bool for simplicity (need to figure out how to do Enums without sharing the structure)
- Deprecated old p2p for pre2p raintree
- RainTree first iteration in Pre2P module (no cleanup or redundancy)