Commit Graph

2578 Commits

Author SHA1 Message Date
7ebf398ed7 AcctIdx: env var "SOLANA_TEST_ACCOUNTS_INDEX_MEMORY_LIMIT_MB" (#23194)
* AcctIdx: env var "SOLANA_TEST_ACCOUNTS_INDEX_MEMORY_LIMIT_MB"

* ignore env var when starting as validator

* Update runtime/src/bucket_map_holder.rs

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

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2022-02-22 09:40:12 -06:00
bcda74f42f Fix builtin handling on epoch boundaries (#23256) 2022-02-22 20:54:08 +08:00
72c68695b5 Do not keep oldest full snapshot 2022-02-21 17:10:31 -07:00
7e08ae1d0c Revert "Add simulation detection countermeasure (#22880)" (#23261)
This reverts commit c42b80f099.
2022-02-21 21:15:37 +00:00
04d23a1597 fix memory ordering in append_vec (#23215) 2022-02-20 20:30:49 -06:00
70ebab2c82 Add rustfmt.toml and cargo fmt (#23238)
* fmt

* formatted

Co-authored-by: Lucas B <buffalu@jito.network>
2022-02-19 13:32:29 +08:00
1719d2349f Skip adding builtins if they will be removed (#23233)
* Add failing test for precompile transition

* Skip adding builtins if they will be removed

* cargo clean

* nits

* fix abi check

* remove workaround

Co-authored-by: Jack May <jack@solana.com>
2022-02-18 18:36:59 -08:00
ee7e411d68 Replaces KeyedAccount by BorrowedAccount in system_instruction_processor. (#23217)
* Adds InstructionContext::check_number_of_instruction_accounts() and InstructionContext::get_instruction_account_key().
Bases check_sysvar_account() on instuction account indices.

* Adds instruction_account_indices enums to system_instruction_processor.

* Reorders parameters and adds InstructionContext.

* Replaces KeyedAccount by BorrowedAccount in system_instruction_processor (part 1).

* Replaces KeyedAccount by BorrowedAccount in system_instruction_processor (part 2).

* Replaces KeyedAccount by BorrowedAccount in system_instruction_processor (part 3).

* Replaces KeyedAccount by BorrowedAccount in system_instruction_processor (part 4).

* Replaces KeyedAccount by BorrowedAccount in system_instruction_processor (part 5).

* Code cleanup
2022-02-19 02:06:33 +01:00
970f543ef6 Precompiles owned by the native loader (#23237) 2022-02-18 15:41:59 -08:00
1a68f81f89 Replaces KeyedAccount by BorrowedAccount in nonce_keyed_account. (#23214)
* Adds get_sysvar_with_account_check2 for ABIv2.

* Replaces get_signers() and get_sysvar_with_account_check() in system_instruction_processor.

* Replaces KeyedAccount by BorrowedAccount in nonce_keyed_account.
2022-02-17 17:36:55 +01:00
da00b39f4f Cleanup: get_program_key() and get_loader_key() in TransactionContext (#23191)
* Moves TransactionContext::get_program_key() to InstructionContext::get_program_key().

* Removes TransactionContext::get_loader_key().

* Test full program and loader executable account chain in BPF loader.
2022-02-17 10:16:28 +01:00
a102453bae accounts_index: Add SPL Token account indexing for token-2022 accounts (#23043) 2022-02-16 16:23:25 -08:00
813725dfec Fix ed25519 builtin program handling (#23182)
* Fix ed25519 builtin program handling

* Fix tests

* Add integration tests for processing transactions with ed25519 ixs

* Fix another test

* fix formatting
2022-02-16 18:48:55 +00:00
c2435363f3 DiskIdx: fix race condition with holding ranges in mem (#23158) 2022-02-16 09:25:00 -06:00
577fa4ec0c Generate full snapshots 4x faster to keep incremental snapshots nice and small 2022-02-15 21:09:21 -08:00
43393ea45d assert on AcctInfo.store_id with cached store (#21952) 2022-02-15 15:22:36 -06:00
197f42d346 chore: bump zstd from 0.9.2+zstd.1.5.1 to 0.10.0+zstd.1.5.2 (#23089)
* chore: bump zstd from 0.9.2+zstd.1.5.1 to 0.10.0+zstd.1.5.2

Bumps [zstd](https://github.com/gyscos/zstd-rs) from 0.9.2+zstd.1.5.1 to 0.10.0+zstd.1.5.2.
- [Release notes](https://github.com/gyscos/zstd-rs/releases)
- [Commits](https://github.com/gyscos/zstd-rs/compare/v0.9.2...v0.10.0)

---
updated-dependencies:
- dependency-name: zstd
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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-02-15 10:56:04 -07:00
c42b80f099 Add simulation detection countermeasure (#22880)
* Add simulation detection countermeasures

* Add program and test using TestValidator

* Remove incinerator deposit

* Remove incinerator

* Update Cargo.lock

* Add more features to simulation bank

* Update Cargo.lock per rebase

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-02-15 13:09:59 +01:00
20bc37c9c9 Removes KeyedAccount in tests of system_instruction_processor. (#23118) 2022-02-15 00:00:49 +01:00
3d9874b95a Add fees to tx-wide caps (#22081) 2022-02-11 16:23:16 -08:00
0a1ab945bc Move cap_accounts_data_len feature gate only around new error (#23048) 2022-02-10 11:57:00 -06:00
47e4291303 add Debug to RentResult (#23044) 2022-02-09 18:07:36 -06:00
226a71f073 Refactor: Use instruction_trace instead of instruction_context_stack (#22988)
* Moves stack_height of the instruction_trace into InstructionContext.

* Uses nesting_level instead of stack_height internally in transaction_context.rs

* Uses the instruction_trace instead of the instruction_context_stack internally.

* Adds feature gate: record_instruction_in_transaction_context_push.
2022-02-09 20:04:49 +01:00
205cd4609b bank::get_rent_collector_from_parent (#23016) 2022-02-09 12:31:58 -06:00
f334931903 rent: refactor test function (#23014) 2022-02-08 22:11:47 -06:00
fb47c1f0a3 consolidate Rent construction in test code (#23018) 2022-02-08 21:51:52 -06:00
869cfc9a1c Return the accounts data len delta after processing messages (#22986) 2022-02-08 19:24:47 -06:00
7aa1fb4e24 1. Persist to blockstore less frequently;
2. reduce alpha for EMA to 1 percent to have roughly 200 data points for estimatio
2022-02-08 16:18:23 -06:00
6587dbfa47 use EMA in place of Welford 2022-02-08 16:18:23 -06:00
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
86cf226395 eliminate separate max root member (#22943) 2022-02-08 09:31:32 -06:00
f0f4042680 Put accounts data len updates behind feature gate (#22918) 2022-02-08 08:51:16 -06:00
b2e475b5c4 clarify that RollingBitField max is exclusive (#22947) 2022-02-07 13:40:31 -06:00
a160fc30f2 make max_roots_inclusive clear (#22942) 2022-02-07 13:26:53 -06:00
ba215e94f6 Refactor: Add AccountKeys struct for static and dynamic message keys (#22960) 2022-02-05 20:00:31 +08:00
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
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
60af1a4cce Refactor: Add trait for loading addresses (#22903) 2022-02-03 11:00:12 +00:00
cc94a93b56 Safer invoke context (#22898)
* Safer invoke context

* feedback and rebase with master
2022-02-03 02:34:51 -08:00
bd1850df25 Return actual committed transactions from process_transactions() (#22802) 2022-02-03 03:56:36 -05:00
ab02dba96f Add get_processed_sibling_instruction syscall (#22859) 2022-02-02 16:45:57 -08:00
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
fb0e71946f Cleanup use declaration (#22875) 2022-02-01 23:34:11 +00:00
22f6db2e4f Cleanup serde snapshot common.rs (#22854) 2022-02-01 05:39:53 -06:00
551c24da57 nit: consistent name (#22857) 2022-02-01 07:46:04 +00:00
d60dac9749 add comment (#22846) 2022-01-31 11:40:19 -06:00
fb95fa68a2 cleanup api (#22845) 2022-01-31 11:39:23 -06:00
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
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
94a5aee484 Add new_from_parent() timings (#22744) 2022-01-27 20:35:13 -05:00