18496 Commits
Author SHA1 Message Date
zzz 8752b8d0ae I2CP: Add new discardMessage() to session API
to avoid decompression overhead on messages with no match
in the demuxer.

Log hexdump of discarded message if enabled
2026-08-26 12:08:29 -04:00
zzz 73cc98d28b i2psnark: Compress KRPC DG1 messages 2026-08-26 08:21:00 -04:00
zzz 6efe2dc715 i2psnark: Compress UDP connect requests 2026-08-26 07:59:51 -04:00
zzz 529ea7ac43 i2psnark: Close all RAFs after creating or checking files
to avoid possible stale fds after errors,
ro vs rw issues after rechecks, running out of fds,
and other corner cases
2026-08-25 09:30:45 -04:00
zzz fda1ced99c i2psnark: Remove ancient/disabled single-torrent and CLI code
from the original snark, unused for 20 years.
CoordinatorSet and acceptor are now always non-null.
Cleanup in prep for hybrid support (WIP)
2026-08-24 11:10:54 -04:00
zzz d0fae9f895 i2psnark: Only call retransmitRequests() for non-fast peers 2026-08-24 08:25:02 -04:00
zzz a60f10ba3b i2psnark: Reduce log level for common error serving file resources 2026-08-23 11:21:36 -04:00
zzz 5311271498 i2snark: v2 WIP cleanup
a v2 infohash is a Hash not a MerkleHash
2026-08-23 11:15:14 -04:00
zzz a258c86b06 i2snark: v2 WIP part 6 2026-08-23 11:12:24 -04:00
zzz 029d2df70e i2snark: limit log in one more spot 2026-08-23 11:09:12 -04:00
zzz f34c097a53 bump -4 2026-08-22 16:27:39 -04:00
zzz cf329f3829 Build: Improve i2psnark standalone build
by not depending on router, and not bundling DTG internal classes
2026-08-22 14:56:23 -04:00
zzz 517e660389 i2psnark: Add support for magnet xl param 2026-08-22 10:31:53 -04:00
zzz 697bb94f8f i2psnark: Smooth out request throttling
The request throttler had several problems:

- Throttling was very laggy, but when it reacted it throttled too quickly.
- PartialPieces got returned back to PeerCoordinator,
  and then back to PeerState, every few seconds, rather
  than continuing steady-state in PeerState
- Holding the PartialPiece in the PeerCoordinator for
  several seconds while staying interested is poor and risks snubbing
- Max request queue size was reduced far too quickly,
  doing so exponentially when the reduction occurred linearly
- shouldRequest() called the request limiter second in the conditional,
  so the estimator was not decayed properly when over down bw limit
- shouldRequest() used overDownBandwidthLimit() rather than _down.offer(),
  ensuring a very slow and laggy feedback loop.
- Requests were added too quickly on unthrottle

Fix these by:

- Fixing and slowing max request queue size reduction to simulate
  an exponential reduction over time when throttled
- Fixing shouldRequest() to always call offer() for both limiters
- Slow addition of requests after unthrottle to simulate
  a linear increase over time

Log tweaks also

The request queue now mostly maintains a steady size,
and properly meters the requests.
The PartialPiece returns to the PeerCoordinator much less often,
and comes back to PeerState much quicker if it does.

Further tuning TODO
2026-08-22 10:22:50 -04:00
zzz 171838070a i2psnark: Improve handling of chunks received out-of-order
- For fast peers:
  Do not rerequest, peer is expected to meet its BEP 6 obligation,
  and rerequesting needlessly inflates the request bandwidth estimate
- Drop dup requests for pieces peers already have
- Remove old comment about future enhancements we already did
- Fix repeated PartialPiece log about hole filled in
- Log tweaks

Should improve d/l from qbittorrent that aggressively reorders
2026-08-21 11:30:42 -04:00
zzz cc63ee6843 i2psnark: Improve BitField.toString() for logging 2026-08-20 11:29:20 -04:00
zzz 101a9e54e4 i2psnark: Enum for metainfo types + cleanups (v2 WIP part 5)
- FileTree remove unused param
- PieceLayers remove unused method
2026-08-20 09:38:22 -04:00
zzz 2b002e2b7a i2psnark: Don't load whole pieces in memory when creating/rechecking torrents
for large piece sizes, use a buffer instead,
in two spots: creating and rechecking.
Pass the hash instead of the piece to MetaInfo.checkPiece()
Remove now-unused methods.
2026-08-19 12:06:22 -04:00
zzz 7751367b85 i2psnark: Fail in BDecoder on dup dictionary entry 2026-08-18 17:40:33 -04:00
zzz 63e966890f i2psnark: Fix extraction of metainfo file attributes 2026-08-17 11:44:24 -04:00
zzz a900ca3286 i2psnark: v2 updates (WIP part 4)
- Refactor padding file addition, inspired by similar code in I2P+
  Now will be called from Storage, not done on-the-fly during
  MetaInfo creation, which was the wrong place.
- Skip padding files in PieceLayers constructor based on attributes
- toString() tweaks for logging
2026-08-16 13:05:38 -04:00
zzz 7e3220d293 i2psnark: Piece hash calc optimization on torrent creation
to avoid extra copy and object churn
2026-08-16 12:56:35 -04:00
zzz 276491a450 i2psnark: v2 updates (WIP part 3)
- Revert: make InputStream method private, for root
- Add checks to InputStream method
- Add method for calculating hash from a byte[]
2026-08-15 20:14:02 -04:00
zzz 042efa8493 i2psnark: v2 updates (WIP part 2)
- Add method to generate piece hashes from a File
- Make InputStream methods private
- Fix subclass name
- Add alternate construtor for PieceLayers
- Change PieceLayers constructor exception class
2026-08-15 13:51:39 -04:00
zzz 498488b0d0 i2psnark: Use MagnetURI for magnet creation in Storage CLI 2026-08-14 08:43:21 -04:00
zzz f028b640a2 i2psnark: Add dn name param to magnet links on details page 2026-08-14 08:36:52 -04:00
zzz 76f0101162 i2psnark: Strict URI encoding for UTF-8 2026-08-14 07:50:26 -04:00
zzz d5639a35bf i2psnark: MagnetURI improvements
- Move link generation from I2PSnarkServlet to MagnetURI
- Add v2 generation and parsing support
- Add CLI test
2026-08-13 12:08:27 -04:00
zzz 33233faa32 CLI: Add V2Util 2026-08-13 10:37:08 -04:00
zzz ff92f10f2b bump -3 2026-08-13 09:31:25 -04:00
zzz ad9ce4f795 i2psnark: Add v2 utility classes (WIP)
Not hooked in, not for this release, for safekeeping only
2026-08-13 08:48:41 -04:00
zzz abe8d26705 console, i2psnark: Reload XHR after page becomes visible again
and disable XHR when hidden, to prevent nonce failures,
made worse by nonce changes in the last release.
We keep the XHR timer firing for now.
Cancelling/restarting timer is a possible part 2 TBD.
Credit: drzed for assistance
2026-08-12 18:29:00 -04:00
zzz ce34963939 i2psnark: PeerID cleanups
- Make destHash final
- Use destHash.hashCode() for hashCode()
- Use b32 for toString() if full dest not known
2026-08-12 10:55:45 -04:00
zzz fd2b44244f i2psnark: CSS tweak 2026-08-12 10:14:30 -04:00
zzz e62549d59f i2psnark: add missing translation tag 2026-08-11 11:24:17 -04:00
zzz 013ba1842e Build: Recognize gettext version 1.0
for fast-mode msgfmt.
In forky/stonking.
Adapted from fix courtesy I2P+
2026-08-11 09:13:17 -04:00
zzz eca54607a7 Streaming: log tweak 2026-08-10 19:34:34 -04:00
zzz 061d4e3f6c Streaming: synch fixes
- extend synchronization in Connection.ackPackets()
- add missing synchronization in CPH.adjustWindow()
2026-08-10 19:21:01 -04:00
zzz 927d1297ee i2psnark: javadoc add @since 2026-08-10 19:16:14 -04:00
zzz 2936e27162 Streaming: Remove option to disable protocol number enforcement
default has been enabled since 0.9.36 (2018)
2026-08-10 17:07:16 -04:00
zzz 4dd77de204 I2CP: check if limiter enabled before calling updateBps()
micro-optimization
2026-08-10 12:27:21 -04:00
zzz bd81ab51d3 i2psnark: Disable I2CP bw limiting
For now, disable it, since we now have good bandwidth limiting
in snark, we don't need the additional throttling/drops in I2CP
causing more streaming issues and making snark/streaming analysis/optimization harder.

The I2CP limiter is also bad and old and needs to be completely rewritten or tossed out.
2026-08-10 12:19:56 -04:00
zzz 25503b72e3 i2psnark: Add CompleteBitfield subclass for efficiency
and use it on reception of HAVE_ALL
2026-08-10 12:02:19 -04:00
zzz 8cf0585579 Streaming: Increase min slow start threshold in retransmit path
for faster window size recovery (WIP)

- Fast: increase min from 2 to 16
- Timer: increase min from 2 to 8
- Both: Double Westwood BDP value used in calculation, use rounding
- Add missing synchronization in fast-retx path
- Log tweaks
2026-08-10 11:56:20 -04:00
zzz a8f555be72 i2psnark: PeerID tweaks
- truncate peer IDs before b64, not after, for efficiency
- reduce dest b64 chars from 6 to 4
- deprecate non-compact PeerID constructor
2026-08-09 17:27:16 -04:00
zzz ed3134d776 i2psnark: Log tweaks
- log peer hashes in acceptors in b32, not b64
- log infohashes in hex, not b64
2026-08-09 16:57:18 -04:00
zzz 7aa0d4cf71 i2psnark: Remove unused name_utf8 param from MetaInfo constructors
leftover from removal of the old utf8 metainfo support
2026-08-06 14:20:35 -04:00
zzz ec5231836f i2psnark: Use inbound banlist for outbound also 2026-08-05 17:25:42 -04:00
zzz ab715a94a7 NTCP: Catch unchecked BufferOverflowException on read() call, unknown cause
reported 2x by: postman
2026-08-05 16:06:08 -04:00
zzz 316f0bc1e3 Streaming: Don't log MTU increase if not increased 2026-08-05 14:23:26 -04:00