GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(discovery): peer announcements carry a timestamp nothing checks — a replayed or out-of-order announcement overwrites newer peer state and can keep a departed peer 'live' forever · Issue #1552 · developing-today/code

id(discovery): peer announcements carry a timestamp nothing checks — a replayed or out-of-order announcement overwrites newer peer state and can keep a departed peer 'live' forever #1552

New issue
Copy link
New issue
Copy link
Closed
#2932
Closed
id(discovery): peer announcements carry a timestamp nothing checks — a replayed or out-of-order announcement overwrites newer peer state and can keep a departed peer 'live' forever#1552
#2932
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Oct 28, 2026
Issue body actions

Problem

Peer announcements carry a creation timestamp (PeerAnnouncement.timestamp_secs, pkgs/id/src/discovery.rs:364), but nothing on the receive path ever reads it:

  • The gossip receive loop in id serve passes every deserializable announcement straight to the peer table (pkgs/id/src/commands/serve.rs:1278, recv_discovery.update(announcement)), with no freshness or ordering check.
  • PeerDiscovery::update (pkgs/id/src/discovery.rs:430-437) unconditionally inserts the announcement and stamps last_seen = Instant::now() — the arrival time, never the announcement's own timestamp.

Two consequences, both verified below:

  1. Out-of-order / replayed announcements regress live state. An older announcement received after a newer one silently overwrites the stored name/blob_count with the stale values.
  2. A departed peer can be kept "live" forever by replay. Freshness (peers(), stale_peers()) is measured only from the local arrival clock, so re-broadcasting one captured announcement at any cadence under STALE_THRESHOLD (120 s) refreshes the peer indefinitely. The cleanup task only probes peers that are stale (serve.rs:1312-1352), so a replay-refreshed peer is never probed and never removed. Announcements are unsigned plain postcard (PeerAnnouncement has no signature field) broadcast on a public topic with a public secret (DEFAULT_TOPIC / DEFAULT_TOPIC_SECRET), so a capture is available to anyone who has ever been on the topic — and ordinary gossip duplication/reordering triggers consequence 1 without any attacker at all.

Evidence (verified this run, main a120b9a9)

Probe crate ON THE LAPTOP (~/git/fleet/probe-2026-10-27-laneB-discovery) compiling the verbatim pkgs/id/src/discovery.rs (sha256 52b897d2cfa2c620f54ac7945e1bad66435472e73327c43cd87ef2bc56ee3d99, identical both sides; iroh-base pinned =1.3.0 per pkgs/id/Cargo.lock). Log: hidden_files/probe-2026-10-27-laneB-discovery/out.log.

case1 after ts=2000: name=Some("new-name") blob_count=42 timestamp_secs=2000 count=1
case1 after replayed ts=1000: name=Some("old-name") blob_count=7 timestamp_secs=1000 count=1
case2 after ts=1000 then ts=2000: name=Some("new-name") blob_count=42 timestamp_secs=2000 count=1
case3 ancient ts=1 accepted: name=Some("ghost") blob_count=99 timestamp_secs=1 count=1
case3: peers()=1 stale_peers()=0
  • Case 1: the replayed older announcement (ts=1000) overwrites the newer stored state (ts=2000, 42 blobs → 7, name regresses).
  • Case 2 (control): normal in-order delivery works, so the gap is specifically the missing ordering/freshness check.
  • Case 3: an announcement stamped timestamp_secs = 1 (1970) is accepted as a currently-live peer: peers() returns it and stale_peers() does not — its claimed age is never compared to anything.

Existing tests cover insert/replace/stale-by-local-clock only; no test delivers announcements out of order or with an old timestamp.

Why it matters

The peer table is what id peers, the REPL peer views, and the web /peers route show an operator, and blob_count is the only content signal in it. Today that table can be rolled back by ordinary gossip reordering, and — because the announcement is unauthenticated and replayable — pinned to a phantom peer indefinitely by anyone holding one old broadcast. The stale-probe cleanup that exists precisely to evict dead peers is structurally unable to see the replayed case.

Acceptance criteria

  • An announcement whose timestamp_secs is not newer than the stored announcement's for that node does not overwrite the stored announcement (equal timestamps: keep the first, or a documented deterministic rule).
  • An announcement stamped older than a pinned bound relative to local wall-clock time (e.g. STALE_THRESHOLD) does not make a peer live / does not refresh its freshness; the peer can still become live again from a genuinely new announcement.
  • Regression tests in discovery.rs: out-of-order delivery keeps the newer announcement; an ancient-timestamp announcement is not returned by peers() as fresh (or is refused at update); in-order controls still pass.
  • The receive path in serve.rs needs no new trust assumptions: the fix lives in PeerDiscovery (and/or a checked entry point it exposes), so every caller gets the ordering/freshness guarantee.
  • Out of scope: signing announcements (a larger design question) — this issue is only about refusing to let an old announcement move state backwards or manufacture freshness.

Activity

Next
  1. developing-today commented on Oct 28, 2026

    @developing-today
    developing-todayBot
    on Oct 28, 2026 – with developing.today
    Contributor
    More actions

    CODE-600

  2. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Oct 28, 2026
  3. dezren39 commented on Oct 28, 2026

    @dezren39
    dezren39
    on Oct 28, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator (lane B, new-issue-creator-code-b)
    • Session / ID: new-issue-creator-code-b run 2026-10-27 20:20 CDT (2026-10-28T01:30:53Z)
    • Found via: filed this run
    • Task: Triage the discovery announcement ordering/freshness defect: PeerDiscovery::update ignores timestamp_secs, so replayed/out-of-order announcements regress peer state and manufacture freshness.
    • Expectation: effort/s — done looks like: out-of-order and ancient-timestamp announcements no longer move state backwards or make a peer live, with regression tests in discovery.rs.
    • Links: probe + log in goal hidden_files/probe-2026-10-27-laneB-discovery/ (verbatim discovery.rs, laptop-built)
  4. github-actions
    assigned
    dezren39
    on Oct 28, 2026
  5. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Oct 28, 2026
  6. 78 remaining items

  7. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Oct 31, 2026
  8. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: queue worker (repo-worker-code), lane A
    • Session / ID: queue task 1823, repo-queue-worker-shift 2026-10-31 03:04 CDT
    • Found via: queue claim (resume, stage awaiting_ci)
    • Task: CI run 41168873387 still queued at 08:09Z — only the full (main tier) job remains uncompleted; basic test shards 0/1/3 passed, shard 2 cancelled, test-unit/test-web-unit failures still to be confirmed against the pre-existing set once logs are available. Codex: 0 unresolved review threads verified fresh this shift; PR mergeable/clean.
    • Expectation: parked 20m; resume = run completes → merge PR 2932 if remaining failures are only the verified pre-existing ones outside the 2-file diff, close id(discovery): peer announcements carry a timestamp nothing checks — a replayed or out-of-order announcement overwrites newer peer state and can keep a departed peer 'live' forever #1552, complete fixed_merged
    • Links: PR id(discovery): check announcement timestamps in PeerDiscovery::update — ordering + freshness bound (#1552) #2932 · run https://github.com/developing-today/code/actions/runs/41168873387
  9. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Oct 31, 2026
  10. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: repo-worker-code (lane D)
    • Session / ID: queue task 1823 (small_fix, resume from awaiting_ci checkpoint)
    • Result: PR id(discovery): check announcement timestamps in PeerDiscovery::update — ordering + freshness bound (#1552) #2932 merged. CI run 41168873387 completed: all discovery::tests pass (incl. the 5 new regression tests); remaining failures verified outside the diff / pre-existing — store_traits Cargo.lock rusqlite check, flaky log_sync batch-collection timing tests, rustfmt/treefmt/prettier/biome drift in untouched files and untouched lines of peers.rs. Codex: 0 unresolved review threads on head d8d58d9.
    • Issue: id(discovery): peer announcements carry a timestamp nothing checks — a replayed or out-of-order announcement overwrites newer peer state and can keep a departed peer 'live' forever #1552 closes with the merge.
  11. dezren39
    added a commit that references this issue on Oct 31, 2026

    Merge pull request #2932 from developing-today/queue/1823-1552-discov…

    775f9a8
  12. dezren39
    closed this as completedin #2932on Oct 31, 2026
  13. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.