Commit Graph

6193 Commits

Author SHA1 Message Date
zzz
8ba5cb4d02 Profiles: Adjust capacity for send success/failure
Stub out adjustments for congestion caps
2023-02-12 14:23:10 -05:00
zzz
f9b9633ac0 Profiles: Downrate capacity of slow/unreachable peers
Use more efficient RI lookup
Comment out unused same-country code
2023-02-12 13:39:47 -05:00
zzz
6f80df48e0 bump -8 2023-02-12 10:17:57 -05:00
zzz
4a9ca43614 NetDB: Don't call heardAbout() unless peer is reachable
Consolidate hash() calls
2023-02-12 10:15:28 -05:00
zzz
afe236c62c Profiles: Limit storage and memory usage
Write profiles to disk more often
Delete old profiles on disk more often
Reduce max age of profiles
Limit age of profiles read in at startup based on downtime
Limit total profiles read in at startup
Change loaded profiles from a Set to a List for efficiency
Log tweaks
2023-02-12 10:11:46 -05:00
zzz
7a75ea4bef NetDB: Store handler updates
Drop some unsolicited RI stores when over thresholds
Don't update profile for banned/blocked RI
Don't flood RIs with blocked IP
Log tweaks
2023-02-12 07:58:24 -05:00
zzz
78ee005870 Data: Move LS RAP/RAR booleans up to superclass
Add RAR to I2NP DSM
WIP
2023-02-11 09:47:40 -05:00
zzz
cb90139342 NetDB: Increase flood thottle time 2023-02-11 06:34:04 -05:00
zzz
d6c6b5e092 NetDB: Expiration tweaks
Start expire job sooner if forced floodfill or downtime was short
Don't run refresh routers job if forced floodfill or downtime was short or vmcommsystem
Increase expire probability
Don't expire routers close to us just before midnight
Don't start expire leases job until 11 minutes after startup
Base probability out of 128 to reduce random usage
Consolidate now() calls
2023-02-11 06:02:57 -05:00
zzz
1f81d35423 Router: Tighten skew calculation window 2023-02-10 12:42:36 -05:00
zzz
12239124d6 Profiles: Don't delete old profiles from disk until 90m uptime 2023-02-09 16:27:38 -05:00
zzz
71a1d6dd7b NetDB: Don't lookup before dropping after shutdown initiated 2023-02-09 14:38:21 -05:00
zzz
d3e5879068 NetDB: Improve efficiency of ExpireRoutersJob
by iterating through the map entries directly, as in ExpireLeasesJob
Expire RIs just before saving them at shutdown
2023-02-09 13:19:00 -05:00
zzz
56ab3b59a2 bump -7 2023-02-08 09:46:38 -05:00
zzz
7834f44973 NetDB: Minor cleanups and log tweaks 2023-02-08 09:36:32 -05:00
zzz
621862afa9 NetDB: Replace Set with List in ExpireLeasesJob for efficiency 2023-02-08 09:25:42 -05:00
zzz
af99250a69 NetDB: Further restrict what RIs we lookup before dropping
if floodfill, unreachable, or L class
Only kicks in if we don't have a lot of RIs to begin with
2023-02-08 09:20:10 -05:00
zzz
0bce9d1211 Profiles: Reduce initial/min/max expirations
Adjust expiration faster
Use more efficient RI lookup method
2023-02-08 09:10:27 -05:00
zzz
8b7f68e6f9 NTCP: Route RI block of another router to InNetMessagePool 2023-02-08 09:05:29 -05:00
zzz
6ac08e0929 Tunnels: Load RIs more efficiently in peer selector 2023-02-08 08:58:22 -05:00
zzz
b87fd621b1 NetDB: Implement faster RI expiration mode
exempt routers within our keyspace if we are floodfill
2023-02-08 08:52:12 -05:00
zzz
c94bfe6cd0 NTCP: Increase temp. inbound IP block time
Block IP on failed inbound
Ban peers that ban us
2023-02-08 08:32:06 -05:00
zzz
c08d6b3a18 log tweak 2023-02-08 08:27:20 -05:00
zzz
9e2bb1ad0a Transports: Check RI in handshake for matching IP 2023-02-08 08:25:09 -05:00
zzz
10e0596011 NetDB: Reduce min RI expiration 2023-02-08 08:19:34 -05:00
zzz
6216081259 NetDB: Increase closest-floodfill search size
Reduce max fail rate
Lookup RIs more efficiently
2023-02-08 08:10:46 -05:00
zzz
981946c950 NetDB: Don't explore if we have enough RIs 2023-02-08 08:05:30 -05:00
zzz
8ff421143f NetDB: Set max routers to load at startup 2023-02-08 07:40:18 -05:00
zzz
3816278a5e Router: Don't set congestion cap at startup because of high job lag 2023-02-08 07:32:56 -05:00
zzz
338985a4cc Sybil: Thread analyzer at reduced priority
Don't do pair distance check unless enough memory
2023-02-08 07:28:46 -05:00
zzz
c6fca9da6a bump -6 2023-02-04 09:26:32 -05:00
zzz
bdbbe148c3 Profiles: Make DBHistory rates final 2023-02-04 08:58:46 -05:00
zzz
f2b206b1e0 Router: Continue work on congestion caps (proposal 162)
Set caps based on job lag and share bandwidth
Add 20 minute rate to tunnel.participatingMessageCountAvgPerTunnel to
be used for congestion caps
Don't set congestion cap if hidden
2023-02-04 08:57:10 -05:00
zzz
c1f83d6ec9 Router: Stat cleanup
Remove old non-required client.timeoutCongestion* stats in OCMOSJ.
Remove RouterThrottle.getInboundRateDelta(), used only for those stats.
Remove transport.sendMessageSize rates longer than 60s, used only for getInboundRateDelta().
Remove transport.receiveMessageSize rates longer than 60s, unused anywhere.
Remove transport.sendProcessingTime rates longer than 60s, unused anywhere.
getInboundRateDelta() was broken anyway as it was looking at send, not receive size.
All of this was untouched since 2004.
9 total rates for required stats removed.
2023-02-04 08:49:40 -05:00
zzz
37beb53245 Profiles: Remove 30m tunnel history rates
to save a large amount of space.
30m rates were almost always within 10% of the 60m rates,
so we clearly don't need both.
Keep 60m because that's what we publish in the netdb.
Adjust rate weighting in CapacityCalculator accordingly.
2023-02-01 17:10:04 -05:00
zzz
019a8b6655 Profiles: Count all build rejections in tunnel history
Previously did not count probabalistic or transient codes
Reduce 10 minute acceptance rate for these codes
(previously adjusted the averaged rate)
Make rates final in TunnelHistory
Static rates array to reduce object churn
Prep for removing 30m rates
Reduce now() calls, pull out of loops
2023-02-01 16:23:45 -05:00
zzz
99703d53ba Ratchet: Don't bundle LS with ratchet ACK
Not necessary, and will be the wrong LS for EdDSA subsession
2023-02-01 08:47:58 -05:00
zzz
1e28557ce2 cleanup buf.append(s.substring(a, b)) -> buf.append(s, a, b)
all over, for object churn
2023-01-31 07:31:02 -05:00
zzz
07a796bcf6 typo 2023-01-30 14:50:40 -05:00
zzz
ac50eefe07 Tunnels: Improve expl. build success in well-connected routers during congestion
by not using high cap tier. Congestion starts from the top.
Right now, the fastest routers have the worst expl. build success.
This will help correct that.
2023-01-30 12:40:39 -05:00
zzz
bd4415ad5c Blocklist: Don't maintain IPv6 blocklist unless we have an IPv6 address
Don't read in same-country blocklist unless configured or in strict country,
so we don't continue to block when no longer hidden
2023-01-30 11:51:44 -05:00
zzz
86c6800fbd NTCP2: Ensure we publish a "6" address on transition to firewalled
Do not call restartListening() on transition to firewalled
2023-01-30 11:11:48 -05:00
zzz
124ebe9fdf Tunnels: Refactor peer selection
by checking if a peer qualifies when adding, rather than
iterating through the whole netdb to generate an exclusion list at the start.
This was very inefficient and generated needless lookup storms via lookupBeforeDropping()
Same idea for getClosetHopExclude()
Goal is to never iterate through all the known routers, profiles, or connected peers
to select peers for a single tunnel.
Add ExcluderBase and 4 classes for various cases:
Excluder, ClosestHopExcluder, IBGWExcluder, and OBEPExcluder.

Change CSFI.getEstablished() from a Set to a List for efficiency
Improve efficiency of selectActivePeersNotFailingPeers()
by iterating through connected list rather than profiles.
Do not add not-connected peers to exclude set,
which would become huge for hidden routers.

Change getExclude() to shouldExclude()
The exclude set calls shouldExclude() in contains().
Pass the exclude set to ProfileOrganizer.

For client tunnels, do OBEP and IBGW checks at peer selection time,
not afterwards in ConnectChecker, so it doesn't fail at the end in checkTunnel().

Check closest hop when hidden.
Fail-fast for inbound when no connected peers and hidden, do not fall back to non-connected peers.
Should improve startup time for hidden routers.

Use ArraySet for matches to save space
Remove unused selectPeersLocallyUnreachable() and selectPeersRecentlyRejecting()

No peer selection policy changes here.
2023-01-30 08:05:39 -05:00
zzz
1e35f940da Util: Comment out main() test 2023-01-29 12:50:54 -05:00
zzz
9fd31d014f Reseed test message fix 2023-01-28 07:52:52 -05:00
zzz
bfd7b1a5f5 Tools: Check RI dates and counts in reseed test 2023-01-28 07:43:53 -05:00
zzz
56e00fbe3a Tools: Delete reseed test files before retest 2023-01-28 06:26:08 -05:00
zzz
a27e1393f1 Router: Force the stragglers to rekey 2023-01-27 19:01:11 -05:00
zzz
3831348301 Tunnels: Reduce grace period from 120 to 90 sec. 2023-01-27 11:15:07 -05:00
zzz
9cbd7643db Tools: Add CLI reseed test 2023-01-27 10:51:17 -05:00