FuelLabs/fuel-tx

Enhance ScriptExecutionResult

Offen

#100 geöffnet am 31.03.2022

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (3 Forks)auto 404
good first issue

Repository-Metriken

Stars
 (14 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

ref https://github.com/FuelLabs/fuel-tx/pull/99#issuecomment-1084909047

Currently, ScriptExecutionResult only supports 3 variants (Success, Revert, Panic), which only require 2 bits to represent.

This leaves 62 bits unused in the canonical encoding, which could be used to pack extra additional metadata. This could be things like

  • PanicReason when result is a panic
  • $pc - assuming it's safe to represent as 32bits, which is more than enough for the VM_MAX_MEMORY unless we decide to allow transactions to use 4gb of mem in the future.
  • the index of the resultant receipt in the set of receipts
  • etc

It's impossible to fully represent all the data that's needed, so we'd have to come up with a transparent yet compact encoding of metadata useful for debugging.

Contributor Guide