Playground editor does not rename opcode 0x44 from DIFFICULTY to PREVRANDAO post-merge

Abierto
#219 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

  • #220 de @ardislu — cerrado sin fusionar

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
typescript

Línea de trabajo

Reproduce el comportamiento en la URL del playground de Merge y, después, lee ethereumContext.tsx, especialmente loadInstructions y la comprobación existente de extractDocFromOpcode. Verifica cómo se carga el opcode 0x44 al cambiar entre los modos Bytecode y Mnemonic. Está terminado cuando el Merge fork muestra PREVRANDAO y lo convierte de nuevo en 44 sin producir undefined.

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

Descripción

bug

Steps to reproduce the issue:

  1. Go to https://www.evm.codes/playground?fork=merge
  2. Set the editor language to "Bytecode"
  3. Enter "44" into the editor
  4. Change the editor language to "Mnemonic"
  5. Change the editor language back to "Bytecode"

Expected result: the "44" opcode is recognized as "PREVRANDAO" in the "Mnemonic" setting, and the value "PREVRANDAO" is converted to "44" when switched back to bytecode.

Actual result: the "44" opcode is recognized as "DIFFICULTY" in the "Mnemonic" setting, and the value "DIFFICULTY" is converted to "undefined" when switched back to bytecode.


I see there was the prior issue #172 and PR #180 to address this, additionally in ethereumContext.tsx there's already this logic in extractDocFromOpcode to account for this change:

// TODO: need to implement proper selection of doc according to selected fork (maybe similar to dynamic gas fee)
// Hack for "difficulty" -> "prevrandao" replacement for "merge" HF
if (selectedFork?.name === mergeHardforkName && toHex(op.code) == '44') {
  return {
    ...meta[prevrandaoDocName],
    ...{
      opcodeOrAddress: toHex(op.code),
      staticFee: op.fee,
      minimumFee: 0,
      name: 'PREVRANDAO',
    },
  }
}

So I think this issue was a small oversight in the larger PR. I believe the specific issue I described can be fixed by adding a check in the loadInstructions function in ethereumContext.tsx, similar to the check in extractDocFromOpcode.

Lenguaje dominante
TypeScript
Estrellas
833
Forks
197
Merge medio
5 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 duneanalytics/evm.codes

Todos los issues de duneanalytics/evm.codes

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.