Commit Graph

2867 Commits

Author SHA1 Message Date
apfitzge 0fffccb4a3
account_info.rs: docs offset is reduced_offset * ALIGN_BOUNDARY_OFFSET (#25848) 2022-06-10 16:19:53 -05:00
ivandzen 2251aa2809
Report transaction signature on update account (#25726)
There's no direct linkage between account-update events and transaction-events

Issue is linked with geyser plugin interface
Currently, there's no straightforward way to determine what notify_transaction call is related to particular update_account call. So, there's no simple way to determine what transaction caused what changes in accounts. This issue is especially valuable in case when several transactions modifies single account in the same slot.

Add txn_signature field to ReplicaTransactionInfo structure

This additional field will contain the signature of transaction which caused this account update event. This modification is not bringing significant overhead because all necessary information for such linkage already available inside Accounts::collect_accounts_to_store method
2022-06-10 10:24:35 -07:00
Brooks Prumo bea35d5fbe
Add ApplyFeatureActivationsCaller enum (#25858) 2022-06-10 10:15:13 -05:00
Brooks Prumo fedd3f26d0
Fix new cost tracker with accounts data size limit (#25843) 2022-06-10 07:39:43 -05:00
behzad nouri b4190319a1
feat(nonce): adds system instruction to upgrade legacy nonce versions (#25789)
https://github.com/solana-labs/solana/pull/25788
permanently disables durable transactions with legacy nonce versions
which are within chain blockhash domain.

This commit adds a new system instruction for a one-time idempotent
upgrade of legacy nonce accounts in order to bump them out of chain
blockhash domain.
2022-06-10 00:04:29 +00:00
behzad nouri 3c1ce3cc93
permanently disables durable nonces with chain blockhash domain (#25788)
https://github.com/solana-labs/solana/pull/25744
separated durable nonce and blockhash domains, which will stop double
execution going forward. However it is possible that a durable
transaction has *already* been executed once as a normal transaction and
it is now a valid durable transaction. #25744 cannot stop such
transactions to be re-executed until the nonce accounts are advanced.

This commit adds a new nonce version indicating that the nonce is moved
out of the blockhash domain, and permanently disables durable
transactions for legacy nonces which are in the blockhash domain.
2022-06-09 15:28:37 +00:00
Brooks Prumo e5f36aa371
Change `WaitableCondvar`'s mutex to hold `()` (#25857) 2022-06-09 09:03:22 -05:00
Justin Starry 6a7edc02c6
Reject durable nonce txs that don't use an advanceable nonce (#25832)
* Reject durable nonce txs that use the latest durable nonce hash

* feedback
2022-06-08 21:34:57 +00:00
Justin Starry b2b426d4bf
Reject durable nonce transactions not signed by authority (#25831) 2022-06-08 14:43:09 -05:00
HaoranYi 40b1655eb5
fix intermittent bucket age test failure (#25841)
* fix double count of account index del stats

* refactor to seperate delete and insert account index stats

* fix test

* increase test timing tolerance for bucket age

* Revert "increase test timing tolerance for bucket age"

This reverts commit 2b91cf902208e4585d25dff1d4298d412c9da516.

* Revert "Revert "increase test timing tolerance for bucket age""

This reverts commit 8f07367b64ddc45a9a693729ea2725895627d14c.
2022-06-08 16:15:49 +00:00
HaoranYi 28142f8a6d
Refactor: separate delete and insert account index stats (#25800)
* fix double count of account index del stats

* refactor to seperate delete and insert account index stats

* fix test

* increase test timing tolerance for bucket age

* Revert "increase test timing tolerance for bucket age"

This reverts commit 2b91cf902208e4585d25dff1d4298d412c9da516.
2022-06-08 09:05:37 -05:00
Brooks Prumo d4e4871c47
Add tests to Bank for accounts data size (#25816) 2022-06-07 18:28:53 +00:00
HaoranYi 05cb25d8da
fix double count of account index del stats (#25797) 2022-06-07 11:50:57 -05:00
apfitzge e6c21a3036
Convert Measure::this to measure! and remove Measure::this (#25776)
* Remove the args param from Measure::this since we don't ever use it

* banking_stage.rs: convert to measure!

* poh_recorder.rs: convert to measure!

* cost_update_service.rs: convert to measure!

* poh_service.rs: convert to measure!

* bank.rs: convert to measure!

* measure.rs: Remove Measure::this now that all have been converted to measure!
2022-06-06 20:21:05 -05:00
Ashwin Sekar 8caced68ce
Serialize lamports per signature (#25364)
* Serialize lamports per signature

* Add full snapshot archive test, enable features in previous tests
2022-06-06 13:07:02 -07:00
Brooks Prumo ec64d5261f
Avoid RMWs on shared data inside parallel loops: collect_rent_from_accounts() (#25790) 2022-06-06 13:32:22 -05:00
Justin Starry 61ad8fcc55
Fix bank executor stats and remove copy-on-write semantics (#25621)
* Fix bank executor stats and remove copy-on-write semantics

* Remove clone implementation for CachedExecutors

* feedback
2022-06-04 13:54:26 +00:00
behzad nouri 9851774133 adds feature gate enabling durable nonce
Previous commit separates durable nonce and blockhash domains with a
feature gate. A 2nd feature added in this commit enables durable nonce
at least one epoch after the 1st feature.
By the time 2nd feature is activated, some nonce accounts will have an
old blockhash, but no nonce account can have a recent blockhash.
As a result no transaction (durable or normal) can be executed twice.
2022-06-04 12:39:31 +00:00
behzad nouri 5ee157f43d separates durable nonce and blockhash domains
AdvanceNonceAccount instruction updates nonce to blockhash. This makes it
possible that a durable transaction is executed twice both as a normal
transaction and a nonce transaction if it uses blockhash (as opposed to nonce)
for its recent_blockhash field.

The commit prevents this double execution by separating nonce and blockhash
domains; when advancing nonce account, blockhash is hashed with a fixed string.
As a result a blockhash cannot be a valid nonce value; and if transaction was
once executed as a normal transaction it cannot be re-executed as a durable
transaction again and vice-versa.
2022-06-04 12:39:31 +00:00
Jeff Washington (jwash) 8b0d5b2485
parallelize rent collection (#25767) 2022-06-03 18:00:02 -05:00
Brooks Prumo edebd7e495
Grab read-lock instead of write-lock in From<PreAllocatedAccountMapEntry<T>> for (Slot, T) (#25770) 2022-06-03 20:48:32 +00:00
Christian Kamm 0da0e0da63
Bank: Batch account stores in collect_rent_eagerly (#25707)
* Bank: Batch account stores in collect_rent_eagerly

Previously store() calls were done one-by-one, which leads to suboptimal
performance.

* Accounts: Remove store_slow_cached()

* clippy

Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
2022-06-03 15:00:39 -05:00
Jeff Washington (jwash) 646bd2e488
extract prefix_from_pubkey (#25766) 2022-06-03 14:03:15 -05:00
Jeff Washington (jwash) a9a94166ef
load_account_into_read_cache (#25760) 2022-06-03 13:34:17 -05:00
sakridge e6e2058758
Increase accounts stack size to 8mb (#25592) 2022-06-03 19:46:01 +02:00
Jeff Washington (jwash) 779ec564e4
add data to assert (#25749) 2022-06-03 09:32:43 -05:00
Jeff Washington (jwash) 7c95ae341d
disk idx: reduce lock calls (#25734)
* disk idx: reduce lock calls

* adjust ordering for count_buckets_flushed
2022-06-02 18:26:08 -05:00
Justin Starry 6fc057c1d9
Remove activated evict_invalid_stakes_cache_entries feature (#25739) 2022-06-02 21:04:54 +00:00
apfitzge ed68c0b889
epoch_stakes_reation -> epoch_stakes_creation in Bank::_new_from_parent (#25660) 2022-06-02 12:26:01 -05:00
carllin eeec3fb9c9
Remove unwrap (#25538) 2022-06-02 12:18:46 -05:00
Jeff Washington (jwash) e8df90c34b
rename count_buckets_flushed (#25733) 2022-06-02 12:16:01 -05:00
Jeff Washington (jwash) ddd0ed0af1
fix ordering in disk idx (#25735) 2022-06-02 11:50:44 -05:00
Jeff Washington (jwash) 96f71c7d4d
add metrics on rent collection pieces (#25713) 2022-06-02 09:08:53 -05:00
Jeff Washington (jwash) d1a6cebaa2
u64 -> duration (#25708) 2022-06-02 07:56:47 -05:00
apfitzge 369ff0858d
Helper functions for getting rent partitions between slots (#25669) 2022-06-01 20:20:44 -05:00
Jeff Washington (jwash) 149a54b786
remove par_iter on update index below threshold (#25699) 2022-06-01 17:41:56 -05:00
Jeff Washington (jwash) 891dcb2084
move rent collection time into datapoint (#25714) 2022-06-01 17:28:47 -05:00
Jeff Washington (jwash) dd0bf4ff4b
add filler accounts gradually with cache flush (#25678) 2022-06-01 15:47:21 -05:00
Trent Nelson b80a82a9e5 runtime: gate nonce disable at restart slot 2022-06-01 12:00:10 -06:00
Trent Nelson 635bd40f09 runtime: disable durable nonces 2022-06-01 11:15:16 -06:00
Jeff Washington (jwash) 905fef29cb
add filter to AppendVecScan (#25664) 2022-06-01 11:55:18 -05:00
Jeff Washington (jwash) 94b0ce5d43
remove_old_historical_roots uses accounts_hash_complete_one_epoch_old (#25673) 2022-06-01 10:45:26 -05:00
Jeff Washington (jwash) c91fbd289f
set active state to shrink_ancient when doing intersting work (#25677) 2022-06-01 10:36:58 -05:00
Jeff Washington (jwash) 8bb76fcd87
add ancient metrics (#25656)
* add ancient metrics

* review feedback
2022-06-01 10:36:23 -05:00
Jeff Washington (jwash) 07958fd8ed
use self.init_accum (#25663) 2022-06-01 08:38:37 -05:00
dependabot[bot] 27978c4d0c
chore: bump flate2 from 1.0.23 to 1.0.24 (#25636)
* chore: bump flate2 from 1.0.23 to 1.0.24

Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.23 to 1.0.24.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/commits)

---
updated-dependencies:
- dependency-name: flate2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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>
2022-05-31 23:15:46 -06:00
Tyera Eulberg 8584a3a331
Add feature to increase timestamp bounding on the slow side to 150% of poh estimate (1s/slot) (#25666) 2022-05-31 16:53:06 -06:00
Jeff Washington (jwash) 5994b4f53f
use object for hash scanning (#25418) 2022-05-31 11:51:56 -05:00
apfitzge 56d38e4954
Add lz4 to snapshot filename regex for matching files on load (#25633)
* Add lz4 to snapshot filename regex for matching files on load

* Add tests for lz4 archive format filenames
2022-05-31 11:06:41 -05:00
steviez 6b2f58152b
Ignore rocksdb directories when unpacking genesis archive (#25575)
Unpacking the rocksdb directory from genesis archive can have unintended
consequences, such as clobbering files in pre-existing rocksdb
directory.
2022-05-31 00:38:45 -05:00
Wei Hu 4b1dd0f921
Fix a possible test hang in runtime::test_shared_buffer_sweep (#25545)
* Fix a possible test hang in runtime::test_shared_buffer_sweep

The test may hang if the total number of threads it wants to start
is greater than the number of threads configured in the rayon
threadpool. Check to avoid this situation from happening.

* Incorporate comment from Xiang Zhu, using std::cmp::min() to simplify the code
2022-05-30 23:39:32 +08:00
Christian Kamm 387d9d9c77 Store missing unupdated executors earlier 2022-05-28 13:42:35 +10:00
carllin 740ee0c502
Fix datapoint name (#25614) 2022-05-28 01:01:29 +00:00
Trent Nelson 4e6b276f6c
bump executor cache max entries (#25600)
* executor-cache: unify `remove` calls

* executor-cache: metrics - add one-hit-wonder counter

* executor-cache: bump max entries to 256
2022-05-28 01:54:10 +10:00
Justin Starry ce14c63bf0
fix: stop double counting execution timings (#25605) 2022-05-28 00:06:29 +10:00
buffalu e58de2c233
Check fee payer before loading all accounts (#25371)
* fix vote account loading

* fix clippy and rename some stuff

* fix bug

Co-authored-by: Justin Starry <justin@solana.com>
2022-05-27 13:44:29 +10:00
Brooks Prumo 7384c41ea7
Speed up bank::tests::test_max_accounts_data_size_exceeded() (#25523) 2022-05-25 22:22:30 -04:00
Justin Starry 26a02f6f59
Add invoke logging to builtin programs that don't have it yet (#25230)
* Refactor process_executor_chain

* Enable builtin program invoke logs by default

* feedback
2022-05-26 07:27:00 +08:00
Alexander Meißner f10c80b49f
Refactor: Rebase offset of `index_in_caller` (#25531)
* Removes the offset InstructionContext::get_number_of_program_accounts() from InstructionAccount::index_in_caller.

* Removes unreachable SyscallError::InvalidLength in orig_data_lens.get().
2022-05-25 13:43:20 +02:00
buffalu 7b98ff1929
Refactor: pull out fee payer balance check (#25519) 2022-05-25 20:44:03 +10:00
Brooks Prumo b7149f7f54
Add helper fn to set accounts_data_size_initial for tests (#25522) 2022-05-25 02:43:54 +00:00
Brooks Prumo 0dd3c6bf1f
Split up accounts data size field (#25495) 2022-05-24 20:26:32 -04:00
Alexander Meißner 2fb096c486
Refactor: Adds `index_in_callee` to `InstructionAccount` (#25490)
* Adds InstructionAccount::index_in_callee

* Adjusts tests and benches.

* Adds documentation for InstructionAccount.

* Adds InstructionContext::is_duplicate()
2022-05-25 00:04:46 +02:00
Justin Starry e66ea7cb6a Clean up Bank::commit_transactions parameters 2022-05-24 20:24:42 +08:00
dependabot[bot] 3566fb5660
chore: bump regex from 1.5.5 to 1.5.6 (#25488)
* chore: bump regex from 1.5.5 to 1.5.6

Bumps [regex](https://github.com/rust-lang/regex) from 1.5.5 to 1.5.6.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.5.5...1.5.6)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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>
2022-05-23 13:45:43 -06:00
Jeff Washington (jwash) bac05dc55a
calc slot info on max slot once per hash calc (#25422) 2022-05-23 10:11:00 -05:00
Jeff Washington (jwash) 41f30a2383
stop logging misleading bank hash mismatch (#25427) 2022-05-23 08:43:25 -05:00
Michael Vines b05c7d91ed Fix derive_partial_eq_without_eq clippy lint 2022-05-22 22:22:21 -07:00
Brooks Prumo f8842032c6
clippy: fix "this let-binding has unit value" warnings (#25429) 2022-05-22 12:17:59 -04:00
Alexander Meißner 7eae98c6d9
Introduces `Result` return types to mutable accessors of `BorrowedAccount` (#25380)
* Introduces result return types to get_data_mut(), set_data() and set_data_length() of BorrowedAccount.

* Introduces result return types to set_owner(), set_lamports() and set_executable() of BorrowedAccount.
2022-05-21 17:47:09 +02:00
Brooks Prumo e9a6d1ecef
clippy: is_digit(10) -> is_ascii_digit() (#25428) 2022-05-21 07:03:11 -05:00
Jeff Washington (jwash) f584b249dd
special case for common case of 1 storage on append vec scan (#25414) 2022-05-20 17:36:30 -05:00
Jack May 851958f77a
Disallow deployment of deprecated _sol_alloc_free syscall (#25179) 2022-05-20 13:19:41 -07:00
Jeff Washington (jwash) cfcc18f7f4
apply AccountsInAppendVec to more places (#25408) 2022-05-20 14:25:46 -05:00
Brooks Prumo a25212b087
Move append_vec::test_utils into its own file (#25407) 2022-05-20 13:37:45 -05:00
Jeff Washington (jwash) 9ef0acdf5d
allow hash calc to use all threads at startup (#25369) 2022-05-20 11:45:01 -05:00
Jeff Washington (jwash) 467431de89
add ledger-tool accounts-db-skip-initial-hash-calc (#25354) 2022-05-20 10:27:00 -05:00
Jeff Washington (jwash) 950245c29b
simulate filler account hash calc time at delta hash (#25387) 2022-05-20 10:20:44 -05:00
Jeff Washington (jwash) 1b4e4ef548
impl squash to ancient append vecs (#24538)
* squash to ancient append vecs

* pr feedback

* clippy
2022-05-20 10:20:17 -05:00
Jeff Washington (jwash) de03a3d3aa
filler accounts get a non-zero rent_epoch (#25386)
* fill accounts get a non-zero rent_epoch

* use snapshot_slot

* get rid of perf simulation code
2022-05-20 09:03:55 -05:00
Jeff Washington (jwash) 3fe7655378
use iterator instead of vec to iterate accounts (#25370)
* user iterator instead of vec to iterate accounts

* rename
2022-05-20 08:50:24 -05:00
Jeff Washington (jwash) 36ed36edf0
use previous epoch's # slots per epoch (#25382) 2022-05-20 08:47:55 -05:00
Michael Vines c54e06355f
voteSubscribe pubsub notification now includes the vote transaction signature (#25291) 2022-05-19 18:28:46 -07:00
Brooks Prumo 021276c955
Move updating accounts data len from execute to commit (#25256) 2022-05-19 12:24:13 -05:00
Jeff Washington (jwash) 0f703b71cc
minor test renaming (#25297) 2022-05-18 12:53:55 -05:00
Jeff Washington (jwash) fe91f40f8a
use previous epoch rent collector in expected rent collection (#25289) 2022-05-18 12:53:45 -05:00
dependabot[bot] 542bd0ec3c
chore: bump rayon from 1.5.2 to 1.5.3 (#25242)
* chore: bump rayon from 1.5.2 to 1.5.3

Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.5.2 to 1.5.3.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/v1.5.2...v1.5.3)

---
updated-dependencies:
- dependency-name: rayon
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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>
2022-05-18 09:39:57 -06:00
Justin Starry a1522d0024
Use consistent naming for compute unit limit (#25229)
* Use consistent naming for compute unit limit

* feedback
2022-05-18 13:14:31 +08:00
Jon Cinque 0820065c98
rpc: Support token-2022 in token-specific calls (#25150)
* rpc: Support token-2022 in token-specific calls

* Address feedback
2022-05-17 21:02:43 +02:00
HaoranYi 85a2e599bb
revert memory map for reading snapshot (#25259) 2022-05-17 09:32:18 -05:00
Jeff Washington (jwash) 2cf7c73ced
cleanup types in tests (#25254) 2022-05-16 15:54:40 -05:00
Jack May 21e066ef26
Merge pull request from GHSA-wxrh-ff9f-fc6w 2022-05-16 12:30:37 -07:00
HaoranYi 3e44046a73
Support lz4 for snapshot archives (#25089)
* add lz4

* add cargo package file

* fix tests

* use fast lz4 compression

* report snapshot archive format

* add test

* code review feedback

* add cargo.lock

* fix var name

* refactor archive format parsing and add default compress cli arg

* clippy

* add from_cli_arg test

* update cargo.lock

* add lz4 support for mmap

* cargo.lock

* clippy
2022-05-16 12:44:15 -05:00
Justin Starry f81c5df1f0
Include account index in rent paying account tx error (#25189) 2022-05-16 23:35:34 +08:00
HaoranYi 389d78e424
Don't use mmarinus package (#25177)
* Revert "Revert "Use memory map to speed up snapshot untar (#24889)" (#25174)"

This reverts commit fc793de2dd.

* not use mmarinus

* enable secondary build

* Revert "enable secondary build"

This reverts commit 5aa43a94bbad59497506f02235597e7adc0dc47b.

* macbuild

* Revert "macbuild"

This reverts commit 0da92945a40dc5431eff4bd91054b407e22418fb.
2022-05-16 08:49:17 -05:00
Tao Zhu b1b3702e6d
Prioritize transactions in banking stage by their compute unit price (#25178)
* - get prioritization fee from compute_budget instruction;
- update compute_budget::process_instruction function to take instruction iter to support sanitized versioned message;
- updated runtime.md

* update transaction fee calculation for prioritization fee rate as lamports per 10K CUs

* review changes

* fix test

* fix a bpf test

* fix bpf test

* patch feedback

* fix clippy

* fix bpf test

* feedback

* rename prioritization fee rate to compute unit price

* feedback

Co-authored-by: Justin Starry <justin@solana.com>
2022-05-16 12:06:33 +08:00
Justin Starry 6c10515ccf
Revert "Serialize lamports per signature in snapshots (#25181)" (#25228)
This reverts commit 35d2a0fd69.
2022-05-15 12:04:17 +00:00
Ashwin Sekar 35d2a0fd69
Serialize lamports per signature in snapshots (#25181)
* Serialize lamports per signature

* pr comments
2022-05-14 10:57:51 -07:00
Ryo Onodera 592aa4c21b
Improve hard fork message with more detail (#25214) 2022-05-15 01:14:23 +09:00
sakridge 3d96a1ab76
Block packets in vote-only mode (#24906) 2022-05-14 17:53:37 +02:00