From d4115a31e82f032c0ca8be39df1beca8d3dc810d Mon Sep 17 00:00:00 2001 From: Padreug Date: Tue, 19 May 2026 22:30:06 +0200 Subject: [PATCH] =?UTF-8?q?fix(hal/ebds):=20poll=20MEI=20at=20100ms,=20not?= =?UTF-8?q?=2010s=20=E2=80=94=20bills=20were=20getting=20torn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EBDS is a host-polled protocol: the MEI validator only speaks when polled, and its internal escrow grace expires after ~5 seconds. With POLLING_INTERVAL=10_000 the host learned about an escrowed bill *after* the MEI had already autonomously begun returning it, which on BATM3 hardware can shear the bill between the transport rollers and the mouth (see torn $20 reported by operator). Drop the interval to 100ms to match id003's cadence — so we see escrow and issue stack/reject inside the validator's grace window. This is the production-critical fix; observability + escrow watchdog follow in subsequent commits. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/hal/src/validators/ebds/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/hal/src/validators/ebds/index.ts b/packages/hal/src/validators/ebds/index.ts index 9ae78b7..cedbedf 100644 --- a/packages/hal/src/validators/ebds/index.ts +++ b/packages/hal/src/validators/ebds/index.ts @@ -17,7 +17,13 @@ import { EbdsFsm } from './ebds-fsm.js' import { denominations as denominationsTable } from './denominations.js' import type { BillValidator, ValidatorConfig, BillData } from '../../types.js' -const POLLING_INTERVAL = 10_000 +// EBDS is host-polled: the validator only speaks when polled, and its +// internal escrow grace expires after ~5s. Polling slower than that means +// the host learns about an escrowed bill after the validator has already +// auto-returned it, which on MEI hardware (BATM3) tears bills at the +// transport rollers. Match id003's 100ms cadence so we see escrow inside +// the validator's grace window. +const POLLING_INTERVAL = 100 /** * BigNumber-like interface for bill comparisons