Commit Graph

2550 Commits

Author SHA1 Message Date
Tao Zhu
6587dbfa47 use EMA in place of Welford 2022-02-08 16:18:23 -06:00
Tao Zhu
a25ac1c988 - estimate a program cost as 2 standard deviation above mean
- replaced get_average / get_mode with get_default to assign max units to unknown program
2022-02-08 16:18:23 -06:00
Jeff Washington (jwash)
86cf226395 eliminate separate max root member (#22943) 2022-02-08 09:31:32 -06:00
Brooks Prumo
f0f4042680 Put accounts data len updates behind feature gate (#22918) 2022-02-08 08:51:16 -06:00
Jeff Washington (jwash)
b2e475b5c4 clarify that RollingBitField max is exclusive (#22947) 2022-02-07 13:40:31 -06:00
Jeff Washington (jwash)
a160fc30f2 make max_roots_inclusive clear (#22942) 2022-02-07 13:26:53 -06:00
Justin Starry
ba215e94f6 Refactor: Add AccountKeys struct for static and dynamic message keys (#22960) 2022-02-05 20:00:31 +08:00
Alexander Meißner
660f6981c6 Cleanup: TransactionContext (#22910)
* Adds BorrowedAccount::check_sysvar().

* Adds BorrowedAccount::get_data_mut().

* Implements account resizing in BorrowedAccount.

* Exposes is_signer() and is_writable() in InstructionContext.

* Removes AccountMeta and get_instruction_accounts_metas().

* Makes throwing errors in BorrowedAccount optional.

* Removes result return values from BorrowedAccount.
2022-02-03 17:19:42 +01:00
Alexander Meißner
c16cf9cf8a Refactor: Use SysvarCache in all builtin programs (#22864)
* Replaces from_keyed_account() by SysvarCache in stake instruction.

* Replaces from_keyed_account() by SysvarCache in system instruction processor.

* Removes from_keyed_account().
Moves check_sysvar_keyed_account() into sysvar_cache.rs

* Removes tests which test for incorrectly serialized sysvars.
2022-02-03 13:03:50 +01:00
Justin Starry
60af1a4cce Refactor: Add trait for loading addresses (#22903) 2022-02-03 11:00:12 +00:00
Jack May
cc94a93b56 Safer invoke context (#22898)
* Safer invoke context

* feedback and rebase with master
2022-02-03 02:34:51 -08:00
carllin
bd1850df25 Return actual committed transactions from process_transactions() (#22802) 2022-02-03 03:56:36 -05:00
Jack May
ab02dba96f Add get_processed_sibling_instruction syscall (#22859) 2022-02-02 16:45:57 -08:00
Will Hickey
75563f6c7b Reject close of active vote accounts (#22651)
* 10461 Reject close of vote accounts unless it earned no credits in the previous epoch. This is checked by comparing current epoch (from clock sysvar) with the most recent epoch with credits in vote state.
2022-02-02 14:16:24 -06:00
Brooks Prumo
fb0e71946f Cleanup use declaration (#22875) 2022-02-01 23:34:11 +00:00
Brooks Prumo
22f6db2e4f Cleanup serde snapshot common.rs (#22854) 2022-02-01 05:39:53 -06:00
Jack May
551c24da57 nit: consistent name (#22857) 2022-02-01 07:46:04 +00:00
Jeff Washington (jwash)
d60dac9749 add comment (#22846) 2022-01-31 11:40:19 -06:00
Jeff Washington (jwash)
fb95fa68a2 cleanup api (#22845) 2022-01-31 11:39:23 -06:00
Alexander Meißner
bc800a8d5a Refactor: Unify SysvarCache (#22843)
* Unifies SysvarCache filling in the runtime and tests.
Removes new_mock_with_sysvars_and_features()
Removes mock_process_instruction_with_sysvars().
Replaces from_keyed_account() by SysvarCache in vote processor.

* Replaces from_keyed_account() by SysvarCache in BPF loader.
2022-01-31 17:53:50 +01:00
dependabot[bot]
cc74693176 chore: bump serde from 1.0.134 to 1.0.136 (#22817)
* chore: bump serde from 1.0.134 to 1.0.136

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.134 to 1.0.136.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.134...v1.0.136)

---
updated-dependencies:
- dependency-name: serde
  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-01-28 12:20:37 -07:00
carllin
94a5aee484 Add new_from_parent() timings (#22744) 2022-01-27 20:35:13 -05:00
Jeff Washington (jwash)
89c42ebcbe refactor rent collection (#22803) 2022-01-27 18:48:04 -06:00
Jeff Washington (jwash)
350207b05f impl ReadableAccount for LoadedAccount (#22793) 2022-01-27 16:59:30 -06:00
Jeff Washington (jwash)
18d69c8d2b SortedStoragesIter to remove random access requirement (#22713) 2022-01-27 10:25:13 -06:00
Justin Starry
d9c259a231 Set the correct root in block commitment cache initialization (#22750)
* Set the correct root in block commitment cache initialization

* clean up test

* bump
2022-01-27 00:48:00 +08:00
Justin Starry
071e97053f Perf: Reduce write locks on blockhash queue (#22729)
* Perf: Reduce write locks on blockhash queue

* Add comment about thread safety

* Add comment about write starvation
2022-01-26 16:24:27 +08:00
Jeff Washington (jwash)
8b90084ebc fix comment typos (#22723) 2022-01-25 11:10:42 -06:00
Jon Cinque
fc21af4e6e spl-associated-token-account: Add feature for new program (#22648)
* spl-associated-token-account: Add feature for new program

* Address feedback
2022-01-24 22:54:41 +01:00
Michael Vines
6d5bbca630 Pacify clippy 2022-01-21 19:12:57 -08:00
dependabot[bot]
0cf886302d chore: bump serde from 1.0.133 to 1.0.134 (#22650)
* chore: bump serde from 1.0.133 to 1.0.134

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.133 to 1.0.134.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.133...v1.0.134)

---
updated-dependencies:
- dependency-name: serde
  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-01-21 17:14:02 -07:00
Jeff Washington (jwash)
e3915e4b7a add comment (#22636) 2022-01-21 10:51:58 -06:00
Jeff Washington (jwash)
4abf7a7f88 add ActiveStats to track when long running, expensive bg processes are running (#22608) 2022-01-21 10:51:23 -06:00
Brooks Prumo
9977396d8f Remove unused fields from Bank (#22491) 2022-01-21 06:03:41 -06:00
Justin Starry
7d34a7acac Perf: Only check executors cache for executable bpf program ids (#22624)
* Only check executors cache for executable bpf program ids

* switch to native loader check

* clean up tests

* fix tests

* clippy
2022-01-21 18:32:30 +08:00
Jeff Washington (jwash)
0eb488580d minor cleanup (#22610) 2022-01-20 18:11:00 -06:00
Justin Starry
7ba57e7a7c Refactor: move instructions sysvar serialization out of Message (#22544) 2022-01-20 17:33:49 +08:00
Justin Starry
7f20c6149e Refactor: move simple vote parsing to runtime (#22537) 2022-01-20 10:39:21 +08:00
anatoly yakovenko
d343713f61 Optimize packet dedup (#22571)
* Use bloom filter to dedup packets

* dedup first

* Update bloom/src/bloom.rs

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* Update core/src/sigverify_stage.rs

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* Update core/src/sigverify_stage.rs

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* Update core/src/sigverify_stage.rs

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* fixup

* fixup

* fixup

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2022-01-19 13:58:20 -08:00
Alexander Meißner
b448472037 Refactor: Move InstructionRecorder into TransactionContext (#22578)
* Moves InstructionRecorder into TransactionContext.

* Adds assertions for number_of_instructions_at_transaction_level.
2022-01-19 22:40:09 +01:00
Justin Starry
cc76a73c49 Refactor: move compute budget runtime logic into solana-program-runtime (#22543) 2022-01-17 20:48:00 +08:00
Justin Starry
2c38a9213f Revert "Refactor: move compute budget runtime logic into solana-program-runtime (#22533)" (#22542)
This reverts commit b27976626a.
2022-01-17 17:43:17 +08:00
Justin Starry
b27976626a Refactor: move compute budget runtime logic into solana-program-runtime (#22533) 2022-01-17 15:52:33 +08:00
Brooks Prumo
6edeed888d Remove unnecessary & from AsRef params (#22523) 2022-01-15 04:51:05 +00:00
Brooks Prumo
70633b5c2f Add Bank::accounts_data_len to SetRootMetrics (#22509) 2022-01-14 20:00:07 -06:00
Tao Zhu
a724fa2347 Add hidden cli option to allow validator reports replayed transaction cost metrics (#22369)
* add hidden cli option to allow validator reports replayed transaction cost detail metrics

* Update validator/src/main.rs

Co-authored-by: Michael Vines <mvines@gmail.com>

* - rebase master, using unbounded instead of channel; dowgrade to datapoint_trace

* removed cli arg, prefer log at trace

Co-authored-by: Michael Vines <mvines@gmail.com>
2022-01-15 00:31:21 +00:00
Jeff Washington (jwash)
7d7228c356 cleanup assert (#22495) 2022-01-14 11:53:24 -06:00
Tao Zhu
9c9f2dd5bd port counting vote CUs to block cost (#22477) 2022-01-14 10:50:29 -06:00
Justin Starry
cddab635ff Cleanup activated rent_for_sysvars feature (#22454) 2022-01-14 20:34:09 +08:00
Justin Starry
ae6c511f13 Refactor: Split vote_instruction.rs into multiple files (#22502) 2022-01-14 17:25:15 +08:00