allmende-sim: latency and connection loss, attackers, seeds down, anti-entropy repair, 300 nodes
Findings: default libp2p connection limits strand nodes on a bootstrap node beyond ~190 peers, there is no peer scoring, and newcomers cannot find their region without DHT servers when their remembered peers are elsewhere. Documented in docs/PROTOCOL.md and SPECS.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
@@ -107,6 +107,9 @@ type Config struct {
|
||||
// Bandwidth, if set, counts the bytes this node sends and receives (the
|
||||
// simulator uses it; a real node leaves it nil).
|
||||
Bandwidth metrics.Reporter
|
||||
// ExtraOptions are added to the libp2p host's options; the simulator uses
|
||||
// them to put latency and connection loss on the transport.
|
||||
ExtraOptions []libp2p.Option
|
||||
}
|
||||
|
||||
// Node is a running participant.
|
||||
@@ -203,6 +206,7 @@ func New(ctx context.Context, cfg Config) (*Node, error) {
|
||||
}
|
||||
opts = append(opts, libp2p.AddrsFactory(func([]ma.Multiaddr) []ma.Multiaddr { return announce }))
|
||||
}
|
||||
opts = append(opts, cfg.ExtraOptions...)
|
||||
if cfg.Bandwidth != nil {
|
||||
opts = append(opts, libp2p.BandwidthReporter(cfg.Bandwidth))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user