From e54fda40d73fc0058e21d30a5f50d61e069b3b39 Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Wed, 7 Oct 2026 18:12:00 +0000 Subject: [PATCH] fast-time: switch-crossing.mjs drops null override fields at write (an older binary refuses an unknown key) Co-Authored-By: Claude Fable 5.1 --- infra/fast-time/switch-crossing.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/infra/fast-time/switch-crossing.mjs b/infra/fast-time/switch-crossing.mjs index d6cb4b9a9..b2f560597 100644 --- a/infra/fast-time/switch-crossing.mjs +++ b/infra/fast-time/switch-crossing.mjs @@ -52,7 +52,10 @@ function mergeOverrideText(text, fields) { let out = text; for (const k of Object.keys(fields)) out = out.replace(new RegExp(`\\s*"${k}":\\s*[^,}\\n]+,?`), ''); const extra = Object.entries(fields).map(([k, v]) => `"${k}": ${typeof v === 'string' && !/^\d+$/.test(v) ? JSON.stringify(v) : v}`).join(', '); - return out.replace(/,?\s*}\s*$/, `,\n ${extra}\n}\n`); + out = out.replace(/,?\s*}\s*$/, `,\n ${extra}\n}\n`); + // a null field is an unset Option and means the same as an absent one, but a binary older than the field refuses the + // unknown key (deny_unknown_fields): the 0.3.22 pair exited on the 0.3.23 line's subsidy_per_block field, 18:09Z + return out.replace(/\n\s*"[a-z0-9_]+":\s*null\s*,?/g, '').replace(/,(\s*})/g, '$1'); } const DAY_MS = fieldOf('pow_day_ms'); const common = { genesis_bits: GENESIS_BITS, skip_proof_of_work: false, program_class_v3_activation_daa: NEVER, program_class_v4_activation_daa: NEVER, signing_bonus_activation_daa: NEVER };