Skip to content

fix(hotblocks): keep ingesting when a block time is unrepresentable#100

Merged
mo4islona merged 1 commit into
masterfrom
fix/hotblocks-block-time-range
Jul 20, 2026
Merged

fix(hotblocks): keep ingesting when a block time is unrepresentable#100
mo4islona merged 1 commit into
masterfrom
fix/hotblocks-block-time-range

Conversation

@mo4islona

@mo4islona mo4islona commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

A block time outside the datetime-conversion range killed the ingest flush and left the
dataset re-requesting the same block every P-EPOCH-RETRY forever. The conversion feeds
nothing but a debug! field, so this was a log line taking the dataset down with it — and
at info level, over a line that is never emitted: the field is evaluated lazily, the
fallible conversion above it was not.

time is informational — DEF-4 says so and CN-8 forbids correctness depending on it. So
the conversion is best-effort now. What is stored is unchanged and always was the raw
Option<i64>; only the human-readable rendering could ever fail, and it degrades to None
with last_block_time_ms carrying the number, so an absurd value is still diagnosable from
the log.

Saturating conversion

self.header.timestamp * 1000 on the evm and solana paths is an unchecked i64 multiply.
With no [profile] overrides in the workspace root, dev builds run overflow-checks = true
and it panics; release wraps, and a sliver of overflowing inputs wrap back onto a
plausible-looking date. Saturating keeps an absurd input absurd. Bitcoin's timestamp: u32
cannot overflow and is untouched.

GAP-26

Closed. The register's expected behavior — "the dataset must ingest it and keep serving"
is now what happens, so the row leaves the open register for §6.1, the way GAP-11/19/32/38
did. No regression test was written; the §6.1 entry says so and names the CT-9 scenario
(last block at time = i64::MAX).

Testing

cargo clippy and cargo +nightly fmt --check clean, with no new warnings on the changed
files. No test added — the regression test is registered against CT-9 rather than written
here. Thirty days of logs across the hotblocks-db containers carry zero occurrences of the
rejection this removes, so the path is reachable by construction rather than observed.

🤖 Generated with Claude Code

@mo4islona mo4islona changed the title fix(hotblocks): name the block behind an out-of-range timestamp fix(hotblocks): keep ingesting when a block time is unrepresentable Jul 20, 2026
The datetime conversion in `flush` feeds nothing but a `debug!` field, yet its
`?` killed the batch and wedged the dataset on a 60 s retry loop forever — at
info level, over a line that is never emitted. `time` is informational (DEF-4,
CN-8), so the conversion is best-effort now and the raw millis are logged beside
it. The seconds→millis conversions saturate so an absurd source value neither
panics in debug nor wraps into a plausible date.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mo4islona
mo4islona force-pushed the fix/hotblocks-block-time-range branch from 7fd177c to 89069a7 Compare July 20, 2026 10:39
@mo4islona
mo4islona merged commit 8b7b1f6 into master Jul 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant