Specify the "snap" ENR entry and how it signals snap versions

Abierto
#286 1 comentario 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@MysticRyuujin ya está trabajando en esto.

Desde el 12/10/2026.

  • #287 de @MysticRyuujin — abierto

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
15/100
Tipo de issue
Documentación
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go, markdown

Línea de trabajo

Start with the existing entry specs in enr-entries/ (eth.md, les.md) and caps/snap.md, then read eth/protocols/snap/discovery.go in go-ethereum to see how the snap entry is written today. The work is to draft enr-entries/snap.md and settle the three open questions about old consumers, retiring snap/1, and DNS trees, which need maintainer decisions first. Done means a reviewed spec file that the maintainers accept and that matches the current go-ethereum behaviour.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Problem

The snap ENR entry has no specification. enr-entries/ defines eth, les and ng, but not snap. Go-ethereum defines the entry in code only (eth/protocols/snap/discovery.go): the key snap with an empty list as its value. Go-ethereum attaches the same entry to every snap version that it registers.

DNS discovery lists depend on this entry. devp2p nodeset filter -snap selects a node when its ENR has a snap entry with any list value, and the snap.* trees of EIP-1459 are built that way. Go-ethereum uses those trees to find snap peers.

The entry does not say which snap versions a node serves. Before snap/2 (EIP-8189), this was not a problem, because the only version was snap/1. Now caps/snap.md names snap/2 as the current version, and snap/2 is not compatible with snap/1: it removes GetTrieNodes and TrieNodes and adds GetBlockAccessLists. Clients now ship different version sets:

  • Go-ethereum offers snap/1, and snap/2 only when it is enabled.
  • Nethermind offers snap/1, and also snap/2 when block access lists are enabled.
  • Reth (main, not released) serves only snap/2, with --snap.v2.

A node that serves only snap/2 cannot use the current entry correctly. With the entry, presence-only filters put it in snap.* trees, and a default go-ethereum peer, which speaks only snap/1, can never negotiate snap with it. Without the entry, no consumer can find it as a snap server.

Data

On mainnet, of 14,103 execution nodes with a recent client identification, only Geth writes the entry today: 7,014 of 7,756 Geth nodes. Nethermind and Besu serve snap/1 but do not write it. Changes for both are open: NethermindEth/nethermind#14585 and besu-eth/besu#11565. As more clients write the entry, the version question becomes more important.

Proposal

Add enr-entries/snap.md:

entry-key   = "snap"
entry-value = [ version, ... ]
  • version is a snap protocol version that the node serves, as an unsigned integer.
  • An empty list means [1]. This keeps every existing go-ethereum record valid.
  • A node writes the entry only when it serves snap, not while it only syncs with snap.
  • Consumers ignore elements that they do not understand, as eth.md and les.md already require.
  • A consumer that needs a specific version selects on the list, and does not select on presence only.

Existing parsers accept this format, because go-ethereum decodes the value with a tail field.

Open questions

  1. Old consumers. A presence-only filter would still select a node that writes [2]. Should a node that does not serve snap/1 omit the entry until consumers are version aware? Or should consumers change first, with devp2p nodeset filter -snap taking a version argument?
  2. Retiring snap/1. When clients stop serving snap/1, the empty-list rule ([] means [1]) must not make old records look current. Is a defined end date for that rule necessary?
  3. DNS trees. Should snap.* trees stay "serves snap/1", or should there be one tree per version (for example, snap2.*)?
Lenguaje dominante
JavaScript
Estrellas
1.1k
Forks
301
Merge medio
12 h 3 min
PR fusionados (30 d)
2

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ethereum/devp2p

Todos los issues de ethereum/devp2p

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.