Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIMD-0198: Define CUs for Builtin instructions #198

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions proposals/simd-0198-repricing-builtin-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
simd: '0198'
title: Define CUs for Builtin instructions
authors:
- Tao Zhu (Anza)
category: Standard
type: Core
status: Review
created: 2024-11-20
feature:
supersedes:
superseded-by:
extends:
---

## Summary

Builtin programs should consume a predefined number of CUs for each instruction.

## Motivation

To correct account how many CUs builtin instructions should consume from VM's
CU meter, each builtin instructions should be individually meansured for their
execution cost.

## New Terminology

None

## Detailed Design

1. Statically define each builtin instruction's execution cost, When the virtual
machine (VM) invokes a builtin instruction, the defined DEFAULT_COMPUTE_UNITS
is consistently deducted from the CU Meter.

2. Handling invalid CU requests: Transactions will fail if they request:
- More than MAX_COMPUTE_UNIT_LIMIT per transaction, or
- Less than the sum of all included builtin instructions'
DEFAULT_COMPUTE_UNITS

## Alternatives Considered

None

## Impact

None

## Security Considerations

Both Agave and FD clients should implement this proposal to avoid breaking
consensus.

Loading