Skip to content

decouple malachite consensus from engine API #218

Description

@rnbguy

ref: ADR-0001 (#226)

emerald currently has malachite consensus directly calling Engine API methods (generate_block, notify_new_block, set_latest_forkchoice_state, etc.) throughout app/src/. this couples consensus logic to EVM execution details like retry config, fee recipient, fork detection, payload caching, and validator contract reads.

introduce a consensus-agnostic ExecutionLayer trait in a new crates/core crate as the single integration boundary. restructure the codebase so malachite consensus is generic over this trait and the EVM Engine API is one concrete implementation behind it.

crate layout after

crates/
  core/                    # ExecutionLayer trait (no malachite, no alloy deps)
  consensus/malachite/     # malachite consensus, generic over ExecutionLayer
  execution/evm/           # Engine API impl of ExecutionLayer
  cli/                     # single binary wiring everything together

existing emerald start behavior is preserved throughout. each PR compiles and passes tests independently.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions