The allocations an initcode Code is built in: its bytecode buffer and its
jump-destination bitmap. A finished initcode hands them back through
Code::into_initcode_buffer, so the VM can keep them for the next CREATE instead of
allocating new ones each time, which a zkVM guest’s bump allocator never reclaims.
Trailing STOP bytes appended to every bytecode so the dispatch loop can read
the next opcode without a bounds check. 33 is the widest single-opcode advance
(PUSH32: 1 opcode byte + 32 immediate bytes), so pc can never step past the
padding regardless of which opcode sits at the last real byte.
Maximum RLP-encoded core size for an EIP-4844 blob transaction (1 MiB),
excluding the blob sidecar. Sidecar size is bounded separately by the
per-blob byte count and the fork’s max blob count.
The maximum number of bytes that can be “safely” stored in a blob. This is, prepend
a zero byte for every 32 bytes of data to ensure they not exceed the field modulus.
Computes the receipts root and the aggregate header logs_bloom in a single pass,
hashing each receipt’s bloom only once (it feeds both the receipts trie and the
OR-ed header bloom). Validation paths need both, so this avoids the duplicate
bloom_from_logs keccak work — relevant in the zkVM guest where it is cycle-counted.
Approximates factor * e ** (numerator / denominator) using Taylor expansion
https://eips.ethereum.org/EIPS/eip-4844#helpers
400_000_000 numerator is the limit for this operation to work with U256,
it will overflow with a larger numerator
Normalizes a legacy post-Shanghai body shape produced by older ethrex versions,
which omitted the withdrawals field while the header committed to the
empty-withdrawals root. validate_block_body rejects that shape (reference
clients treat it as malformed on the wire), but blocks already sitting in a
node’s store or in batch blobs published to L1 are immutable history. When the
header’s withdrawals_root is exactly the empty-list root, Some(vec![]) is the
provably-equivalent canonical body; any other root leaves the body untouched, and
validation rejects it exactly as before.