Commit Graph

78 Commits

Author SHA1 Message Date
b8837c04ec Reformat imports to a consistent style for imports
rustfmt.toml configuration:
  imports_granularity = "One"
  group_imports = "One"
2021-12-03 09:19:13 -08:00
785fcb63f5 Remove support for dynamically loaded native programs (#20444) 2021-10-06 14:53:23 -07:00
8fee9a2e1a Dont call precompiled programs (#19930) 2021-09-29 06:25:08 +00:00
73aa004c59 stake: Remove v2 program references (#19308)
* stake: Remove v2 program references

* Remove stake v2 feature, along with stake rewrite
2021-08-20 01:08:44 -04:00
5fb6b341c4 Handle cleaning of zero-lamport accounts w.r.t. Incremental Snapshots (#18870)
* Handle cleaning zero-lamport accounts

Handle cleaning zero-lamport accounts in slots higher than the last full
snapshot slot.  This is part of the Incremental Snapshot work.

Fixes #18825
2021-08-12 15:56:08 -05:00
41f4973f0d accounts default refactoring stragglers (#19097) 2021-08-06 12:36:42 -05:00
14361906ca for all tests, bank::new -> bank::new_for_tests (#19064) 2021-08-05 08:42:38 -05:00
6a995f5dfd rename to AccountsDb::new_single_for_tests (#19039) 2021-08-04 11:47:11 -05:00
6514096a67 chore: cargo +nightly clippy --fix -Z unstable-options 2021-06-18 10:42:46 -07:00
1b1d34da59 Refactor stake program into solana_program (#17906)
* Move stake state / instructions into solana_program

* Update account-decoder

* Update cli and runtime

* Update all other parts

* Commit Cargo.lock changes in programs/bpf

* Update cli stake instruction import

* Allow integer arithmetic

* Update ABI digest

* Bump rust mem instruction count

* Remove useless structs

* Move stake::id() -> stake::program::id()

* Re-export from solana_sdk and mark deprecated

* Address feedback

* Run cargo fmt
2021-06-15 18:04:00 +02:00
8f5e773caf system-program: Remove zero lamport check on transfers (#17726)
* system-program: Move lamports == 0 check on transfers

* Address feedback

* Update stake split to explicitly allocate + assign

* Update stake tests referring to split instruction

* Revert whitespace

* Update split instruction index in test

* Remove unnecessary `assign_with_seed` from `split_with_seed`

* Fix stake instruction parser

* Update test to allow splitting into account with lamports
2021-06-06 01:45:45 +02:00
98f1b11edd Ancestors to HashSet: From(Vec) (#17447)
* ancestors.large_range_slots becomes HashSet

* Ancestors to HashSet: From(Vec)
2021-05-25 11:01:11 -05:00
0486df02ba don't limit to thread pool when cleaning on startup (#17317) 2021-05-20 14:36:35 -05:00
a9aa533684 replace Ancestors HashMap for performance (#16477)
* replace Ancestors HashMap for performance

* add ancestors module
2021-05-20 10:11:56 -05:00
ed9cbd50f0 move Ancestors to its own module (#17316) 2021-05-19 11:50:34 -05:00
541aa5ad85 tests: lamports -> lamports() (#16982) 2021-05-03 10:45:54 -05:00
763c04adf3 lamports = -> .set_lamports() (#16980) 2021-04-30 21:17:05 +00:00
3fdbaefaa6 tests: lamports -= to checked_sub (#16843) 2021-04-27 09:12:48 -05:00
69cbad0869 some ReadableAccount changes (#16688)
* some ReadableAccount changes

* deref
2021-04-21 12:20:37 -05:00
d747614b27 Account for possibility of cache flush in load() (#15454)
* Account for possibility of cache flush in load()

* More cleaning

* More cleaning

* Remove unused method and some comment cleaning

* Fix typo

* Make the detected impossible purge race panic()!

* Finally revert to original .expect()

* Fix typos...

* Add assertion for max_root for easier reasoning

* Reframe races with LoadHint as possible opt.

* Fix test

* Make race bug tests run longer for less flaky

* Delay the clone-in-lock slow path even for RPC

* Make get_account panic-free & add its onchain ver.

* Fix rebase conflicts...

* Clean up

* Clean up comment

* Revert fn name change

* Fix flaky test...

* fmt...

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-04-17 00:23:32 +09:00
17aa45fad1 Remove old way of account hashing
Account data hashing used to use different ways of hashing on different
clusters.  That is no longer the case, but the old code still existed.
This commit removes that old, now used code.

**NOTE** The golden hash values in bank.rs needed to be updated.  Since
the original code that selected the hash algorithm used `if >` instead
of `if >=`, this meant that the genesis block's hash _always_ used the
old hashing method, which is no longer valid.

Validated by running `cargo test` successfully.
2021-04-13 14:42:21 -05:00
8a3135d17b Account->AccountSharedData (#15691) 2021-03-09 15:06:07 -06:00
5df36aec7d Pacify clippy 2021-02-19 20:08:41 -08:00
7f7370c306 Re-allow clippy::integer_arithmetic at crate-level 2021-02-17 13:55:08 -07:00
6dfad0652f Cache account stores, flush from AccountsBackgroundService (#13140) 2021-01-11 17:00:23 -08:00
1c61d005b5 Re-enable shrink test (#14331) 2020-12-30 08:25:45 -08:00
89b474e192 Fix slow/stuck unstaking due to toggling in epoch (#13501)
* Fix slow/stuck unstaking due to toggling in epoch

* nits

* nits

* Add stake_program_v2 feature status check to cli

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2020-11-11 14:11:57 -07:00
bc62313c66 Allow feature builtins to overwrite existing builtins (#13403)
* Allow feature builtins to overwrite existing builtins

* Add feature_builtin ActivationType

* Correctly retain idempotent for replacing case

* Fix test

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2020-11-05 15:37:07 +00:00
c458d4b213 move Account to solana-sdk (#13198) 2020-10-28 22:01:07 -07:00
959880db60 Remove unused pubkey::Pubkey imports 2020-10-21 19:08:13 -07:00
7bc073defe Run codemod --extensions rs Pubkey::new_rand solana_sdk::pubkey::new_rand 2020-10-21 19:08:13 -07:00
7ade330b23 Rename Client methods to match proposed BanksClient (#10793) 2020-06-25 03:35:38 +00:00
1c498369b5 Remove fee-payer guesswork from Message and Transaction (#10776)
* Make Message::new_with_payer the default constructor

* Remove Transaction::new_[un]signed_instructions

These guess the fee-payer instead of stating it explicitly
2020-06-24 14:52:38 -06:00
36a36d1c83 No longer allow create-account to add funds to an existing account (#10192)
automerge
2020-05-22 16:39:01 -07:00
58ef02f02b 9951 clippy errors in the test suite (#10030)
automerge
2020-05-15 09:35:43 -07:00
eb1acaf927 Remove archiver and storage program (#9992)
automerge
2020-05-14 18:22:47 -07:00
894549f002 Put empty accounts in the accounts list on load (#9840)
Indexing into accounts array does not match account_keys otherwise.
Also enforce program accounts not at index 0
Enforce at least 1 Read-write signing fee-payer account.
2020-05-01 17:23:33 -07:00
efad193180 Make default programs static (#9717) 2020-04-27 21:05:12 -07:00
a6ad660e5e Merge stake::withdraw instructions (#9617) 2020-04-20 18:16:50 -06:00
ad0482be73 Revert "Add native loader entry points (#9275)" Breaks genesis_config abi (#9377)
This reverts commit ed86d8d1fc.
2020-04-08 14:36:18 -07:00
ed86d8d1fc Add native loader entry points (#9275) 2020-04-03 17:40:59 -07:00
e28368ff1b Move address creation with seed into pubkey (#8991) 2020-03-20 15:20:48 -07:00
f78a90bce2 Vote InitializeAccount and UpdateNode instructions now need a signature from the validator identity (#8947)
automerge
2020-03-19 01:58:52 -07:00
6eb4973780 Don't use move semantics if not needed (#8793) 2020-03-11 14:37:23 -07:00
d821fd29d6 Add versioning (#8348)
automerge
2020-02-25 17:12:01 -08:00
ab361a8073 Rename KeypairUtil to Signer (#8360)
automerge
2020-02-20 13:28:55 -08:00
e8124324ff Support transaction signing by heterogenous lists of keypairs (#8342)
automerge
2020-02-20 12:13:23 -08:00
83718a3b3e Cleanup runtime use syntax (#8002) 2020-01-28 17:03:20 -08:00
c95e5346a4 Boot the mut (#7926) 2020-01-22 17:54:06 -08:00
ce70d6eedc Add redeem_vote_credits to runtime (#7910)
* Move redeem_vote_credits into runtime

* fixup

* test

* move stake manipulation to stake program

* chugga for less indentation
2020-01-22 12:21:31 -08:00