feat: add public I2P network mode to router daemon
check / check (ubuntu-latest) (push) Failing after 26s
check / check (macos-latest) (push) Failing after 28s
check / check (windows-latest) (push) Failing after 29s

- Add `--public`, `--hops`, `--hosts`, and `--debug` router flags; `--public` auto-reseeds from the live network and keeps a status loop running.
- Route NetDB lookups through tunnels with Noise_N garlic wrapping, fan out to two floodfills, and fetch unknown RouterInfos in the background.
- Back off failed NTCP2 peers and fall back to IPv6 addresses when no IPv4 NTCP2 address is available.
- Size session LeaseSet2 expiry from lease end dates and use the destination's X25519 key when present.
- Add canonical Ed25519 Destination KeyCertificate constructors with round-trip tests.
- Fix DatabaseStore gzip handling to honor the length prefix, and send `Wget/1.11.4` as the reseed User-Agent.
This commit is contained in:
nandi committed 2026-11-28 00:11:28 -08:00
1 parent ae72b00323
commit 54cfb2faa9
25 files changed
+2033 -191

No files matched your search

+27
View File
@@ -162,4 +162,31 @@ test "Proposal 144 ECIES-X25519-AEAD-Ratchet NS -> NSR -> bidirectional ES + DH
let enc_dsm = @ratchet.encrypt_ecies_lookup_reply(rkey, rtag, [dsm_blk])
let dec_dsm = @ratchet.decrypt_ecies_lookup_reply(rkey, rtag, enc_dsm)
assert_eq(dec_dsm, [dsm_blk])
// 6. Router-targeted Noise_N Garlic round-trip & auth check
let router_s = @noise.KeyPair::from_private(
@crypto.sha256(b"router-n-static"),
)
let ephem_n = @noise.KeyPair::from_private(@crypto.sha256(b"router-n-ephem"))
let wrong_s = @noise.KeyPair::from_private(@crypto.sha256(b"wrong-n-static"))
let router_clove = @ratchet.garlic_clove_block(
Local,
123U,
1700000600U,
Data(data=b"lookup-payload"),
)
let rg_wire = @ratchet.encrypt_router_garlic(router_s.public_key, ephem_n, [
DateTime(1700000200U),
router_clove,
])
let rg_dec = @ratchet.decrypt_router_garlic(router_s, rg_wire)
assert_eq(rg_dec, [DateTime(1700000200U), router_clove])
let mut wrong_failed = false
try {
let _ = @ratchet.decrypt_router_garlic(wrong_s, rg_wire)
} catch {
AuthenticationFailed => wrong_failed = true
_ => ()
}
assert_eq(wrong_failed, true)
}