-
Notifications
You must be signed in to change notification settings - Fork 275
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
Conversation
Cherry-pick of 3e9af14 has failed:
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 |
f1d1130
to
33377db
Compare
2ccc80e
to
b869c2a
Compare
b869c2a
to
cb4e3b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only minor comment about a test change.
Conflict resolutions look correct to me, let's give Starry a chance to review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me, but this is obviously a very large backport, so I'm paranoid. Have we run any canaries on mainnet/testnet (with feature disabled, of course)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, it is a large backport, but most files are touched to pass additional feature_set
parameter. But still be good to run it on canary, I will grab a box to run it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Let's let @t-nelson take a look before we merge tho
4472e56
to
f144108
Compare
😱 New commits were pushed while the automerge label was present. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pain. this could have been done so much more reviewably
@@ -40,6 +41,12 @@ pub enum DeserializedPacketError { | |||
FailedFilter(#[from] PacketFilterFailure), | |||
} | |||
|
|||
lazy_static::lazy_static! { | |||
// Make a dummy feature_set with all features enabled to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? could have easily resolved the feature set higher in the call stack and passed a bool down instead of introducing an entire sentinel feature set instance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considered that too, since we plan to remove immutable_deserialized_packet
soon m(when legacy "scheduler" is removed), adding dummy here is easier for backporting than piping a bool through more files.
lazy_static::lazy_static! { | ||
// Make a dummy feature_set with all features enabled to | ||
// fetch compute_unit_price and compute_unit_limit for legacy leader. | ||
static ref FEATURE_SET: FeatureSet = FeatureSet::all_enabled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why all and not just the one we care about here? what if someone naively decides to leverage the arg in at an intermediary call site for something unrelated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea a lazy step for dummy.
// array of slots for all possible static and sanitized program_id_index, | ||
// each slot indicates if a program_id_index has not been checked (eg, None), | ||
// or already checked with result (eg, Some(ProgramKind)) that can be reused. | ||
program_kind: [Option<ProgramKind>; FILTER_SIZE as usize], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this not super clumsy if we need to change static account limit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The size of array is the largest possible pubkeys a packet can have: (PACKET_DATA_SIZE / core::mem::size_of::<Pubkey>()) as u8;
, increase static account limits should not change its value.
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
Feature Gate Issue: #2562
This is an automatic backport of pull request #3799 done by [Mergify](https://mergify.com).