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

Feature Gate: reserve minimal CUs for builtin instructions #2562

Open
tao-stones opened this issue Aug 12, 2024 · 0 comments
Open

Feature Gate: reserve minimal CUs for builtin instructions #2562

tao-stones opened this issue Aug 12, 2024 · 0 comments
Labels
feature-gate Pull Request adds or modifies a runtime feature gate

Comments

@tao-stones
Copy link

tao-stones commented Aug 12, 2024

SIMD

solana-foundation/solana-improvement-documents#170

Description

When transactions do not request a specific compute unit limit, the Solana
runtime conservatively allocates 200,000 compute units for each tx-level
instruction (excluding compute budget instructions) in the transaction's
compute budget. Since builtin program instructions consume far less than 200k
compute units, the runtime will be modified to only allocate 3,000 compute units
in the transaction compute budget for each of these instructions.

Changing compute budget allocation can impact transaction execution results, need to be feature gated.

Feature ID

C9oAhLxDBm3ssWtJx1yBGzPY55r2rArHmN1pbQn6HogH

Activation Method

Single Core Contributor

Deployment Considerations

Should communicate with dev that not to assume builtins still have 200K CU budget

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

@tao-stones tao-stones added the feature-gate Pull Request adds or modifies a runtime feature gate label Aug 12, 2024
@tao-stones tao-stones changed the title Feature Gate: fix compute budget allocation for builtins Feature Gate: reserve minimal CUs for builtin instructions Nov 21, 2024
tao-stones added a commit that referenced this issue Dec 5, 2024
- Add feature gate, issue #2562;
- Implement SIMD-170;

---------

Co-authored-by: Justin Starry <[email protected]>
mergify bot pushed a commit that referenced this issue Dec 5, 2024
- Add feature gate, issue #2562;
- Implement SIMD-170;

---------

Co-authored-by: Justin Starry <[email protected]>
(cherry picked from commit 3e9af14)

# Conflicts:
#	builtins-default-costs/src/lib.rs
#	compute-budget/src/compute_budget_limits.rs
#	compute-budget/src/compute_budget_processor.rs
#	core/src/banking_stage/consumer.rs
#	core/src/banking_stage/immutable_deserialized_packet.rs
#	core/src/banking_stage/transaction_scheduler/receive_and_buffer.rs
#	cost-model/src/cost_model.rs
#	cost-model/src/transaction_cost.rs
#	programs/compute-budget-bench/benches/compute_budget.rs
#	programs/sbf/tests/programs.rs
#	runtime-transaction/benches/process_compute_budget_instructions.rs
#	runtime-transaction/src/compute_budget_instruction_details.rs
#	runtime-transaction/src/compute_budget_program_id_filter.rs
#	runtime-transaction/src/lib.rs
#	runtime-transaction/src/runtime_transaction.rs
#	runtime-transaction/src/runtime_transaction/sdk_transactions.rs
#	runtime/src/bank.rs
#	runtime/src/bank/tests.rs
#	runtime/src/prioritization_fee_cache.rs
#	sdk/src/feature_set.rs
#	svm-transaction/src/svm_message.rs
#	svm-transaction/src/svm_message/sanitized_message.rs
#	svm-transaction/src/svm_message/sanitized_transaction.rs
#	svm/src/transaction_processor.rs
#	transaction-view/src/resolved_transaction_view.rs
#	transaction-view/src/transaction_view.rs
mergify bot pushed a commit that referenced this issue Dec 5, 2024
- Add feature gate, issue #2562;
- Implement SIMD-170;

---------

Co-authored-by: Justin Starry <[email protected]>
(cherry picked from commit 3e9af14)

# Conflicts:
#	builtins-default-costs/src/lib.rs
#	core/src/banking_stage/consumer.rs
#	core/src/banking_stage/immutable_deserialized_packet.rs
#	core/src/banking_stage/transaction_scheduler/receive_and_buffer.rs
#	cost-model/src/cost_model.rs
#	programs/compute-budget-bench/benches/compute_budget.rs
#	runtime-transaction/src/lib.rs
#	runtime-transaction/src/runtime_transaction/sdk_transactions.rs
#	runtime/src/prioritization_fee_cache.rs
tao-stones added a commit that referenced this issue Dec 11, 2024
- Add feature gate, issue #2562;
- Implement SIMD-170;

---------

Co-authored-by: Justin Starry <[email protected]>
(cherry picked from commit 3e9af14)

# Conflicts:
#	builtins-default-costs/src/lib.rs
#	core/src/banking_stage/consumer.rs
#	core/src/banking_stage/immutable_deserialized_packet.rs
#	core/src/banking_stage/transaction_scheduler/receive_and_buffer.rs
#	cost-model/src/cost_model.rs
#	programs/compute-budget-bench/benches/compute_budget.rs
#	runtime-transaction/src/lib.rs
#	runtime-transaction/src/runtime_transaction/sdk_transactions.rs
#	runtime/src/prioritization_fee_cache.rs
tao-stones added a commit that referenced this issue Dec 11, 2024
- Add feature gate, issue #2562;
- Implement SIMD-170;

---------

Co-authored-by: Justin Starry <[email protected]>
(cherry picked from commit 3e9af14)

# Conflicts:
#	builtins-default-costs/src/lib.rs
#	core/src/banking_stage/consumer.rs
#	core/src/banking_stage/immutable_deserialized_packet.rs
#	core/src/banking_stage/transaction_scheduler/receive_and_buffer.rs
#	cost-model/src/cost_model.rs
#	programs/compute-budget-bench/benches/compute_budget.rs
#	runtime-transaction/src/lib.rs
#	runtime-transaction/src/runtime_transaction/sdk_transactions.rs
#	runtime/src/prioritization_fee_cache.rs
tao-stones added a commit that referenced this issue Dec 13, 2024
- Add feature gate, issue #2562;
- Implement SIMD-170;

---------

Co-authored-by: Justin Starry <[email protected]>
(cherry picked from commit 3e9af14)

# Conflicts:
#	builtins-default-costs/src/lib.rs
#	core/src/banking_stage/consumer.rs
#	core/src/banking_stage/immutable_deserialized_packet.rs
#	core/src/banking_stage/transaction_scheduler/receive_and_buffer.rs
#	cost-model/src/cost_model.rs
#	programs/compute-budget-bench/benches/compute_budget.rs
#	runtime-transaction/src/lib.rs
#	runtime-transaction/src/runtime_transaction/sdk_transactions.rs
#	runtime/src/prioritization_fee_cache.rs
tao-stones added a commit that referenced this issue Jan 9, 2025
- Add feature gate, issue #2562;
- Implement SIMD-170;

---------

Co-authored-by: Justin Starry <[email protected]>
(cherry picked from commit 3e9af14)
tao-stones added a commit that referenced this issue Jan 11, 2025
…) (#3931)

* Fix reserve minimal compute units for builtins  (#3799)

- Add feature gate, issue #2562;
- Implement SIMD-170;

---------

Co-authored-by: Justin Starry <[email protected]>
(cherry picked from commit 3e9af14)

* Fix conflicts manually

* avoid getting program_ids that are not used after all

---------

Co-authored-by: Tao Zhu <[email protected]>
Co-authored-by: Tao Zhu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-gate Pull Request adds or modifies a runtime feature gate
Projects
None yet
Development

No branches or pull requests

1 participant