From 32b897d8f313bc6d5eafbb2db49079c4db5c7faf Mon Sep 17 00:00:00 2001 From: you Date: Sat, 21 Mar 2026 21:31:25 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20remove=20ADVERT=20timestamp=20validation?= =?UTF-8?q?=20=E2=80=94=20field=20isn't=20stored=20or=20used?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Timestamp is decoded from the ADVERT but never persisted to the nodes table. The validation was rejecting valid nodes with slightly-off clocks (28h future) and nodes broadcasting timestamp=4. No reason to gate on it. --- decoder.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/decoder.js b/decoder.js index fa48059..e2ed9f4 100644 --- a/decoder.js +++ b/decoder.js @@ -311,14 +311,7 @@ function validateAdvert(advert) { if (!VALID_ROLES.has(role)) return { valid: false, reason: `unknown role: ${role}` }; } - // timestamp sanity: must be after 2020-01-01 and not more than 1 day in the future - if (advert.timestamp != null) { - const MIN_TS = 1577836800; // 2020-01-01 - const MAX_TS = Math.floor(Date.now() / 1000) + 86400; // now + 1 day - if (advert.timestamp < MIN_TS || advert.timestamp > MAX_TS) { - return { valid: false, reason: `timestamp out of range: ${advert.timestamp}` }; - } - } + // timestamp: decoded but not currently used for node storage — skip validation return { valid: true }; }