solana/runtime/src
Christian Kamm cf58640937
Keypair: implement clone() (#26248)
* Keypair: implement clone()

This was not implemented upstream in ed25519-dalek to force everyone to
think twice before creating another copy of a potentially sensitive
private key in memory.

See https://github.com/dalek-cryptography/ed25519-dalek/issues/76

However, there are now 9 instances of
  Keypair::from_bytes(&keypair.to_bytes())
in the solana codebase and it would be preferable to have a function.

In particular since this also comes up when writing programs and can
cause users to either start messing with lifetimes or discover the
from_bytes() workaround themselves.

This patch opts to not implement the Clone trait. This avoids automatic
use in order to preserve some of the original "let developers think
twice about this" intention.

* Use Keypair::clone
2022-08-06 11:54:38 -06:00
..
accounts_background_service Add stats for Accounts Background Service (#26298) 2022-06-30 02:21:30 +00:00
accounts_db store_cached takes StorableAccounts to eliminate collect (#26109) 2022-06-22 08:45:03 -05:00
append_vec removes erroneous uses of std::mem::swap (#26536) 2022-07-11 11:33:15 +00:00
bank Removes `AccountSharedData` from `SysvarCache`. (#26712) 2022-07-21 18:32:28 +02:00
serde_snapshot Refactor: Add `RuntimeConfig` field to Bank (#26946) 2022-08-05 20:49:00 +01:00
snapshot_utils Support lz4 for snapshot archives (#25089) 2022-05-16 12:44:15 -05:00
account_info.rs account_info.rs: docs offset is reduced_offset * ALIGN_BOUNDARY_OFFSET (#25848) 2022-06-10 16:19:53 -05:00
account_overrides.rs Extended interface for AccountOverrides (#25964) 2022-06-22 15:22:31 -04:00
account_rent_state.rs restricts rent-paying accounts lifetime extension (#26606) 2022-07-15 13:23:37 +00:00
accounts.rs accounts: Don't collect rent on newly created accounts (#26851) 2022-08-02 16:34:34 +02:00
accounts_background_service.rs Make `solana-ledger-tool` run AccountsBackgroundService (#26914) 2022-08-04 15:44:31 -05:00
accounts_cache.rs
accounts_db.rs add 'oldest_root' stat in hash calc (#26896) 2022-08-03 10:02:08 -05:00
accounts_hash.rs add 'oldest_root' stat in hash calc (#26896) 2022-08-03 10:02:08 -05:00
accounts_index.rs Fix ordering for AccountEntry ref_count (#26842) 2022-07-29 15:47:03 -05:00
accounts_index_storage.rs AcctIdx: only advance age on thread 0 (#25943) 2022-06-14 21:43:42 -05:00
accounts_update_notifier_interface.rs Report transaction signature on update account (#25726) 2022-06-10 10:24:35 -07:00
active_stats.rs move hash stat to correct level for ahv to work (#26649) 2022-07-18 12:44:33 -05:00
ancestors.rs
ancient_append_vecs.rs temporarily make ancient append vecs 10x smaller to find intermittent bugs (#26574) 2022-07-19 08:51:36 -05:00
append_vec.rs Add AppendVec::new_from_file_unchecked (#26795) 2022-07-28 14:57:26 -05:00
bank.rs Refactor: Add `RuntimeConfig` field to Bank (#26946) 2022-08-05 20:49:00 +01:00
bank_client.rs Clean up feature preventing new rent-paying accounts (#26000) 2022-06-16 15:35:25 -06:00
bank_forks.rs Concurrent slot replay (#26465) 2022-07-28 11:33:19 -07:00
bank_utils.rs Do not exclude failed simple vote transactions from consensus 2022-06-12 22:11:23 -07:00
block_cost_limits.rs
blockhash_queue.rs Refactor: Rename BlockhashQueue fields and methods for clarity (#24426) 2022-04-21 11:57:17 +08:00
bucket_map_holder.rs add comment (#26875) 2022-08-01 14:25:19 -05:00
bucket_map_holder_stats.rs add stats for disk_index_find_entry_mut_us (#26753) 2022-07-25 14:47:17 -05:00
builtins.rs Change get_pubkeys to match the new enum (#26177) 2022-06-23 11:56:09 -05:00
cache_hash_data.rs check file size of accounts cache mmap before indexing (#25077) 2022-05-10 13:33:22 -05:00
cache_hash_data_stats.rs
commitment.rs Set the correct root in block commitment cache initialization (#22750) 2022-01-27 00:48:00 +08:00
contains.rs
cost_model.rs Use consistent naming for compute unit limit (#25229) 2022-05-18 13:14:31 +08:00
cost_tracker.rs forward packets by prioritization in desc order (#25406) 2022-07-05 23:24:58 -05:00
epoch_stakes.rs Refactor: Add get_delegated_stake method to VoteAccounts (#26221) 2022-06-25 16:41:35 +00:00
execute_cost_table.rs Use consistent naming for compute unit limit (#25229) 2022-05-18 13:14:31 +08:00
expected_rent_collection.rs preserves rent_epoch for rent exempt accounts (#26479) 2022-07-08 20:04:08 +00:00
genesis_utils.rs Keypair: implement clone() (#26248) 2022-08-06 11:54:38 -06:00
hardened_unpack.rs Add streaming_unpack_snapshot to send entry files during unpack (#26781) 2022-07-26 14:09:28 -05:00
in_mem_accounts_index.rs in mem acct idx scan multiple ages simultaneously (#26853) 2022-08-03 13:44:01 -05:00
inline_spl_associated_token_account.rs token: Add features for new program releases (#24742) 2022-04-28 23:43:57 +02:00
inline_spl_token.rs token: Add features for new program releases (#24742) 2022-04-28 23:43:57 +02:00
inline_spl_token_2022.rs rpc: Support token-2022 in token-specific calls (#25150) 2022-05-17 21:02:43 +02:00
lib.rs async hash verify on load (#26208) 2022-07-15 14:29:56 -05:00
loader_utils.rs Add size_of const fns for upgradeable loader states (#25131) 2022-05-11 22:22:59 +08:00
message_processor.rs Cleanup: `record_instruction_in_transaction_context_push` (#26658) 2022-07-21 12:49:34 +02:00
non_circulating_supply.rs Update non-circulating supply list (#24817) 2022-04-29 02:57:54 +00:00
nonce_keyed_account.rs Feature: Early verification of account modifications in `BorrowedAccount` (#25899) 2022-07-15 09:31:34 +02:00
pubkey_bins.rs
read_only_accounts_cache.rs load_account_into_read_cache (#25760) 2022-06-03 13:34:17 -05:00
rent_collector.rs preserves rent_epoch for rent exempt accounts (#26479) 2022-07-08 20:04:08 +00:00
rent_paying_accounts_by_partition.rs protect access to rent paying account vec (#26919) 2022-08-05 08:19:46 -05:00
rolling_bit_field.rs removes erroneous uses of std::mem::swap (#26536) 2022-07-11 11:33:15 +00:00
runtime_config.rs Refactor: Add `RuntimeConfig` field to Bank (#26946) 2022-08-05 20:49:00 +01:00
secondary_index.rs log secondary index contents on startup (#24348) 2022-04-15 13:30:03 -05:00
serde_snapshot.rs Refactor: Add `RuntimeConfig` field to Bank (#26946) 2022-08-05 20:49:00 +01:00
shared_buffer_reader.rs removes erroneous uses of std::mem::swap (#26536) 2022-07-11 11:33:15 +00:00
snapshot_archive_info.rs
snapshot_config.rs Add options to store full and/or incremental snapshots in separate locations (#24247) 2022-05-10 16:37:41 -04:00
snapshot_hash.rs
snapshot_minimizer.rs Refactor: add account_iter api for appendvec (#26591) 2022-07-12 23:56:05 +00:00
snapshot_package.rs clean up and optimize account hash verify (#26560) 2022-07-12 19:27:28 +00:00
snapshot_utils.rs Refactor: Add `RuntimeConfig` field to Bank (#26946) 2022-08-05 20:49:00 +01:00
sorted_storages.rs SortedStorages::max_slot_inclusive() (#25153) 2022-05-12 10:24:03 -05:00
stake_account.rs uses OnceCell instead of RwLock+Once to cache vote-state in vote-account (#26257) 2022-06-29 11:45:53 +00:00
stake_history.rs Fix derive_partial_eq_without_eq clippy lint 2022-05-22 22:22:21 -07:00
stake_weighted_timestamp.rs Clean up warp-timestamp features (#25994) 2022-06-15 14:11:41 -06:00
stakes.rs removes RwLock+Once in favor of OnceCell in caching staked-nodes (#26313) 2022-06-29 22:22:22 +00:00
static_ids.rs Add static vector to get all static ids in runtime (#25909) 2022-06-13 13:21:16 -05:00
status_cache.rs Add StatusCache::root_slot_deltas() and use it (#26170) 2022-06-23 15:19:06 -05:00
storable_accounts.rs add StorableAccountsMovingSlots (#24555) 2022-04-21 15:48:20 -05:00
system_instruction_processor.rs Feature: Early verification of account modifications in `BorrowedAccount` (#25899) 2022-07-15 09:31:34 +02:00
transaction_batch.rs Unset needs_unlock for rebatched transactions batches (#25095) 2022-05-10 13:39:08 -07:00
transaction_error_metrics.rs Move error counters to be reported by leader only at end of slot (#24581) 2022-04-23 18:10:47 -05:00
verify_accounts_hash_in_background.rs async hash verify on load (#26208) 2022-07-15 14:29:56 -05:00
vote_account.rs removes RwLock+Once in favor of OnceCell in caching staked-nodes (#26313) 2022-06-29 22:22:22 +00:00
vote_parser.rs Compact vote state updates to reduce block size (#26616) 2022-07-27 13:23:44 -06:00
vote_sender_types.rs
vote_transaction.rs Fix derive_partial_eq_without_eq clippy lint 2022-05-22 22:22:21 -07:00
waitable_condvar.rs Change `WaitableCondvar`'s mutex to hold `()` (#25857) 2022-06-09 09:03:22 -05:00