Skip to content

Register CN for Caplin - #844

Merged
mkalinin merged 1 commit into
ethereum:mainfrom
lystopad:feature/lystopad/register-caplin
Jul 7, 2026
Merged

mkalinin merged 1 commit into
ethereum:mainfrom
lystopad:feature/lystopad/register-caplin

Conversation

@lystopad

@lystopad lystopad commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Register CN for Caplin, Erigon's embedded consensus layer client.

Caplin integrates the consensus layer directly into the Erigon node, removing the need for a separate CL process and its own disk storage, which reduces operational complexity and resource usage. It is a distinct consensus client and needs its own two-letter code so that blocks proposed by an Erigon + Caplin setup are correctly attributable.

EG is already reserved for erigon (execution layer), so it cannot be reused for the consensus layer: the graffiti client-version format (<EL code><EL commit><CL code><CL commit>) requires distinct codes to tell the two layers apart. With CN, an Erigon + Caplin block encodes as e.g. EGa53eCNa53e, letting client-diversity tooling measure Caplin adoption independently.

Register `CN` for Caplin, Erigon's embedded consensus layer client.

Caplin integrates the consensus layer directly into the Erigon node, removing the need for a separate CL process and its own disk storage, which reduces operational complexity and resource usage. It is a distinct consensus client and needs its own two-letter code so that blocks proposed by an Erigon + Caplin setup are correctly attributable.

`EG` is already reserved for erigon (execution layer), so it cannot be reused for the consensus layer: the graffiti client-version format (`<EL code><EL commit><CL code><CL commit>`) requires distinct codes to tell the two layers apart. With `CN`, an Erigon + Caplin block encodes as e.g. `EGa53eCNa53e`, letting client-diversity tooling measure Caplin adoption independently.
@mkalinin
mkalinin merged commit a6dea42 into ethereum:main Jul 7, 2026
5 checks passed
pull Bot pushed a commit to Dustin4444/erigon that referenced this pull request Jul 8, 2026
…ontech#22303)

## What

When a validator proposes a block without specifying graffiti, Caplin
now fills the graffiti with the client-version encoding from the [client
identification
standard](https://github.com/ethereum/execution-apis/blob/main/src/engine/identification.md)
instead of the literal `"Caplin"` string:

```
<EL code><EL commit><CN><CL commit>    e.g. EGa53eCNa53e
```

This lets client-diversity tooling attribute proposed blocks to both
their execution and consensus clients. Today an Erigon + Caplin node
leaves no execution-client fingerprint in its blocks.

## Why

Execution-layer client diversity is largely unmeasurable from block
data. The standard addresses this by having the consensus client embed
the execution and consensus client codes and their commit prefixes in
the default graffiti. Caplin previously emitted only the literal
`"Caplin"`, contributing no execution-client signal.

## How

- Adds `GetClientVersionV1` to the `ExecutionEngine` interface; Caplin
obtains the execution client's code and commit via
`engine_getClientVersionV1`. The result is cached, so steady-state block
production performs no extra engine API calls.
- Caplin identifies itself with the reserved consensus client code `CN`.
- When the execution client does not support the method, the graffiti
degrades to the consensus-client identifier only (`CN<commit>`).
- User-specified graffiti is unchanged.
- Deduplicates the local client-version construction into
`engine_types.NewClientVersionV1` / `LocalClientVersionV1`, now shared
by the engine API handler and the in-process execution client.

## Dependency

Caplin's consensus client code `CN` is registered in
ethereum/execution-apis#844. This change can merge independently: the
encoding works before registration (consumers must accept any two-letter
code), and attribution tooling recognizes `CN` once that PR lands.

## Testing

- New `cl/beacon/handler/block_production_graffiti_test.go`: encoding,
execution-client-unavailable fallback, no-engine fallback, and cache
behavior (the engine is queried once across multiple proposals).
- `make lint`, `go vet`, and the affected package tests pass.
nflaig pushed a commit to ChainSafe/lodestar that referenced this pull request Jul 9, 2026
jihoonsong pushed a commit to jihoonsong/execution-apis that referenced this pull request Jul 16, 2026
Register `CN` for Caplin, Erigon's embedded consensus layer client.

Caplin integrates the consensus layer directly into the Erigon node, removing the need for a separate CL process and its own disk storage, which reduces operational complexity and resource usage. It is a distinct consensus client and needs its own two-letter code so that blocks proposed by an Erigon + Caplin setup are correctly attributable.

`EG` is already reserved for erigon (execution layer), so it cannot be reused for the consensus layer: the graffiti client-version format (`<EL code><EL commit><CL code><CL commit>`) requires distinct codes to tell the two layers apart. With `CN`, an Erigon + Caplin block encodes as e.g. `EGa53eCNa53e`, letting client-diversity tooling measure Caplin adoption independently.
@lystopad
lystopad deleted the feature/lystopad/register-caplin branch August 4, 2026 13:07
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.

3 participants