Skip to content

Commit 7835a24

Browse files
committed
deps: bump to agave 3.1
1 parent 0c01e45 commit 7835a24

File tree

13 files changed

+368
-159
lines changed

13 files changed

+368
-159
lines changed

Cargo.lock

Lines changed: 277 additions & 97 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ edition = "2021"
2121
version = "0.7.2"
2222

2323
[workspace.dependencies]
24-
agave-feature-set = "3.0.10"
25-
agave-precompiles = "3.0.10"
26-
agave-syscalls = "~3.0.10"
24+
agave-feature-set = "3.1.0"
25+
agave-precompiles = "3.1.0"
26+
agave-syscalls = "3.1.0"
2727
bincode = "1.3.3"
2828
bs58 = "0.5.1"
2929
chrono = "0.4.42"
@@ -55,9 +55,9 @@ serde_yaml = "0.9.34"
5555
serial_test = "2.0"
5656
solana-account = "3.2.0"
5757
solana-account-info = "3.0"
58-
solana-bpf-loader-program = "3.0.10"
58+
solana-bpf-loader-program = "3.1.0"
5959
solana-clock = "3.0"
60-
solana-compute-budget = "3.0.10"
60+
solana-compute-budget = "3.1.0"
6161
solana-cpi = "3.0"
6262
solana-ed25519-program = "3.0"
6363
solana-epoch-rewards = "3.0"
@@ -68,7 +68,7 @@ solana-instruction-error = { version = "2.0", features = ["serde"] }
6868
solana-keccak-hasher = { version = "3.0", features = ["sha3"] }
6969
solana-loader-v3-interface = "6.1.0"
7070
solana-loader-v4-interface = "3.1.0"
71-
solana-loader-v4-program = "3.0.10"
71+
solana-loader-v4-program = "3.1.0"
7272
solana-logger = "3.0"
7373
solana-native-token = "3.0"
7474
solana-precompile-error = "3.0"
@@ -83,15 +83,15 @@ solana-secp256k1-program = "3.0"
8383
solana-secp256r1-program = "3.0"
8484
solana-slot-hashes = "3.0"
8585
solana-stake-interface = "2.0.1"
86-
solana-stake-program = "3.0.10"
87-
solana-svm-callback = "3.0.10"
88-
solana-svm-log-collector = "3.0.10"
89-
solana-svm-timings = "3.0.10"
86+
solana-stake-program = "3.1.0"
87+
solana-svm-callback = "3.1.0"
88+
solana-svm-log-collector = "3.1.0"
89+
solana-svm-timings = "3.1.0"
9090
solana-system-interface = "2.0"
91-
solana-system-program = "3.0.10"
91+
solana-system-program = "3.1.0"
9292
solana-sysvar = "3.0"
9393
solana-sysvar-id = "3.0"
94-
solana-transaction-context = "~3.0.10"
94+
solana-transaction-context = "3.1.0"
9595
spl-associated-token-account-interface = "2.0.0"
9696
spl-token-interface = "2.0.0"
9797
thiserror = "1.0.64"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ clippy-fix:
8080
@cargo +$(NIGHTLY_TOOLCHAIN) clippy --all --all-features --all-targets --fix --allow-dirty --allow-staged -- -D warnings
8181

8282
check-features:
83-
@cargo hack check --feature-powerset --no-dev-deps
83+
@cargo hack --feature-powerset --no-dev-deps check
8484

8585
build:
8686
@$(MAKE) build-test-programs

fuzz/fixture/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ prost = { workspace = true }
1515
serde = { workspace = true, features = ["derive"] }
1616
solana-account = { workspace = true }
1717
solana-clock = { workspace = true }
18-
solana-compute-budget = { workspace = true }
18+
solana-compute-budget = { workspace = true, features = ["agave-unstable-api"] }
1919
solana-epoch-rewards = { workspace = true }
2020
solana-epoch-schedule = { workspace = true }
2121
solana-hash = { workspace = true }

fuzz/fixture/src/context.rs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ impl From<ProtoContext> for Context {
6666
let feature_set: FeatureSet = value.feature_set.map(Into::into).unwrap_or_default();
6767
let simd_0268_active =
6868
feature_set.is_active(&agave_feature_set::raise_cpi_nesting_limit_to_8::id());
69+
let simd_0339_active =
70+
feature_set.is_active(&agave_feature_set::increase_cpi_account_info_limit::id());
6971

70-
let compute_budget = value
71-
.compute_budget
72-
.map(Into::into)
73-
.unwrap_or_else(|| ComputeBudget::new_with_defaults(simd_0268_active));
72+
let compute_budget = value.compute_budget.map(Into::into).unwrap_or_else(|| {
73+
ComputeBudget::new_with_defaults(simd_0268_active, simd_0339_active)
74+
});
7475

7576
Self {
7677
compute_budget,
@@ -151,12 +152,15 @@ mod tests {
151152
ComputeBudget as ProtoComputeBudget, FeatureSet as ProtoFeatureSet,
152153
InstrContext as ProtoContext,
153154
},
155+
solana_pubkey::Pubkey,
154156
};
155157

156-
fn proto_feature_set_with(feature_id: solana_pubkey::Pubkey) -> ProtoFeatureSet {
157-
let discr = u64::from_le_bytes(feature_id.to_bytes()[0..8].try_into().unwrap());
158+
fn proto_feature_set_with(features: &[Pubkey]) -> ProtoFeatureSet {
158159
ProtoFeatureSet {
159-
features: vec![discr],
160+
features: features
161+
.iter()
162+
.map(|id| u64::from_le_bytes(id.to_bytes()[0..8].try_into().unwrap()))
163+
.collect(),
160164
}
161165
}
162166

@@ -175,20 +179,21 @@ mod tests {
175179
#[test]
176180
fn test_defaults_use_feature_flag_when_active() {
177181
let mut proto = empty_proto_context();
178-
proto.feature_set = Some(proto_feature_set_with(
182+
proto.feature_set = Some(proto_feature_set_with(&[
179183
agave_feature_set::raise_cpi_nesting_limit_to_8::id(),
180-
));
184+
agave_feature_set::increase_cpi_account_info_limit::id(),
185+
]));
181186

182187
let ctx: Context = proto.into();
183-
let expected = ComputeBudget::new_with_defaults(true);
188+
let expected = ComputeBudget::new_with_defaults(true, true);
184189
assert_eq!(ctx.compute_budget, expected);
185190
}
186191

187192
#[test]
188193
fn test_defaults_use_feature_flag_when_inactive() {
189194
let proto = empty_proto_context();
190195
let ctx: Context = proto.into();
191-
let expected = ComputeBudget::new_with_defaults(false);
196+
let expected = ComputeBudget::new_with_defaults(false, false);
192197
assert_eq!(ctx.compute_budget, expected);
193198
}
194199

@@ -202,9 +207,10 @@ mod tests {
202207
proto.compute_budget = Some(cb);
203208

204209
// Whether the feature is present or not should not affect passthrough
205-
proto.feature_set = Some(proto_feature_set_with(
210+
proto.feature_set = Some(proto_feature_set_with(&[
206211
agave_feature_set::raise_cpi_nesting_limit_to_8::id(),
207-
));
212+
agave_feature_set::increase_cpi_account_info_limit::id(),
213+
]));
208214

209215
let ctx: Context = proto.into();
210216
assert_eq!(ctx.compute_budget.compute_unit_limit, 12345);

fuzz/fixture/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ mod tests {
112112
fn test_consistent_hashing() {
113113
const ITERATIONS: usize = 1000;
114114

115-
let compute_budget = ComputeBudget::new_with_defaults(true);
115+
let compute_budget = ComputeBudget::new_with_defaults(true, true);
116116

117117
let feature_set = FeatureSet::all_enabled();
118118
let sysvars = Sysvars::default();

harness/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ serde = [
3232
]
3333

3434
[dependencies]
35-
agave-feature-set = { workspace = true }
36-
agave-precompiles = { workspace = true, optional = true }
35+
agave-feature-set = { workspace = true, features = ["agave-unstable-api"] }
36+
agave-precompiles = { workspace = true, features = ["agave-unstable-api"], optional = true }
3737
agave-syscalls = { workspace = true }
3838
bincode = { workspace = true }
3939
serde = { workspace = true, features = ["derive"], optional = true }
@@ -44,17 +44,17 @@ mollusk-svm-fuzz-fs = { workspace = true, optional = true }
4444
mollusk-svm-keys = { workspace = true }
4545
mollusk-svm-result = { workspace = true }
4646
solana-account = { workspace = true }
47-
solana-bpf-loader-program = { workspace = true }
47+
solana-bpf-loader-program = { workspace = true, features = ["agave-unstable-api"] }
4848
solana-clock = { workspace = true }
49-
solana-compute-budget = { workspace = true }
49+
solana-compute-budget = { workspace = true, features = ["agave-unstable-api"] }
5050
solana-epoch-rewards = { workspace = true }
5151
solana-epoch-schedule = { workspace = true }
5252
solana-hash = { workspace = true }
5353
solana-instruction = { workspace = true }
5454
solana-instruction-error = { workspace = true, features = ["serde"] }
5555
solana-loader-v3-interface = { workspace = true, features = ["serde"] }
5656
solana-loader-v4-interface = { workspace = true }
57-
solana-loader-v4-program = { workspace = true, optional = true }
57+
solana-loader-v4-program = { workspace = true, features = ["agave-unstable-api"], optional = true }
5858
solana-logger = { workspace = true }
5959
solana-precompile-error = { workspace = true }
6060
solana-program-error = { workspace = true }
@@ -68,7 +68,7 @@ solana-stake-program = { workspace = true, optional = true }
6868
solana-svm-callback = { workspace = true }
6969
solana-svm-log-collector = { workspace = true }
7070
solana-svm-timings = { workspace = true }
71-
solana-system-program = { workspace = true }
71+
solana-system-program = { workspace = true, features = ["agave-unstable-api"] }
7272
solana-sysvar = { workspace = true }
7373
solana-sysvar-id = { workspace = true }
7474
solana-transaction-context = { workspace = true, features = ["dev-context-only-utils"] }

harness/src/compile_accounts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ use {
99
},
1010
keys::KeyMap,
1111
},
12-
solana_account::{Account, WritableAccount},
12+
solana_account::{Account, AccountSharedData, WritableAccount},
1313
solana_instruction::Instruction,
1414
solana_pubkey::Pubkey,
15-
solana_transaction_context::{InstructionAccount, TransactionAccount},
15+
solana_transaction_context::InstructionAccount,
1616
};
1717

1818
pub struct CompiledAccounts {
1919
pub program_id_index: u16,
2020
pub instruction_accounts: Vec<InstructionAccount>,
21-
pub transaction_accounts: Vec<TransactionAccount>,
21+
pub transaction_accounts: Vec<(Pubkey, AccountSharedData)>,
2222
}
2323

2424
pub fn compile_accounts(

harness/src/fuzz/firedancer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub(crate) fn parse_fixture_context(context: &FuzzContext) -> ParsedFixtureConte
114114

115115
let compute_budget = ComputeBudget {
116116
compute_unit_limit: *compute_units_available,
117-
..ComputeBudget::new_with_defaults(true)
117+
..ComputeBudget::new_with_defaults(true, true)
118118
};
119119

120120
let accounts = accounts

harness/src/lib.rs

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -462,19 +462,25 @@ use {
462462
program::ProgramCache, sysvar::Sysvars,
463463
},
464464
agave_feature_set::FeatureSet,
465+
agave_syscalls::{
466+
create_program_runtime_environment_v1, create_program_runtime_environment_v2,
467+
},
465468
mollusk_svm_error::error::{MolluskError, MolluskPanic},
466469
mollusk_svm_result::{Check, CheckContext, Config, InstructionResult},
467-
solana_account::Account,
470+
solana_account::{Account, ReadableAccount},
468471
solana_compute_budget::compute_budget::ComputeBudget,
469472
solana_hash::Hash,
470473
solana_instruction::{AccountMeta, Instruction},
471-
solana_program_runtime::invoke_context::{EnvironmentConfig, InvokeContext},
474+
solana_program_runtime::{
475+
invoke_context::{EnvironmentConfig, InvokeContext},
476+
loaded_programs::ProgramRuntimeEnvironments,
477+
},
472478
solana_pubkey::Pubkey,
473479
solana_svm_callback::InvokeContextCallback,
474480
solana_svm_log_collector::LogCollector,
475481
solana_svm_timings::ExecuteTimings,
476482
solana_transaction_context::TransactionContext,
477-
std::{cell::RefCell, collections::HashSet, iter::once, rc::Rc},
483+
std::{cell::RefCell, collections::HashSet, iter::once, rc::Rc, sync::Arc},
478484
};
479485

480486
pub(crate) const DEFAULT_LOADER_KEY: Pubkey = solana_sdk_ids::bpf_loader_upgradeable::id();
@@ -539,7 +545,7 @@ impl Default for Mollusk {
539545
solana_runtime::message_processor=debug,\
540546
solana_runtime::system_instruction_processor=trace",
541547
);
542-
let compute_budget = ComputeBudget::new_with_defaults(true);
548+
let compute_budget = ComputeBudget::new_with_defaults(true, true);
543549

544550
#[cfg(feature = "fuzz")]
545551
let feature_set = {
@@ -719,8 +725,26 @@ impl Mollusk {
719725
epoch_stake: &self.epoch_stake,
720726
feature_set: &self.feature_set,
721727
};
728+
let execution_budget = self.compute_budget.to_budget();
722729
let runtime_features = self.feature_set.runtime_features();
723730
let sysvar_cache = self.sysvars.setup_sysvar_cache(accounts);
731+
732+
let program_runtime_environments = ProgramRuntimeEnvironments {
733+
program_runtime_v1: Arc::new(
734+
create_program_runtime_environment_v1(
735+
&runtime_features,
736+
&execution_budget,
737+
/* reject_deployment_of_broken_elfs */ false,
738+
/* debugging_features */ false,
739+
)
740+
.unwrap(),
741+
),
742+
program_runtime_v2: Arc::new(create_program_runtime_environment_v2(
743+
&execution_budget,
744+
/* debugging_features */ false,
745+
)),
746+
};
747+
724748
let mut invoke_context = InvokeContext::new(
725749
&mut transaction_context,
726750
&mut program_cache,
@@ -729,6 +753,8 @@ impl Mollusk {
729753
/* blockhash_lamports_per_signature */ 5000, // The default value
730754
&callback,
731755
&runtime_features,
756+
&program_runtime_environments,
757+
&program_runtime_environments,
732758
&sysvar_cache,
733759
),
734760
self.logger.clone(),
@@ -742,7 +768,7 @@ impl Mollusk {
742768
.configure_next_instruction_for_tests(
743769
program_id_index,
744770
instruction_accounts.clone(),
745-
&instruction.data,
771+
instruction.data.clone(),
746772
)
747773
.expect("failed to configure next instruction");
748774

@@ -780,12 +806,15 @@ impl Mollusk {
780806
transaction_context
781807
.find_index_of_account(pubkey)
782808
.map(|index| {
783-
let resulting_account = transaction_context
784-
.accounts()
785-
.try_borrow(index)
786-
.unwrap()
787-
.clone()
788-
.into();
809+
let account_ref =
810+
transaction_context.accounts().try_borrow(index).unwrap();
811+
let resulting_account = Account {
812+
lamports: account_ref.lamports(),
813+
data: account_ref.data().to_vec(),
814+
owner: *account_ref.owner(),
815+
executable: account_ref.executable(),
816+
rent_epoch: account_ref.rent_epoch(),
817+
};
789818
(*pubkey, resulting_account)
790819
})
791820
.unwrap_or((*pubkey, account.clone()))

0 commit comments

Comments
 (0)