Skip to content

refactor(vara.eth/malachite-core): concretize BlockPayload, drop <P> generic#5506

Draft
grishasobol wants to merge 4 commits into
masterfrom
gsobol/ethexe/malachite-core-concretize-payload
Draft

refactor(vara.eth/malachite-core): concretize BlockPayload, drop <P> generic#5506
grishasobol wants to merge 4 commits into
masterfrom
gsobol/ethexe/malachite-core-concretize-payload

Conversation

@grishasobol
Copy link
Copy Markdown
Member

Summary

  • Replace marker BlockPayload trait + blanket impl with concrete BlockPayload { version: u16, bytes: LimitedVec<u8, 1_024_000> } and drop <P> from Block, Externalities, MalachiteService, State, Store, BlockEntry.
  • All encode/decode of ethexe_common::malachite::Transactions moves to ethexe-malachite (service); core stays application-agnostic and ships an opaque versioned byte string.
  • 1000 KiB LimitedVec cap turns oversize payloads into decode-time errors before the 1 MiB engine ceiling can be hit silently.
  • No DB migration — wire format is incompatible with previous chains on this branch (per task spec).

Fixes #5505.

Test plan

  • cargo nextest run -p ethexe-malachite-core — 57/57 pass (includes new block_payload_* regressions for size cap + decode rejection).
  • cargo nextest run -p ethexe-malachite — 56/56 pass.
  • cargo fmt, cargo clippy --tests -p ethexe-malachite-core -p ethexe-malachite — clean.
  • CI green.

🤖 Generated with Claude Code

@grishasobol grishasobol added type: refactor Internal improvements without changing behavior scope: vara.eth Vara Ethereum application layer (L2) ai-friendly Suitable for AI-assisted implementation or review labels May 22, 2026
@grishasobol grishasobol self-assigned this May 22, 2026
@grishasobol grishasobol force-pushed the gsobol/ethexe/malachite-core-concretize-payload branch from 733e281 to eca538f Compare May 25, 2026 10:54
Base automatically changed from gsobol/ethexe/malachite-new to master May 25, 2026 16:59
…generic

Replace the marker `BlockPayload` trait + blanket impl with a concrete
versioned struct `BlockPayload { version: u16, bytes: LimitedVec<u8, 1_024_000> }`,
and drop the `<P>` type parameter from `Block`, `Externalities`,
`MalachiteService`, `State`, `Store`, `BlockEntry`. The new
`BlockPayload` type and its constants (`BLOCK_PAYLOAD_VERSION`,
`MAX_BLOCK_PAYLOAD_BYTES`) live in `ethexe-common` so the executor
side can consume them without a back-dep on the consensus layer;
`ethexe-malachite-core` picks them up from there.

Application-level encoding/decoding of `ethexe_common::malachite::Transactions`
moves entirely to ethexe-malachite (the service crate) where it's
wrapped into `BlockPayload` before crossing the core boundary. The
1000 KiB byte cap keeps the encoded block under the 1 MiB engine
ceiling and turns oversize payloads into decode-time errors at the
wire.

Fixes #5505
@grishasobol grishasobol force-pushed the gsobol/ethexe/malachite-core-concretize-payload branch from fbd5c67 to d3341a6 Compare May 25, 2026 17:15
@grishasobol grishasobol added ai-generated Created entirely by an AI agent without direct human authorship and removed ai-friendly Suitable for AI-assisted implementation or review labels Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Created entirely by an AI agent without direct human authorship scope: vara.eth Vara Ethereum application layer (L2) type: refactor Internal improvements without changing behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ethexe-malachite-core: replace generic BlockPayload with concrete versioned struct

1 participant