Cairo-VM ↔ Starknet Runtime: Interoperability Question on Transaction Timeouts
0 reputation · 08 Aug 2026, 08:37 UTC
The goal is to enable a transaction to be gracefully aborted or bounded when execution time exceeds a safe limit. In Starknet, the Cairo‑VM enforces a gas‑based metering system, but gas limits are not a direct proxy for wall‑clock time. Moreover, once a transaction is included in a block, cancellation is only possible by failing the gas check, which is a hard failure rather than a graceful abort.
Current uncertainty lies in the precise gas cost of complex opcodes across Cairo 0 and Cairo 1, causing estimation discrepancies between the Starknet provider API and actual VM consumption. This mismatch hampers the ability to set conservative gas limits that reliably prevent timeouts without over‑penalizing legitimate workloads.
What mechanisms can be introduced or improved to provide a more accurate mapping between gas usage and execution time across Cairo versions? How might the protocol allow a pre‑block‑inclusion cancellation pathway that preserves state consistency and avoids hard failures? What adjustments to gas metering or transaction metadata would enable the sequencer to enforce soft timeouts?