Phase0 epoch processing is quadratic: get_base_reward rescans the registry for every validator
Los mantenedores suelen responder en 6 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 67/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- backend, performance
Línea de trabajo
Start in crates/blockchain/state_transition/src/beacon/stf/epoch/rewards.rs, reading get_base_reward and the phase0 delta loops that call it. Compare how RewardContext in #632 passes precomputed balance for Altair and later; then run the phase0 fixtures and the era replay for mainnet era 290. Done means the epoch path avoids rescanning the registry per validator and those checks complete successfully.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Found by the era replay battery (#680): mainnet phase0 era 290 did not get through a single epoch boundary in 30 minutes, so phase0 eras are excluded from its matrix.
Cause (crates/blockchain/state_transition/src/beacon/stf/epoch/rewards.rs)
get_base_reward(line 71) callsget_total_active_balance(state)— a full registry scan — on every call.- It is called per validator from the phase0 delta loops (lines 118, 121, 125, 212, 246, and through
get_proposer_rewardat 82), so a phase0 epoch transition does O(validators) scans of O(validators) each: quadratic in the registry size. With the registry now a persistent tree (state.validator(i)is a descent), each scan is also more expensive than an array walk.
Fix
- Compute the total active balance (or the base reward per increment) once per epoch transition and pass it in, the way #632's
RewardContextalready does for altair and later, and #648 proposes for deneb/electra'sget_base_reward_per_increment. - The spec-literal
get_base_rewardcan stay as the reference the fixtures call, with the epoch path using the precomputed total.
Impact
- No live chain is in phase0, so this doesn't affect following mainnet today; it blocks replaying phase0 history in #680 and makes phase0 fixtures slower than they need to be.
- Once fixed, phase0 eras (e.g. mainnet 290) can be added back to the era replay matrix.
- Lenguaje dominante
- Rust
- Estrellas
- 86
- Forks
- 34
- Merge medio
- 9 d 20 h
- PR fusionados (30 d)
- 77
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de lambdaclass/ethlambda
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
lambdaclass/ethlambda#850 ·
Los mantenedores suelen responder en 6 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
lambdaclass/ethlambda#777 · 1 reacción ·
Los mantenedores suelen responder en 6 días
-
Run all gossip validation testsQuizá libre de nuevo @dicethedev la tomó hace 9 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
lambdaclass/ethlambda#725 · 2 comentarios ·
Los mantenedores suelen responder en 6 días
-
Handle malformed DB dataQuizá libre de nuevo @dicethedev la tomó hace 115 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
lambdaclass/ethlambda#529 · 4 comentarios ·
Los mantenedores suelen responder en 6 días
-
Document architectural choicesQuizá libre de nuevo @dicethedev la tomó hace 115 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
lambdaclass/ethlambda#521 · 2 comentarios ·
Los mantenedores suelen responder en 6 días
Todos los issues de lambdaclass/ethlambda
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
antithesishq/bombadil#473 ·
Los mantenedores suelen responder en 2 días
-
bench/api.sh exec test fails with curl exit 52, and --ignore-failure still records the timingsAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
libracoder/kiri#669 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 5 días
-
autofixer: follow-up
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
tursodatabase/turso#12217 ·
Los mantenedores suelen responder en 1 día
-
Declare the CMS schema library in the optional recipients extraPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoarea:python in-progress
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
yhay81/pyropdf#1005 · 2 comentarios ·
Los mantenedores suelen responder en 1 día