-
Notifications
You must be signed in to change notification settings - Fork 445
Remove SVM dependency on agave-feature-set #5841
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
Conversation
The Firedancer team maintains a line-for-line reimplementation of the |
00b6ddb
to
e4af604
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5841 +/- ##
========================================
Coverage 83.0% 83.0%
========================================
Files 828 829 +1
Lines 375826 375994 +168
========================================
+ Hits 311963 312246 +283
+ Misses 63863 63748 -115 🚀 New features to boost your workflow:
|
e4af604
to
bb102f7
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.
Nice work! Overall, I think the concept of a separate feature set for SVM over a callback is a very nice change. Let's see if we can just tidy it up a bit and reduce bloat.
@@ -147,15 +225,15 @@ pub struct EnvironmentConfig<'a> { | |||
pub blockhash: Hash, | |||
pub blockhash_lamports_per_signature: u64, | |||
epoch_stake_callback: &'a dyn InvokeContextCallback, | |||
pub feature_set: Arc<FeatureSet>, | |||
feature_set: Arc<RuntimeFeatures>, |
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.
Any chance we can take this opportunity to get rid of the Arc
? I can't think of anywhere we actually need a thread-safe atomic reference to a set of Option<Slot>
. The feature set should be frozen from the time SVM is instantiated to to the time it's torn down.
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.
I was keeping this change for a follow on PR, as it'll increase the size of this PR. Let me see how much additional changes it'll cause. If it's reasonable, I will update it here.
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.
Ok, follow-up PR is also okay, but I definitely think we should take the opportunity to eliminate it while our attention is here.
feature-set/src/lib.rs
Outdated
|
||
pub fn runtime_features(&self) -> RuntimeFeatures { | ||
RuntimeFeatures { | ||
lift_cpi_caller_restriction: self.activated_slot(&lift_cpi_caller_restriction::id()), |
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.
This seems like a lot of repeated code. Do you think we can abstract this initialization in a macro? The struct members are named the same as the features.
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.
It'll remove the possibility of naming the feature ID with a different name than what we call in SVM repo. It's easier to call it the same since the features already exist. But, when SVM is a separate repo, it might be extra work to enforce it.
We can probably add a macro in a separate PR, so if we don't like the rigidity in the future we can just revert that PR.
ea83949
to
d2c9f8c
Compare
Hey @yihau, could you please reserve |
36c5660
to
7dc5b17
Compare
7dc5b17
to
7281edb
Compare
Problem
SVM and runtime currently depends on
agave-feature-set
. Not all of the features are relevant for SVM. Also, this is causing a tight dependency between SVM and monorepo. It'll be ideal if the SVM features could be configured when SVM is instantiated.Summary of Changes
Add a new config struct in SVM, that gets initialized/configured as part of SVM instantiation.
Fixes #