Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ALSP] Implements disallowlisting logic (#4441)
* fixes a godoc * adds heartbeat * wires in alsp parameters in code * wires in alsp parameters for testing * adds test for a single heartbeat * decouples misbehavior fixture functions * reduces sleep time of the test * adds decay to zero test * lint fix * test fix * lint fix * dissolves start method of middleware * chore: renames topology method and middleware option * chore: renames middleware option * chores middleware * adds disallow list cache interface * changes signature of a single method * adds cache entity * revises the interface of cache * changes cause type to map * adds adjust function * adds disallow for * refactors interface and adds missing methods * adds TestNewDisallowListCache * adds TestDisallowFor_SinglePeer * adds TestDisallowFor_MultiplePeers * refactors interface of the cache * refactors implementation of the cache * implements test AllowFor Single peer * updates godocs * adds test for multiple peers concurrently * adds a comment * removes unused methods * adds disallow list cache config * replaces middleware parameters with config * adds networking disallow list cache metrics factory * adds default middleware size * adds default middleware size to cache * refactors middleware for access node builder * adds validate to nuddkeware config * refactors middleware initialization for observer * refactors middleware initialization in scaffold * refactors middleware initialization in follower * adds interface for disallow list oracle * moves all disallow listing components to network root package * replaces disallow listing distributor with middleware * revises middleware interface * adds string method to disallow list wrapper * removes disallow list consumer and distributor interfaces * adds disallow listing event handlers to middleware * refactors node blocklist wrappers * lint fix * lint fix * generates mocks * lint fix * fixes tests * fixes tests * fix lint * libp2p implements disallow list consumer * removes disallow list oracle * moves disallow list logic to libp2p node * moves disallow list cache to libp2p node * fixes import cycle * moves disallowlist cache to p2p package * lint fix * wires disallow lists to peer manager * adds disallow list oracle * adds disallow list oracle to connection gater interface and implementation * wires disallow listing oracle to connection gater * wires disallow list consumer to alsp manager * implements disallow listing below threshold * generates mocks * lint fix * lint fix * lint fix * fix lint * adds test for disallow list notification * renames a test fixture and add more * decreases min backoff * adds a new method to connector host * adds disallow listing logic to libp2p node * adds disallow listing test * decreases time interval of peer manager * skips connecting to already connected peers * adds is connected method * reduces backup * fixes closure of authorized peers * adds disallow listing test * adds godoc * separate the connection gater for each node in test util * extends a documentation * adds misbehavior and disallowlisting test * updates mocks * fixes build issues * lint fix * renames block list to disallow list * renames block list to disallow list * fuxes herocache metrics issue * fixes nil dependecy issue * lint fix * fixes nil pointer exception * adds a comment * Update network/disallow.go Co-authored-by: Misha <misha.rybalov@dapperlabs.com> * Update network/p2p/p2pnode/internal/cache.go Co-authored-by: Khalil Claybon <khalil.claybon@dapperlabs.com> * Update network/alsp/manager/manager.go Co-authored-by: Misha <misha.rybalov@dapperlabs.com> * Update network/p2p/p2pnode/internal/cache.go Co-authored-by: Khalil Claybon <khalil.claybon@dapperlabs.com> * Update network/p2p/p2pnode/internal/cache.go Co-authored-by: Khalil Claybon <khalil.claybon@dapperlabs.com> * Update network/p2p/p2pnode/internal/cache.go Co-authored-by: Khalil Claybon <khalil.claybon@dapperlabs.com> * Update module/metrics/labels.go Co-authored-by: Khalil Claybon <khalil.claybon@dapperlabs.com> * Update network/alsp/manager/manager_test.go Co-authored-by: Misha <misha.rybalov@dapperlabs.com> * Update network/alsp/manager/manager_test.go Co-authored-by: Misha <misha.rybalov@dapperlabs.com> * Update network/alsp/manager/manager_test.go Co-authored-by: Misha <misha.rybalov@dapperlabs.com> * Update network/p2p/p2pnode/internal/cache.go Co-authored-by: Khalil Claybon <khalil.claybon@dapperlabs.com> * Update network/p2p/p2pnode/internal/cache.go Co-authored-by: Khalil Claybon <khalil.claybon@dapperlabs.com> * Update network/p2p/p2pnode/internal/cache.go Co-authored-by: Khalil Claybon <khalil.claybon@dapperlabs.com> * Update network/disallow.go Co-authored-by: Misha <misha.rybalov@dapperlabs.com> * adds documentation for integration testing * Update network/alsp/manager/manager_test.go Co-authored-by: Misha <misha.rybalov@dapperlabs.com> * resolves shadow variables * Update network/alsp/manager/manager.go Co-authored-by: Khalil Claybon <khalil.claybon@dapperlabs.com> * Update network/alsp/manager/manager.go Co-authored-by: Khalil Claybon <khalil.claybon@dapperlabs.com> * Update network/p2p/connection/peerManager.go Co-authored-by: Khalil Claybon <khalil.claybon@dapperlabs.com> * renames and refactors a cache and libp2p method * lint fix * adds readme * Update network/alsp/manager/manager_test.go Co-authored-by: Misha <misha.rybalov@dapperlabs.com> * Update network/alsp/manager/README.md Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com> * Update network/alsp/manager/README.md Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com> * Update network/alsp/manager/README.md Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com> * Update network/p2p/p2pnode/libp2pNode.go Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com> * Update network/alsp/manager/README.md Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com> * Update network/alsp/manager/README.md Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com> * Update network/alsp/manager/README.md Co-authored-by: Misha <misha.rybalov@dapperlabs.com> * Update network/alsp/manager/manager_test.go Co-authored-by: Misha <misha.rybalov@dapperlabs.com> * adds disallow-listed status to cache * switches a log level * fixes duplicate metrics panic --------- Co-authored-by: Misha <misha.rybalov@dapperlabs.com> Co-authored-by: Khalil Claybon <khalil.claybon@dapperlabs.com> Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com>
- Loading branch information