Milestone 6: DiscoveryProvider seam, signed announcements, redoal sketch
The discovery module defines the seam: DiscoveryProvider (subscribe/ announce over 32-byte TopicKeys) and a signed Announcement carrying root hash, ed25519 author, metadata and provider addresses. Signatures cover a deterministic postcard encoding including the topic (no cross- channel replay) and the provider identities (addresses stay refreshable hints). LanDiscovery conforms to the trait — mdns sightings become locally-authored announcements, one per pinned root — and the daemon's auto-sync now runs entirely through it: verify, index unconditionally, fetch only for trusted authors from allowlisted providers on already- pinned incomplete roots. The milestone-4 real-mdns sync test passes unchanged through the new path. Verification unit tests cover round trip, tampered root, wrong topic, forged author, mismatched signing key, and serde survival. docs/redoal-integration.md sketches the gesture-topic gossip provider against this contract. Also: fix a flaky hang in the socket-activation test (dup2(3,3) leaves CLOEXEC set when the listener already sits on fd 3; parent's listener copy masked daemon death), and give the test client a read-timeout hang guard. Add a top-level README. Dependencies: ed25519-dalek (Signature type; same implementation iroh keys use), postcard (deterministic signed encoding, iroh's canonical compact codec). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -101,6 +101,11 @@ pub struct Client {
|
||||
impl Client {
|
||||
pub fn connect(socket: &Path) -> Client {
|
||||
let stream = UnixStream::connect(socket).expect("connecting to daemon");
|
||||
// Hang guard: a daemon that accepts but never answers should fail
|
||||
// the test, not wedge the whole suite.
|
||||
stream
|
||||
.set_read_timeout(Some(Duration::from_secs(120)))
|
||||
.expect("setting read timeout");
|
||||
let reader = BufReader::new(stream.try_clone().expect("cloning stream"));
|
||||
Client {
|
||||
reader,
|
||||
|
||||
Reference in New Issue
Block a user