Skip to content

Commit

Permalink
Merge branch 'secp256r1-precompile' of https://github.com/iceomatic/a…
Browse files Browse the repository at this point in the history
…gave into secp256r1-precompile
  • Loading branch information
0xRigel committed Oct 15, 2024
2 parents f74009a + 46e15a1 commit 6011adf
Show file tree
Hide file tree
Showing 49 changed files with 912 additions and 442 deletions.
16 changes: 14 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ members = [
"rpc-test",
"runtime",
"runtime-transaction",
"sanitize",
"sdk",
"sdk/account",
"sdk/account-info",
Expand All @@ -117,6 +116,7 @@ members = [
"sdk/instruction",
"sdk/macro",
"sdk/msg",
"sdk/native-token",
"sdk/package-metadata",
"sdk/package-metadata-macro",
"sdk/program",
Expand All @@ -126,6 +126,7 @@ members = [
"sdk/program-pack",
"sdk/pubkey",
"sdk/rent",
"sdk/sanitize",
"sdk/serde-varint",
"sdk/serialize-utils",
"sdk/sha256-hasher",
Expand Down Expand Up @@ -432,6 +433,7 @@ solana-measure = { path = "measure", version = "=2.1.0" }
solana-merkle-tree = { path = "merkle-tree", version = "=2.1.0" }
solana-metrics = { path = "metrics", version = "=2.1.0" }
solana-msg = { path = "sdk/msg", version = "=2.1.0" }
solana-native-token = { path = "sdk/native-token", version = "=2.1.0" }
solana-net-utils = { path = "net-utils", version = "=2.1.0" }
solana-nohash-hasher = "0.2.1"
solana-notifier = { path = "notifier", version = "=2.1.0" }
Expand All @@ -453,7 +455,7 @@ solana-quic-client = { path = "quic-client", version = "=2.1.0" }
solana-rayon-threadlimit = { path = "rayon-threadlimit", version = "=2.1.0" }
solana-remote-wallet = { path = "remote-wallet", version = "=2.1.0", default-features = false }
solana-rent = { path = "sdk/rent", version = "=2.1.0", default-features = false }
solana-sanitize = { path = "sanitize", version = "=2.1.0" }
solana-sanitize = { path = "sdk/sanitize", version = "=2.1.0" }
solana-serde-varint = { path = "sdk/serde-varint", version = "=2.1.0" }
solana-serialize-utils = { path = "sdk/serialize-utils", version = "=2.1.0" }
solana-sha256-hasher = { path = "sdk/sha256-hasher", version = "=2.1.0" }
Expand Down
42 changes: 25 additions & 17 deletions accounts-db/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,14 @@ impl Accounts {
}
}

/// Return loaded addresses and the deactivation slot.
/// If the table hasn't been deactivated, the deactivation slot is `u64::MAX`.
pub fn load_lookup_table_addresses(
&self,
ancestors: &Ancestors,
address_table_lookup: SVMMessageAddressTableLookup,
slot_hashes: &SlotHashes,
) -> std::result::Result<LoadedAddresses, AddressLookupError> {
) -> std::result::Result<(LoadedAddresses, Slot), AddressLookupError> {
let table_account = self
.accounts_db
.load_with_fixed_root(ancestors, address_table_lookup.account_key)
Expand All @@ -98,18 +100,21 @@ impl Accounts {
let lookup_table = AddressLookupTable::deserialize(table_account.data())
.map_err(|_ix_err| AddressLookupError::InvalidAccountData)?;

Ok(LoadedAddresses {
writable: lookup_table.lookup(
current_slot,
address_table_lookup.writable_indexes,
slot_hashes,
)?,
readonly: lookup_table.lookup(
current_slot,
address_table_lookup.readonly_indexes,
slot_hashes,
)?,
})
Ok((
LoadedAddresses {
writable: lookup_table.lookup(
current_slot,
address_table_lookup.writable_indexes,
slot_hashes,
)?,
readonly: lookup_table.lookup(
current_slot,
address_table_lookup.readonly_indexes,
slot_hashes,
)?,
},
lookup_table.meta.deactivation_slot,
))
} else {
Err(AddressLookupError::InvalidAccountOwner)
}
Expand Down Expand Up @@ -806,10 +811,13 @@ mod tests {
SVMMessageAddressTableLookup::from(&address_table_lookup),
&SlotHashes::default(),
),
Ok(LoadedAddresses {
writable: vec![table_addresses[0]],
readonly: vec![table_addresses[1]],
}),
Ok((
LoadedAddresses {
writable: vec![table_addresses[0]],
readonly: vec![table_addresses[1]],
},
u64::MAX
)),
);
}

Expand Down
4 changes: 4 additions & 0 deletions bucket_map/src/bucket_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ impl<O: BucketOccupied> BucketStorage<O> {
std::env::current_dir(),
);
});
// Access to the disk bucket files are random (excluding the linear search on collisions),
// so advise the kernel to treat the mmaps as such.
#[cfg(unix)]
mmap.advise(memmap2::Advice::Random).unwrap();
measure_mmap.stop();
stats
.new_file_us
Expand Down
Loading

0 comments on commit 6011adf

Please sign in to comment.