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 builtin default cost dependents on migration (backport of #3768) #4415

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

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Jan 12, 2025

Problem

Some of builtin programs are being migrated to sbpf, while the rest is being planned for too. Once a builtin program is migrated in a cluster, it's "default cost" defined in BUILTIN_INSTRUCTION_COSTS should be changed to 0.

Summary of Changes

  • add public function to fetch correct default cost for builtin program, based on migration feature status
  • add BuiltinCost struct to track migration feature ID
  • add developer notes to remind to add migration feature ID whenever it becomes available.

Fixes #


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

* Add public function to as placeholder to implement fetching default cost depends on feature_set;
Make AhashMap private

* Add BuiltinCost to help determine default cost based on migration status

* test

* fix - after migration feature activation, it should no longer be considered as builtin

* use lazy_static, avoid naked unwrap

* rename

* add comments to BUILINS

(cherry picked from commit d791c9a)

# Conflicts:
#	builtins-default-costs/src/lib.rs
#	cost-model/src/cost_model.rs
@mergify mergify bot added the conflicts label Jan 12, 2025
@mergify mergify bot requested a review from a team as a code owner January 12, 2025 18:57
Copy link
Author

mergify bot commented Jan 12, 2025

Cherry-pick of d791c9a has failed:

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

You are currently cherry-picking commit d791c9a76.
  (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:   builtins-default-costs/benches/builtin_instruction_costs.rs
	modified:   core/src/banking_stage/packet_filter.rs
	modified:   runtime/src/bank/builtins/mod.rs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   builtins-default-costs/src/lib.rs
	both modified:   cost-model/src/cost_model.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
Copy link

tao-stones commented Jan 12, 2025

A prerequisite bp for backporting #3975 to 2.1 (#4091).

Details:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant