Commit Graph

3856 Commits

Author SHA1 Message Date
Pankaj Garg 9d42cd7efe
Initialize fork graph in program cache during bank_forks creation (#33810)
* Initialize fork graph in program cache during bank_forks creation

* rename BankForks::new to BankForks::new_rw_arc

* fix compilation

* no need to set fork_graph on insert()

* fix partition tests
2023-10-23 09:32:41 -07:00
steviez 56ccffdaa5
Replace get_tmp_ledger_path!() with self cleaning version (#33702)
This macro is used a lot for tests to create a ledger path in order to
open a Blockstore. Files will be left on disk unless the test remembers
to call Blockstore::destroy() on the directory. So, instead of requiring
this, use the get_tmp_ledger_path_auto_delete!() macro that creates a
TempDir (which automatically deletes itself when it goes out of scope).
2023-10-21 11:38:31 +02:00
Ryo Onodera 5a963529a8
Add BankWithScheduler for upcoming scheduler code (#33704)
* Add BankWithScheduler for upcoming scheduler code

* Remove too confusing insert_without_scheduler()

* Add doc comment as a bonus

* Simplify BankForks::banks()

* Add derive(Debug) on BankWithScheduler
2023-10-21 15:56:43 +09:00
behzad nouri e0b59a6f53
prunes turbine QUIC connections (#33663)
The commit implements lazy eviction for turbine QUIC connections.
The cache is allowed to grow to 2 x capacity at which point at least
half of the entries with lowest stake are evicted, resulting in an
amortized O(1) performance.
2023-10-20 21:52:37 +00:00
behzad nouri dc3c827299
prunes repair QUIC connections (#33775)
The commit implements lazy eviction for repair QUIC connections.
The cache is allowed to grow to 2 x capacity at which point at least
half of the entries with lowest stake are evicted, resulting in an
amortized O(1) performance.
2023-10-20 17:50:54 +00:00
Pankaj Garg 59cb3b57ee
Set a global fork graph in program cache (#33776)
* Set a global fork graph in program cache

* fix deadlock

* review feedback
2023-10-20 08:47:03 -07:00
behzad nouri 7aa0faea96
separates out routing repair requests from establishing connections (#33742)
Currently each outgoing repair request will attempt to establish a
connection if one does not already exist. This is very wasteful and
consumes many tokio tasks if the remote node is down or unresponsive.

The commit decouples routing packets from establishing connections by
adding a buffering channel for each remote address. Outgoing packets are
always sent down this channel to be processed once the connection is
established. If connecting attempt fails, all packets already pushed to
the channel are dropped at once, reducing the number of attempts to make
a connection if the remote node is down or unresponsive.
2023-10-19 13:25:53 +00:00
steviez 8bd0e4cd95
Change getHealth to compare optimistically confirmed slots (#33651)
The current getHealth mechanism checks a local accounts hash slot vs.
those of other nodes as specified by --known-validator. This is a
very coarse comparison given that the default for this value is 100
slots. More so, any nodes using a value larger than the default
(ie --incremental-snapshot-interval 500) will likely see getHealth
return status behind at some point.

Change the underlying mechanism of how health is computed. Instead of
using the accounts hash slots published in gossip, use the latest
optimistically confirmed slot from the cluster. Even when a node is
behind, it is able to observe cluster optimistically confirmed by slots
by viewing votes published in gossip.

Thus, the latest cluster optimistically confirmed slot can be compared
against the latest optimistically confirmed bank from replay to
determine health. This new comparison is much more granular, and not
needing to depend on individual known validators is also a plus.
2023-10-16 11:21:33 -05:00
Brooks 452fd5d384
Adds `--no-skip-initial-accounts-db-clean` *hidden* CLI flag (#33664) 2023-10-12 13:32:40 -04:00
Jeff Biseda 0f82662a7f
allow empty string for SOLANA_METRICS_CONFIG sanity checking (#33515) 2023-10-11 09:58:39 -07:00
Ryo Onodera 2f090a5882
Define PohRecorder set_bank related test helper methods (#33626)
Define PohRecorder set_bank related test methods
2023-10-11 10:34:39 +09:00
Ryo Onodera 1704789247
Define tick related helper test methods (#33537)
* Define tick related helper methods

* dcou VoteSimulator

* blacklist ledger-tool for dcou

* fix dcou ci...

* github
2023-10-10 09:23:18 +09:00
Ikko Eltociear Ashimine bd8cfc9923
fix typo in latest_validator_votes_for_frozen_banks.rs (#33585)
upate -> update
2023-10-08 18:12:52 +00:00
Brooks c588f25eca
Stops pushing legacy snapshot hashes to crds (#33576) 2023-10-07 14:29:42 -04:00
Ryo Onodera 95810d876a
Enable frozen_abi on banking trace file (#33501)
* Enable frozen_abi on banking trace file

* Fix ci with really correct bugfix...

* Remove tracker_callers

* Fix typo...

* Fix AbiExample for Arc/Rc's Weaks

* Added comment for AbiExample impl of SystemTime

* Simplify and document EvenAsOpaque with new usage

* Minor clean-ups

* Simplify SystemTime::example() with UNIX_EPOCH...

* Add comment for AbiExample subtleties
2023-10-07 13:15:38 +09:00
Wen 630feeddf2
Add wen_restart module (#33344)
* Add wen_restart module:
- Implement reading LastVotedForkSlots from blockstore.
- Add proto file to record the intermediate results.
- Also link wen_restart into validator.
- Move recreation of tower outside replay_stage so we can get last_vote.

* Update lock file.

* Fix linter errors.

* Fix depencies order.

* Update wen_restart explanation and small fixes.

* Generate tower outside tvu.

* Update validator/src/cli.rs

Co-authored-by: Tyera <teulberg@gmail.com>

* Update wen-restart/protos/wen_restart.proto

Co-authored-by: Tyera <teulberg@gmail.com>

* Update wen-restart/build.rs

Co-authored-by: Tyera <teulberg@gmail.com>

* Update wen-restart/src/wen_restart.rs

Co-authored-by: Tyera <teulberg@gmail.com>

* Rename proto directory.

* Rename InitRecord to MyLastVotedForkSlots, add imports.

* Update wen-restart/Cargo.toml

Co-authored-by: Tyera <teulberg@gmail.com>

* Update wen-restart/src/wen_restart.rs

Co-authored-by: Tyera <teulberg@gmail.com>

* Move prost-build dependency to project toml.

* No need to continue if the distance between slot and last_vote is
already larger than MAX_SLOTS_ON_VOTED_FORKS.

* Use 16k slots instead of 81k slots, a few more wording changes.

* Use AncestorIterator which does the same thing.

* Update Cargo.lock

* Update Cargo.lock

---------

Co-authored-by: Tyera <teulberg@gmail.com>
2023-10-06 15:04:37 -07:00
Brooks c8d545c501
Uses stable `u64::next_multiple_of()` (#33549) 2023-10-06 13:45:14 -04:00
Andrew Fitzgerald 2a17be0eea
Bugfix: MultiIterator batch priority guard (#33454) 2023-10-05 09:20:24 -07:00
Ryo Onodera eb262aabe3
Enable the banking trace by default (#33497) 2023-10-04 09:01:28 +09:00
steviez 3eae980293
Minor cleanup on some snapshot related tests (#33485) 2023-10-02 20:25:30 +02:00
Andrew Fitzgerald 660e41a8e1
Remove entry shuffling (#33378) 2023-10-02 09:03:12 -07:00
carllin ec2e1241a1
Cleanup select_vote_and_reset_forks() (#33421) 2023-09-29 15:11:25 -07:00
Andrew Fitzgerald e3cd13e49d
Add new received forwarded packets metric to banking stage (#33414) 2023-09-28 09:25:10 -07:00
Tyera ddd029774a
Add geyser block-metadata notification with entry count (#33359)
* Add new ReplicaBlockInfoVersions variant

* Use new variant to return entry count
2023-09-26 10:13:17 -06:00
Tao Zhu a41c15e47e
Separate vote cost (#33230)
* Separate simple-vote transaction cost from non-vote transaction cost

* remove is_simple_vote flag from transaction UsageCostDetails

* update test and comment

* set static usage cost for SimpleVote transaction
2023-09-25 15:02:08 -05:00
Ashwin Sekar 85cc6ace05
Update is_locked_out cache when adopting on chain vote state (#33341)
* Update is_locked_out cache when adopting on chain vote state

* extend to all cached tower checks

* upgrade error to panic
2023-09-25 12:33:38 -07:00
Pankaj Garg f50342a790
Split vote related code from runtime to its own crate (#32882)
* Move vote related code to its own crate

* Update imports in code and tests

* update programs/sbf/Cargo.lock

* fix check errors

* update abi_digest

* rebase fixes

* fixes after rebase
2023-09-19 10:46:37 -07:00
Andrew Fitzgerald 22338f5472
TransactionScheduler: InFlightTracker (#33206) 2023-09-19 09:08:42 -07:00
Brooks bc2b372762
Adds DCOU to verify_snapshot_archive() (#33298) 2023-09-18 19:11:28 -04:00
Andrew Fitzgerald 86dd18bfb5
TransactionScheduler: Id Generators (#33207) 2023-09-18 10:07:40 -07:00
Andrew Fitzgerald e860019687
TransactionScheduler: Pipe BlockProductionMethod (#33217) 2023-09-18 10:05:27 -07:00
Brooks c40e88aef9
Adds metrics for fastboot storages kept alive (#33222) 2023-09-13 09:28:19 -04:00
Brooks acd7ad96c3
Purges old accounts hash cache dirs (#33183) 2023-09-12 13:10:22 -04:00
behzad nouri e01269a9de
sends repair requests over QUIC protocol (#33016)
The commit implements client-side of serve-repair and
ancestor-hash-service over QUIC protocol.
2023-09-11 22:22:04 +00:00
Alexander Meißner bbb57be0a5
Refactor - Move interfaces of address-lookup-table into the program SDK (#33165)
* Adds a module `address_lookup_table` to the SDK.

* Adds a module `address_lookup_table::instruction` to the SDK.

* Adds a module `address_lookup_table::error` to the SDK.

* Adds a module `address_lookup_table::state` to the SDK.

* Moves AddressLookupTable into SDK as well.

* Moves AddressLookupTableAccount into address_lookup_table.

* Adds deprecation messages.

* Disentangles dependencies across cargo files.
2023-09-11 21:10:40 +02:00
behzad nouri 7fc6fea8d8
serves remote repair requests from QUIC endpoint (#33069)
The commit implements server-side of repair using QUIC protocol.

UDP repair requests are adapted as RemoteRequest and sent down the same
channel as remote requests arriving over QUIC, and the rest of the
server code is update to process over RemoteRequest type.
2023-09-11 16:57:10 +00:00
Andrew Fitzgerald 297ffad797
set_forwarded needs mut ref (#33203) 2023-09-11 09:34:48 -07:00
Andrew Fitzgerald 527a4bbf00
TransactionScheduler: TransactionStateContainer (#33002)
Co-authored-by: Tao Zhu <82401714+taozhu-chicago@users.noreply.github.com>
2023-09-09 09:51:23 -07:00
behzad nouri 9ff0b35f29
adds QUIC endpoint for repair service (#33057)
Working towards using QUIC protocol for repair, the commit adds a QUIC
endpoint for repair service.

Outgoing local requests are sent as

    struct LocalRequest {
        remote_address: SocketAddr,
        bytes: Vec<u8>,
        num_expected_responses: usize,
        response_sender: Sender<(SocketAddr, Vec<u8>)>,
    }

to the client-side of the endpoint. The client opens a bidirectional
stream with the LocalRequest.remote_address and once received the
response, sends it down the LocalRequest.response_sender channel.

Incoming requests from remote nodes are received from bidirectional
streams and sent as

    struct RemoteRequest {
        remote_pubkey: Option<Pubkey>,
        remote_address: SocketAddr,
        bytes: Vec<u8>,
        response_sender: Option<OneShotSender<Vec<Vec<u8>>>>,
    }

to the repair-service. The response is received from the receiver end of
RemoteRequest.response_sender channel and send back to the remote node
using the send side of the bidirectional stream.
2023-09-07 18:00:25 +00:00
behzad nouri 528a03f32a
removes outdated matches crate from dependencies (#33172)
removes outdated matches crate from the dependencies

std::matches has been stable since rust 1.42.0.
Other use-cases are covered by assert_matches crate.
2023-09-07 12:52:57 +00:00
Ashwin Sekar a8e83c8720
replay: send duplicate proofs from blockstore to state machine (#32962)
* replay: send duplicate proofs from blockstore to state machine

* pr feedback: bank.slot() -> slot

* pr feedback
2023-09-05 21:29:53 -07:00
Andrew Fitzgerald f8d304c610
Drop poh_service to avoid unwanted ticking (#33150) 2023-09-05 16:08:48 -07:00
steviez 3b108564f9
Demote Arc<Bank> parameter to &Bank (#33130) 2023-09-05 21:04:39 +02:00
Andrew Fitzgerald d36ded20fc
Make TimedTracedEvent accessible outside banking_trace.rs (#32985) 2023-09-05 08:54:32 -07:00
steviez ad33c68ce9
Update ShredFetchStage::modify_packets to drop root bank quicker (#33105)
This function used to contain feature gate activation checks that
required access to a bank. Those checks have been cleaned up, so we no
longer need access to a full Bank. Rather, we can momentarily get a Bank
from BankForks, calculate the necessary results and then drop the Bank
along with the BankForks read lock.
2023-09-01 23:08:49 +02:00
Alessandro Decina 16ea141402
sdk: put AccountSharedData::set_data() behind feature="dev-context-only-utils" (#33086)
set_data() is deprecated in favor of set_data_from_slice().
2023-09-01 21:02:14 +07:00
Alexander Meißner 9e703f85de
Upgrades Rust to 1.72.0 & nightly-2023-08-25 (#32961)
* allow pedantic invalid cast lint

* allow lint with false-positive triggered by `test-case` crate

* nightly `fmt` correction

* adapt to rust layout changes

* remove dubious test

* Use transmute instead of pointer cast and de/ref when check_aligned is false.

* Renames clippy::integer_arithmetic to clippy::arithmetic_side_effects.

* bump rust nightly to 2023-08-25

* Upgrades Rust to 1.72.0

---------

Co-authored-by: Trent Nelson <trent@solana.com>
2023-09-01 07:26:13 +00:00
behzad nouri 1431275328
removes outdated check for merkle shreds (#33088) 2023-08-31 20:01:54 +00:00
Ashwin Sekar 6d2dae6ab0
send duplicate shred proofs for conflicting shred scenarios (#32965)
* send duplicate shred proofs for conflicting shred scenarios

The scenarios are multiple last_shred_in_slot shreds and
coding shreds with conflicting erasure metas.

* Pr feedback: deprecate shred_index for gossip duplicate shred proofs

* Pr feedback

* Remove extraneous dead code
2023-08-31 12:08:10 -07:00
Ashwin Sekar 025651e0d4
ff cleanup: allow_votes_to_directly_update_vote_state and compact_vot… (#32967)
ff cleanup: allow_votes_to_directly_update_vote_state and compact_vote_state_updates
2023-08-30 17:00:19 -07:00