Skip to content

Conversation

@almk-dev
Copy link
Member

@almk-dev almk-dev commented Sep 12, 2025

Description

This adds d2 diagramming to this repo. This allows us to define diagrams declaratively in the repo and require that they be maintained, whenever there are substantial changes made, as a part of the PR process.

This PR adds make targets d2check, d2watch, d2gen, d2gen-all, which should be self explanatory. The standard styling to be used for all diagrams in this repo is defined by environment variables used by the make command, so manual styling need not (and should not) be used. The generated SVG should automatically support light/dark modes.

We are opting to use the licensed tala (instead of the free elk or dagre) layout engine as it uses a more sophisticated graph traversing algorithm that results in more cleaner, more compact diagrams. People making new contributions or edits can still generate and test using tala, it will just have an "unlicensed" watermark.

The plan is to get as singe license (relatively cheap) and integrate it into the CI. Before merging, the final CI step should update the SVGs with the watermark removed.

Mempool diagram

To start, I converted our mempool_architecture.png to an equivalent d2 file. Please verify equivalency. This is the image used for reference:

mempool_architecture

And this is the svg rendered by the d2 file (watermark to be removed):

mempool_architecture

@almk-dev almk-dev marked this pull request as ready for review September 12, 2025 14:50
@almk-dev almk-dev requested review from a team as code owners September 12, 2025 14:50
@almk-dev almk-dev requested review from aljo242 and vladjdk September 12, 2025 14:53
@almk-dev almk-dev changed the title docs: add d2 tool to repo and mempool diagram docs: add d2 tool to repo and mempool arch diagram Sep 12, 2025
Copy link
Member

@vladjdk vladjdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice! Could we add diagram updates to the contribution guidelines?

@aljo242 aljo242 added this pull request to the merge queue Sep 15, 2025
Merged via the queue into main with commit 1518fe3 Sep 15, 2025
17 checks passed
@aljo242 aljo242 deleted the add-mempool-d2-diagram branch September 15, 2025 15:23
zsystm pushed a commit to zsystm/evm that referenced this pull request Nov 2, 2025
* add mempool draft

* add svg

* update readme

* add missing edge

* make tx handler two lines

* make ext mempool interface impl two lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants