Jack May
ee0a80a092
Prevent bpf loader impersonators ( #14278 )
2020-12-24 03:04:48 +00:00
Jack May
b1d702a618
Don't use caller passed executable account ( #14276 )
2020-12-23 14:34:14 -08:00
Jack May
5945305b1d
Save cloning program account data ( #14251 )
2020-12-23 10:18:14 -08:00
Trent Nelson
5b903318b2
vote: Add helper for creating current-versioned states
2020-12-22 19:37:26 -07:00
Trent Nelson
3881ae10fb
Deinitialize nonce data upon zero balance
2020-12-22 19:37:26 -07:00
behzad nouri
a14cfd660a
removes &Arc<Self> receivers ( #14234 )
2020-12-22 23:51:53 +00:00
Tyera Eulberg
c276513b84
Ignore long/hanging test ( #14261 )
2020-12-22 16:13:03 -07:00
Tyera Eulberg
7042f11791
Feature-gate stake-program-v3 ( #14232 )
...
* Remove deprecated legacy stake program
* Add legacy stake program
* Strip out duplicative legacy code
* Feature-deploy stake-program-v3
* Add ownership check in stake processor
2020-12-22 11:20:38 -07:00
Jack May
ab205b682a
Upgradeable programs called same as non-upgradeable ( #14239 )
...
* Upgradeable programs called same as non-upgradeable
* nudge
2020-12-22 09:26:55 -08:00
sakridge
baa9602411
Add shrink paths ( #14238 )
2020-12-21 21:33:37 -08:00
behzad nouri
7b08cb1f0d
improves performance in replay-stage ( #14217 )
...
bank::vote_accounts returns a hash-map which is slow to iterate, but all uses
only require an iterator:
https://github.com/solana-labs/solana/blob/b3dc98856/runtime/src/bank.rs#L4300-L4306
Similarly, calculate_stake_weighted_timestamp takes a hash-map whereas it only
requires an iterator:
https://github.com/solana-labs/solana/blob/b3dc98856/sdk/src/stake_weighted_timestamp.rs#L21-L28
2020-12-21 19:18:19 +00:00
Michael Vines
93ae177503
Do not delete ALL other snapshots before downloading a new snapshot
2020-12-21 08:58:52 +00:00
Tyera Eulberg
e15f95a36f
Fix timestamp handling on ledger warp ( #14210 )
...
* Reset timestamp for slot and epoch-start on warp
* Fix genesis timestamp metric source
* Remove check that timestamp > unix_timestamp_from_genesis
Default to previous timestamp, not genesis timestamp
* Move timestamp metrics to report even on warp
* Initialize slot 0 timestamps correctly
* Add feature gate to warp testnet timestamp
* Review suggestion: simplify warp-timestamp slot check
2020-12-20 21:36:56 +00:00
Jack May
e8cc0bef6c
Add CPI support for upgradeable loader ( #14193 )
2020-12-17 15:39:49 -08:00
behzad nouri
d6d76219b6
caches staked nodes computed from vote-accounts ( #13929 )
2020-12-17 21:22:50 +00:00
Michael Vines
efc091e28a
Add transactionCount field to GetEpochInfo
2020-12-17 12:29:50 -08:00
carllin
75e9e321de
Fix race between setting tick height and calculating accounts hash ( #14101 )
...
Co-authored-by: Carl Lin <carl@solana.com>
2020-12-15 12:45:40 -08:00
Michael Vines
1e977ac025
Bump version to v1.6.0
2020-12-15 18:28:04 +00:00
Jack May
d513b0c4ca
Add Program loader/environment instruction errors ( #14120 )
2020-12-15 09:54:07 -08:00
sakridge
53fe0bb5eb
Remove regular expressions, speeds up untar ( #14119 )
2020-12-15 08:48:21 -08:00
sakridge
5294f70189
Remove some non-warnings ( #14115 )
2020-12-14 16:26:17 -08:00
Jack May
9e90394583
Upgradeable loader ( #13689 )
2020-12-14 15:35:10 -08:00
Michael Vines
e907510a1a
clippy
2020-12-14 13:11:50 -08:00
Michael Vines
7143aaa89b
Clippy
2020-12-14 08:03:29 -08:00
Ryo Onodera
de9ac43ebf
Simple cap by including sysvars and native programs ( #13884 )
...
* Simpler cap by including sysvars and native programs
* Fix tests
* Add comment
* revert some unrelated code
* Update test_bank_update_sysvar_account for cap.
* Test cap. for add_native_program using new helper
* Improve the cap adjustment with new tests
* Fix typo...
* Adjust test for improved code coverage
* Rename simpler_capitalization => simple_capitalization
* More rename and bonus commenting
2020-12-14 21:03:24 +09:00
Ryo Onodera
5788e75188
Shrink slots by sparseness of written data size ( #14072 )
2020-12-14 02:58:38 +09:00
dependabot[bot]
88d950e5a8
chore: bump log from 0.4.8 to 0.4.11 ( #13691 )
...
* chore: bump log from 0.4.8 to 0.4.11
Bumps [log](https://github.com/rust-lang/log ) from 0.4.8 to 0.4.11.
- [Release notes](https://github.com/rust-lang/log/releases )
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rust-lang/log/compare/0.4.8...0.4.11 )
Signed-off-by: dependabot[bot] <support@github.com>
* [auto-commit] Update all Cargo lock files
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2020-12-13 13:48:23 +09:00
dependabot[bot]
8df9bcc784
chore: bump libc from 0.2.80 to 0.2.81 ( #14092 )
...
* chore: bump libc from 0.2.80 to 0.2.81
Bumps [libc](https://github.com/rust-lang/libc ) from 0.2.80 to 0.2.81.
- [Release notes](https://github.com/rust-lang/libc/releases )
- [Commits](https://github.com/rust-lang/libc/compare/0.2.80...0.2.81 )
Signed-off-by: dependabot[bot] <support@github.com>
* [auto-commit] Update all Cargo lock files
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2020-12-13 12:13:17 +09:00
carllin
55fc963595
Move slot cleanup to AccountsBackgroundService ( #13911 )
...
* Move bank drop to AccountsBackgroundService
* Send to ABS on drop instead, protects against other places banks are dropped
* Fix Abi
* test
Co-authored-by: Carl Lin <carl@solana.com>
2020-12-13 01:22:34 +00:00
Trent Nelson
edff62af3d
Switch to memmap2 fork
2020-12-11 23:44:03 +00:00
Tyera Eulberg
d6eff3d62c
Filter out stake and vote accounts with incorrect owners ( #14062 )
...
* Add failing test
* Check stake/vote accounts for validity
* Feature gate change
* Add datapoint
* Add test realism
2020-12-11 12:21:25 -07:00
Ryo Onodera
2d3a337200
Increase another snapshot limit: UNPACKED_COUNT ( #14071 )
2020-12-11 11:01:22 +00:00
Ryo Onodera
7078a6ac61
Add more comments in Stakes::store for its subtlety ( #14065 )
...
* Add more comments in Stakes::store for its subtlety
* more comment tweak
2020-12-11 18:13:36 +09:00
Ryo Onodera
09bd412b13
Wrong rpc inflation rate ( #14063 )
...
* Fix wrong inflation calculation in rpc
* Reorder
* Fix test
2020-12-11 07:42:39 +00:00
Michael Vines
0a9ff1dc9d
Initial solana-test-validator command-line program
2020-12-11 04:17:38 +00:00
Jack May
83fda2d972
Clean invoke in prep for native invoke ( #14055 )
2020-12-10 18:25:57 -08:00
Ryo Onodera
164b7895b3
Tiny add_native_program bug fixes with cleanups ( #14042 )
...
* Tiny add_native_program bug fixes with cleanups
* Fix typo
2020-12-11 11:03:31 +09:00
Jack May
7abd8084b6
Add get_minimum_balance_for_rent_excemption to Client ( #14048 )
2020-12-10 16:39:28 -08:00
Jack May
5ea80e673f
Fix priv escalation test ( #14046 )
2020-12-10 22:36:33 +00:00
sakridge
68109a46e0
Lower priority for hashing threads. ( #14043 )
2020-12-10 12:26:47 -08:00
Ryo Onodera
14e241be35
Increase snapshot file size limits ( #14024 )
...
* Increase snapshot file size limits
* Fix test
* Reorder code a bit
2020-12-10 02:46:33 +09:00
Ryo Onodera
28b014ccf4
Add tests for store_account_and_update_capitalization ( #14008 )
2020-12-09 00:46:28 +09:00
Jack May
dca579851c
Cannot change owner if account is executable ( #13977 )
2020-12-07 11:37:07 -08:00
Alexander Meißner
a706706572
Validator CLI option to enable just-in-time compilation of BPF ( #13789 )
...
* Adds a CLI option to the validator to enable just-in-time compilation of BPF.
* Refactoring to use bpf_loader_program instead of feature_set to pass JIT flag from the validator CLI to the executor.
2020-12-07 09:49:55 +01:00
Jack May
882d033233
Don't use stale executor cache ( #13966 )
2020-12-05 05:54:42 +00:00
carllin
5dceddd21d
Remove associated functions on AccountsDb, replace with methods ( #13953 )
...
Co-authored-by: Carl Lin <carl@solana.com>
2020-12-03 17:53:42 -08:00
Trent Nelson
17defbff13
Make `Accounts::is_non_loader_key()` a method on `Message`
2020-12-02 20:10:08 +00:00
Trent Nelson
404fc1570d
runtime: Replace `HashAgeKind` with `NonceRollbackInfo`
2020-12-02 20:10:08 +00:00
Trent Nelson
be7760caa1
accounts: Replace nonce_rollback unreachable block with descriptive panic
2020-12-02 20:10:08 +00:00
Trent Nelson
47af5933ca
accounts: Don't assume fee-payer is the first account
2020-12-02 20:10:08 +00:00
Trent Nelson
8df2a4bac0
runtime: Factor out `DurableNoncePartial` finishing logic and add tests
2020-12-02 20:10:08 +00:00
Michael Vines
73111b005f
Reduce the number of snapshots
2020-12-01 11:13:37 -08:00
Michael Vines
254790f8c8
Fully clean up temporary snapshot staging directories
2020-11-30 19:40:06 -08:00
behzad nouri
e1793e5a13
caches vote-state de-serialized from vote accounts ( #13795 )
...
Gossip and other places repeatedly de-serialize vote-state stored in
vote accounts. Ideally the first de-serialization should cache the
result.
This commit adds new VoteAccount type which lazily de-serializes
VoteState from Account data and caches the result internally.
Serialize and Deserialize traits are manually implemented to match
existing code. So, despite changes to frozen_abi, this commit should be
backward compatible.
2020-11-30 17:18:33 +00:00
Jack May
ce4304cc9a
Add extra checks to verify_and_update ( #13848 )
...
* Add extra checks to verify_and_update
* nudge
2020-11-29 10:06:43 +00:00
Ryo Onodera
6048342c57
Enhance ledger-tool for multi-epoch rewards ( #13837 )
...
* Support ledger-tool for multi-epoch rewards
* nits
* Ensure not to skip some records in csv
2020-11-27 04:20:47 +00:00
carllin
955b99cf69
Fix roots_and_ref_count ( #13827 )
...
Co-authored-by: Carl Lin <carl@solana.com>
2020-11-26 13:09:20 -08:00
Michael Vines
43b82b31e5
More TestValidator cleanup
2020-11-26 08:56:25 +00:00
Michael Vines
b5f7e39be8
TestValidator public interface cleanup
2020-11-25 17:04:37 -08:00
Michael Vines
4ef2da0ff0
Add `solana logs` command
2020-11-25 11:44:41 -08:00
sakridge
b70abdc645
Nonce updates ( #13799 )
...
* runtime: Add `FeeCalculator` resolution method to `HashAgeKind`
* runtime: Plumb fee-collected accounts for failed nonce tx rollback
* runtime: Use fee-collected nonce/fee account for nonced TX error rollback
* runtime: Add test for failed nonced TX accounts rollback
* Fee payer test
* fixup: replace nonce account when it pays the fee
* fixup: nonce fee-payer collect test
* fixup: fixup: clippy/fmt for replace...
* runtime: Test for `HashAgeKind::fee_calculator()`
* Clippy
Co-authored-by: Trent Nelson <trent@solana.com>
2020-11-24 23:53:51 -08:00
Tyera Eulberg
c930f92411
Restore bank feature used to deprecate Rewards sysvar ( #13786 )
2020-11-24 10:22:31 -07:00
Michael Vines
60ce6f1a9b
Truncate logs immediately upon collection. Also reduce limit from 100k to 10k
2020-11-23 17:20:02 -08:00
carllin
791fb17437
Prevent scans on unrooted slots from seeing partial clean ( #13628 )
...
Co-authored-by: Carl Lin <carl@solana.com>
2020-11-20 13:01:04 -08:00
Michael Vines
62fa8b0ed8
Demote bank-process_transactions-error counters to info!
2020-11-20 10:43:07 -08:00
Tyera Eulberg
c75d97e3f2
Add new inflation feature-ids ( #13671 )
...
* Add new inflation feature-ids, and full_inflation default values
* Compute inflation start from full_inflation activation
* Include pico_inflation in inflation start computation
* Add full-inflation constructor
* Align inflation taper with rewards accrual start and catch overflow edge case
2020-11-20 09:54:41 -07:00
Michael Vines
11e92f0c9f
Snapshot archives are now cleaned up when `--snapshot-compression none` is used
2020-11-20 08:41:17 -08:00
Ryo Onodera
b74d7b5758
Fix fragile tests in prep of stake rewrite pr ( #13654 )
...
* Fix fragile tests in prep of stake rewrite pr
* Restore BOOTSTRAP_VALIDATOR_LAMPORTS where appropriate
* Further clean up
* Further clean up
* Aligh with other call site change
* Remove false warn!
* fix ci!
2020-11-20 17:21:03 +09:00
behzad nouri
a8c29505f0
sanitizes bloom filters to avoid division by zero ( #13714 )
...
Pull requests received over the wire can cause a validator to panic
because of division by zero in bloom filters:
https://github.com/solana-labs/solana/blob/af08ba93e/runtime/src/bloom.rs#L86-L88
2020-11-19 23:35:22 +00:00
Ryo Onodera
397cf726fc
Allow GNUSparse for genesis.bin ( #13704 )
2020-11-19 20:29:19 +00:00
Ryo Onodera
43d5e47ea9
Rewrite stake accounts for clear migration ( #13461 )
...
* Reduce overage stake by rewritng stake accounts
* Write tests and finish implemention
* Create and use new feature gate
* Clean up logging
* Fix typo
* Simplify enable_rewrite_stake
* Fix typo...
* Even simplify gating
* Add metrics
2020-11-20 05:15:06 +09:00
carllin
110acd20dc
Check for overflow in rent partition calculation ( #13569 )
...
Co-authored-by: Carl Lin <carl@solana.com>
2020-11-19 04:17:00 -08:00
Tyera Eulberg
645598e615
Improve monitoring of timestamp correction and bounding ( #13656 )
...
* Include rejuvenated field in Clock parsing
* Expand timestamp-correction logging info
2020-11-17 21:51:43 +00:00
carllin
6276360468
Prevent scans from seeing root updates/clean ( #13464 )
...
Co-authored-by: Carl Lin <carl@solana.com>
2020-11-16 17:23:11 -08:00
Ryo Onodera
bcd303a447
ledger-tool cap: delegation owner and stake v2 flag ( #13602 )
...
* Output delegation owner as well
* Add --enable-stake-program-v2
* Small cleanup and add sanity assertion
* Fix typo...
2020-11-15 19:38:46 +00:00
Michael Vines
baa6b3a261
Add stable program logging for BPF and native programs
2020-11-14 08:26:01 -08:00
Ryo Onodera
c97a7d1105
Small cleaning update_epoch_stakes ( #13576 )
2020-11-13 11:16:38 +00:00
joshua-maros
a8a77614fe
Fix potential undefined behavior ( #13555 )
...
* Switch to ouroboros 0.5.1
* Update other lock files
2020-11-13 18:12:41 +09:00
Ryo Onodera
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
carllin
2c2432fddc
Refactor function ( #13294 )
...
Co-authored-by: Carl Lin <carl@solana.com>
2020-11-10 17:20:35 -08:00
Tyera Eulberg
91f4e99b4c
Fix parsing CreateAccountWithSeed instructions ( #13513 )
...
* Reduce required num_system_accounts and handle 2-account instructions properly
* Update CreateAccountWithSeed account docs to be correct
* Add CreateAccountWithSeed test
2020-11-10 23:51:53 +00:00
Tyera Eulberg
c0e2ef06dc
Fix Bank accounts hash mismatch related to Clock::unix_timestamp ( #13477 )
...
* Test for different ancestors with mismatch bank hash
* Test cleanup
* Remove nondeterministic ancestor check
* Update timestamp bounding feature key
* Update design doc
* Filter recent_timestamps to nodes voting within the last epoch
Co-authored-by: Stephen Akridge <sakridge@gmail.com>
2020-11-10 02:10:09 +00:00
Ryo Onodera
a81e7e7749
Output more inflation calc details in ledger-tool ( #13345 )
...
* Output more inflation calc details in ledger-tool
* Fix broken ci...
* Rename confusing variables
* Fix panic by wrapping PointValue with Opiton...
* Minor modifications
* Remove explict needless flush; Drop already does
* Yet another csv field adjustments
* Add data_size and rename epochs to earned_epochs
* Introduce null_tracer
* Unwrap Option in new_from_parent_with_tracer
* Don't shorten identifiers
* Allow irrefutable_let_patterns temporalily
* More null_tracer
* More field adjustments
2020-11-08 16:43:50 +09:00
Tyera Eulberg
1b1d9f6b0c
Feature-gate stake program ( #13394 )
...
* Add legacy stake-program handling
* Strip out duplicative legacy code
* Add feature for stake-program-fix
* Feature-deploy new stake program
* Expand comment
2020-11-06 08:08:11 +00:00
behzad nouri
8f0796436a
shares the lock on gossip when processing prune messages ( #13339 )
...
Processing prune messages acquires an exclusive lock on gossip:
https://github.com/solana-labs/solana/blob/55b0428ff/core/src/cluster_info.rs#L1824-L1825
This can be reduced to a shared lock if active-sets are changed to use
atomic bloom filters:
https://github.com/solana-labs/solana/blob/55b0428ff/core/src/crds_gossip_push.rs#L50
2020-11-05 15:42:00 +00:00
Tyera Eulberg
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
Justin Starry
c24fbb6f8b
Fix duplicate records of inner instructions ( #13380 )
...
* Fix duplicate records of inner instructions
* fix tests
* fix clippy
* Remove bad_inner_instructions
2020-11-05 15:23:52 +08:00
sakridge
43053dcc90
Re-use accounts stores ( #12885 )
...
* Re-use accounts_db stores
Creating files and dropping mmap areas can be expensive
* Add test for storage finder
Can encounter an infinite loop when the store is too small, but
smaller than the normal store size.
* Fix storage finding
* Check for strong_count == 1
* try_recycle helper
2020-11-04 09:17:05 -08:00
Ryo Onodera
b0d1ae1d8b
Comment Stakes::clone_with_epoch ( #13388 )
2020-11-04 11:18:05 +00:00
Ryo Onodera
0e4509c497
Small code cleanup and typo fixes ( #13325 )
...
* Small code cleanup and typo fixes
* Clean up calculate_points_and_credits
2020-11-02 10:28:24 +09:00
sakridge
55b0428ff7
Add store-tool ( #13254 )
2020-11-01 09:41:28 -08:00
Michael Vines
e60bda082d
Adapt to feature::create_account
2020-11-01 05:53:29 +00:00
Tyera Eulberg
4260b3b416
Sample votes from ancestors back to root
2020-10-31 21:30:42 -07:00
Tyera Eulberg
eb2560e782
Prevent block times from ever going backward
2020-10-31 21:30:42 -07:00
Tyera Eulberg
90778615f6
Use bounded timestamp-correction when feature enabled
2020-10-31 21:30:42 -07:00
Tyera Eulberg
80db6c0980
Add bounded timestamp-estimation method
2020-10-31 21:30:42 -07:00
Tyera Eulberg
0049ab69fb
Repurpose unused as Clock::epoch_start_timestamp; add gated update
2020-10-31 21:30:42 -07:00
Michael Vines
4b65e32f22
Move Feature struct to solana-program
2020-10-30 17:57:51 -07:00
Ryo Onodera
bc7133d752
Print the entry type as well when checking archive ( #13312 )
2020-10-31 01:36:12 +09:00
Michael Vines
9263ae1c60
Simplify CPI interface into MessageProcessor
2020-10-30 09:20:09 +00:00