-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat(networking): adding API to perform sybil attack check #1573
Conversation
037b455
to
01684e6
Compare
01684e6
to
7ae76ec
Compare
7ae76ec
to
0522e65
Compare
cdd9b5e
to
f01b7cc
Compare
@@ -431,6 +435,8 @@ | |||
} | |||
} | |||
SwarmCmd::PutLocalRecord { record } => { | |||
// TODO: eclipse content if sybil was set, if sybil xorname set is close to the key ....? |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
@@ -379,6 +381,8 @@ | |||
sender, | |||
quorum, | |||
} => { | |||
// TODO: eclipse content if sybil was set, if sybil xorname set is close to the key ....? |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
@@ -364,6 +364,8 @@ | |||
.payment_received(); | |||
} | |||
SwarmCmd::GetLocalRecord { key, sender } => { | |||
// TODO: eclipse content if sybil was set, if sybil xorname set is close to the key ....? |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
1d313c5
to
38e406b
Compare
a2578fe
to
743d670
Compare
48b20ff
to
86ca0e2
Compare
86ca0e2
to
cf6dbb6
Compare
866df65
to
50cfb4a
Compare
let k = peers.len(); | ||
info!(">>> CHECKING SYBIL ATTACK WITH {k} PEERS: {peers:?}"); | ||
|
||
// FIXME: return error if we don't have at least K peer ids per key |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
|
||
// Threshold to determine if there is an attack using Kullback-Liebler (KL) divergence | ||
// between model peer ids distribution vs. actual distribution around any point in the address space. | ||
const KL_DIVERGENCE_THRESHOLD: f64 = 10f64; // TODO: find a proper value |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
72f85ed
to
83f47bf
Compare
fn get_net_size_estimate(random_keys: &RandomKeysAndClosestPeerIds) -> usize { | ||
let mut best_n_found = 0; | ||
let mut smallest_value_found = f64::MAX; | ||
// FIXME: this iteration needs to be smarter |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
83f47bf
to
992fcee
Compare
9a8e679
to
e734056
Compare
Closing it, keeping the branch though for potential references. |
Description
reviewpad:summary