You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(vara.eth): introduce typed MB/EB hashes, move MB/BlockPayload to ethexe-common
Move the consensus block envelope `MB` (formerly `ethexe_malachite_core::Block`),
the versioned `BlockPayload`, and the on-disk `CompactMb` shape into
`ethexe_common::malachite` so the executor (`ethexe-compute`, etc.)
can reason about them without depending on the consensus layer.
Type-safe MB / EB hashes:
- `CompactMb { parent: HashOf<MB>, height, payload_hash, reserved }` —
same shape as `MB` with the opaque payload bytes replaced by the
payload digest. Renames the legacy `transactions_hash` field.
- `MbMeta::last_advanced_eb: HashOf<EB>`.
- `BlockMeta::{last_committed_mb, last_committed_eb}` typed.
- `DBGlobals::{start_block_hash, latest_prepared_eb_hash,
latest_finalized_mb_hash, latest_computed_mb_hash}` typed.
- `DBConfig::genesis_block_hash: HashOf<EB>`.
- New `pub type EB = SimpleBlockData` alias + `SimpleBlockData::typed_hash()`
/ `eb_hash_of(H256)` for lifting raw Ethereum block hashes into the typed
envelope.
`HashOf<T>` SCALE-encodes as a bare 32-byte hash (phantom is `#[codec(skip)]`),
so the on-wire/on-disk byte layout is identical to the previous bare
`H256` columns where these fields used to be plain hashes.
Trait sigs in `MbStorageRO/RW` keep `mb_hash: H256` for now — the gain
from threading `HashOf<MB>` through every storage call site (compute,
cli, consensus, processor, etc.) doesn't justify the cascade right now;
typed wrappers at boundary structs already catch the EB-vs-MB confusion
the refactor was about. Call sites pass `field.inner()` where needed.
Fixes#5507
0 commit comments