Skip to content

🤖 [claude] Firehose series on upstream develop 049d306 (fork-recovery memory fix) - #3

Merged
Johnaverse merged 27 commits into
upstream/049d306from
release/develop-fh
Sep 8, 2026
Merged

Johnaverse merged 27 commits into
upstream/049d306from
release/develop-fh

Conversation

@Johnaverse

Copy link
Copy Markdown
Collaborator

Summary

First Firehose build cut from an upstream commit rather than an upstream tag. Base branch upstream/049d306 is pristine bnb-chain/reth-bsc develop@049d3065 ("fix: refine new-payload/fcu flow to avoid memory accumulation", bnb-chain#501 — the fix the bsc-arch* archive nodes already run as eosn-reth-bsc 1.0.0-3; upstream v0.1.2 + 15). This branch replays the StreamingFast Firehose series (as of v0.1.1-fh3.1, 23 commits) on top of it, plus the release pipeline from #2.

Two layers, both public, no secrets:

  • reth layer: pinax-network/bnb-reth (fork of bnb-chain/reth) branch firehose/develop = bf76323c — the exact commit 049d3065's lockfile resolves branch = "develop" to — + StreamingFast's 17 Firehose hook commits from bnb-v0.1.1-fh3.1 + a bot Cargo.lock commit. Zero code conflicts.
  • this repo: all 44 + 15 reth-* pins → that branch; reth-firehose / firehose-tracer = "5" added; [patch.crates-io] alloy-evm → streamingfast/evm sf/v0.34.0 (same patch the reth layer applies). Cargo.lock regenerated by the new lockfile.yml (cargo fetch, commits with GITHUB_TOKEN, cannot loop).

Conflicts resolved (2 code, rest pins):

  • src/node/evm/executor.rs — Pasteur contract upgrade path: keep upstream's block (reports the code change to the state hook; the bsc-qanet root fix) and emit Firehose on_code_change before the mutation, as SF did.
  • src/node/evm/pre_execution.rs — internal consensus eth_calls: keep upstream's view_call_tx_env() helper, add SF's reth_firehose::suspend_tracing() guard.

Release semantics: tags dev-<sha>-fh<proto>-<n> build with maxperf like tag releases but are published as prereleases and never move the latest image tag. Planned tag after merge: dev-049d306-fh3.1-1.

The v0.1.1-fh3.1-1 clippy fix from #2 is not needed here (upstream already rewrote that code).

Test plan

  • CI green (ci.yml; sf-release.yml Docker build in release profile without push) — first real compile of the glue against the new reth commit
  • After merge: tag dev-049d306-fh3.1-1 → asset + ghcr.io/pinax-network/reth-bsc:dev-049d306-fh3.1-1 (prerelease)
  • local-build eosn-sf-bsc4-test on that asset; canary on bsc-sfdm40; FIRE output compared against a live eosn-sf-bsc4 node

🤖 Created by Claude Code Fable 5.1 (effort: medium)

🤖 Generated with Claude Code

https://claude.ai/code/session_01YHvxpuVpZfzefJgwgqjAzn

sduchesneau and others added 27 commits September 8, 2026 18:16
Consumes reth crates from streamingfast/bnb-reth (firehose/0.x-bsc),
initializes the Firehose tracer, wraps BscEvmConfig in FirehoseEvmConfig
and installs the Firehose ExEx. Also fixes the zero head hash advertised
in the eth/69 status that prevented fresh nodes from peering, and adds
the StreamingFast release CI (fireeth-bundled image) in place of the
upstream tag-triggered workflows.

(cherry picked from commit 99b8178)
Fees (incl. blob fees) are emitted to SYSTEM_ADDRESS instead of the
beneficiary, deferred system transactions are traced as ordinary txs at
their finalize-time execution point, the distribute_incoming sweep and
direct system-contract code installs emit their balance/code changes.

(cherry picked from commit a17baef)
The validator-set and turn-length reads run on the inspector-carrying
EVM between transactions; their hooks panicked the tracer state machine
on mainnet sync. Geth never traces these reads.

(cherry picked from commit 020df22)
Companion to the bnb-reth add_block_log_offset fix: without it, call
logs emitted after a log-bearing system tx lagged receipt log indices
and panicked the tracer's ordinal assignment.

(cherry picked from commit ddde242)
Pre-release tags use the release profile (thin LTO) instead of maxperf,
and branch pushes no longer build images — tags, PRs and manual
dispatch only.

(cherry picked from commit 58b9650)
Skips tracer init so the node runs the plain untraced execution path;
the firehose ExEx idles in no-op mode. A/B lever for isolating
tracing-induced behavior.

(cherry picked from commit 7a32699)
The CacheDB type-name heuristic is fragile; a misfire on a full-block
path double-credits the validator in committed state. Gate funding off
whenever the inspector is the FirehoseInspector.

(cherry picked from commit f1765b6)
Lost in cherry-pick conflict resolution during the v0.1.1 rebase.

(cherry picked from commit b81a8e2)
(cherry picked from commit 0181b56)
Diagnostic for fee-accumulation divergences: at the UnexpectedSystemTx
error the node holds its own receipts, so logging cumulative-gas deltas
identifies which transaction's gas diverges from canonical.

(cherry picked from commit f6dd095)
Two BSC Firehose parity fixes vs the geth reference:

- transact_system_call bypassed the inspector, so the per-block EIP-2935
  history-storage update executed and committed state but never appeared
  in the trace. Route it through the inspected variant when tracing so it
  is emitted as a system_call, matching geth.

- BSC headers carry a 0 base fee; the tracer computed dynamic-fee
  gas_price as min(tip + base_fee, cap), collapsing to the tip, while geth
  reports the fee cap (tx.GasPrice()). Enable the fork's new
  treat_zero_base_fee_as_absent so a Some(0) base fee is emitted as nil,
  yielding the fee cap and omitting the header field.

Bumps the bnb-reth fork to 4de725a6.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit b19b044)
BscBlock::rlp_length counted blob sidecars, so the Firehose `size` (and
eth_getBlock size) over-reported blob blocks by ~128 KiB/blob vs geth,
which measures the canonical block. Make rlp_length sidecar-free; encode()
still carries sidecars for the BSC network/storage form. The EIP-7934
size check that also uses rlp_length is Osaka-gated and inert on BSC.

Bumps the bnb-reth fork to 5f9e1ec1 (Firehose size uses rlp_length).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit bac9619)
(cherry picked from commit c434b81)
Dev genesis files activate Shanghai/Cancun/Prague at time 0, so reth's
fork-aware genesis builder added withdrawals/blob/requests header fields
that geth-bsc omits, mismatching the genesis hash and breaking the P2P
status handshake against a geth-bsc peer (battlefield's dockerized
miner). Strip the post-merge fields and re-seal.

(cherry picked from commit a3ec010)
Chain id 714 alone also matches custom dev networks (battlefield uses
it), which then diverge from geth: geth keys upgrades on genesis hash
and applies none for unknown networks. Applying the QA-net bytecode on
a dev chain changed 0x2002's code at the Maxwell transition and shifted
block gas used.

(cherry picked from commit e0c88cc)
Cargo.lock rev bump follows once streamingfast/bnb-reth#1 merges.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 38d676f)
(cherry picked from commit 2e3ad5d)
(cherry picked from commit d2c1865)
This branch carries StreamingFast's Firehose series unchanged (23 commits on
top of bnb-chain/reth-bsc v0.1.1) and repoints its two streamingfast/* git
dependencies at pinax-network mirrors of the identical commits, so releases can
be built here without any streamingfast repository being reachable:

- reth-* crates (incl. reth-firehose): pinax-network/reth tag bnb-v0.1.1-fh3.1
  (= streamingfast/reth release/bnb-0.x @ d0e869a06)
- alloy-evm [patch.crates-io]: pinax-network/evm branch sf/v0.34.0
  (= streamingfast/evm @ 49b4c64c3, alloy-rs/evm v0.34.0 + inspector system-call patch)

Cargo.lock keeps the same commit hashes; only the source URLs change, so
`--locked` still resolves exactly the bytes StreamingFast shipped.

pinax-network/reth is private, so Dockerfile.sf and ci.yml fetch git
dependencies with the git CLI and take a read token (org secret
PAT_INTERNAL_REPOSITORIES) through a BuildKit secret mount / insteadOf rewrite.
The credential never lands in an image layer.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YHvxpuVpZfzefJgwgqjAzn
…rs are reachable

pinax-network/reth is private and the fork's CI token cannot read it (403), so
this restores the exact streamingfast/reth and streamingfast/evm pins from
v0.1.1-fh3.1. Cargo.toml and Cargo.lock are now byte-identical to that tag.

The credential rewrite in Dockerfile.sf and ci.yml is scoped to
https://github.com/pinax-network/ so public dependencies are never fetched with
a token attached; with no pinax-network pin it is a no-op.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YHvxpuVpZfzefJgwgqjAzn
…the Firehose deps

Upstream 049d306 pins bnb-chain/reth by branch `develop` (resolved to bf76323c
in its Cargo.lock). The Firehose hooks for that exact commit live on
pinax-network/bnb-reth branch `firehose/develop` (bf76323c + StreamingFast's
17 hook commits; public, so no token is needed to fetch). Repoint all 44 + 15
reth crate pins there, add `reth-firehose` / `firehose-tracer` as the glue
requires, and carry the alloy-evm inspector patch that the reth layer also
applies.

Cargo.lock is intentionally left as upstream's here; the lockfile workflow
regenerates it with `cargo fetch` on push.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YHvxpuVpZfzefJgwgqjAzn
…306-fh3.1-1

- lockfile.yml regenerates Cargo.lock with `cargo fetch` on release/** pushes
  that touch a manifest, so a rebase onto a new upstream commit needs no local
  Rust toolchain; the bot commit does not retrigger workflows.
- Tags `dev-<sha>-fh<proto>-<n>` (builds on an upstream branch commit) keep the
  maxperf profile but are published as prereleases and never move `latest`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YHvxpuVpZfzefJgwgqjAzn
Generated by .github/workflows/lockfile.yml (cargo fetch) after the Firehose series was rebased.
…car struct

Upstream develop added `version: u8` to BscBlobTransactionSidecar (EIP-7594
cell-proof marker, rlp:"-", 0 = legacy proofs). StreamingFast's
test_rlp_length_excludes_sidecars builds the struct literally and no longer
compiled; the library itself was unaffected. The field is excluded from the RLP
so the size assertion is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YHvxpuVpZfzefJgwgqjAzn
… commit, fix docs

- Cargo.toml / bsc-ef-tests / Cargo.lock: pin pinax-network/bnb-reth by tag
  `bnb-bf76323c-fh3.1-1` (= firehose/develop @ 1fccff49, the commit the lock
  already resolved) instead of the moving branch, so the manifest states what
  the changelog promises and `cargo fetch` cannot drift the reth layer.
- lockfile.yml: after pushing the regenerated Cargo.lock, dispatch ci.yml and
  sf-release.yml on the branch. GITHUB_TOKEN pushes never trigger push
  workflows, so without this the only commit on which `--locked` can pass was
  never built. ci.yml gains a workflow_dispatch trigger for that.
- sf-release.yml: the secrets comment described a private reth fork that
  nothing pins; align it with the header.
- CHANGELOG: the v0.1.1-fh3.1-1 entry no longer claims identical sources; it
  documents the clippy rewrite under Fixed. The dev entry names the tag.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YHvxpuVpZfzefJgwgqjAzn
The previous commit only rewrote entries carrying a commit hash; the 27
dependency references without one still named branch=firehose/develop, which
cargo treats as a different source.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YHvxpuVpZfzefJgwgqjAzn
@Johnaverse
Johnaverse merged commit 36f98f7 into upstream/049d306 Sep 8, 2026
11 checks passed
@Johnaverse
Johnaverse deleted the release/develop-fh branch September 8, 2026 19:57
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.

2 participants