Commit Graph

19437 Commits

Author SHA1 Message Date
behzad nouri d053ce79d4
removes RwLock+Once in favor of OnceCell in caching staked-nodes (#26313)
VoteAccounts uses std::sync::{RwLock, Once} to lazily compute and cache
staked_nodes:
https://github.com/solana-labs/solana/blob/032bee13a/runtime/src/vote_account.rs#L89-L104

This commit instead switches to using once_cell::sync::OnceCell which
provides this exact intended functionality by design.
2022-06-29 22:22:22 +00:00
Jeff Washington (jwash) 557bf6e656
allow initial hash calc to occur in bg (#26271)
* allow initial hash calc to occur in bg

* validator_initialized -> startup_verification_complete

* add infos for leader and vote

* rework snapshot for startup verification

* change to assert
2022-06-29 16:48:33 -05:00
Jeff Washington (jwash) 608191352f
track # roots added/removed since last clean (#26319) 2022-06-29 16:47:57 -05:00
behzad nouri f875733a9e
patches bug in retransmit stats where slot stats are erroneously dropped (#26317)
slot_stats are submitted at a different cadence from the rest of
RetransmitStats. Current code erroneously clears slot_stats before
submitting any metrics.
2022-06-29 21:35:58 +00:00
Jeff Washington (jwash) 2deb396490
remove noisy and useless 'error!' and add test (#26138) 2022-06-29 16:26:23 -05:00
Greg Cusack 032bee13ab
Add Gossip Loop metrics (#26195)
* add three gossip metrics measuring gossip loop times

* add 5 metrics

* rm space

* rm space

* Update SECURITY.md

- fix nav link
- add bounty split policy for duplicate reports

* Add transaction index in slot to geyser plugin TransactionInfo (#25688)

* Define shuffle to prep using same shuffle for multiple slices

* Determine transaction indexes and plumb to execute_batch

* Pair transaction_index with transaction in TransactionStatusService

* Add new ReplicaTransactionInfoVersion

* Plumb transaction_indexes through BankingStage

* Prepare BankingStage to receive transaction indexes from PohRecorder

* Determine transaction indexes in PohRecorder; add field to WorkingBank

* Add PohRecorder::record unit test

* Only pass starting_transaction_index around PohRecorder

* Add helper structs to simplify test DashMap

* Pass entry and starting-index into process_entries_with_callback together

* Add tx-index checks to test_rebatch_transactions

* Revert shuffle definition and use zip/unzip

* Only zip/unzip if randomize

* Add confirm_slot_entries test

* Review nits

* Add type alias to make sender docs more clear

* Update SECURITY.md

finish filling out the table....

* rpc: fix possible deadlock in rpc (#26051)

* Add StatusCache::root_slot_deltas() and use it (#26170)

* Remove InMemAccountsIndex::map() and use map_internal directly (#26189)

* [quic]Decrement total_streams correctly (#26158)

* remove comment

* alphabetical metrics. no abbreviations

* remove trailing white space

* cargo fmt to update code format/readability

Co-authored-by: Trent Nelson <trent@solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
Co-authored-by: Boqin Qin(秦 伯钦) <Bobbqqin@gmail.com>
Co-authored-by: Brooks Prumo <brooks@solana.com>
Co-authored-by: Miles Obare <bdhobare@gmail.com>
2022-06-29 11:55:41 -06:00
Alexander Meißner c01a8f271e
Prepare built-in program tests to deal with stricter account modification checks (#26314)
* Fixes test_vote_state_withdraw().

* Set is_writable to true where needed.
2022-06-29 19:29:12 +02:00
Steven Luscher f57f228126
feat: add `minContextSlot` configuration to (almost) all web3.js methods (#26296)
* feat: add `minContextSlot` config to `getAccountInfo`

* feat: add `minContextSlot` config to `getBalance`

* feat: add `minContextSlot` config to `getBlockHeight``

* feat: add `minContextSlot` config to `getEpochInfo`

* feat: add `minContextSlot` config to `getInflationReward`

* feat: add `minContextSlot` config to `getLatestBlockhash`

* feat: add `minContextSlot` config to `getMultipleAccounts`

* feat: add `minContextSlot` config to `getProgramAccounts`

* feat: add `minContextSlot` config to `getSignaturesForAddress`

* feat: add `minContextSlot` config to `getSlot`

* feat: add `minContextSlot` config to `getSlotLeader`

* feat: add `minContextSlot` config to `getStakeActivation`

* feat: add `minContextSlot` config to `getTokenAccountsByOwner`

* feat: add `minContextSlot` config to `getTransactionCount`

* feat: add `minContextSlot` config to `sendTransaction`
2022-06-29 09:22:34 -07:00
Jeff Washington (jwash) e241906db2
remove outdated, confusing comment (#26315) 2022-06-29 10:42:34 -05:00
Jeff Washington (jwash) ca83f143aa
load_accounts_index_for_shrink uses scan (#26260) 2022-06-29 09:02:27 -05:00
behzad nouri b3406b5b2a
removes IndexedParallelIterator::with_min_len from retransmit (#26305)
Testing on mainnet-beta, with_min_len does not seem to have much impact
in the current retransmit code.
2022-06-29 13:27:17 +00:00
behzad nouri af7f08eba4
uses OnceCell instead of RwLock+Once to cache vote-state in vote-account (#26257)
RwLock seems excessive since only the very 1st call to VoteAccount::vote_state
will write-lock the inner field. Future calls would also incur overhead of an
RwLockReadGuard.
once_cell::sync::OnceCell provides a matching api to the desired functionality.
2022-06-29 11:45:53 +00:00
Alexander Meißner 3e44df598a
Refactor `push` and `pop` in `InvokeContext::process_instruction()`. (#26285)
* Refactor push and pop in InvokeContext::process_instruction().

* Moves set_return_data, compute_units_consumed and timings from process_instruction() into process_executable_chain().

* Clear unused import: native_loader.

* Moves verify_callee_time inside and_then lambda.

* Chains statements back to back,
so that there is no room for additional "?" operators throwing errors.

* Typo in comment
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2022-06-29 12:07:50 +02:00
Justin Starry f44fcd1880 Detect and reject invalid AccountInfo reallocations 2022-06-29 09:15:59 +01:00
ryleung-solana 826f3312cc
Replace unwraps with expects in quic-client to aid debugging (#26283) 2022-06-29 15:37:27 +08:00
Michael Vines eb2894e727
Remove references to labels that nobody cares about 2022-06-29 00:08:33 -07:00
steveluscher eb12983785 feat: add custom version HTTP header string to RPC requests 2022-06-29 06:59:44 +00:00
Jack May 265f36c044
Cleanup feature: sycall base costs (#26304) 2022-06-28 22:24:59 -07:00
Pankaj Garg e8ed7c1c46
Close QUIC connection before dropping the entry (#26269) 2022-06-28 13:46:56 -07:00
Justin Starry fa77cc5e48
Fix active vote account close error (#26250) 2022-06-28 20:35:23 +01:00
Justin Starry 50631e274d
Ensure that staked nodes is populated before returning length (#26293) 2022-06-28 19:15:42 +00:00
steveluscher 028c3eba8f test: compile web3.js tests in such a way that you can use es2020+ syntax without crashing Mocha 2022-06-28 11:22:43 -07:00
Jeff Washington (jwash) 89e5640c63
AccountsIndex::Scan takes iter (#26268) 2022-06-28 12:47:17 -05:00
Jon Cinque 2436a2bea8
client: Use async connection in async TPU client (#25969)
* client: Add nonblocking QuicTpuConnection implementation

* Remove integer arithmetic

* client: Support sync and async connections in cache

* client: Use async connection in async TPU client

* Address feedback

* Rename Connection -> BaseTpuConnection
2022-06-28 11:01:49 -04:00
Jeff Washington (jwash) d07b079850
make test_age_time less intermittent (#26280) 2022-06-28 09:13:01 -05:00
Jeff Washington (jwash) bfc390f9ed
refactor acct idx scan func for reuse (#26252) 2022-06-28 09:01:04 -05:00
Jeff Washington (jwash) 4b591d7b59
AccountsDb::load_accounts_index_for_shrink takes slice (#26267) 2022-06-28 08:59:57 -05:00
microwavedcola1 8c130acfc1
Fix explore mango-v3 ix decoding by upgrading ts client (#26288)
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2022-06-28 14:41:24 +01:00
behzad nouri 348fe9ebe2
verifies shred slot and parent in fetch stage (#26225)
Shred slot and parent are not verified until window-service where
resources are already wasted to sig-verify and deserialize shreds.
This commit moves above verification to earlier in the pipeline in fetch
stage.
2022-06-28 12:45:50 +00:00
Alexander Meißner e8fed88669
Both kinds of LamportsError are turned into InstructionError::ArithmeticOverflow anyway. (#26273) 2022-06-28 10:04:54 +02:00
steveluscher de5b6a2989 chore: upgrade `rpc-websockets` to eliminate bad `circular-json` dependency 2022-06-28 06:23:26 +00:00
yihau b86d80e676 chore: fix solana-private buildkite steps 2022-06-28 12:09:14 +08:00
Jeff Washington (jwash) e164879f20
load_accounts_index_for_shrink uses &item instead of (&item.0, &item.1) (#26266) 2022-06-27 22:40:45 -05:00
Pankaj Garg 31d870fe1b
Do not unwrap the oldest IP in QUIC connectiont table (#26272) 2022-06-28 00:17:08 +00:00
Steven Luscher 9765034e04
Enable wire compression in Solana CLI and Rust client (#26236) 2022-06-27 15:38:07 -07:00
steveluscher 558dd53025 Add user-agent header to Solana rust client requests 2022-06-27 22:29:44 +00:00
Jeff Washington (jwash) d6a28cb7a8
load_accounts_index_for_shrink unrefed_pubkeys is optional (#26265) 2022-06-27 17:23:46 -05:00
behzad nouri 39ca788b95
discards shreds in sigverify if the slot leader is the node itself (#26229)
Shreds are dropped in window-service if the slot leader is the node
itself:
https://github.com/solana-labs/solana/blob/cd2878acf/core/src/window_service.rs#L181-L185

However this is done after wasting resources verifying signature on
these shreds, and requires a redundant 2nd lookup of the slot leader.

This commit instead discards such shreds in sigverify stage where we
already know the leader for the slot.
2022-06-27 20:12:23 +00:00
sakridge 2cc48a650b
Spawn for each stream (#26086) 2022-06-27 21:03:40 +02:00
Daniel Chew 72dc813ada
add explorer support for pyth batch update price ix (#26240) 2022-06-27 18:08:13 +00:00
behzad nouri 67936aaa74
moves Shred::seed to ShredId and adds test coverage (#26251)
Following commits will skip shreds deserializaton before retransmit, and
so we will only have a ShredId and not a fully deserialized shred to
obtain the shuffling seed from.
2022-06-27 17:58:43 +00:00
apfitzge 50eb9965ab
fix test_new_from_file_crafted_executable for m1 (#26009)
* fix test_new_from_file_crafted_executable for m1

* re-add old assert/comment, but disable for aarch64
2022-06-27 12:03:52 -05:00
Artie Kushner 1a87b6cd97 Updated link to compute budget struct
post ristretto reduction
2022-06-27 09:47:38 -07:00
Artie Kushner 7ecaf12ff8 doc typo 2022-06-27 09:43:51 -07:00
Jeff Washington (jwash) d8516b5c88
comment and expand on test (#26231) 2022-06-27 11:35:46 -05:00
Justin Starry 974db28e4d
Increase the QUIC stream timeout duration to improve perf (#26247) 2022-06-27 17:01:39 +01:00
Brooks Prumo 662818ef0d
Use `VoteAccount::node_pubkey()` (#26207) 2022-06-27 09:09:06 -05:00
HaoranYi d5efbdb19b
Add timing measurement for gossip vote txn processing (#26163)
* add timing for gossip vote txn processing

* fix build

* fix too many arg error in clippy

* atomic interval
2022-06-27 08:53:34 -05:00
Ryo Onodera 090e11210a
Add const_assert_eq to PACKET_DATA_SIZE (#26227) 2022-06-27 13:58:08 +09:00
Steven Luscher a741eddf7d
fix: always use the nonce as the recent blockhash; never overwrite it (#25829) 2022-06-26 19:01:54 -07:00