Commit Graph

19648 Commits

Author SHA1 Message Date
apfitzge 07f41628db
untar_snapshot_create_shared_buffer doesn't need to return a result (#26686) 2022-07-19 23:15:41 +00:00
Jeff Washington (jwash) 2d689ac53a
get rid of rwlock per bin in accounts index (#26675) 2022-07-19 17:48:40 -05:00
apfitzge e7cd6daebe
Add helper fn to create shared buffer - simplify archive format matching (#26674) 2022-07-19 20:30:30 +00:00
apfitzge 84c8cfe901
Refactor/hardened unpack more generic unpack archive (#26677)
* Add entry_processor fn to unpack_archive - not used yet

* Add generic unpack_snapshot_with_processors to separate account paths handling from entry checking
2022-07-19 14:48:57 -05:00
Jeff Washington (jwash) 7efe72a74f
eliminate write lock usage in acct idx (#26673) 2022-07-19 13:24:03 -05:00
apfitzge 77843306c7
rename parallel_archivers -> parallel_divisions for consistency (#26672)
parallel_archivers -> parallel_divisions for consistency
2022-07-19 13:15:33 -05:00
scriptrunner2049 41c851cf8a
Update SECURITY.md 2022-07-20 01:32:31 +09:00
Jeff Washington (jwash) 263911e7fd
save off what we find when calculating hash (#26663) 2022-07-19 09:55:52 -05:00
Jeff Washington (jwash) 738c4a79b7
metric for 'ancient_account_cleans' (#26664) 2022-07-19 09:16:23 -05:00
Jeff Washington (jwash) 6efe7e095b
temporarily make ancient append vecs 10x smaller to find intermittent bugs (#26574) 2022-07-19 08:51:36 -05:00
ryleung-solana f0994c4ba1
Merge pull request from GHSA-x236-qc46-7v8j
* Restrict the usable port range of the validator such that adding QUIC_PORT_OFFSET never gets us an invalid port. Also validate this for incoming ContactInfos

* Require the proper port range in ContactInfo::valid_client_facing_addr

* Use asserts instead of panics, and enforce USABLE_PORT_RANGE for all the ports in ContactInfo

* Fix typo

* Make the quic client return errors on the quinn endpoint connect() call,
not just the result of awaiting the connect() call, as the connect()
call can itself fail realistically (e.g. due to expected/invalid IPs, etc)

* Update USABLE_PORT_RANGE to a better range and use port_range_validator to validate dynamic-port-range rather than a panic

* Fall back on UDP when the remote peer's tpu port is too large to have QUIC_PORT_OFFSET added to it

* Get rid of tpu port sanitization in ContactInfo

* Turn USABLE_PORT_RANGE into a Range and make connnection_cache fall back on UDP when the tpu port is out of range

* Fix build

* Dummy commit

* Reert dummy commit

* dummy commit

* revert dummy commit

* Fix typo

* Fix range validation

* Fix formatting

* Fix USABLE_PORT_RANGE

* Remove USABLE_PORT_RANGE

* Avoid creating a QuicLazyInitializedEndpoint when forcing the use of UDP

* Implement test for connection cache overflow
2022-07-19 14:54:42 +02:00
kirill lykov 3929ad67eb
Refactor bench-tps chunking transactions logic (#26661)
Refactor bench-tps chunking txs
2022-07-19 13:13:24 +02:00
Richard Patel 4163dc181e
sdk/bpf/c: fix sol_get_return_data signature (#26525) 2022-07-19 09:30:29 +02:00
Ikko Ashimine a6c41367aa
docs: fix typo in blockstore-rocksdb-compaction.md (#26662)
Fix typo in blockstore-rocksdb-compaction.md

accross -> across
2022-07-18 13:37:40 -07:00
Jeff Washington (jwash) c4d2c95540
move hash stat to correct level for ahv to work (#26649) 2022-07-18 12:44:33 -05:00
Jeff Washington (jwash) 1c08f83c7e
eliminate flatten().collect() of reclaims in clean (#26647) 2022-07-18 12:37:17 -05:00
Yueh-Hsuan Chiang dcbda2c6c5
Allow ledger tool to automatically detect the shred compaction style (#26182)
#### Problem
Ledger-tool doesn't support shred-compaction-type other than the default rocksdb level compaction.

#### Summary of Changes
This PR enables ledger-tool to automatically detect the shred-compaction-type of the specified ledger.

#### Test Plan
New ledger-tool tests are added for both level and fifo compactions.
2022-07-19 01:19:17 +08:00
behzad nouri 2dd8573287
removes erroneous allow(dead_code) annotations from core (#26660) 2022-07-18 17:15:47 +00:00
Lcchy 18e9225a75
Use BPF serialization ABI for native target in program-test; Fix account data resizing and editing (#26507)
* Use BPF serialization ABI for native target in program-test (PR22754)

* Fixes for the program-test PR22754 rebase on v1.11.1

* Include bug test case in program-test unit tests

* Fix segfault on duped accounts

* Add CPI create_account test

* Revert gitignore addition

Co-authored-by: jozanza <hello@jsavary.com>
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-07-18 18:13:03 +02:00
kirill lykov c4ec031daa
add create durable nonce accounts (#26513)
* add create durable nonce accounts

* extract common logic into method

* add test

* got rid of unnecessary Result
2022-07-18 13:38:20 +02:00
Yihau Chen e69d8ae7d7
chore: use sccache (#26376)
* chore: remove CARGO_TARGET_CACHE

* chore: prepare sccache env for docker container

* chore: use s3 as sccache backend
2022-07-18 15:39:21 +08:00
Brooks Prumo a8be960e05
Add RPC getStakeMinimumDelegation (#26638)
* Add RPC getStakeMinimumDelegation

* fixup! rpc

* fixup rpc

* fixup rpc client mock sender

* fixup docs

* pr: sort
2022-07-17 18:39:39 +00:00
Justin Starry 0d7d2090a2
Disable JIT bpf program tests on non x86 archs (#26654) 2022-07-17 15:39:40 +00:00
Justin Starry ca4d917081 Fix clippy warning 2022-07-17 12:23:03 +02:00
Justin Starry fd6038884b Clean up forgotten error log 2022-07-17 12:21:52 +02:00
Justin Starry 07d7c938b9
Refactor: split up syscalls module (#26637)
* Refactor: split up syscalls module

* fix ci script

* fix visibility
2022-07-16 19:33:57 +02:00
sakridge 9714cb3764
Remove some unchecked math from the quic chunk handling (#26408) 2022-07-16 17:03:31 +02:00
Tao Zhu 22d465cd57
Share function to get priority details from various transaction types (#26643) 2022-07-15 18:17:22 -05:00
Jeff Washington (jwash) be8813e588
shrink stops using HandleReclaims (#26594) 2022-07-15 17:54:48 -05:00
Jeff Washington (jwash) 83c614da3c
change type to be more clear (#26646) 2022-07-15 17:17:17 -05:00
Jeff Washington (jwash) 47716a5e01
async hash verify on load (#26208)
* verify accounts hash in bg on startup

* fix some tests and loading from genesis

* add extra state for when background thread has completed
2022-07-15 14:29:56 -05:00
Justin Starry 15d18a03e5
Clean up activated `reduce_required_deploy_balance` feature (#26557)
Clean up activated reduce_required_deploy_balance feature
2022-07-15 16:08:14 +01:00
behzad nouri bf225bae73
restricts rent-paying accounts lifetime extension (#26606)
https://github.com/solana-labs/solana/pull/22292
prevents rent paying accounts creation going forward. However a rent
paying account can linger on for ever if it is continually topped up but
stays below the rent-exempt minimum.
This can prevent eliminating accounts-rewrites and the problematic
rent_epoch field in accounts.

Link to discord discussion:
https://discord.com/channels/428295358100013066/943609352068145162/995202300001927219

This commit restricts rent-paying accounts lifetime extension by
preventing increasing lamports on the account if the account stays below
the rent-exempt minimum.
2022-07-15 13:23:37 +00:00
dependabot[bot] 6887e1268e
chore:(deps): bump @testing-library/user-event from 13.5.0 to 14.2.3 in /explorer (#26633)
chore:(deps): bump @testing-library/user-event in /explorer

Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.5.0 to 14.2.3.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v13.5.0...v14.2.3)

---
updated-dependencies:
- dependency-name: "@testing-library/user-event"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-15 08:17:26 +00:00
kirill lykov b1acd9954b
extract method to split keypairs into two set of chunks (#26623) 2022-07-15 09:47:30 +02:00
Alexander Meißner 038da82b6f
Feature: Early verification of account modifications in `BorrowedAccount` (#25899)
* Adjusts test cases for stricter requirements.

* Removes account reset in deserialization test.

* Removes verify related test cases.

* Replicates account modification verification logic of PreAccount in BorrowedAccount.

* Adds TransactionContext::account_touched_flags.

* Adds account modification verification to the BPF ABIv0 and ABIv1 deserialization, CPI syscall and program-test.

* Replicates the total sum of all lamports verification of PreAccounts in InstructionContext

* Check that the callers instruction balance is maintained during a call / push.

* Replicates PreAccount statistics in TransactionContext.

* Disable verify() and verify_and_update() if the feature enable_early_verification_of_account_modifications is enabled.

* Moves Option<Rent> of enable_early_verification_of_account_modifications into TransactionContext::new().

* Relaxes AccountDataMeter related test cases.

* Don't touch the account if nothing changes.

* Adds two tests to trigger InstructionError::UnbalancedInstruction.

Co-authored-by: Justin Starry <justin@solana.com>
2022-07-15 09:31:34 +02:00
Tao Zhu f13b5c832d
Remove obsoleted metrics reporting to reduce lock contention on cost_model (#26608)
remove obsoleted metrics reporting to reduce lock contention on cost_model
2022-07-14 23:02:49 -05:00
Dmitri Makarov 0b78a213c3 Add a comment explaining the check for crate recompilation redundancy 2022-07-14 17:59:37 -07:00
skrrb 4f71ae6102 test-validator: use ADDRESS from account flag 2022-07-14 11:23:07 -07:00
Dmitri Makarov 27cee7a7de Compile for bpf target for compatibility when cargo-build-bpf is used 2022-07-14 10:41:39 -07:00
Justin Starry 3fc161bea4
Fix flaky message kitchen sink test (#26624) 2022-07-14 18:39:57 +01:00
bji 61fd9288ba
Fix sol_memset to return the correct value. (#26598) 2022-07-14 17:27:02 +01:00
HaoranYi 819d6512ab
add PartialEq, Eq and spell correction (#26614) 2022-07-14 14:55:03 +00:00
Jeff Washington (jwash) 3e9bd6170c
use OnceCell instead of RwLock for rent_paying_accounts_by_partition (#26601) 2022-07-14 08:52:41 -05:00
behzad nouri 1bc2cc7f76
patches flaky test_rpc_slot_updates (#26593)
test_rpc_slot_updates fails if SlotUpdate::Completed is received after
SlotUpdate::Frozen:
https://github.com/solana-labs/solana/blob/dcfd823ca/rpc-test/tests/rpc.rs#L198-L228

However, SlotUpdate::Completed is sent asynchronous to banking-stage and
replay when shreds are inserted into blockstore. When the leader
generates blocks, replay may freeze the bank before shreds are all
inserted into blockstore; and so SlotUpdate::Completed may be received
_after_ SlotUpdate::Frozen.

The commit removes the ordering check for SlotUpdate::Completed.
2022-07-14 12:33:54 +00:00
Jeff Washington (jwash) 4dea32e8e5
fix active_scans metric to not swap (#26602) 2022-07-13 20:11:23 -05:00
Jeff Washington (jwash) 2b7cc107d8
typo (#26618) 2022-07-13 17:55:02 -05:00
Alessandro Decina ab6802bd2d cargo-build-sbf, cargo-test-sbf: add --arch option
--arch allows selecting the target SBF version. See
https://github.com/solana-labs/llvm-project/pull/26.
2022-07-13 14:49:38 -07:00
Dmitri Makarov 8797ad03c4 Bump sbf-tools version to v1.28 2022-07-13 21:47:48 +00:00
Dmitri Makarov 1db17a8874 Issue a warning about removing RUSTC from cargo env by build-sbf 2022-07-13 20:44:27 +00:00