Commit Graph

22438 Commits

Author SHA1 Message Date
dependabot[bot] 96ef87f976
Bump crossbeam-channel from 0.5.7 to 0.5.8 (#31424)
Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.7 to 0.5.8.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](crossbeam-rs/crossbeam@crossbeam-channel-0.5.7...crossbeam-channel-0.5.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: illia.bobyr@solana.com
2023-05-01 17:39:18 -07:00
dependabot[bot] 021daea9ec
Bump serde from 1.0.159 to 1.0.160 (#31427)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.159 to 1.0.160.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.159...v1.0.160)

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

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: illia.bobyr@solana.com
2023-05-01 17:37:29 -07:00
Brooks 90e1b00fb5
Uses get_bank_snapshot_dir() in `core/tests/snapshot.rs` (#31434) 2023-05-01 22:57:59 +00:00
Brooks fdf7bdae1a
Fixes name of snapshot_utils::get_bank_snapshot_dir() (#31432) 2023-05-01 19:28:35 +00:00
Xiang Zhu 0a2e897f16
Clean up the outdated SnapshotPackage snapshot_links field (#31360)
* Remove snapshot_links

* Change the function name from snapshot_dir to bank_snapshot_dir

* Format fix

* Fix test_concurrent_snapshot_packaging

* Fix clippy error

* Fix nits

* Fix nits 2nd try

* Use get_bank_snapshots_dir

* Use slot_dir

* Revert "Use get_bank_snapshots_dir" because get_bank_snapshots_dir is private to crate

This reverts commit 1ed9b3b2c8e84689a918beee7159f63c56500a96.
2023-05-01 11:24:59 -07:00
Jeff Washington (jwash) 58ce19446f
replace tuple with `VoteReward` struct (#31408) 2023-05-01 10:42:05 -07:00
Pankaj Garg 8eebf64464
Add a second level cache to contain tx batch specific programs (#31413)
* Add a second level cache to contain tx batch specific programs

* fix clippy

* address review comments
2023-05-01 09:09:43 -07:00
steviez 427ad7b5bd
Combine AccountsHashVerifier metrics (#31420)
It is more efficient to submit the metrics together, and there is no
reason for them to be separate.
2023-04-30 21:39:44 -04:00
steviez 1a995ade3f
Combine multiple snapshot_utils metrics (#31406)
Within the contents of snapshot_utils::add_bank_snapshot(), metrics were
being reported in several datapoints and counters. This adds extra
overhead, and makes it harder to correlate fields that correspond to the
same snapshot.

So, combine the counters and multiple datapoints into a single
datapoint.
2023-04-30 16:36:08 -04:00
Illia Bobyr b790c129e0
Cargo.toml: winapi: List used features (#31417)
`winapi` hides every module behind a feature flag, see here:

  https://github.com/retep998/winapi-rs#why-am-i-getting-errors-about-unresolved-imports

`install` was working by accident as for each package, requested
feature set is a superset of all features requested by all packages in
the workspace, and `console` used to list features that `install` needs.
But after a change in `console` we had build breakages.
2023-04-29 01:23:15 -07:00
dependabot[bot] 53e9e8b8d7
Bump syn from 2.0.5 to 2.0.12 (#31388)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.5 to 2.0.12.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](dtolnay/syn@2.0.5...2.0.12)

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

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: illia.bobyr@solana.com
2023-04-28 17:03:50 -07:00
Jeff Biseda b5bb5c6da1
filter invalid repair requests by size (#30951) 2023-04-28 16:57:15 -07:00
Dmitri Makarov aa7baaff29
Save nested traces on syscall context pop in InvokeContext (#31397) 2023-04-28 19:03:45 -04:00
Dmitri Makarov 74bd5f87af
Add minor extensions to Bank API (#31396)
* Make load_program method of Bank public for use in ledger-tool

* Add an accessor method to get a reference to builtin_programs of Bank

* Add a parameter to Bank::load_program to control debugging_features
2023-04-28 19:02:49 -04:00
Xiang Zhu bb95d44328
Check incomplete file flag first (#31409)
* Check incomplete file flag first

* Use the simple is_file call, no need for metadata
2023-04-28 15:44:59 -07:00
Alessandro Decina 117a194b73
Account data direct mapping (#28053)
* AccountSharedData: make data_mut() private

This ensures that the inner Vec is never handed out. This is in
preparation of enforcing that the capacity of the inner vec never
shrinks, which is required for direct mapping.

* Adds the feature bpf_account_data_direct_mapping.

* Remaps EbpfError::AccessViolation into InstructionError::ReadonlyDataModified.

* WIP: Memory regions for each instruction account in create_vm().

* Fix serialization benches, run both copy and !copy variants

* rbpf-cli: fix build

* BorrowedAccount: ensure that account capacity is never reduced

Accounts can be directly mapped in address space. Their capacity can't
be reduced mid transaction as that would create holes in vm address
space that point to invalid host memory.

* bpf_load: run serialization tests for both copy and !copy account data

* bpf_loader: add Serializer::write_account

* fix lints

* BorrowedAccount: make_data_mut is host only

* Fix unused import warning

* Fix lints

* cpi: add explicit direct_mapping arg to update_(callee|caller)_account

* cpi: rename account_data_or_only_realloc_padding to serialized_data

* cpi: add CallerAccount::original_data_len comment

* cpi: add update_callee_account direct_mapping test

* cpi: add test_update_caller_account_data_direct_mapping and fix bug

We used to have a bug in zeroing data when shrinking account, where we zeroed
the spare account capacity but not the realloc padding.

* cpi: add tests for mutated readonly accounts

* cpi: update_caller_account doesn't need to change .serialized_data when direct_mapping is on

* cpi: update_caller_account: ensure that account capacity is always enough

Introduce a better way to ensure that account capacity never goes below what
might be mapped in memory regions.

* cpi: zero account capacity using the newly introduced BorrowedAccount::spare_data_capacity_mut()

Before we were using BorrowedAccount::get_data_mut() to get the base pointer to
the account data, then we were slicing the spare capacity from it. Calling
get_data_mut() doesn't work if an account has been closed tho, since the
current program doesn't own the account anymore and therefore get_data_mut()
errors out.

* bpf_loader: fix same lint for the umpteenth time

* bpf_loader: map AccessViolation to ReadonlyDataModified only for account region violations

* programs/sbf: realloc: add test for large write after realloc

Add a test that after a realloc does a large write that spans the
original account length and the realloc area. This ensures that memory
mapping works correctly across the boundary.

* programs/sbf: run test_program_sbf_realloc with both direct_mapping on and off

By default test banks test with all features on. This ensures we keep
testing the existing code until the new feature is enabled.

* bpf_loader: tweak memcmp syscall

Split the actual memcmp code in a separate function. Remove check
indexing the slices since the slices are guaranteed to have the correct
length by construction.

* bpf_loader: tweak the memset syscall

Use slice::fill, which is effectively memset.

* bpf_loader: syscalls: update mem syscalls to work with non contiguous memory

With direct mapping enabled, accounts can now span multiple memory
regions.

* fix lint, rebase mem_ops

* Implement CoW for writable accounts

* Fix CI

* Move CoW to the MemoryMapping level

* Update after rbpf API change

* Fix merge screwup

* Add create_vm macro. Fix benches.

* cpi: simplify update_caller_account

Simplify the logic to update a caller's memory region when a callee
causes an account data pointer to change (eg during CoW)

* benches/bpf_loader: move serialization out of  create_vm bench

* benches/bpf_loader: don't copy accounts when direct mapping is on

* Fix review nits

* bpf_loader: mem_ops: handle u64 overflow in MemoryChunkIterator::new

When starting at u64::MAX, the chunk iterator would always return the
empty sequence (None on the first next()) call, instead of returning a
memory access violation.

Use checked instead of saturating arithmetic to detect the condition and
error out.

This commit also adds more tests around boundary conditions.

* Fix loader-v3 tests: data_mut => data_as_mut_slice

* Fix CI

* bpf_loader: fix tuner bench: account must be writable

With direct mapping on, invalid writes are caught early meaning the
tuner would fail on the first store and not consume the whole budget
like the benchmark expects.

---------

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
2023-04-29 06:54:39 +10:00
Yihau Chen bd5893907e
ci: fix private pipeline agents (#31407) 2023-04-29 04:23:23 +08:00
Brooks 53dfb9fa41
Gives lifetimes more descriptive names in append_vec.rs (#31403) 2023-04-28 15:32:29 -04:00
Brooks f86dc35471
Fixes lifetimes on AppendVec::get_type() (#31401) 2023-04-28 15:27:22 -04:00
Tyera 7474404539
Fix lockup docs (#31362) 2023-04-28 13:00:47 -06:00
dependabot[bot] 138d6bc305
Bump http from 0.2.8 to 0.2.9 (#31389)
* Bump http from 0.2.8 to 0.2.9

Bumps [http](https://github.com/hyperium/http) from 0.2.8 to 0.2.9.
- [Release notes](https://github.com/hyperium/http/releases)
- [Changelog](https://github.com/hyperium/http/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/http/compare/v0.2.8...v0.2.9)

---
updated-dependencies:
- dependency-name: http
  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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2023-04-28 12:54:37 -06:00
dependabot[bot] 6ac080282d
Bump semver from 1.0.16 to 1.0.17 (#31385)
* Bump semver from 1.0.16 to 1.0.17

Bumps [semver](https://github.com/dtolnay/semver) from 1.0.16 to 1.0.17.
- [Release notes](https://github.com/dtolnay/semver/releases)
- [Commits](https://github.com/dtolnay/semver/compare/1.0.16...1.0.17)

---
updated-dependencies:
- dependency-name: semver
  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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2023-04-28 11:36:44 -06:00
dependabot[bot] 280d70a89f
Bump prost from 0.11.8 to 0.11.9 (#31386)
* Bump prost from 0.11.8 to 0.11.9

Bumps [prost](https://github.com/tokio-rs/prost) from 0.11.8 to 0.11.9.
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.11.8...v0.11.9)

---
updated-dependencies:
- dependency-name: prost
  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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2023-04-28 11:35:35 -06:00
Brennan e79b84ea70
Rework tx sig verify batching (#31355)
* Rework tx sig verify batching to eliminate special casing and increase the packet limit for sigverify from 2k to 5k
2023-04-28 09:21:12 -07:00
Brooks d621b48026
Cleanup usage of AsRef<Path> in snapshot_utils (#31393) 2023-04-28 14:46:57 +00:00
Pankaj Garg 94dc8fed55
Check program modification slots during cold start (#31331) 2023-04-28 06:22:14 -07:00
behzad nouri aafcac27d8
removes pubkey from LegacyContactInfo public interface (#31375)
Working towards LegacyContactInfo => ContactInfo migration, the commit
adds more api parity between the two.
2023-04-28 12:05:15 +00:00
dependabot[bot] 95806c3295
Bump openssl from 0.10.48 to 0.10.51 (#31323)
Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.48 to 0.10.51.
- [Release notes](https://github.com/sfackler/rust-openssl/releases)
- [Commits](sfackler/rust-openssl@openssl-v0.10.48...openssl-v0.10.51)

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

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: illia.bobyr@solana.com
2023-04-27 20:17:58 -07:00
dependabot[bot] 1bb0bb52c1
Bump rustls from 0.20.6 to 0.20.8 (#31367)
Bumps [rustls](https://github.com/rustls/rustls) from 0.20.6 to 0.20.8.
- [Release notes](https://github.com/rustls/rustls/releases)
- [Changelog](https://github.com/rustls/rustls/blob/main/RELEASE_NOTES.md)
- [Commits](rustls/rustls@v/0.20.6...v/0.20.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: illia.bobyr@solana.com
2023-04-27 20:09:28 -07:00
Brooks 6393c7d98d
Removes erroneous Copy on AsRef<Path> params in snapshot_utils (#31382) 2023-04-27 22:45:59 -04:00
dependabot[bot] 18baafbb48
Bump tokio-stream from 0.1.9 to 0.1.12 (#31307)
Bumps [tokio-stream](https://github.com/tokio-rs/tokio) from 0.1.9 to 0.1.12.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](tokio-rs/tokio@tokio-stream-0.1.9...tokio-stream-0.1.12)

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

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: illia.bobyr@solana.com
2023-04-27 19:41:40 -07:00
dependabot[bot] 4909c76ec6
Bump cargo_metadata from 0.15.0 to 0.15.4 (#31368)
Bumps [cargo_metadata](https://github.com/oli-obk/cargo_metadata) from 0.15.0 to 0.15.4.
- [Release notes](https://github.com/oli-obk/cargo_metadata/releases)
- [Changelog](https://github.com/oli-obk/cargo_metadata/blob/main/CHANGELOG.md)
- [Commits](oli-obk/cargo_metadata@0.15.0...0.15.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: illia.bobyr@solana.com
2023-04-27 19:11:29 -07:00
dependabot[bot] bc19918809
Bump csv from 1.1.6 to 1.2.1 (#31366)
Bumps [csv](https://github.com/BurntSushi/rust-csv) from 1.1.6 to 1.2.1.
- [Release notes](https://github.com/BurntSushi/rust-csv/releases)
- [Commits](BurntSushi/rust-csv@1.1.6...1.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: illia.bobyr@solana.com
2023-04-27 19:07:22 -07:00
Xiang Zhu a52f44c342
Use async delete to save time and gracefully handle missing dir (#31380) 2023-04-27 18:13:34 -07:00
Andrew Fitzgerald 6f014710ff
Fix keypair multiplier check (#31374) 2023-04-27 18:00:09 -07:00
Jeff Washington (jwash) 45558f6efe
remove unused metrics (#31377) 2023-04-27 13:26:46 -07:00
Kevin Heavey 7e2b1a885f
delete rpc_banks_service.rs (#31369)
* delete rpc_banks_service.rs

* remove now-unused tokio-stream dep

* run cargo-for-all-lockfiles
2023-04-27 18:26:44 +00:00
Dmitri Makarov e03826b6d8
Refactor ledger-tool moving some of functions to a separate module (#31359)
* Refactor ledger-tool moving some of functions to a separate module

* Rename utils to ledger_utils, move arg parsing funcs to a new module
2023-04-27 14:11:04 -04:00
Tyera 9af7009bb4
Add new CreateVoteAccount instruction-set builders (#31330)
* Add failing test

* Add config struct for vote-account creation

* Add create-vote-account ix builders that use CreateVoteAccountConfig

* Test now passes; add case to demonstrate failure after activation

* Deprecate existing ix builders

* Use new builders in solana-cli

* Query feature status to use correct VoteState size in solana-cli

* Fix tests and clippy warnings

* Improve ugly conditional block
2023-04-27 11:14:39 -06:00
Alexander Meißner 54f1595dfa
Fix - Filter condition in `filter_executable_program_accounts()` (#31371)
* Removes `!tx.message().is_writable(i)` from the filter condition in `filter_executable_program_accounts()`.

* cargo fmt
2023-04-27 18:38:00 +02:00
Kevin Heavey e5223e19c7
remove unused solana-net-utils dep from solana-client (#31372) 2023-04-27 16:14:43 +00:00
Andrew Fitzgerald 99cd1a51f5
Set compute unit limit correctly (#31352) 2023-04-26 18:28:56 -07:00
Ryo Onodera a30830d7a9
ci: treewide: deny used_underscore_binding (#31319)
* Enforce used_underscore_binding

* Fix all

* Work around for cfg()-ed code...

* ci....

* Make clipply fixes more pleasant

* Clone exit signal while intentionally shadowing

* Use more verbose code to avoid any #[allow(...)]s
2023-04-27 10:10:16 +09:00
Brennan 685ebcb3b0
Rework bank to allow RentCollectionCycleParams private (#31361) 2023-04-26 14:48:51 -07:00
dependabot[bot] 6b1980285b
Bump signal-hook from 0.3.14 to 0.3.15 (#31322)
* Bump signal-hook from 0.3.14 to 0.3.15

Bumps [signal-hook](https://github.com/vorner/signal-hook) from 0.3.14 to 0.3.15.
- [Release notes](https://github.com/vorner/signal-hook/releases)
- [Changelog](https://github.com/vorner/signal-hook/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/signal-hook/compare/v0.3.14...v0.3.15)

---
updated-dependencies:
- dependency-name: signal-hook
  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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2023-04-26 14:24:56 -06:00
dependabot[bot] b6e2c83177
Bump serde_json from 1.0.83 to 1.0.96 (#31356)
* Bump serde_json from 1.0.83 to 1.0.96

Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.83 to 1.0.96.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.83...v1.0.96)

---
updated-dependencies:
- dependency-name: serde_json
  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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2023-04-26 13:37:28 -06:00
Brennan a540690778
Move partition logic out of bank (#31343)
* Move partition logic out of bank
2023-04-26 12:37:02 -07:00
Xiang Zhu f3e94ca73c
AHV processes the snapshot dirs in place (#30978)
* AHV processes the snapshot dirs in place

Let account pacakge use the snapshot dir, so AHV computes the accounts hash and turns the pre snapshot dir into a post snapshot dir

* fix status cache path to maintain the archive layout for the in-place snapshot dir archiving

* fix test_package_snapshots

* Fix test_concurrent_snapshot_packaging

* Remove debug change.

* Fix snapshot_links path

* change to borrow for bank_snapshots_dir

* Reverted changes in create_and_verify_snapshot

* Fix param errors

* Fix rebase errors

* Remove NOTE 1

* Remove unwrap

* Remove the variables to make it apparent taht snapshot_links is the bank_snapshots_dir

* Use soft link instead of hard link for snapshot and status cache

* After switching to soft symlinking, the src path should be absolute
2023-04-26 11:48:48 -07:00
Jeff Washington (jwash) 6f7429556b
avoid incorrect internal assert in purge_slot_cache_pubkeys (#31344) 2023-04-26 09:09:38 -07:00
Brooks c73b6545e6
Spins up AccountsHashVerifier in ledger-tool (#31358) 2023-04-26 12:07:35 -04:00