Measure the payload copy in the engine request, and share the block if it shows

Abierto
#819 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 6 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
performance

Línea de trabajo

Read crates/blockchain/src/beacon_engine.rs and the changes in lambdaclass/ethlambda#755 to understand NewPayloadRequest::into_owned and the engine import phase metric. Measure request construction on a live node with an execution client for typical and transaction-heavy blocks, comparing it with the roughly 157 ms transition time cited in the issue. If the copy is material, apply the outlined Arc ownership approach; done means the measurement is reported and any resulting change avoids the actor-thread copy while preserving the block for on_block_speculative.

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

Descripción

Since lambdaclass/ethlambda#755, a pre-gloas beacon import with an execution client sends engine_newPayloadV4 from a spawned task while the chain actor computes the block's state transition. The task cannot borrow the block, so NewPayloadRequest::into_owned (crates/blockchain/src/beacon_engine.rs) clones the block's ExecutionPayload, transactions included, on the actor thread before the request is spawned. Three automated reviewers raised the copy across two review rounds of that PR.

Its cost has not been measured, neither typically nor for a transaction-heavy worst case, so it is not known how it compares with the transition it overlaps (~157 ms at the docs' p50). Since #755 the engine import phase (lean_block_import_phase_seconds{phase="engine"}) includes building the request, so the copy is visible there on a live node: the phase's floor, for blocks whose answer arrived before the transition finished, is roughly the request construction.

Measuring it was out of scope for #755, since it needs a live node with an execution client.

What a fix would look like, if the floor is material:

  • Move the block into an Arc for the duration of the question.
  • Have the task build the request from its clone, so nothing is copied on the actor.
  • Take the block back with Arc::unwrap_or_clone before on_block_speculative. The task has finished by then, so this does not clone in practice.

OwnedNewPayloadRequest and into_owned would then go away.

Lenguaje dominante
Rust
Estrellas
86
Forks
34
Merge medio
9 d 20 h
PR fusionados (30 d)
77

Preparar el entorno

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 lambdaclass/ethlambda

Todos los issues de lambdaclass/ethlambda

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.