informalsystems / informalsystems/emerald

decouple malachite consensus from engine API

Open
#218 0 comments 0 reactions 1 assignee Claimed by @rnbguy View on GitHub
Dominant language
Rust
Stars
25
Forks
9
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.