Skip to main content

flashblocks

Decode Base Flashblocks in real time and get Chainlink price updates 200–2000 ms before the block is sealed — with on-the-spot confirmation from logs_bloom, no receipt round-trip.

Rust library, command-line tool and Python module (pip install flashblocks).

Why

Base builds every 2-second block out of ten 200 ms slices and streams them publicly (wss://mainnet.flashblocks.base.org/ws). Anything that reacts to an oracle price — liquidation bots, OEV solvers, hedgers, dashboards — can act on a Chainlink update the moment its transaction lands in a slice, instead of waiting for the block or polling an RPC. The stream is raw, though: brotli-compressed JSON with RLP-encoded signed transactions, roughly 3.5 GB a day. This crate turns it into typed events:

{"block":53118600,"index":4,"aggregator":"0x05c84a58…","answer":"229655000000","confirmed":true,"tx":"0x…","latency_ms":0.41}
  • Finds transmits. Chainlink updates on Base arrive as forward(aggregator, transmit(report)) through a forwarder, or as a direct transmit(report). Both are decoded from the raw transaction bytes; the new answer is the median of the report's observations, exactly as the OCR2 aggregator computes it (verified against the aggregator on-chain).
  • Confirms without a receipt. A slice carries the block's cumulative logs_bloom. If the transmit succeeded, AnswerUpdated(aggregator, answer) is in the bloom; a reverted transmit leaves nothing. Blooms have no false negatives, so confirmed == false is final. On a live stream 11 of 11 confirmations matched the receipts.
  • Fast. Slices without a watched address are rejected by a byte search before any JSON parsing. On the recorded sample (135 real slices, Apple M-series): 0.55 ms for a slice with an update, 0.11 ms without. A Python reference implementation (web3.py + eth_abi) takes 3.0 ms and 0.9 ms on the same input.

Command line

cargo install flashblocks
flashblocks-tail --feed 0x05c84a58fe042275b37db038baacd15f410c7bb0   # cbETH/USD aggregator on Base

Base documents the public mainnet.flashblocks.base.org endpoint as intended for infrastructure use; for anything serious run your own flashblocks-websocket-proxy or use a node provider that exposes the stream, and point --url at it. The message format is the same.

--feed is the aggregator address (what EACAggregatorProxy.aggregator() returns), not the proxy. Pass it as many times as you like; --url overrides the stream endpoint. One JSON line per update goes to stdout, connection statistics go to stderr when the stream is quiet.

Rust

use flashblocks::{Listener, Watch};

let watch = Watch { aggregators: vec![cb_eth_usd], ..Watch::default() };
let listener = Listener::start("wss://mainnet.flashblocks.base.org/ws".into(), watch);
for update in listener.receiver.lock().unwrap().iter() {
    let f = update.update;
    println!("block {} slice {} feed 0x{} confirmed {:?} after {:.2} ms",
             f.block, f.index, hex::encode(f.aggregator), f.confirmed,
             update.received.elapsed().as_secs_f64() * 1000.0);
}

Decoding only, without the listener: flashblocks::parse(&message, compressed, &watch) takes one WebSocket frame (binary = brotli) and returns Vec<FeedUpdate>. Listener.watch can be swapped at runtime.

Python

pip install flashblocks
import flashblocks

listener = flashblocks.Listener("wss://mainnet.flashblocks.base.org/ws",
                                aggregators=["0x05c84a58fe042275b37db038baacd15f410c7bb0"])
while True:
    got = listener.next(1000)            # (aggregator, answer, block, index, age_ms, tx_hash, confirmed) or None
    if got:
        print(got)

flashblocks.parse(message, compressed, aggregators) decodes one frame. Decoding and waiting run with the GIL released.

How Base orders transactions, and why slices matter

Transactions in a slice are ordered by arrival (priority fee breaks ties only among those arriving together). A bot that reacts to the sealed block is always a full block late; a bot that reacts to the slice can land in the next 200 ms slice of the same block. The received timestamp in Update is the moment the frame arrived, so you can measure your own end-to-end reaction time.

Testing

cargo test --release replays tests/fixtures/base_sample.ndjson — 135 messages recorded from the live stream in October 2026 — and checks every decoded update against results from an independent Python decoder. Selectors are derived from the function signatures in a test, so a typo cannot silently break decoding.

License

MIT.

Metadata

Release files for flashblocks 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flashblocks 0.1.1
File Size Uploaded Provenance Actions
flashblocks-0.1.1.tar.gz 690.3 kB With provenance Details for flashblocks-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for flashblocks 0.1.1
File Actions
flashblocks-0.1.1-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for flashblocks-0.1.1-cp312-abi3-win_amd64.whl
flashblocks-0.1.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details for flashblocks-0.1.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
flashblocks-0.1.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details for flashblocks-0.1.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
flashblocks-0.1.1-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for flashblocks-0.1.1-cp312-abi3-macosx_11_0_arm64.whl
flashblocks-0.1.1-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details for flashblocks-0.1.1-cp312-abi3-macosx_10_12_x86_64.whl

Total release size: 6.6 MB

Release files / flashblocks-0.1.1.tar.gz

Download URL flashblocks-0.1.1.tar.gz
Size 690.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f77e3a4ac73599e2eecb9afc258964629b16df351e43aeba8070fc7f1fc79820
BLAKE2b-256 checksum
How to use checksums
282d7d981e53913c8b7eece2878a2ba0bde7239df042e1bf499a4bbf4dfbc2a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / flashblocks-0.1.1-cp312-abi3-win_amd64.whl

Download URL flashblocks-0.1.1-cp312-abi3-win_amd64.whl
Size 1.1 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
80d97d8b2b613d9c324db2bc9c2fc6076fa8afcb6d78ab9b556b56662a5acc4f
BLAKE2b-256 checksum
How to use checksums
079b70028f62e8a7893264c0f44a362649a103a8523beb3b87d783a9ee83e09e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / flashblocks-0.1.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL flashblocks-0.1.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
44d3028570f45a278e874aea832c6976a6d49c81d9e1dbc11f880bce14015d0e
BLAKE2b-256 checksum
How to use checksums
e74a25206a62074d9f19b6b97a2fa83e162c14b18d1b9b03296f646a08456da6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / flashblocks-0.1.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL flashblocks-0.1.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.2 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
b35c8168a58866cc4c5bab1638f2cdb3624b7330de9bf5dab423fe5e9a10042a
BLAKE2b-256 checksum
How to use checksums
9201165e5881f868c54c981b42b8e31a49d61b12d9c2c758c1ba8fe1648eea77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / flashblocks-0.1.1-cp312-abi3-macosx_11_0_arm64.whl

Download URL flashblocks-0.1.1-cp312-abi3-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d588aa099434d19cd456d4e9c948666372dd56aad576c40d02498265cc976170
BLAKE2b-256 checksum
How to use checksums
eea95cf4737644983c92bbf14373040824c324bb19d935a97ec6b8131f0e03e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / flashblocks-0.1.1-cp312-abi3-macosx_10_12_x86_64.whl

Download URL flashblocks-0.1.1-cp312-abi3-macosx_10_12_x86_64.whl
Size 1.2 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
09d1ca1281ba3db3f973d8495023050aee9f1fecaae796c813ccbb5d0ca2c0e4
BLAKE2b-256 checksum
How to use checksums
9950a74b7459f677c31da5065c486ac4bd63eb96b8db82ad0ed372f38c21f9df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for flashblocks 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for flashblocks-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

6 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page