Repository navigation
feat(ethclspecs): make the builder pending-balance sums throw-faithful - #110
Open
IvanAnishchuk wants to merge 4 commits into
Open
IvanAnishchuk wants to merge 4 commits into
IvanAnishchuk wants to merge 4 commits into
Conversation
IvanAnishchuk
force-pushed
the
feat/gloas-builder-pending-balance-faithfulness
branch
from
September 28, 2026 04:48
7e0890a to
211de3a
Compare
IvanAnishchuk
marked this pull request as ready for review
September 28, 2026 04:48
IvanAnishchuk
force-pushed
the
feat/gloas-builder-pending-balance-faithfulness
branch
from
October 16, 2026 04:42
211de3a to
0f101e1
Compare
IvanAnishchuk
force-pushed
the
feat/gloas-builder-pending-balance-faithfulness
branch
from
October 25, 2026 19:52
0f101e1 to
0f271c4
Compare
IvanAnishchuk
changed the base branch from
main
to
feat/fulu-churn-faithfulness
October 25, 2026 19:52
IvanAnishchuk
force-pushed
the
feat/gloas-builder-pending-balance-faithfulness
branch
from
November 18, 2026 14:21
0f271c4 to
caa5cbf
Compare
IvanAnishchuk
force-pushed
the
feat/fulu-churn-faithfulness
branch
from
November 18, 2026 14:21
fa52ff0 to
98b4d33
Compare
`get_pending_balance_to_withdraw_for_builder` accumulates one `balance` with `+=` over `uint64` amounts, first the pending withdrawals and then the pending payments, so the SSZ backend raises a `ValueError` past 2^64 - 1. `can_builder_cover_bid` then adds `MIN_DEPOSIT_AMOUNT` to that total, which can raise the same way. The Lean folds and the addition wrapped. `getPendingBalanceToWithdrawForBuilder` now returns `Except`. It folds one accumulator through `checkedAdd`, over the withdrawals and then over the payments. `canBuilderCoverBid` returns `Except` and checks its addition too. `processBuilderExitRequest` binds the pending balance only after the active and address checks, which is where the spec's early returns compute it. The `canBuilderCoverBid` theorems take the successful pending balance and the in-range addition as hypotheses. Two new theorems give the two faults.
When the natural-number totals of the pending withdrawals and the queued payments for a builder add to less than 2^64, the function returns that exact total. At 2^64 or more it rejects with `.arithmetic`, at the first step that passes the bound, in the withdrawals loop or in the payments loop. Two private lemmas carry the induction over a checked, filtered fold from any start value.
The `getPendingBalanceToWithdrawForBuilder` row moves from proposed to proved. The `canBuilderCoverBid` row states the new hypotheses and the two faults.
IvanAnishchuk
force-pushed
the
feat/fulu-churn-faithfulness
branch
from
November 21, 2026 07:32
98b4d33 to
73b057e
Compare
IvanAnishchuk
force-pushed
the
feat/gloas-builder-pending-balance-faithfulness
branch
from
November 21, 2026 07:32
caa5cbf to
2a71a57
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_pending_balance_to_withdraw_for_builderaddsuint64amounts into onebalancewith+=, first the pending withdrawals and then the pending payments, so the SSZ backend raisesValueErrorpast2^64 - 1.can_builder_cover_bidaddsMIN_DEPOSIT_AMOUNTto that total, which can raise the same way. The Lean folds and the addition wrapped. They are now checked and reject with.arithmetic.Stacked on #105. Next in the stack: #134.
What changed
EthCLSpecs
getPendingBalanceToWithdrawForBuilderreturnsExcept. It folds one accumulator throughcheckedAdd, over the withdrawals and then over the payments.canBuilderCoverBidreturnsExceptand checks its addition.processExecutionPayloadBidbinds it inside itsassert.processBuilderExitRequestbinds the pending balance only after the active and address checks. The spec returns early at each check, so it computes the sum only there.Proofs/Gloas/PendingBalanceForBuilder.lean: below2^64the result is the exactNattotal. At2^64or more the function rejects with.arithmetic, at the first step that passes the bound.Proofs/Gloas/CanBuilderCoverBid.lean: the existing characterization takes the successful pending balance and the in-range addition as hypotheses. Two new theorems give the two faults.Test plan
lake build(full monorepo, on the pinned toolchain) is green.lake build LeanSha256Testslake build SizzLeanTestsjust ethcl-testjust ethcl-pyspecis green.before/after
lake exe ssz_benchTSV (or relevant rows) inthe PR description.
native_decideorproperty test that exercises them.
Risk / trust footprint
None.
LICENSE (LGPL version 3)