feat(federation): relay envelope populates peer epoch baseline

This commit is contained in:
Jannis Braun
2026-07-01 21:58:03 +02:00
parent 8f60e92f94
commit 3b1a0b64a3
5 changed files with 126 additions and 1 deletions
@@ -15,7 +15,7 @@ import { startupBootstrapSync, onPeerDeactivated } from './federationPeerActivat
import { probePeerReachable, markPeerRecovered } from './federationRecovery.js';
import { backfillReplicatedProfileAssets } from '../routes/federation.js';
import { invokePermanentFailureCallback } from './federationRollback.js';
import { refreshPeerEpochs } from './federationEpoch.js';
import { refreshPeerEpochs, getInstanceId } from './federationEpoch.js';
import fs from 'node:fs';
import path from 'node:path';
import crypto from 'node:crypto';
@@ -235,6 +235,11 @@ export async function processOutboxTick(): Promise<void> {
const request: FederationRelayRequest = {
version: 1,
sourceInstance: ourOrigin,
// Stamp our current epoch so a verified relay authentically carries this
// instance's incarnation id — the receiver uses it as the fast-path
// populate-if-null baseline (design §3.2). A reset instance cannot sign a
// valid relay, so this never carries a *new* epoch post-reset.
sourceInstanceId: getInstanceId(),
events,
};