Skip to content

Prepare the oracle for Glamsterdam without changing results - #259

Open
Marketen wants to merge 4 commits into
mainfrom
glamsterdam-prep
Open

Marketen wants to merge 4 commits into
mainfrom
glamsterdam-prep

Conversation

@Marketen

@Marketen Marketen commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

What this does

Four changes that the Glamsterdam support builds on. They are safe on every chain today: none of them changes a result before the fork.

  • go-eth2-client v0.30.2, Go 1.25. Needed to decode Gloas blocks.
  • Vanilla reward from each transaction's priority fee. The reward is now the sum of effective tip × the gas each receipt reports, instead of total fees minus header gas used × base fee. After EIP-7778/8037 the header's gas used no longer equals the gas transactions paid for, so the old formula over-credits. Before the fork both give the same number, and a test pins that.
  • Missed slots from the HTTP status. GetConsensusBlockAtSlot treated any error whose text contained "404" as a missed slot, for example a slot number such as 4540412 in the URL of an unrelated error. It now checks the status code of go-eth2-client's api.Error.
  • Pending consolidations request. It built its URL from ConsensusClient.Address(), which go-eth2-client masks for logging (credentials, path and query become xxxxx), and used a client with no timeout. It now uses the configured endpoint and the same 120 s timeout as the rest.

Why a separate PR

So it can be released and run on mainnet and Hoodi before the Hoodi fork (15 Dec 2026, epoch 143616), with the Glamsterdam logic reviewed on its own in the PR stacked on this one.

Testing

  • go build ./... && go vet ./... && go test -count=1 ./... pass.
  • The fee formula was checked against live Sepolia, which has run Glamsterdam since October: on 8 blocks (12249914 to 12249921) it equals the fee recipient's balance change to the wei, while the header's gas used was 9 to 21M below the gas the receipts report.

🤖 Generated with Claude Code

Marketen and others added 4 commits December 1, 2026 12:19
Glamsterdam's consensus fork (Gloas) moves the execution payload out of
the beacon block. v0.30.2 is the first go-eth2-client release that can
decode Gloas beacon blocks and fetch execution payload envelopes; with
v0.27.1 the oracle stops at the first Gloas slot because the block can't
be decoded.

v0.30 requires Go 1.25, so the Dockerfile and CI move to it as well.
go-bitfield moved from prysmaticlabs to OffchainLabs upstream, which only
affects one test import. No behaviour changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The vanilla reward was calculated as every fee paid minus the block
gas_used times the base fee. That relies on the block gas_used being the
sum of the gas charged to each tx, which Glamsterdam breaks: EIP-7778
stops subtracting refunds from it, and EIP-8037 makes it the largest of
two gas dimensions. The pool would have been credited less than it
received, and the onchain reconciliation would refuse to freeze the
checkpoint.

Sum each tx's priority fee instead, using the gas its receipt charged.
Until Glamsterdam both calculations are equal, which the new tests check
for every supported tx type, so no published reward changes and the
change needs no activation slot.

It also fixes a tx/receipt hash mismatch silently returning a nil reward
with a nil error, as the error was wrapped from a nil one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A beacon block request failing with an error whose text contained "404"
was taken as a missed slot. Any slot number with 404 in it, like
4540412, shows up in the error of a request for it, so a server error or
timeout at such a slot would have counted as a missed proposal: a yellow
or red card for a validator that did nothing wrong.

The status code is now read from go-eth2-client's api.Error, and only a
404 counts as missed. Any other error is retried and then stops the
oracle, as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…solidations

GetPendingConsolidations built its URL from ConsensusClient.Address(),
which go-eth2-client masks for logging: a path is replaced by xxxxx and
query values and passwords too. With an endpoint like
https://node/beacon?apikey=... every call went to the wrong place. It
also used http.DefaultClient, which has no timeout, so a node that
stopped answering mid response would hang the oracle forever.

The URL is now built from the configured endpoint, keeping its path,
query and credentials as go-eth2-client does, and sent with a client
that times out after 120 seconds, the timeout already given to
go-eth2-client. Failures are reported without the URL, so a key in the
query does not end up in the logs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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