StableContainer
Spec: EIP-7495: SSZ StableContainer
Tests: ethereum/EIPs
For EL, StableContainer
is required but can skip Variant
and OneOf
initially.
StableContainer[N]
merkleizes same as regular Container
, but the Merkle tree is padded up to nextpow2(N)
members.
When serializing StableContainer[N]
, a Bitvector[N]
is prefixed with 1/0 denoting presence/absence of fields, in the order that they are specified. Absent fields are subsequently skipped when encoding the container.
When parsing, first read the Bitvector[N]
and then use it to read the present fields in order. Ensure that extra bits referring to unknown fields are set to 0, and that no data is left after reading the buffer.
Implementation notes: https://hackmd.io/Swl71tWeS7WP_f4D8abKHA
Goals:
StableContainer
Reference implementations:
TransactionSignature
Spec: EIP-6493: SSZ Transaction Signature Scheme
Transaction
into two pieces, TransactionPayload
(unsigned transaction) and TransactionSignature
(v/r/s). This split is core to the SSZ representation. Reconstruct the RLP representation during serialization.gasPrice
and post-EIP-1559 max_fee_per_gas
fields, get rid of the gasPrice
one and store it in max_fee_per_gas
instead. Pass the effective_gas_price
out-of-bands or compute it on demand (needs base fee from the corresponding block).v/r/s
to y_parity/r/s
. Reconstruct v
from chain_id
+ y_parity
on demand.ecdsa_pack_signature
and ecdsa_unpack_signature
functions from EIP-6493, and store the packed version instead of y_parity/r/s
. Reconstruct y_parity/r/s
on demand.TransactionSignature
with from_address
. Fill it in lazily when the sender is computed using ecrecover
. Read from that from_address
field instead of computing ecrecover
in multiple locations.Goals:
Reference implementation:
TransactionPayload
Spec: EIP-6493: SSZ Transaction Signature Scheme
Tests: ethereum/EIPs
compute_sig_hash
and compute_tx_hash
functions (Reference implementation)compute_sig_hash
(unsigned TransactionPayload
) and through compute_tx_hash
(signed Transaction
)Goals:
Spec: EIP-6404: SSZ Transactions Root
transactions_root
computation with one based on SSZ.Goals:
Spec: EIP-6493: SSZ Transaction Signature Scheme
Spec: EIP-6466: SSZ SSZ Receipts Root
The overall process is similar to transactions, the following notable changes exist:
gas_used
instead of cumulative_gas_used
. The SSZ <-> RLP converters have to be on lists of receipts instead of individual receipts.contract_address
, so the transactions list must be available before receipts can be converted.Spec: EIP-6465: SSZ SSZ Withdrawals Root
Similar to transactions / receipts, except no changes to data structures should be needed.
root
field that contains the hash_tree_root(transaction)
next to the existing hash
field.eth_getTransactionByRoot
endpoint that allows lookup by root instead of hash. Also allow lookup of receipt by tx root.root
is included in transactions_root
.Transaction
as JSON using its canonical encoding.BasicTransaction
/ BlobTransaction
from_address
matches the ecrecover
value. The from_address
is exchanged on the network.hash
and root
value.