Commit Graph

525 Commits

Author SHA1 Message Date
Michael Vines f385af25e5 Simplify get_programs(), specify a real Preview activation epoch for new BPFLoader 2020-08-31 09:10:25 +00:00
Michael Vines 450c667aa7 Add methods to adjust rent burn percentage, and hashes per tick 2020-08-28 16:35:27 -07:00
Ryo Onodera 57174cdabe
Make ledger-tool accounts print rent_epoch and slot (#11845) 2020-08-27 12:28:40 +09:00
Jack May ea179ad762
Bump compute budget (#11864)
* Bump compute budget

* nudge
2020-08-26 21:48:51 +00:00
Jack May db4bbb3569
Switch programs activation to whole-set based gating (#11750)
* Implement Debug for MessageProcessor

* Switch from delta-based gating to whole-set gating

* Remove dbg!

* Fix clippy

* Clippy

* Add test

* add loader to stable operating mode at proper epoch

* refresh_programs_and_inflation after ancestor setup

* Callback via snapshot; avoid account re-add; Debug

* Fix test

* Fix test and fix the past history

* Make callback management stricter and cleaner

* Fix test

* Test overwrite and frozen for native programs

* Test epoch callback with genesis-programs

* Add assertions for parent bank

* Add tests and some minor cleaning

* Remove unsteady assertion...

* Fix test...

* Fix DOS

* Skip ensuring account by dual (whole/delta) gating

* Fix frozen abi implementation...

* Move compute budget constatnt init back into bank

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2020-08-26 01:49:15 +09:00
Ryo Onodera dbd079f54c
Update comment (#11826) 2020-08-25 22:36:11 +09:00
Jack May 8d362f682b
The constraints on compute power a program can consume is limited only to its instruction count (#11717) 2020-08-21 15:31:19 -07:00
Justin Starry 9e89a963d9 Fully enable cross program support in mainnet-beta 2020-08-18 06:30:43 -07:00
Michael Vines d15173ad9d Address latest nightly clippy lints, but globally disable stable_sort_primitive 2020-08-17 22:36:10 -07:00
Jack May e9b610b8df
Add SystemInstruction::CreateAccount support to CPI (#11649) 2020-08-17 13:38:42 -07:00
Ryo Onodera 23fa84b322
Re-do rent collection check on rent-exempt account (#11349)
* wip: re-do rent collection check on rent-exempt account

* Let's see how the ci goes

* Restore previous code

* Well, almost all new changes are revertable

* Update doc

* Add test and gating

* Fix tests

* Fix tests, especially avoid to change abi...

* Fix more tests...

* Fix snapshot restore

* Align to _new_ with better uninitialized detection
2020-08-17 14:22:16 +09:00
Jack May 7c736f71fe
Make BPF Loader static (#11516) 2020-08-14 12:32:45 -07:00
Ryo Onodera 6c242f3fec
Fix bad rent in Bank::deposit as if since epoch 0 (#10468)
* Fix bad rent in Bank::deposit as if since epoch 0

* Remove redundant predicate

* Rename

* Start to add tests with some cleanup

* Forgot to add refactor code...

* Enchance test

* Really fix rent timing in deposit with robust test

* Simplify new behavior by disabling rent altogether
2020-08-12 00:04:32 +09:00
carllin 7e25130529
Send votes from banking stage to vote listener (#11434)
*  Send votes from banking stage to vote listener

Co-authored-by: Carl <carl@solana.com>
2020-08-07 11:21:35 -07:00
Greg Fitzgerald 3fdd8ffdf0
Remove circular dep between InstructionError and SystemError (#11427) 2020-08-06 22:04:43 +00:00
Jack May 03263c850a
Force program address off the curve (#11323) 2020-08-05 16:35:54 -07:00
Trent Nelson 29b3265dc7 Sanitize transactions during RPC preflight test 2020-08-05 06:06:57 +00:00
Michael Vines 7db144c5da Remove legacy_system_instruction_processor0 2020-08-04 00:45:09 +00:00
Michael Vines eefcf484cb clippy 2020-08-03 18:35:15 +00:00
Greg Fitzgerald 1d2426ddbc
Move simulate_transaction from rpc to bank (#11294) 2020-07-30 19:15:45 +00:00
Jack May 2dbed80e48
Disable cross-program invocations for OperatingMode::Stable (#11272) 2020-07-29 15:29:52 -07:00
Trent Nelson e553a98d2f Rerere-enable RecentBlockhashes fix on testnet (epoch 76) 2020-07-29 02:43:10 +00:00
Michael Vines ed01591be6 Designate mainnet-beta epoch 61 as an upgrade epoch 2020-07-27 11:41:39 -07:00
Trent Nelson 7931579610 Remove accidental MB activation for RecentBlockhashes consistency fix 2020-07-26 17:34:52 +00:00
Trent Nelson 1f8df36b7d Push back activation epochs
Effects:
- Re-enabling inflation
- Nonce FeeCalculator overwrite / RecentBlockhashes sysvar inconsistency fix
2020-07-24 12:54:31 -06:00
Tyera Eulberg ca6480a8ac
Use OrderedIterator in collect_balances (#11166) 2020-07-23 13:35:10 -06:00
Michael Vines a5dd848702 getEpochInfo RPC endpoint now includes the current block height 2020-07-21 17:24:07 -07:00
Rob Walker 7cc2a6801b
fix rewards points (#10914)
* fix rewards points

* fixups

* * verify that we don't spend more in rewards than we've allocated for rewards
* purge f64s from calculations that could be done with integers

* test typical values

* simplify iteration over delegations some

* fixups

* Use try_from

* Add a comment for commission_split()

* Add assertion to detect inconsistent reward dist.

* Fix vote_balance_and_staked

* Don't overwrite accounts with stale copies

* Fix CI...

* Add tests for vote_balance_and_staked

* Add test for the determinism of update_rewards

* Revert "Don't overwrite accounts with stale copies"

This reverts commit 9886d085a69d695f48970f48f2f567e62ba05414.

* Make stake_delegation_accounts to return hashmap

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2020-07-21 13:57:25 +09:00
Ryo Onodera 3db246f596
Add --warp-epoch and --force-inflation to ledger-tool cap. (#11107)
* Add --warp-epoch and --force-inflation to ledger-tool cap.

* Add more arguments

* Address review comments

* Fix message

* Fix various typos...
2020-07-20 19:09:38 +09:00
Michael Vines e5d8c4383f Add Bank support for "upgrade epochs" where all non-vote transactions will be rejected 2020-07-17 08:48:42 -07:00
Tyera Eulberg 1da9f9f05a
Gate nonce-overwrite change (#11081) 2020-07-15 21:45:30 +00:00
Trent Nelson 5741002a32 Mode gate RecentBlockhashes/BlockhashQueue sync 2020-07-14 00:36:31 +00:00
Trent Nelson 51283c931c Fix test advancing banks from incomplete slots 2020-07-14 00:36:31 +00:00
Trent Nelson 837ac77c02 Bump goldens 2020-07-14 00:36:31 +00:00
Trent Nelson 5357ff6d60 Synchronize BlockhashQueue and RecentBlockhashes sysvar update 2020-07-14 00:36:31 +00:00
Trent Nelson 9cc379af6c Factor locked portion of Bank::update_recent_blockhashes() out to helper 2020-07-14 00:36:31 +00:00
Tyera Eulberg 942c019d50 Add failing test 2020-07-14 00:36:31 +00:00
Ryo Onodera de379a8cd6
Ensure to digest non-empty snapshot_storages and add asserts (#11021)
* Add asserts to detect not-digestable example data

* Ensure to digest non-empty snapshot_storages
2020-07-13 15:58:34 +00:00
Kristofer Peterson ed5a2f2a90
Fold bank serialisation into serde snapshot (#10581)
* Move bank (de)serialisation logic from bank and snapshot_utils to serde_snapshot.
Add sanity assertions between genesis config and bank fields on deserialisation.
Atomically update atomic bool in quote_for_specialization_detection().
Use same genesis config when restoring snapshots in test cases.

* Tidy up namings and duplicate structs to version

* Apply struct renames to tests

* Update abi hashes

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2020-07-13 23:00:59 +09:00
Ryo Onodera f1c1152948
Fix skipped slot detection for eager rent collect (#10890) 2020-07-10 08:49:18 +09:00
Tyera Eulberg 25228ca957
Fix nonce fee_calculator overwrite (#10973)
* Add failing test

* Pass fee_calculator to prepare_if_nonce_account; only overwrite in error case
2020-07-09 20:22:21 +00:00
sakridge 6429042b6e
Add --print-account-stats/--snapshot-archive-path arguments to ledger-tool (#10945)
Allows for seeing how the accounts are being stored
and specifying a different snapshot source directory.
2020-07-08 09:32:11 -07:00
sakridge 1269e348fb
Add a way to re-hash the bank (#10765) 2020-07-06 12:42:41 -07:00
Ryo Onodera 39b3ac6a8d
Introduce automatic ABI maintenance mechanism (2/2; rollout) (#8012)
* Introduce automatic ABI maintenance mechanism (2/2; rollout)

* Fix stable clippy

* Change to symlink

* Freeze abi of Tower

* fmt...

* Improve dev-experience!

* Update BankSlotDelta

$ diff -u /tmp/abi8/*7dg6BreYxTuxiVz6aLvk3p2Z7GQk2cJqfGvC9h4FAoSj* /tmp/abi8/*9chBcbXVJ4fK7uGgydQzam5aHipaAKFw6V4LDFpjbE4w*
--- /tmp/abi8/bank__BankSlotDelta_frozen_abi__test_abi_digest_7dg6BreYxTuxiVz6aLvk3p2Z7GQk2cJqfGvC9h4FAoSj      2020-06-18 18:01:22.831228087 +0900
+++ /tmp/abi8/bank__BankSlotDelta_frozen_abi__test_abi_digest_9chBcbXVJ4fK7uGgydQzam5aHipaAKFw6V4LDFpjbE4w      2020-07-03 15:59:58.430695244 +0900
@@ -140,7 +140,7 @@
                                                         field u8
                                                             primitive u8
                                                         field solana_sdk::instruction::InstructionError
-                                                            enum InstructionError (variants = 34)
+                                                            enum InstructionError (variants = 35)
                                                                 variant(0) GenericError (unit)
                                                                 variant(1) InvalidArgument (unit)
                                                                 variant(2) InvalidInstructionData (unit)
@@ -176,6 +176,7 @@
                                                                 variant(31) CallDepth (unit)
                                                                 variant(32) MissingAccount (unit)
                                                                 variant(33) ReentrancyNotAllowed (unit)
+                                                                variant(34) MaxSeedLengthExceeded (unit)
                                                     variant(9) CallChainTooDeep (unit)
                                                     variant(10) MissingSignatureForFee (unit)
                                                     variant(11) InvalidAccountIndex (unit)

* Fix some merge conflicts...
2020-07-06 20:22:23 +09:00
Ryo Onodera cabedc0f36
Remove outdated todo comment (#10850) 2020-06-30 13:43:01 +00:00
Ryo Onodera 50f7ed80c8
Dont skip eager rent collect across gapped epochs (#10206)
* Dont skip eager rent collect across gapped epochs

* Adjust style and comment

* Adjust ascii chart and comment a bit

* Moar assert

* Relax the partition_count assert for completeness

* Tweak comment...

* tweak a bit

* Add gating logic

* Address reviews

* small formatting

* Clarify the code by replacing auto_generated...

* small formatting

* small formatting

* small formatting

* small formatting

* Narrow down conditional compilation scope
2020-06-25 23:11:33 +09:00
Greg Fitzgerald 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
carllin 8bd62d78eb
Fix race in remove_unrooted_slot (#10607)
* Fix race

* clippy fixes

* Rename and add comment

Co-authored-by: Carl <carl@solana.com>
2020-06-15 19:41:26 -07:00
Jack May b6a9573748
Route all loader messages to log collector (#10528) 2020-06-13 13:20:08 -07:00
Ryo Onodera dfe72d5242
Optimize stale slot shrinking for previously cleaned roots (#10099)
* Prioritize shrinking of previously cleaned roots

* measure time of stale slot shrinking

* Disable shrink for test

* shrink: budgeting, store count, force for snapshot

* Polish implementation and fix tests

* Fix ci..

* Clean up a bit

* Further polish implementation and fix/add tests

* Rebase fixes

* Remove unneeded Default for AccountStorageEntry

* Address review comments

* More cleanup

* More cleanup
2020-06-12 14:51:43 +09:00