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

v2.1: Fix reserve minimal compute units for builtins (backport of #3799) #3931

Open
wants to merge 3 commits into
base: v2.1
Choose a base branch
from

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Dec 5, 2024

Problem

Implementing solana-foundation/solana-improvement-documents#170 by defining MAX_BUILTIN_ALLOCATION_COMPUTE_UNIT_LIMIT to 3K CUs, then use it to allocate builtin instructions' CU Meters for VM and cost tracking for leaders.

Summary of Changes

  • When calculates default tx cu limits, use MAX_BUILTIN_ALLOCATION_COMPUTE_UNIT_LIMIT per builtin instruction, including compute-budget program instructions.
  • Cost model reads cu limits from RuntimeTransaction's static_meta, replacing a localized implementation that isn't consistent with compute-budget.
  • Changes are behind Feature gate
  • updated existing tests to allow additional feature_set parameters (touch many files)

Feature Gate Issue: #2562


This is an automatic backport of pull request #3799 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team as a code owner December 5, 2024 03:51
@mergify mergify bot added conflicts feature-gate Pull Request adds or modifies a runtime feature gate labels Dec 5, 2024
Copy link
Author

mergify bot commented Dec 5, 2024

Cherry-pick of 3e9af14 has failed:

On branch mergify/bp/v2.1/pr-3799
Your branch is up to date with 'origin/v2.1'.

You are currently cherry-picking commit 3e9af14f3a.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   compute-budget/src/compute_budget_limits.rs
	modified:   cost-model/src/transaction_cost.rs
	modified:   programs/sbf/tests/programs.rs
	modified:   runtime-transaction/benches/process_compute_budget_instructions.rs
	new file:   runtime-transaction/src/builtin_programs_filter.rs
	modified:   runtime-transaction/src/compute_budget_instruction_details.rs
	modified:   runtime-transaction/src/compute_budget_program_id_filter.rs
	modified:   runtime-transaction/src/instructions_processor.rs
	modified:   runtime-transaction/src/runtime_transaction.rs
	modified:   runtime/src/bank.rs
	modified:   runtime/src/bank/tests.rs
	modified:   sdk/feature-set/src/lib.rs
	modified:   sdk/program/src/message/sanitized.rs
	modified:   sdk/program/src/message/versions/sanitized.rs
	modified:   svm-transaction/src/svm_message.rs
	modified:   svm-transaction/src/svm_message/sanitized_message.rs
	modified:   svm-transaction/src/svm_message/sanitized_transaction.rs
	modified:   svm/src/transaction_processor.rs
	modified:   transaction-view/src/resolved_transaction_view.rs
	modified:   transaction-view/src/transaction_view.rs

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   builtins-default-costs/src/lib.rs
	both modified:   core/src/banking_stage/consumer.rs
	both modified:   core/src/banking_stage/immutable_deserialized_packet.rs
	deleted by us:   core/src/banking_stage/transaction_scheduler/receive_and_buffer.rs
	both modified:   cost-model/src/cost_model.rs
	deleted by us:   programs/compute-budget-bench/benches/compute_budget.rs
	both modified:   runtime-transaction/src/lib.rs
	deleted by us:   runtime-transaction/src/runtime_transaction/sdk_transactions.rs
	both modified:   runtime/src/prioritization_fee_cache.rs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@tao-stones tao-stones force-pushed the mergify/bp/v2.1/pr-3799 branch from 9acea14 to f1d1130 Compare December 11, 2024 00:02
tao-stones and others added 2 commits December 11, 2024 15:06
- 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 tao-stones force-pushed the mergify/bp/v2.1/pr-3799 branch from f1d1130 to 33377db Compare December 11, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts feature-gate Pull Request adds or modifies a runtime feature gate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant