Skip to content

Feature Gate: Consume all requested CUs for VM failures #3993

Open
@jstarry

Description

@jstarry

SIMD

solana-foundation/solana-improvement-documents#182

Description

To improve performance, Solana programs are often compiled with a JIT that works
at the level of Basic Blocks — linear sequences of sBPF instructions with a
single entry and exit point, and no loops or branches. Basic Blocks allow for
efficient execution by reducing the overhead associated with tracking CU
consumption for each individual sBPF instruction.

However, when an exception is thrown during the execution of a Basic Block
(e.g., a null memory dereference or other faults), determining the exact number
of CUs consumed up to the point of failure requires additional effort. Requiring all clients to
track the exact number of executed sBPF instructions for consensus is costly and
unnecessary.

In the event of irregular failure, where execution aborts from the middle of
basic block, the full amount of requested CUs for the transaction will be charged to the CU
meter. This allows for a simple and efficient fallback mechanism that avoids the
need for tracking the exact number of executed instructions up to the point of
failure.

Feature ID

B7H2caeia4ZFcpE3QcgMqbiWiBtWrdBRBSJ1DY6Ktxbq

Activation Method

Single Core Contributor

Deployment Considerations

NA

Minimum Beta Version

No response

Minimum Stable Version

No response

Testnet Activation Epoch

No response

Devnet Activation Epoch

No response

Mainnet-Beta Activation Epoch

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-gatePull Request adds or modifies a runtime feature gate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions