FFORGE//RS
← Roadmap

blockchain / LEVEL 4

The instruction charged after execution

EST.50 MIN
01

THEORY / RETRIEVAL

What to restore

  • Compute deterministic instruction cost with checked arithmetic
  • Reject an instruction before it crosses the gas budget
  • Keep consensus execution independent of wall clock and host speed

Gas converts untrusted work into protocol accounting

A deterministic runtime assigns protocol costs to operations and charges before performing them. Wall-clock timeout alone is unsuitable for consensus because validators have different hardware and scheduling. The schedule must also cover memory growth, storage and expensive cryptographic work.

Out of gas is a defined state-machine result

An instruction that cannot be fully paid must not partially execute. Protocols must define which outer effects remain, how fees are charged and whether nested calls revert. Arithmetic overflow in cost calculation is a trap, never a cheap instruction.

CHECKPOINT

Why is a 100 ms wall-clock timeout insufficient as the only smart-contract resource limit in consensus?

ISOLATED RUST 1.96
src/lib.rsEDIT

02 / DEBUGGING

Find and fix the defect

Repair the gas meter. Costs are Read=10+bytes, Write=50+5×bytes, Hash=20+2×bytes and Transfer=500. Use checked arithmetic, precharge each instruction, and report the index and gas consumed before the failing instruction.

Initializing editor…
CLOUD SANDBOXnetwork off · 256 MB · 12 s
2 / 64 KB
OUTPUT
Runner is waiting for a submission.