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

[ALSP] Adjust Node Penalty Decay Speed on Repeated Disallow-listing #4485

Merged
merged 217 commits into from
Aug 22, 2023
Merged
Changes from 1 commit
Commits
Show all changes
217 commits
Select commit Hold shift + click to select a range
8b8dd46
fixes a godoc
thep2p May 17, 2023
9ef7ed5
adds heartbeat
thep2p May 17, 2023
ec18867
wires in alsp parameters in code
thep2p May 17, 2023
734785b
wires in alsp parameters for testing
thep2p May 17, 2023
ea31c5f
adds test for a single heartbeat
thep2p May 18, 2023
e503468
decouples misbehavior fixture functions
thep2p May 18, 2023
388fbfe
reduces sleep time of the test
thep2p May 18, 2023
32e8aec
adds decay to zero test
thep2p May 18, 2023
567d34f
Merge remote-tracking branch 'origin/master' into yahya/6470-alsp-par…
thep2p May 24, 2023
eff453d
Merge branch 'master' into yahya/6470-alsp-part-5-decay
thep2p May 24, 2023
71684fc
lint fix
thep2p May 24, 2023
c59b9d4
test fix
thep2p May 24, 2023
3efe364
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-5-decay' in…
thep2p May 24, 2023
4e7117a
lint fix
thep2p May 24, 2023
b10397a
Merge branch 'master' into yahya/6470-alsp-part-5-decay
thep2p May 24, 2023
141bc1d
dissolves start method of middleware
thep2p May 24, 2023
780c594
chore: renames topology method and middleware option
thep2p May 24, 2023
0d21785
chore: renames middleware option
thep2p May 24, 2023
4fb9a8f
chores middleware
thep2p May 24, 2023
0e05b59
adds disallow list cache interface
thep2p May 24, 2023
ddcf7d8
changes signature of a single method
thep2p May 25, 2023
a7b9335
adds cache entity
thep2p May 25, 2023
b63cb9e
revises the interface of cache
thep2p May 25, 2023
ac7739b
changes cause type to map
thep2p May 25, 2023
f28ff45
adds adjust function
thep2p May 25, 2023
14a616d
adds disallow for
thep2p May 25, 2023
6a6c9d6
refactors interface and adds missing methods
thep2p May 25, 2023
e08e7cb
adds TestNewDisallowListCache
thep2p May 25, 2023
aab01c6
adds TestDisallowFor_SinglePeer
thep2p May 25, 2023
53a75e8
adds TestDisallowFor_MultiplePeers
thep2p May 26, 2023
b57e0ad
refactors interface of the cache
thep2p May 26, 2023
0eda3d0
refactors implementation of the cache
thep2p May 26, 2023
4d52d74
implements test AllowFor Single peer
thep2p May 26, 2023
c850faf
updates godocs
thep2p May 26, 2023
c015531
adds test for multiple peers concurrently
thep2p May 26, 2023
c64ddfc
adds a comment
thep2p May 26, 2023
0456c66
removes unused methods
thep2p May 26, 2023
b3147f4
adds disallow list cache config
thep2p May 26, 2023
c2f0fa6
replaces middleware parameters with config
thep2p May 29, 2023
56ba9be
adds networking disallow list cache metrics factory
thep2p May 29, 2023
746e565
adds default middleware size
thep2p May 29, 2023
66af1fc
adds default middleware size to cache
thep2p May 29, 2023
8e4062b
refactors middleware for access node builder
thep2p May 29, 2023
b2e4e3e
adds validate to nuddkeware config
thep2p May 29, 2023
31a3e19
refactors middleware initialization for observer
thep2p May 29, 2023
643ea52
refactors middleware initialization in scaffold
thep2p May 29, 2023
e960230
refactors middleware initialization in follower
thep2p May 29, 2023
fdfebb4
Merge remote-tracking branch 'origin/master' into yahya/6470-alsp-par…
thep2p May 29, 2023
ab9cce5
adds interface for disallow list oracle
thep2p May 29, 2023
99d3daa
moves all disallow listing components to network root package
thep2p May 29, 2023
69e8de1
replaces disallow listing distributor with middleware
thep2p May 29, 2023
be1ae68
revises middleware interface
thep2p May 29, 2023
6c51a00
adds string method to disallow list wrapper
thep2p May 29, 2023
d955a31
removes disallow list consumer and distributor interfaces
thep2p May 29, 2023
f31b5b3
adds disallow listing event handlers to middleware
thep2p May 29, 2023
e8794d6
refactors node blocklist wrappers
thep2p May 29, 2023
3b8864a
lint fix
thep2p May 29, 2023
02edadd
lint fix
thep2p May 29, 2023
9894b9f
generates mocks
thep2p May 29, 2023
2eababa
lint fix
thep2p May 29, 2023
a01d718
fixes tests
thep2p May 30, 2023
acab9d3
fixes tests
thep2p May 30, 2023
72da2d9
Merge remote-tracking branch 'origin/master' into yahya/6470-alsp-par…
thep2p Jun 5, 2023
d0067c4
fix lint
thep2p Jun 5, 2023
3e3f07a
libp2p implements disallow list consumer
thep2p Jun 5, 2023
7884cfe
removes disallow list oracle
thep2p Jun 5, 2023
2d289b4
moves disallow list logic to libp2p node
thep2p Jun 5, 2023
38dc082
moves disallow list cache to libp2p node
thep2p Jun 5, 2023
cc468c8
fixes import cycle
thep2p Jun 5, 2023
97b6683
moves disallowlist cache to p2p package
thep2p Jun 5, 2023
b87c449
lint fix
thep2p Jun 5, 2023
0f1eb95
wires disallow lists to peer manager
thep2p Jun 5, 2023
5c80d74
adds disallow list oracle
thep2p Jun 5, 2023
8d1bcd6
adds disallow list oracle to connection gater interface and implement…
thep2p Jun 5, 2023
03f36b2
wires disallow listing oracle to connection gater
thep2p Jun 5, 2023
7d9242f
wires disallow list consumer to alsp manager
thep2p Jun 5, 2023
5b51471
implements disallow listing below threshold
thep2p Jun 5, 2023
5bc0be9
generates mocks
thep2p Jun 5, 2023
b76ab40
lint fix
thep2p Jun 5, 2023
a32e12f
lint fix
thep2p Jun 5, 2023
3c25286
lint fix
thep2p Jun 5, 2023
aa36d19
fix lint
thep2p Jun 5, 2023
7d02c90
adds test for disallow list notification
thep2p Jun 5, 2023
1fd72a8
renames a test fixture and add more
thep2p Jun 6, 2023
2983198
decreases min backoff
thep2p Jun 6, 2023
9f28a3b
adds a new method to connector host
thep2p Jun 6, 2023
e2e0146
adds disallow listing logic to libp2p node
thep2p Jun 6, 2023
c9ed446
adds disallow listing test
thep2p Jun 6, 2023
6098a7f
decreases time interval of peer manager
thep2p Jun 6, 2023
938a36e
skips connecting to already connected peers
thep2p Jun 6, 2023
f77621c
adds is connected method
thep2p Jun 6, 2023
4fbe8af
Merge remote-tracking branch 'origin/master' into yahya/6470-alsp-par…
thep2p Jun 6, 2023
0342aee
reduces backup
thep2p Jun 7, 2023
5bb3fc4
fixes closure of authorized peers
thep2p Jun 7, 2023
d5cf92a
adds disallow listing test
thep2p Jun 7, 2023
a1cd316
adds godoc
thep2p Jun 7, 2023
f3dd70d
separate the connection gater for each node in test util
thep2p Jun 7, 2023
2a033db
extends a documentation
thep2p Jun 7, 2023
e8b7178
adds misbehavior and disallowlisting test
thep2p Jun 7, 2023
a1a1f00
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
thep2p Jun 7, 2023
afde747
updates mocks
thep2p Jun 7, 2023
38539e6
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-6-pruning' …
thep2p Jun 7, 2023
276d352
fixes build issues
thep2p Jun 7, 2023
dd43a63
lint fix
thep2p Jun 7, 2023
14fe8db
renames block list to disallow list
thep2p Jun 7, 2023
a2fd745
renames block list to disallow list
thep2p Jun 7, 2023
8af9228
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
thep2p Jun 7, 2023
f5c8bd3
fuxes herocache metrics issue
thep2p Jun 7, 2023
7c2b1d7
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-6-pruning' …
thep2p Jun 7, 2023
1da07ed
fixes nil dependecy issue
thep2p Jun 7, 2023
1445fbd
lint fix
thep2p Jun 8, 2023
c1ac0a4
fixes nil pointer exception
thep2p Jun 8, 2023
20ed7a3
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
thep2p Jun 8, 2023
3a9df70
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
thep2p Jun 9, 2023
16d09f3
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
thep2p Jun 12, 2023
6435656
adds a comment
thep2p Jun 12, 2023
1f77da8
Update network/disallow.go
thep2p Jun 12, 2023
ae12a36
Update network/p2p/p2pnode/internal/cache.go
thep2p Jun 12, 2023
0a996e5
Update network/alsp/manager/manager.go
thep2p Jun 12, 2023
c3c81e7
Update network/p2p/p2pnode/internal/cache.go
thep2p Jun 12, 2023
3b43e0b
Update network/p2p/p2pnode/internal/cache.go
thep2p Jun 12, 2023
8e5d412
Update network/p2p/p2pnode/internal/cache.go
thep2p Jun 12, 2023
c5b48af
Update module/metrics/labels.go
thep2p Jun 12, 2023
8c1cd97
Update network/alsp/manager/manager_test.go
thep2p Jun 12, 2023
5cd8855
Update network/alsp/manager/manager_test.go
thep2p Jun 12, 2023
282ef12
Update network/alsp/manager/manager_test.go
thep2p Jun 12, 2023
aa6228a
Update network/p2p/p2pnode/internal/cache.go
thep2p Jun 12, 2023
088dbb3
Update network/p2p/p2pnode/internal/cache.go
thep2p Jun 12, 2023
58f4090
Update network/p2p/p2pnode/internal/cache.go
thep2p Jun 12, 2023
f1d581f
Update network/disallow.go
thep2p Jun 12, 2023
14f7d60
adds documentation for integration testing
thep2p Jun 12, 2023
bb9c358
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-6-pruning' …
thep2p Jun 12, 2023
850310e
Update network/alsp/manager/manager_test.go
thep2p Jun 12, 2023
37bedd3
resolves shadow variables
thep2p Jun 12, 2023
06a1fbe
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-6-pruning' …
thep2p Jun 12, 2023
eefca22
Update network/alsp/manager/manager.go
thep2p Jun 12, 2023
3e3cd10
Update network/alsp/manager/manager.go
thep2p Jun 12, 2023
9264afb
Update network/p2p/connection/peerManager.go
thep2p Jun 12, 2023
554c7d5
renames and refactors a cache and libp2p method
thep2p Jun 12, 2023
e42d58c
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-6-pruning' …
thep2p Jun 12, 2023
0c60366
lint fix
thep2p Jun 12, 2023
5e98a72
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
thep2p Jun 12, 2023
473153b
adds readme
thep2p Jun 12, 2023
0ee0a2a
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-6-pruning' …
thep2p Jun 12, 2023
cb7744e
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
thep2p Jun 13, 2023
e6a2f38
Update network/alsp/manager/manager_test.go
thep2p Jun 13, 2023
0d54873
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
thep2p Jun 13, 2023
9f07e0f
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
thep2p Jun 13, 2023
121987e
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
thep2p Jun 14, 2023
520c2ef
Update network/alsp/manager/README.md
thep2p Jun 14, 2023
c9e5140
Update network/alsp/manager/README.md
thep2p Jun 14, 2023
da1d5c4
Update network/alsp/manager/README.md
thep2p Jun 14, 2023
f5c7d2d
Update network/p2p/p2pnode/libp2pNode.go
thep2p Jun 14, 2023
c8ff213
Update network/alsp/manager/README.md
thep2p Jun 14, 2023
b483f08
Update network/alsp/manager/README.md
thep2p Jun 14, 2023
3d3f69f
Update network/alsp/manager/README.md
thep2p Jun 14, 2023
a9233f7
Update network/alsp/manager/manager_test.go
thep2p Jun 14, 2023
430b369
adds disallow-listed status to cache
thep2p Jun 14, 2023
722fc29
Merge remote-tracking branch 'origin/yahya/6470-alsp-part-6-pruning' …
thep2p Jun 14, 2023
be550f2
Merge branch 'master' into yahya/6470-alsp-part-6-pruning
thep2p Jun 14, 2023
a3c613c
switches a log level
thep2p Jun 14, 2023
95535ab
fixes duplicate metrics panic
thep2p Jun 14, 2023
63ff727
created default penalty params
gomisha Jun 15, 2023
1d358f8
typo
gomisha Jun 16, 2023
99828d6
typo
gomisha Jun 16, 2023
a2ea980
un-exported disallowListingThreshold
gomisha Jun 16, 2023
9de85fe
increase timeout to fix flakiness
gomisha Jun 16, 2023
26ebb22
typos
gomisha Jun 17, 2023
1ff3044
revert back InitialDecaySpeed
gomisha Jun 17, 2023
a33dd37
typo
gomisha Jun 17, 2023
4e53cc8
WIP TestHandleReportedMisbehavior_And_DisallowListing_RepeatOffender_…
gomisha Jun 18, 2023
dedbab3
debug test failure
gomisha Jun 19, 2023
e38f9a6
updated manager
thep2p Jun 19, 2023
060c1f3
Merge remote-tracking branch 'origin/misha/6766-adjust-node-penalty-d…
thep2p Jun 19, 2023
661b92e
replaced sleep with function option to decay to zero
gomisha Jun 20, 2023
ba3ef45
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Jun 20, 2023
270cc40
clean up
gomisha Jun 21, 2023
79e00f3
clean up - removed func DefaultParams()
gomisha Jun 21, 2023
5144f91
moved out test helper functions to separate file
gomisha Jun 21, 2023
8caa38e
moved WithDecayFunc() to test helper
gomisha Jun 21, 2023
7403dcf
rename to fastDecay, fastDecayFunc
gomisha Jun 21, 2023
444ccef
lint fix
gomisha Jun 21, 2023
e10d556
check spam record fields on each violation
gomisha Jun 22, 2023
bd1116f
fix tests - get spam record before each check
gomisha Jun 22, 2023
5cfc254
using loop of expected decays - test failing
gomisha Jun 23, 2023
6a770b3
decay list implementation
gomisha Jun 24, 2023
9d093c4
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Jun 24, 2023
0daeb03
more debugging, decays in test
gomisha Jun 24, 2023
f84fbcd
check penalty was decayed by expected decay after each disallow listing
gomisha Jun 25, 2023
a2c5e9f
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Jul 6, 2023
7c31c0c
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Jul 6, 2023
0705c9a
using updated testutils.LibP2PNodeForMiddlewareFixture(t, 3)
gomisha Jul 7, 2023
f657343
disable p2p backoff so test passes
gomisha Jul 7, 2023
1795d3b
clean up
gomisha Jul 7, 2023
e784dde
reduce wait time for connecting
gomisha Jul 7, 2023
812f331
remove data driven table
gomisha Jul 7, 2023
26e950f
removed timestamp from logs
gomisha Jul 7, 2023
fa5765f
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Jul 31, 2023
0431cf2
build fix
gomisha Jul 31, 2023
52d335a
removed unused PenaltyParams
gomisha Jul 31, 2023
a6baa91
changed some logging messages from Info() to Trace()
gomisha Jul 31, 2023
b40f664
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Aug 12, 2023
f7b7b62
CacheFactory unexported, test helpers moved to test
gomisha Aug 12, 2023
2e027bc
DecayFunc unexported
gomisha Aug 12, 2023
e5cf8fd
model.DisallowListingThreshold clean up
gomisha Aug 12, 2023
133a24b
heartbeat interval log update
gomisha Aug 12, 2023
7e75e86
heartbeat interval log update 2
gomisha Aug 12, 2023
05c9f9f
renamed loop variables
gomisha Aug 14, 2023
e8cb9db
Comment fix
gomisha Aug 14, 2023
14325cd
refactor to use adjustDecayFunc(), removed DecayList from spam record
gomisha Aug 14, 2023
55cc428
updated docs for adjustDecayFunc()
gomisha Aug 14, 2023
7bda8d2
clean up
gomisha Aug 15, 2023
9ab2620
simplify adjustDecayFunc() with switch-case
gomisha Aug 17, 2023
f820c09
flaky test fix
gomisha Aug 17, 2023
008cbea
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Aug 18, 2023
b107e35
lint fix
gomisha Aug 18, 2023
a07337e
Merge branch 'master' into misha/6766-adjust-node-penalty-decay-speed
gomisha Aug 21, 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
Prev Previous commit
Next Next commit
model.DisallowListingThreshold clean up
  • Loading branch information
gomisha committed Aug 12, 2023
commit e5cf8fd949cbc7cd2e5ab0b07dcf72a96cf03686
5 changes: 2 additions & 3 deletions network/alsp/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,9 @@ func (m *MisbehaviorReportManager) onHeartbeat() error {

// TODO: this can be done in batch but at this stage let's send individual notifications.
// (it requires enabling the batch mode end-to-end including the cache in middleware).
// as long as record.Penalty is NOT below model.disallowListingThreshold,
// as long as record.Penalty is NOT below model.DisallowListingThreshold,
// the node is considered allow-listed and can conduct inbound and outbound connections.
// Once it falls below model.disallowListingThreshold, it needs to be disallow listed.
//if record.Penalty < model.disallowListingThreshold && !record.DisallowListed {
// Once it falls below model.DisallowListingThreshold, it needs to be disallow listed.
if record.Penalty < model.DisallowListingThreshold && !record.DisallowListed {
// cutoff counter keeps track of how many times the penalty has been below the threshold.
record.CutoffCounter++
Expand Down