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

Aperta
#219 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

  • #220 di @ardislu — chiusa senza merge

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
typescript

Direzione di ricerca

Riproduci il comportamento all’URL del playground di Merge, quindi leggi ethereumContext.tsx, in particolare loadInstructions e il controllo esistente di extractDocFromOpcode. Verifica come viene caricato l’opcode 0x44 passando tra le modalità Bytecode e Mnemonic. Il lavoro è completato quando il Merge fork visualizza PREVRANDAO e lo riconverte in 44 senza produrre undefined.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
833
Fork
197
Merge medio
5m
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di duneanalytics/evm.codes

Tutte le issue di duneanalytics/evm.codes

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.