This file lists the changes of each release that a caller of EthLib may need to act on.
The version is the same in pyproject.toml and lakefile.lean.
Not yet released.
-
In Lean, the gossip message ID has its length in its type.
Gossip.messageIdreturnsVector UInt8 20in place of aByteArray. A caller that needs aByteArraytakesBase.packBytes (messageId fork topic data).messageId_sizeis removed, since the type states the length.messageId_of_okandmessageId_of_errorstate the ID as(Sha256.hash32 input).take 20. The newpackBytes_messageId_of_okandpackBytes_messageId_of_errorstate their former equations, throughBase.packBytes. The C exporteth_gossip_message_idand the Pythongossip.message_idare unchanged. -
Slashing-protection imports use EIP-3076's minimal strategy (#1963). Import compacts both the held record and the file: each key keeps its greatest block slot and its greatest source and target epochs, taken independently, without signing roots. So a repeat of any message held before the import is refused, and so is a block at or before the slot limit, or a vote with a source before the source limit or a target at or before the target limit. The keys of the record come out in byte order. The JSON format and the C and Python signatures are unchanged.
-
The cumulative churn bounds also hold for idle queues (#1451). In Lean,
churnQueue_foldlM_ledrops itsfirstargument, andcomputeExitEpochAndUpdateChurn_foldlM_leandcomputeConsolidationEpochAndUpdateChurn_foldlM_ledrop theiropen_argument. Callers remove that argument. The exact_spendequalities keep it. -
A req/resp payload now fails when bytes follow the chunk that completes its declared length. A reader must reject any bytes that remain after it has read the declared number of SSZ bytes. The decoder read the whole Snappy stream. So it accepted chunks after the one that completes the length, if they add no bytes: padding, reserved skippable chunks, a second stream identifier or an empty data chunk. With a declared length of 0, the reader now reads the stream identifier alone, so any chunk after it fails too.
reqresp.decode_payloadandreqresp.decode_response_chunkraiseReqRespErrorwith the message "N bytes follow the last chunk of the payload", and the C exports return the new error code 10. In Lean,decodePayloadreads the stream with the newSnappy.readFrames, which stops at the chunk that completes the declared length and returns the bytes after it.Snappy.readChunksis its chunk loop, and the new moduleNetworking.Proofs.Snappy.Readproves their properties.ReqRespErrorgains the constructortrailingBytes. The last conjunct ofdecodePayload_okanddecodePayload_eq_ok_iffis nowSnappy.readFrames … = .ok (d.data.toList, [])in place ofSnappy.decodeFrames … = .ok d.decodeFramesList_of_readFramesgives the list form of the old conjunct, and the newdecodePayload_append_ne_okproves that bytes appended to a payload that decodes make it fail. -
The leanXMSS signing lemmas over a map of monads now derive, from the monad laws, that the map keeps
map(#1385).findCodeword_map_monad,otsSign_map_monad,signLayer_map_monadandsignDerived_map_monadrequireLawfulMonadinstances for both monads instead of an explicitmap_mapargument. Drop that argument at each call.Sphincs.Unforgeability.map_monad_mapmoves toHashSig.map_monad_map, so leanXMSS and leanSPHINCS share one proof that such a map keepsmap. -
From Gloas, the discount for empty slots of the fast confirmation rule also counts the votes for the pending node of the parent (#1368, #1458). A parent has three nodes from Gloas: a pending one, and a full and an empty one for the two answers on its payload. The discount counted only the votes for the full or the empty node that the block builds on. It counts the votes for that node and for the pending node, and the votes for the other of the two stay out. A vote cast in the slot of the block it names supports the pending node of that block. A member of the committees of the empty slots can hold such a vote for the parent, and the discount missed it. Before Gloas the parent has only its pending node, and the discount keeps its value. No signature of a C export or Python function changes. From Gloas the threshold can be lower, so a
fast_confirmationstep offork_choicecan confirm a block sooner. In Lean,Store.getNodeSupportBetweenSlotstakes a list of nodes in place of a node, and counts a vote for any of them.getNodeSupportBetweenSlots_letakes that list too. -
The block supply bound and the Glamsterdam equality now follow from the exact block supply equation (#1902). No C export or Python function changes. In Lean,
supply_systemCall,supply_systemCall_join,supply_startSystemCalls,supply_blockRequestsandapplyTransactions_supplyare gone fromEthLib.Execution.Proofs.Blocks.Supply. The newSystemCallBurns.total_eq_zero_of_glamsterdam,StartSystemCallsBurns.total_eq_zero_of_glamsterdam,TransactionsBurns.total_eq_zero_of_glamsterdam,RequestsBurns.total_eq_zero_of_glamsterdam,BlockRequestsBurns.total_eq_zero_of_glamsterdamandBodyBurns.total_eq_zero_of_glamsterdaminEthLib.Execution.Proofs.Blocks.Burnprove that the certified losses are 0 from Glamsterdam.withdrawnWei,rewardWei,createdWei,burnedWeiand the supply lemmas of the DAO transfer, the withdrawals and the rewards move toEthLib.Execution.Proofs.Blocks.Burn, with the same names.EthLib.Execution.Proofs.Blocks.Burnno longer importsEthLib.Execution.Proofs.Blocks.Supply, so import the latter forheaderBurnedWei, theapplyBody_supplytheorems and thestateTransition_supplybounds. -
From Gloas, the rewards and penalties and the inactivity updates of an epoch now fail where a registry position of 2^64 or more would become a validator index (#1883). The specification builds a
ValidatorIndexfor each position when it applies the deltas, and for each eligible validator when it lists the eligible indices. EthLib took such a position modulo 2^64, so it credited the balance, or updated the inactivity score, of another validator. Before Gloas the registry stays within its limit, which is below 2^64, so nothing changes there. No C export or Python function changes. In Lean,applyDeltas_eq_ok_iffnow reads the balance at the position itself, not at the position modulo 2^64, and adds the condition that the position is below 2^64.applyAllDeltas_balances,foldlM_applyAllDeltas_balancesandprocessRewardsAndPenalties_balances_of_altairno longer take a bound on the size of the registry. -
The FFG chain theorems now derive that the block of each justified checkpoint is in the chain of the block of its recent epoch from the order of the roots at consecutive slots, instead of assuming it (#1420). No C export or Python function changes. In Lean, the field
chainofSlackStepBoundsbecomeslinks, which asks the map from roots to blocks to keep in order the roots of consecutive slots (rootLinks).SlackChainInvariantgains the fieldroots, aRootsAbovefact that the newFfgRoots.leankeeps along each chain step. The newChainRootorders the roots by the links of the states that genesis reaches, andslackJustifiedCheckpoints_chainRoot_of_chainStepsuses it, so it asks no order hypothesis. The newrecentJustifiednames the justified checkpoint of a recent epoch, andRootsAbove.le_of_getBlockRootgives the order that justification reads;RootsAbove.of_chainStep,RootsAbove.of_initializeBeaconStateFromEth1andtoChainRootare new too. New shared lemmas:getBlockRootAtSlot_ok_iff,getBlockRootAtSlot_exists,getBlockRootAtSlot_betweenandgetBlockRootAtSlot_congr(Accessors.lean),advanceSlot_previousJustified,processBlock_blockRoots,processUpgrades_slotandprocessUpgrades_blockRoots. -
From Gloas, the pending deposits of an epoch now fail at every deposit they read to a key whose first validator sits at a registry position of 2^64 or more (#1883). The specification builds a
ValidatorIndexfrom that position before it tests the validator, so it fails there. EthLib failed only when it credited such a deposit, and missed the deposit to a validator that exits and is not withdrawn, and the deposit beyond the churn. Before Gloas the registry stays within its limit, which is below 2^64, so nothing changes there. No C export or Python function changes. In Lean,depositTargetStatusnow returns anExcept AccessorError (Bool × Bool). The fieldsstops,used,appliedFilterandmovedFilterofPassPendingDepositsFacts, andprocessPendingDeposits_postponed, test that result. The new fieldstatusOk, and a new conclusion ofprocessPendingDeposits_postponed, say that the status of each deposit read succeeds. The newaddValidatorToRegistry_size_ltsays that a new validator joins a registry of fewer than 2^64 validators. -
The FFG theorems on the beacon chain now take their votes from the attestations that blocks apply, instead of from any data that some signature verifies on (#1888). Under the BLS checks a verifying signature exists for every data that a registered key can sign, so the old votes did not say who voted. No C export or Python function changes. In Lean,
SignedVote,TargetFlagsSignedandPendingSignedare gone, with their lemmas,voteFrame_processOperationsand the twoof_stateTransitionlemmas of the flags and the pending attestations. The newattestationVotesandblockVotesname the votes that an attestation and a block cast, andTargetFlagsVotedand the newPendingVotedtake a set of such votes.VoteFramedrops its configuration, its signature checks and its fieldsigned, andvoteFrame_processAttestationandvoteFrame_processBlockgive the votes of the step by name; the latter takes the preset boundapart. The slot and upgrade lemmas of the flags and the pending attestations no longer take a bound on the registry. The link and slack theorems ofFfgJustification.leanandFfgSlack.leantake the vote set and a hypothesis that the votes of the model hold it, with no slot condition.SlackChainInvariantdrops its configuration, its signature checks and its fieldknown, takes the vote set, and uses its votes in the model;SlackStepHypothesesreplacescontainsbyapplied, on the newblockStepVotes.runVotesdrops its argumentblockand now holds the beacon votes that the block steps of a run cast, so a caller wraps it inffgVotes block.ForkVersionsKnownis gone with its lemmas, andinitializeBeaconStateFromEth1_targetbecomesJustifiedEarly.of_initializeBeaconStateFromEth1, which gives only the equal justified checkpoints.TargetFlagAt.of_flagsKeptOrZeromoves toUpgrade.lean. -
The theorem that an attestation keeps the registry and the RANDAO mixes now holds at every fork (#1888). No C export or Python function changes. In Lean,
processAttestation_registrydrops its argumentbefore : fork < .altair, so a caller removes it. -
From Gloas, builder deposits, exits and onboarding, ejections, slashing penalties, attestation committee counts and active-validator reads now fail where a position of 2^64 or more would become a 64-bit index (#1883). Such a position used to wrap modulo 2^64, so the step read or wrote another validator or builder. The registry updates, the slashing penalties, the effective-balance updates and the genesis activations read and write each validator at its plain position, as the specification indexes the registry with a Python integer. No C export or Python function changes. In Lean,
addBuilderToRegistrynow returns anExcept TransitionError; bind its result, and pass a successful return tobuilderBalanceSum_addBuilderToRegistry. The newgetValidatorAt,getBalanceAtandBeaconState.setValidatorAtread and write at a plain position, andgetValidator_eq_getValidatorAt,getBalance_eq_getBalanceAtandsetValidator_eq_setValidatorAtrelate them to the index forms.EpochFrameLawsreplaces itssetValidatorfield by asetValidatorAtfield, and the theoremEpochFrameLaws.setValidatorgives the index form;EpochFrameLaws.setValidatorAt_of_sameBalance,frame_setValidatorAt_of_whole,activeStep_setValidatorAtandsameSizes_setValidatorAtare new.KeysKept,Frame.keysKeptandUpgradeFrame.keysKeptare gone, as no theorem read them (#1908);advanceSlot_keysbecomesadvanceSlot_kept, without the key conjunct. The setter laws ofEpochFrameLawsand the frame lemmas of validator writes no longer take a key equality, and the_of_wholeforms no longer take the old validator.activeKept_processEpoch,activeKept_processBlock,activeKept_advanceSlot,ChainStep.activeKept,activeKept_of_chainSteps,processBlock_attestationSplit,voteFrame_processBlock,committeesKept_processBlock,committeesKept_advanceSlot,RunKept.committeesKept,slackJustifiedCheckpoints_chainRoot_of_chainSteps,slackFinalized_chainRoot_of_chainStepsandprocessEffectiveBalanceUpdates_effectiveBalancedrop their registry-size argument.SlackStepBoundsdrops its fieldsmall, and the fieldRunKept.activeno longer takes a registry bound.getTotalActiveBalancereads the checked active indices. The newgetActiveValidatorIndicesCheckedconverts each active position withofNatChecked, as the specification builds each index, and the newgetCommitteeCountPerSlotCheckedalso converts their count.getActiveValidatorIndicesChecked_eq_ok_iffreplacesgetActiveValidatorIndices_eq_mapM_ofNatChecked, andgetTotalActiveBalance_ne_indexOutOfRangedrops its registry bound. New lemmas on the checked read:getActiveValidatorIndicesChecked_ok,_of_size_le,_of_within,_of_attesterShuffle,_errorand_eq_error,lt_of_getActiveValidatorIndicesChecked_ok,sorted_of_getActiveValidatorIndicesChecked_ok,mem_iff_of_getActiveValidatorIndicesChecked_okandActiveKept.getActiveValidatorIndicesChecked_eq. New lemmas on the checked count:getCommitteeCountPerSlotChecked_of_withinandgetCommitteeCountPerSlotChecked_ok; inBase,ofNatChecked_toNat,mapM_ofNatChecked_eq_ok_iffandmapM_ofNatChecked_error.getValidatorAt_eq_ok_iff,getBalanceAt_eq_ok_iffandcommitteePositions_ne_nilare new. The newcommitteeCountOfgives the committee count for a number of active validators, so the checked count converts the length of the checked list without a second pass over the registry.CommitteesKept.of_seedalso takes the equality of the checked active indices of the two states.proposerCandidatestakes the checked active indices instead of the epoch, andproposerCandidates_specplaces each candidate among them.getEligibleValidatorIndices_sorted,getEligibleValidatorIndices_okandprocessInactivityUpdates_scoresdrop their registry bound: the newgetEligibleValidatorIndices_fitsbounds each eligible position of a successful computation, and the newvalidatorPositions_sorted_of_fitssorts positions under such a bound. The newdepositTargetStatus_ne_indexOutOfRangestates that the status of a deposit target never fails on an index, through the newgetElem?_toNat_eq_of_ofNatChecked.exists_mem_getBeaconCommitteetakes a successful checked active-index read, andattestationCommitteesSize_of_attesterShuffletakes a successful checked committee-count read.attestationCommitteesSize_consincludes that count check on its right side. -
From Gloas, a deposit, a withdrawal or consolidation request, or a sync aggregate now fails where a registry position of 2^64 or more would become a validator index (#1883). Such a position used to wrap modulo 2^64, so a deposit at 2^64 validators overwrote validator 0. The step now fails with the accessor error
arith overflow, as the specification fails to build aValidatorIndexthere. Before Gloas the registry holds at most 2^40 validators, so nothing changes there. No C export or Python function changes. In Lean, the newBase.Uint64.ofNatCheckedconverts a natural number to aUInt64, and fails with an overflow at 2^64 or more.getIndexForNewValidatornow returns anExcept AccessorError ValidatorIndex, andqueueConsolidationtakes the index of the source in place of its position.addValidatorToRegistry_validators_eq_push,addValidatorToRegistry_push,activeStep_addValidatorToRegistryand the deposit theorems ofProofs.Transition.OperationsandProofs.Transition.EpochPendingno longer take a bound on the size of the registry. The fieldsused,appliedFilterandmovedFilterofPassPendingDepositsFactsno longer take a bound either.frame_queueConsolidation,sameSizes_queueConsolidationandpayloadInputs_queueConsolidationtake the index of the source in place of its position. -
The exact change of the supply of ether across a transaction is now proved at every fork, with the burns of SELFDESTRUCT and the deleted balances as terms fixed by the run (#1793). No C export or Python function changes. In Lean, the rules of a relation of frames split in two:
OrdinaryStepRulesholds the rules of every write but SELFDESTRUCT, andStepRulesextends it with the rule of SELFDESTRUCT. The lemmassameContext,reflandlift, and those of SSTORE, TSTORE, the calls, the creations and the instructions that send a message, move from theStepRulesnamespace toOrdinaryStepRules. So a qualified name changes, while the dot notation on aStepRulesvalue still works.OrdinaryStepRules.instructiontakes a proof that the opcode is not SELFDESTRUCT, andStepRules.instructionis gone;StepRules.stepcovers every instruction. The newOrdinaryStepRules.stepconcludes that a step either runs SELFDESTRUCT, as the newRunsSelfdestructsays, or keeps the relation.runTransaction_eq_oknow concludesTransactionRun, a definition that unfolds to the same seven equations, andTransactionRun.uniqueproves that its values are fixed by the transaction and its output. The newprocessMessage_frame_byKindruns the induction over messages for any fact about the frame of a call, andprocessMessage_rel_byKindkeeps its statement and now follows from it. -
The fork choice now rejects an attestation whose committees are not those of its slot, a step of the safety proof of the fast confirmation rule (#1458). It runs the committee check of block processing in the state of the target, with one aggregation bit for each member of the committees. Before Electra the index must be below the count of committees of the slot. From Electra each index of the committee bits must be below that count, each of those committees must have a bit set, and the index of the attestation must be 0 before Gloas. Before, a committee index past that count named a committee of a later slot of the same epoch, or none, so a validator could vote for a slot before its own. Gossip validation and block processing already rejected such an attestation. The rejection is the fork choice error
transition, which carries the error of the check, such ascommitteeIndexOutOfRange; a failed shuffle is now reported there too. No signature of a C export or Python function changes, but anattestationstep offork_choicenow rejects these attestations, and so does ablockstep that carries one. -
The safety threshold of the fast confirmation rule now fails when the discount for empty slots exceeds the weight of the committees since the parent (#1832). It fails with the new fork choice error
supportDiscountAboveMaximum, of code 53, where it used to return half of what was left, or 0. A block at or before the current slot never reaches that error, and a proof shows it. -
The theorems on the four system contracts of EIP-4788, EIP-2935, EIP-7002 and EIP-7251 now hold from Glamsterdam too, with the state gas meter of EIP-8037 (#1861). No C export or Python function changes. In Lean, each
systemCall_setandsystemCall_dequeue, with itsspec_setorspec_dequeue, no longer requires a fork before Glamsterdam. The one-counter gas premises ofspec_setandspec_dequeueare multiplied bystorageGasScale fork, which is 1 before Glamsterdam and 5 from it.RequestQueue.sstore_writesandRequestQueue.sstore_thenchange the same way, and their continuation must hold with up to 22,100 gas times that factor less. The SSTORE rulessstoreStep_eq,sstoreG,sstoreandsstore_of_accountof the EVM logic now hold from Berlin at every fork. They chargesstoreTotalCost, the price and the state gas of the write, where they chargedsstoreCost. Before Glamsterdam,sstoreTotalCost_of_ltturns that charge back into the price.SystemContract.systemCall_of_specandSystemContract.systemCall_of_writesStorageno longer require a fork before Glamsterdam, and take a proof that the code passesSupportedCodefrom Glamsterdam. -
Each fork upgrade now gives one upgrade frame, and the invariant across the upgrade follows from it (#1841 and #1851).
UpgradeFramenow also keeps the finalized checkpoint, and it carries the balance count and the exit order of the validators. So a caller that builds one supplies the three new fields, andUpgradeFrame.of_carriedtakes the finalized checkpoint and the number of balances as new premises.UpgradeFrame, its constructors,UpgradeFrame.invariantand the frame of each upgrade are inEthLib.Consensus.Proofs.Transition.Upgrade, andupgradeFrame_upgradeNextis inEthLib.Consensus.Proofs.Transition.ForkBoundary.upgradeFrame_carryFieldsno longer takes a proof that the fork is at least Altair.Invariant.of_carriedis gone;UpgradeFrame.invariantreplaces it. No statement of an invariant theorem changes, and no C export or Python function changes. -
The fast confirmation rule now weighs the committees of a range of slots exactly, in place of an average per slot (#1828). Each active member of the committees counts once, by its effective balance in the source of balances, and a range with a whole epoch still weighs the total active balance. The average did not bound a given committee, so the rule could confirm a block that an attack then reorgs. The rule can now confirm fewer blocks, or more, than before, and some pinned fast confirmation vectors expect the old answers.
estimateCommitteeWeightBetweenSlots,adjustCommitteeWeightEstimateToEnsureSafetyandCOMMITTEE_WEIGHT_ESTIMATION_ADJUSTMENT_FACTORare gone; the newStore.computeCommitteeWeightBetweenSlotsreplaces them, and takes the head and the source of balances.Store.computeCommitteeWeightAndMembersalso returns the members it reads, andStore.getEquivocationScoreOfweighs the equivocators of a given set. No C export or Python function changes. -
A contract creation now fails at an address with non-empty storage, at every fork, as EIP-7610 asks (#1823). Before, such a creation wiped the storage and ran the init code. It now fails exactly like a creation at an address with code or a nonce, as EIP-684 asks: a creation transaction ends with
addressCollision, and CREATE or CREATE2 takes the gas of the message and pushes 0. So a block with such a creation can now have another gas used, another state root, or be rejected. From Glamsterdam, CREATE or CREATE2 that collides gets back the state gas of the new account that it paid, as EIP-8037 asks of a collision. Only a target with storage but no nonce, code or balance paid any.accountDeployablealso requires empty storage, through the newaccountHasStorage. The rulescreateKind_stored,create_storedandcreate2_storedtake a new hypothesis: no fact of a slot gives the new address a word other than zero. The new theoremsaccountHasStorage_eq_true_iff,accountDeployable_eq_true_iffandaccountDeployable_congrstate the rule. -
The Engine API now models
engine_getPayloadV1toengine_getPayloadV6(#1848).EngineErrorhas a new constructor,unknownPayload, with code 38001, so an exhaustive match on it needs a new case. A store of completed builds holds the result of the payload build, its blobs bundle, the override flag and, from Glamsterdam, the block access list. The returned payload must give back the stored block hash, with the stored requests and access list. From version 3 the commitments of the bundle must hash to the blob hashes of the block, in order, and its proofs must verify. The C exporteth_engine_get_payloadtakes the configuration, the store and the request. Each entry of the store holds the payload ID, the fork and the four results ofeth_engine_build_payload. Then come the network forms of the blob transactions, the flag and the access list. In Python,engine.get_payloadtakes the configuration, the store, the method and its parameters. The payload ID has one type,PayloadId, which the forkchoice update also returns. The network check of a blob transaction now runsvalidateBlobson its lists, socountsMatchisblobCountsMatchon its fields. -
The forkchoice update now checks the timestamp of payload attributes, on an applied valid head (#1479). A known payload holds the number and the timestamp of its block, so
KnownPayloadhas two new fields,numberandtimestamp.forkchoiceUpdatedCalltakes the chain configuration first, and returns the attributes at the fork of their timestamp. Attributes of a fork that the version does not take now give code 38005,unsupportedFork. Version 1 takes Paris, version 2 Paris and Shapella, version 3 Dencun to BPO5, and version 4 Glamsterdam. Version 2 with the structure of version 1 from Shapella, or of version 2 before it, gives code 38003. So do attributes whose timestamp is not above that of the head. The C exporteth_engine_forkchoice_updatedtakes the configuration first, and each payload of the tree needsnumberandtimestamp. In Python,engine.forkchoice_updatedtakes the configuration first. -
The forkchoice update now models
engine_forkchoiceUpdatedV4, and it checks the structure of the payload attributes on an applied valid head (#1478). Attributes that fit no structure of the version now give code 38003,invalidPayloadAttributes, where any object gave code 0 before. Attributes that fit still give code 0, since no payload build is specified. A wrong number of parameters now has the reasonparams: got N, expected 2, or2 or 3for version 4, in place ofparams: not 2 values.forkchoiceUpdatedParamstakes the version first and returns the attributes as JSON, ornone, in place of a flag.EngineErrorhas a new constructor,invalidPayloadAttributes, with code 38003. -
MIN_REQUEST_LIMIT, the fewest versioned hashes thatengine_getBlobsmust take in one request, is nowMIN_BLOBS_REQUEST_LIMIT. Its value stays 128, and no C export or Python function changes. -
The optimistic store now holds its head as a fork choice node, a root and the status of its payload, in place of the root of the head block (#1475). From Gloas, the optimism of the head reads the payload that the status names, so it can fail as a payload chain does, and it returns an
Except. The C exporteth_consensus_is_optimistic_nodetakes the code of that status after the head root: 0 empty, 1 full and 2 pending. In Python,consensus.is_optimistic_nodetakes it as the keywordhead_payload_status, 2 by default, so a call before Gloas gets the same answer as before. The latest verified ancestor now takes a fork choice node; before Gloas it reads only the root. The C exporteth_consensus_latest_verified_ancestortakes the code of the status after the root, andconsensus.latest_verified_ancestortakes it as the keywordpayload_status, 2 by default. The latest verified ancestor and the optimistic node now run at Gloas. The theoremlatestVerifiedAncestor_of_glamsterdamnow states the Gloas answer, no longer a failure. The optimistic node then fails when the head is not optimistic, since its second case is not yet specified. -
compute_min_epochs_for_block_requestsnow takes the fork, and from Gloas it applies a formula derived from the weak subjectivity period of EIP-8061. Before, every fork got the Phase 0 value: 33024 epochs on mainnet, where Gloas asks for 14299.Config.computeMinEpochsForBlockRequeststakes the fork as a new argument. The C exporteth_consensus_compute_min_epochs_for_block_requestsreads the configuration and the fork as a pair, aseth_consensus_gossip_topicsdoes. In Python,consensus.compute_min_epochs_for_block_requeststakes the fork first, then the configuration,mainnetby default. -
NoiseErrornow gives its own code to each failure of the local identity secret, of signing and of the saved remote message, in the libp2p Noise handshake (#1657). Before, a failure of the secret or of signing had code 9, the code of an invalid remote identity. An identity secret that is 0, or at least the secp256k1 group order, now gives code 11,identitySecret. A failure of ECDSA signing with that secret gives code 12,signing. Completion of a state whose saved remote message is missing, or does not match the state, gives code 13,savedRemote. Before, such a state gave the error of the failed step: code 1, 3, 4, 6, 7, 8 or 9. Code 9 now means only a remote identity that fails to authenticate. -
The libp2p Noise handshake gives the identity secret, the chaining key and the handshake hash their own types, apart from the type of the X25519 keys (#1657). The secp256k1 identity secret of
writeLibp2pandmakePayloadis a scalarSecp256k1.Fn, in place of 32 bytes.Libp2p.publicKeyandLibp2p.signtake that scalar too, and the exports read it from 32 big-endian bytes whose value must be below the group order. The chaining key and the handshake hash ofSymmetricStatehave the typesChainingKeyandHandshakeHash, andhkdf2takes aChainingKey. The C exports and the Python functions keep their signatures: they take the secret and return the chaining key and the hash as 32 bytes.writeLibp2pnow rejects a zero identity secret before every other check, on every message, message 1 included. The C exporteth_noise_libp2p_write, andnoise_libp2p_writein Python, give code 11 for a secret of 0 or at least the group order. Before, a write at step 0 ignored the secret: message 1 succeeded, and a responder writing out of turn got code 1,wrongPhase, or code 10,firstMessageExtensions. -
The libp2p Noise state now stores the authenticated remote, in place of the encrypted remote message and the state before it (#1657). Completion returns that remote with the transport ciphers, and reads no message. It returns
Remote × CipherState × CipherState.Libp2pState.remoteMessageis nowLibp2pState.remote, aRemotewith the static key, the identity point, the signature and the extensions.AuthenticatedRemote,RemoteInfoandremoteInfoare removed, andauthenticatePayloadreturns aRemote.writeLibp2pno longer runs completion after message 3. The Python state ofnoise_libp2p_*holds the remote as(static_key, public_key, signature, extensions), orNone, in place of the saved message and its state. Completion checks that the stored remote has the remote static key of the handshake, and no longer verifies its signature. Code 13,savedRemote, now means that at completion the state holds no remote, or one whose static key is not the remote static key of the handshake.readLibp2p_authenticatesnow concludes that the new state stores the authenticatedRemote. The theoremscomplete_authenticatesandcomplete_peerIdare replaced bycomplete_okand theProducedtheorems, andauthenticatePayload_decodebyauthenticatePayload_ok. The C exports and Python functions that take a libp2p state, to write, read or complete, also give code 13 when the stored public key does not decode. -
ethlib.networking.noisenow exports short typed wrappers in place of the rawnoise_*names of the extension (#1657).noise_initializeis nowinitialize,noise_cipher_encryptiscipher_encrypt,noise_libp2p_completeislibp2p_complete, and so on;libp2p_writetakesextensions=Noneby default. The package also exports the type aliases of its states,CipherState,HandshakeState,Remote,Libp2pState,IdentityandCompletion, whichlake exe gen-bindingswrites from Lean, andNoiseError. The extension methods keep their names and signatures. -
A chain configuration now holds the address of its deposit contract, and the deposit requests of a block come from that address (#1486). Before, every chain read deposits from the mainnet address, so a chain with another deposit contract, such as Sepolia, got no deposit request. The configuration that the exports read as JSON, or as a Python
dict, must givedepositContractAddress:0xand forty hex digits, or 20 bytes in Python. A configuration without it is rejected withconfig: no depositContractAddress.depositRequests, the C exporteth_block_deposit_requestsandblocks.deposit_requestsin Python take the address first. -
The output of the VRF tree at index
inow hashes the index before the secret:keccak256(PQ_VRF_OUTPUT | LE32(i) | s)(#1652). Every output changes, for every root, index and seed. Roots and openings are unchanged, so an existing opening still verifies, but returns a different output.verify,verifyBytesandevaluatekeep their arguments, andoutputHashtakes the index. Before, one secret placed at every leaf gave every index the same output, which the holder could choose. A newmixOutput, the C exporteth_vrf_mixandvrf.mixin Python hash an output with randomness. A selection must compare that mixed value, with randomness revealed after the root is registered. -
engine_forkchoiceUpdatednow applies step 2 of its specification (#1018). The execution layer may know a finalized block from an earlier update. A valid head below that block is answeredVALID, and the forkchoice state is not checked. The Lean function and the C exporteth_engine_forkchoice_updatedtake that block as a new argument, between the tree and the request. The C export reads it as JSON text: a block hash, ornullfor none. In Python,engine.forkchoice_updatedtakes it as the keywordfinalized,Noneby default, so a call without it gets the same answer as before. -
engine_forkchoiceUpdatedwith payload attributes now answers a syncing head, an invalid head and a head below the known finalized block, since no payload build begins there (#1018). A request that would select a new head with payload attributes is still refused with code 0, because the build is not specified. -
The shuffle errors of
ConsensusErrornow have the codes 201 to 204, in place of 1 to 4 (#1087). The custody errors already had the codes 1 to 3 in the same class, so a code did not name one error. A caller that testscode == 1for an index at or past the count now testscode == 201. The new code 204 is a count above 2^40. -
compute_shuffled_indexandcompute_shuffled_permutationnow fail for a count above 2^40, as the consensus specification does (#1072 and #1087). Before, the index wrapped a bucket number that does not fit in 4 bytes and returned a value. -
The C export
eth_engine_forkchoice_updatednow rejects a tree of known payloads that names one block hash twice, with code 0 (#1102). Before, it answered from the first entry of that hash and ignored the second. -
The Ethash exports, the CRC-32 and CRC-32C exports and the precompile price now take and return typed values (#1516). A number crosses as a Python
int, and the proof-of-work function returns its mix digest and its result as a pair. The C exports take the tuple of their arguments as one value, aseth_consensus_fork_choicedoes. In Python, an argument that Lean cannot read raises the error class of the method with code 0, where some raisedTypeErrorbefore. Examples are astrgiven for bytes and aboolgiven for anint. A negative number raisesValueError, where it raisedOverflowError. An address of 2^64 or more has no precompile, so its price raisesPrecompileError, where it raisedOverflowError. -
The EVM word and memory exports, the CREATE address, the fee exports and the block difficulty now take and return typed values (#1524).
eth_evm_word_optakes the opcode and a list of at most three operands, each anintbelow 2^256.eth_evm_extend_memoryreplaceseth_evm_extend_memory_costandeth_evm_extend_memory_expand_by, and returns the price and the growth as a pair. Each range is a pair of two words. The base fee and the fake exponential now return a result that can fail, as every typed export does. The error codes 101 and 102 ofEvmErrorare gone, since no export reads the lengths of operands or ranges now. In Python, an argument that Lean cannot read raises the error class of the method with code 0. Examples are an operand, a range word or an opcode out of range, more than three operands, aboolgiven for anintandbytesgiven for a fork name. Before, these raisedOverflowError,ValueError,TypeErrororAttributeError. A negative number raisesValueError, where it raisedOverflowError. -
The transaction check, the check against a block, the settlement and the run now take and return typed values (#1529). The C exports
eth_tx_check,eth_tx_check_in_block,eth_tx_settleandeth_tx_runtake the tuple of their arguments as one value. They return tuples where they returned fixed-width bytes or an RLP list. In Python,Run.accountsholds each nonce, balance and storage value as anint, where they were the bytes of RLP scalars. Each account and each storage slot is a tuple, where it was a list. An argument that Lean cannot read raisesTransactionErrorwith code 0, where some raisedTypeErrororOverflowError. Examples are a chain ID of 2^64 or more, aboolgiven for anintandbytesgiven for a fork name. A negative number raisesValueError, where it raisedOverflowError. -
The header checks, the genesis block, the typed RLP decoder and the hex-prefix encoding now take typed values (#1542). The C exports
eth_block_validate_header,eth_block_check_header,eth_genesis_block,eth_rlp_decode_asandeth_trie_hex_prefixtake the tuple of their arguments as one value. The header checks take the blob schedules as pairs of four integers, and returnNone.eth_genesis_blocktakes the fields of the header as one tuple, andeth_trie_hex_prefixtakes a list of nibbles.eth_rlp_decode_asreturns the value itself, such as anint, aboolorNonefor a contract creation. A new export,eth_pow_chain_forks, writes the RLP form of the forks of a chain, whichchain_forksreturns. In Python, an argument that Lean cannot read raises the error class of the method with code 0, where some raisedTypeError. Examples arebytesgiven for a fork name or for the kind ofrlp.decode_as, and anintgiven for theis_leafflag. A nibble of 16 or more raisesTrieErrorwith code 0, where one of 256 or more raisedOverflowError. A negative number raisesValueError, where some raisedOverflowError. -
Every typed export reads a pair, such as a memory range or a blob schedule, from a Python list as from a tuple (#1542).
-
The networking exports that returned JSON text, packed records or joined bytes now return typed values (#1547). These are the discv5 key derivation, packet, message, WHOAREYOU and handshake exports, the fork identifier, the consensus entries and
ethentry of a record, the RLPx answer and the req/resp response chunk. Their C exports take the tuple of their arguments as one value, and return a typed value where they returned bytes. Two new exports,eth_fork_id_scheduleandeth_fork_id_encode, write the RLP schedule and fork identifier thatforkid.scheduleandforkid.encodereturn.forkid.encodenow requires a 4-byte hash and a next fork below 2^64, as the fork identifier types them. The discv5dictresults keep their keys and values, in the order of the packet rather than sorted. In Python, an argument of the right Python type that Lean rejects raises the error class of the method with code 0, where some raisedTypeError,OverflowErrororAttributeError. Examples are a block number of 2^64,bytesgiven for a fork name, andstrgiven for bytes. A negative number raisesValueError, where it raisedOverflowError, and a value that cannot cross, such as abytearray, still raisesTypeError.rlpx.SECRETS_SIZEis now read from Lean. -
The consensus presets, configurations and parameters, and the active fork of a configured chain, now take and return typed values (#1548). The C exports
eth_consensus_preset,eth_consensus_config,eth_consensus_parametersandeth_active_forktake the tuple of their arguments as one value. The first three return adict, where they returned JSON text. An integer in thatdictis anint, where it was a string of decimal digits.eth_active_forktakes the chain configuration as adictwith the keys of its JSON form, and returns the name of the fork orNone. In Python, an argument that crosses to Lean but that Lean cannot read raises the error class of the method with code 0, where some raisedTypeError. An example isbytesgiven for a name. A timestamp or a block number of 2^64 or more given tochain.active_forkraisesChainErrorwith code 0, where it raisedOverflowError. Aboolgiven there raisesChainErrorwith code 0, where it read as 0 or 1. A negative number raisesValueError, where it raisedOverflowError. -
A replacement of a 64-bit value of a consensus configuration may now be an
int, where it had to be a string (#1548). -
The Engine API exports, the block state transition and the check of an
eth_getProofanswer now take typed values in place of JSON text (#1549). The C exportseth_engine_new_payload,eth_engine_forkchoice_updated,eth_engine_prepare_execution_payload,eth_engine_new_payload_on_chain,eth_state_transitionandeth_trie_verify_account_prooftake the tuple of their arguments as one value. A configuration, a request or an answer crosses as the Python value of its JSON, and the first three return the value of the JSON of their answer.eth_engine_new_payload_on_chainreturns the status with the header and the accounts in RLP, orNonetwice, where it returned an RLP list.eth_trie_verify_account_proofreturnsNonefor an absent account, or one bool for each slot, and Lean reads the patterns of the fields of the answer, where Python read them. In Python,bytesinside one of these values now crosses as0xhex text, wherejson.dumpsrefused it. Afloat, a negativeintor adictkey that is not astrraisesTypeErrororValueError, wherejson.dumpswrote it. An argument of the right Python type that Lean rejects raises the error class of the method with code 0, where some raisedTypeError. Examples arestrgiven for the state, and1given forcheck_seal. A field of aneth_getProofanswer that is missing or out of its pattern raisesTrieErrorwith code 0, where it raisedKeyErrororValueError. -
On a free-threaded build of CPython, such as 3.14t, importing the extension now leaves the GIL disabled (#1372). Threads may call the exports at the same time, and a list that another thread changes during a call is read as a snapshot.
-
The consensus gossip and req/resp lists, the subscribed subnets and the SSZ root exports now take and return typed values (#1551). The C exports
eth_consensus_gossip_topics,eth_consensus_reqresp_protocol_ids,eth_consensus_reqresp_parse_protocol_id,eth_consensus_reqresp_request_bounds,eth_consensus_reqresp_response_boundsandeth_consensus_compute_subscribed_subnetstake the tuple of their arguments as one value. So doeth_consensus_ssz_static,eth_consensus_reqresp_message,eth_consensus_merkle_proofandeth_pq_keys_ssz. A list comes back as a list, the subscribed subnets as a list ofint, and a pair as a tuple, where each came back as JSON text. The three SSZ exports return the root and the bytes as a pair, where they returned the two joined.eth_consensus_merkle_proofreturns the node and the list of its siblings, andeth_consensus_compute_subscribed_subnetstakes the node ID as anint. In Python, a node ID of 2^256 or more, or an epoch or a generalized index of 2^64 or more, raises the error class of the method with code 0, where it raisedOverflowError. Aboolgiven for one of them raises the same error, where it read as 0 or 1. A negative number raisesValueError, where it raisedOverflowError. An argument that crosses to Lean but that Lean cannot read raises the error class of the method with code 0, where some raisedTypeError. -
The custody exports, the shuffle, the matrix, the shape check of a data column sidecar and the sidecars of a block now take and return typed values (#1552). The C exports
eth_consensus_get_custody_groups,eth_consensus_compute_columns_for_custody_group,eth_consensus_compute_shuffled_permutation,eth_consensus_compute_shuffled_indexandeth_consensus_get_validators_custody_requirementtake the tuple of their arguments as one value. So doeth_consensus_verify_data_column_sidecar,eth_consensus_compute_matrix,eth_consensus_recover_matrixand the two exports of the sidecars of a block. A list of groups, columns or positions comes back as a list ofint, where it came back as JSON text. A node ID crosses as anint, a validator index as anint, and a configuration replacement as adict. The blobs and the matrix entries cross as a list of bytes, where they crossed joined in one byte string. The sidecars come back as a list of bytes, where they came back as the SSZ encoding of a list. A row of cells crosses as a pair of lists, and a row with another count than 128 cells and 128 proofs raisesSszErrorwith code 0. In Python, a node ID of 2^256 or more, or a count, group or index of 2^64 or more, raises the error class of the method with code 0. Aboolor astrgiven for one of these numbers raises the same error. Before, these cases raisedOverflowErrororTypeError, or read aboolas 0 or 1, and for a validator index they raisedstruct.error. A negative number raisesValueError. A seed, a blob, a matrix entry, or a cell or proof of a row, of the wrong length, raises the error class of the method with code 0 and the messageexpected N bytes, got M. Abytearrayor amemoryviewgiven for bytes raisesTypeError, where some were read as bytes. -
The consensus transition exports now take typed values (#1556). These are the block operations, the epoch steps, the slots and the state transitions of one block or of several blocks. They are also the upgrades, the rewards and penalties, the genesis exports and the weak subjectivity exports. Their C exports take the tuple of their arguments as one value, in the order they had. A configuration replacement crosses as a
dict, where it crossed as JSON text, and any other value raises the error class of the method with code 0. In a replacement, a negativeintor afloatraisesValueErrororTypeErrorfrom the converter, andbytescrosses as0xhex. The names of the kinds of deltas and of the forks of the blocks cross asstr. The deposits of the genesis cross as a list of bytes, one deposit each, where they crossed joined in one byte string. A hash of the Eth1 block of another length than 32 bytes raisesTransitionErrorwith code 0 and the messageexpected 32 bytes, got N, where the message began withinput rejected. Every argument is read before the names, so an argument that Lean cannot read is reported before an unknown preset. In Python, a slot count or an Eth1 timestamp of 2^64 or more, or a negative one, raises an error, where it was read modulo 2^64 without one. The times of weak subjectivity of 2^64 or more raise the error class of the method with code 0, where they raisedOverflowError. A negative number raisesValueError. An argument that crosses to Lean but that Lean cannot read raises the error class of the method with code 0, where it raisedTypeError. Examples arebytesgiven for a name andstrgiven for a state. Aboolgiven for a slot count, and1orNonegiven forverify, now raise the same error, where they were read as 0 or 1 or by truthiness. The limits of the converter, 2^29 bytes and 2^22 values in one call, now apply to the states and the blocks. -
The honest validator exports that take a state, and the optimistic sync exports of the ancestor and the payload verdicts, now take and return typed values (#1558). These are the committee, proposer, sync committee and PTC assignments, the sync committee subnets and the upcoming proposal slots. They are also the signature of a duty, the construction of an attestation and of a single attestation, the Eth1 vote, the pending deposit count and the new state root. The others are the latest verified ancestor and the two payload verdicts. Their C exports take the tuple of their arguments as one value, in the order they had, and a configuration replacement as a
dict, as the transition exports do. The committee assignment comes back as a tuple of the committee, its index and its slot, orNone, where it came back as JSON text. The PTC assignment comes back as anintorNone, and the sync committee subnets and the upcoming proposal slots as a list ofint, where they came back as JSON text. The Eth1 chain crosses as a list of pairs of a timestamp and the SSZ bytes of the Eth1 data, where each block crossed as 80 packed bytes. Eth1 data of another length than 72 bytes raisesProposerErrorwith code 0, after the fork and the state are read, where it raisedValueError. The optimistic roots cross and come back as a list of 32-byte roots, where they crossed joined in one byte string. A root of another length than 32 bytes raises the error class of the method with code 0 and the messageexpected 32 bytes, got N. Before, the message wasa root is 32 bytes, not Nora list of roots is 32 bytes each, not N, and it came after the checks of the name and the fork. In Python, an epoch, an index or a timestamp of 2^64 or more raises the error class of the method with code 0, where it raisedOverflowError, orstruct.errorfor an Eth1 timestamp. A negative number raisesValueError, where it raisedOverflowErrororstruct.error. An argument that crosses to Lean but that Lean cannot read raises the error class of the method with code 0, where some raisedTypeError. An example isbytesgiven for a name or a duty. Aboolgiven for an index, and1orNonegiven forverify, now raise the same error, where they were read as 0 or 1 or by truthiness. Abytearrayor amemoryviewgiven for an optimistic root or for the Eth1 data of a block raisesTypeError, where it was read as bytes. -
The light client exports that take a configuration now take and return typed values (#1559). These are the sync, the light client header of a block, the checks of the proofs of an update, the ranking of two updates, the bootstrap, the update and the fork digest. Their C exports take the tuple of their arguments as one value, in the order they had, and a configuration replacement as a
dict, as the transition exports do. The steps of a sync cross as tuples,("update", fork, slot, data),("force", slot)and("upgrade", fork), where they crossed packed in one byte string. The sync returns, for each step, the pair of the finalized and the optimistic header, each a tuple of a slot and two roots, where it returned 144 bytes for each step. The light client header of a block comes back as the pair of the root and the bytes, where the two came back joined. An unknown finalized block of an update isNone, where it was empty bytes; in Python, empty bytes still stand for it. A root of another length than 32 bytes raises the error class of the method with code 0 and the messageexpected 32 bytes, got N, where it saida root has 32 bytes. In Python, a step of an unknown kind raisesLightClientErrorwith code 0, where it raisedValueError. A slot of a step of 2^64 or more raisesLightClientErrorwith code 0, and a negative oneValueError, where it raisedOverflowError. An epoch of the fork digest of 2^64 or more raisesSszErrorwith code 0, and a negative oneValueError, where both were read modulo 2^64. Aboolgiven for a slot or an epoch raises the error class of the method with code 0, where it was read as 0 or 1. Abytearrayor amemoryviewgiven for the data of an update raisesTypeError, where it was read as bytes. Every argument is read before the names, so a root of the wrong length is reported before an unknown preset or a fork before Altair. The limits of the converter, 2^29 bytes and 2^22 values in one call, now apply to the states, the blocks and the steps. An argument that crosses to Lean but that Lean cannot read raises the error class of the method with code 0, where some raisedTypeError. -
The gossip validation export now takes and returns typed values (#1561). Its C export takes the tuple of its arguments as one value, in the order it had, and a configuration replacement as a
dict, as the transition exports do. The blocks after the anchor cross as tuples of a kind, a payload status orNone, the SSZ bytes and an optional envelope, where they crossed packed in one byte string. An envelope ofNonemeans no envelope, as empty bytes still do. A payload status of 255 is now a status, where it meant none; onlyNonemeans none. The messages cross as tuples of a time, a subnet, the SSZ bytes and an optional topic, where they crossed packed in one byte string. A topic of a message may now be longer than 255 bytes in UTF-8, where it raisedValueError. The finalized checkpoint crosses as a pair of an epoch and a root, orNone, where it crossed as 40 bytes, and the topic as astr. Each outcome comes back as a pair ofvalid,ignoreorrejectand its reason orNone, where it came back packed in one byte string. In Python, a block or a message of another length than three or four items raisesForkChoiceErrorwith code 0. Before, a shorter one raisedValueError, and a longer one was read without its extra items. A time, a subnet or an epoch of 2^64 or more raisesForkChoiceErrorwith code 0, and a negative oneValueError, where it raisedOverflowError. A kind or a payload status of 256 or more raisesForkChoiceErrorwith code 0, where it raisedValueError. Aboolgiven for one of these numbers, and1orNonegiven forverify, raise the same error, where they were read as 0 or 1 or by truthiness. Abytearrayor amemoryviewgiven for the bytes of a block, an envelope or a message raisesTypeError, where it was read as bytes. An argument that crosses to Lean but that Lean cannot read raises the error class of the method with code 0, where some raisedTypeErrororAttributeError. A root of the finalized checkpoint of another length than 32 bytes raisesForkChoiceErrorwith code 0 and the messageexpected 32 bytes, got N, where the message wasthe finalized checkpoint is not 40 bytes. Every argument is read before the names, and the limits of the converter, 2^29 bytes and 2^22 values in one call, now apply. -
The generic SSZ exports now take and return typed values (#1563). The C exports
eth_ssz_serialize,eth_ssz_deserializeandeth_ssz_hash_tree_roottake the tuple of their arguments as one value. A type and a value cross as the Python values of their tagged form, such as{"uint": 2}and{"uint": 258}, where they crossed as JSON text.eth_ssz_deserializereturns the value as adict, where it returned JSON text. In Python,bytesinside a type or a value now crosses as0xhex, wherejson.dumpsrefused it. Afloator adictkey that is not astrraisesTypeError, and a negativeintraisesValueError, where each raisedSszErrorwith code 0. Data that is notbytesraisesSszErrorwith code 0, where it raisedTypeError. The converter reads an argument nested at most 64 levels below it, where 256 SSZ levels were read. So a value of more than 31seqorunionlevels raisesValueError, and so does a type of more than 32vectororlistlevels or more than 21containerlevels. A value thatdeserializereturns past these bounds, or past the converter budget, cannot be given back toserialize. -
The active fork of mainnet and of Hoodi, the seal hash, the proof-of-work check, the gossip message ID and the recent blocks of a chain now cross as typed values (#1571). The C exports
eth_mainnet_active_fork,eth_hoodi_active_fork,eth_pow_seal_hash,eth_pow_checkandeth_gossip_message_idtake the tuple of their arguments as one value. A fork crosses as its name, astr, where it crossed as UTF-8 bytes, and the active fork comes back as astrorNone, where it came back as bytes.eth_state_transitionandeth_engine_new_payload_on_chaintake the recent blocks as a list of tuples, where they took one RLP list. Each tuple is the fork name, the header in RLP form and the list of the RLP forms of its ommers. In Python,mainnet_active_forkandhoodi_active_forkraiseChainErrorwith code 0 for a block number or a timestamp of 2^64 or more. They raiseValueErrorfor a negative one, where both raisedOverflowError. Aboolgiven there raisesChainErrorwith code 0, where it was read as 0 or 1. A recent block whose header or ommer does not decode raisesBlockErrorfromstate_transitionandEngineErrorfromnew_payload_on_chain, with code 0, where it raisedRlpError. A fork name given asbytestoseal_hash,check_proof_of_workormessage_idraises the error class of the method with code 0. -
A Python value of a list or a
dictwith many items no longer overflows the stack when an export reads it as JSON or writes JSON as a Python value (#1563). Every export that reads a typed value as JSON, or returns JSON as a typed value, reads and writes the items in a loop. -
The converter of typed values now passes up to 2^22 values in one call, where it passed 1,000,000, so that the longest
ssz_genericvectors of consensus-spec-tests cross (#1563). -
A chain configuration that the exports read as JSON is now rejected, with code 0, when a fork by block number comes after a fork by timestamp (#1110). EIP-6122 requires the forks by timestamp to be scheduled at or after the forks by block.
-
leanSPHINCS now hashes with the layout of FIPS 205 (#1555). For the same seed and message,
key_genandsignnow return a different key and signature.verifychecks the new layout, so keys and signatures made with 0.3.0 must be made again. The sizes are unchanged: a 32-byte seed, a 32-byte public key and a 7740-byte signature. The public key is nowPK.seedthen the root, 16 bytes each, in place of the root then the public parameter. The Python constantsphincs.PUBLIC_PARAM_LENand the C exporteth_sphincs_const_public_param_lenare removed. -
The gossip topics of Heze are now those of Gloas followed by
inclusion_list(#1469).consensus.gossip_topicsandconsensus.gossip_topic_boundnow answer athegota, where they raisedConsensusError. The error of code 304 is gone, since every fork now has a list of topics, and no other error takes that code. In Lean,Config.gossipTopicsreturns aList GossipTopic, where it returned anOption. -
The gossip bounds of four topics are now held to the size limits that the networking specification sets on their messages (#1610).
consensus.gossip_topic_boundanswers the limit forbeacon_aggregate_and_proof,attester_slashingandexecution_payload_bidfromglamsterdam, and forinclusion_listathegota, where it answered the payload cap of 10485760 bytes. On mainnet the limits are 16829, 2097616, 196932 and 41112 bytes, and that of a bid is 196934 bytes athegota. In Lean,topicBound_eqnow takes a topic without a size limit, anddecodePayload_messagea message within the size limit of its topic. -
Data column sidecars on gossip and in responses, and inclusion lists in responses, are now held to the size limits of the networking specification (#1618). From
glamsterdam,consensus.gossip_topic_boundanswers 44072 bytes on mainnet and 18920 on minimal fordata_column_sidecar_{subnet_id}, where it answered the payload cap of 10485760 bytes.consensus.reqresp_response_boundsanswers (56, 44072) on mainnet and (56, 18920) on minimal fordata_column_sidecars_by_rangeanddata_column_sidecars_by_root, and (152, 41112) forinclusion_lists_by_indicesathegota. Their largest length was the payload cap of 10485760 bytes. The limit of a sidecar is its size with a cell and a proof for each blob of the largest blob limit. In Lean,GossipTopic.sizeLimitnow takes the configuration, and the gossipsizeLimit_ne_none_iffnames the data column sidecar topics. Fromglamsterdam,decodePayload_messageat a sidecar topic now needs a message within the size limit of the topic.responseBounds_eqnow takes a protocol without a size limit, anddecodeResponseChunk_responsea value within the size limit of its protocol. -
The rules that a transaction must pass alone now reject a transaction whose type the fork does not have, with
unsupportedTypeand the type (#1779). Before, only decoding rejected it, so a block built in Lean could run a type-4 transaction before Pectra, or a type-3 transaction before Dencun.validateTransactionchecks the type first, and the inclusion check andcheckTransactioncall it, so they reject such a transaction too. The exports decode each transaction at its fork first, so their answers do not change. In Lean,validateTransaction_eq_ok_iffends with the new conjuncttx.fork ≤ fork, andcheckInclusion_fork_lederives it from a passing inclusion check.processTransaction_nonce_ltno longer takes the hypothesistx.fork ≤ fork.
Released on 2026-11-06.
0.2.0 had Python bindings for BLS and KZG only.
In 0.3.0, the package ethlib has a subpackage for each layer of EthLib:
ethlib.cryptography:aes,bls,crc32,crc32c,ethash,hmac,kdf,keccak,kzg,secp256k1,secp256r1,sha256,sphincs,vrfandxmssethlib.serialization:rlpandsszethlib.networking:devp2p,discv4,discv5,enr,forkid,gossip,reqresp,rlpx,snappyandvarintethlib.execution:blocks,evm,fees,network,pow,transactionsandtrie, withethlib.precompiles,ethlib.stateandethlib.chainethlib.consensusandethlib.engine, for the consensus layer and the Engine API
The sections below list the changes that a caller of 0.2.0, or of master before this release, may need to act on.
A failed call into the Python bindings now raises an exception that carries the code and the message of the Lean error (#310).
Before, most failures raised a bare RuntimeError or ValueError with the name of the operation, and the Lean message went to standard error.
The new module ethlib.errors defines one exception class for each primitive, such as KzgError or BlsError.
Each class derives from EthLibError, which has two attributes:
code, an integer that names the kind of failure;message, the text of the Lean error.
Each class also derives from the class that the same failure raised before: RuntimeError, ValueError or both.
So a caller that catches RuntimeError or ValueError still catches it.
A caller that parsed the text of an old message must now read message.
A message no longer starts with the name of the operation.
The Lean type of each error defines its codes, one for each constructor, from 1. When one Python class carries several Lean error types, the second type takes its codes from 101, the third from 201, and so on. A theorem for each error type shows that two errors with one code come from one constructor.
Code 0 means a failure that has no Lean error code.
Examples are an unknown fork name and an input that the export reads before the specification runs.
No Lean error type uses code 0.
Some checks on the type or the length of an argument run in C first, and raise TypeError or ValueError with no code.
The C signatures of the fallible exports change too.
Each one returns the code and the message of its error, in place of a Lean IO error.
The module ethlib.precompiles reaches every precompile by its address, at a fork named by the caller.
run(fork, address, data, gas) returns the output, and price(fork, address, data) returns the gas that the call charges (#459).
A failed call raises PrecompileError, whose code names the precompile.
Before the release, master also had the modules ethlib.precompiles.ecrecover, modexp, sha256 and ripemd160, with the classes EcrecoverError, ModexpError and Sha256PrecompileError.
They are removed, and 0.3.0 does not have them.
A caller of modexp.modexp(data, gas) now calls run(fork, 0x05, data, gas), and a caller of modexp.gas_cost(data) calls price(fork, 0x05, data).
- The KZG operations take the trusted setup as an argument and no longer run in
IO(#235), and their byte inputs are typed (#346). - leanXMSS replaced XMSS, with two layers of height 16 (#134), and hashes with Keccak-256 in place of BLAKE2s (#138).
- The C exports moved into a Lean library of their own, so Lean code that imported them changes its imports (#119).
- An integer argument out of its range raises
OverflowError, as Python's own conversions to a C integer do (#718). Before, an integer outside [0, 2^64), an EVM opcode above 255 and the range checks of the Python wrappers raisedValueError. A caller that caughtValueErrorfor such an argument now catchesOverflowError. consensus.verify_data_column_sidecartakes the signed block before the configuration, in the order of its native export (#729).