Go to file
behzad nouri be957f25c9
adds fallback logic if retransmit multicast fails (#17714)
In retransmit-stage, based on the packet.meta.seed and resulting
children/neighbors, each packet is sent to a different set of peers:
https://github.com/solana-labs/solana/blob/708bbcb00/core/src/retransmit_stage.rs#L421-L457

However, current code errors out as soon as a multicast call fails,
which will skip all the remaining packets:
https://github.com/solana-labs/solana/blob/708bbcb00/core/src/retransmit_stage.rs#L467-L470

This can exacerbate packets loss in turbine.

This commit:
  * keeps iterating over retransmit packets for loop even if some
    intermediate sends fail.
  * adds a fallback to UdpSocket::send_to if multicast fails.

Recent discord chat:
https://discord.com/channels/428295358100013066/689412830075551748/849530845052403733
2021-06-04 12:16:37 +00:00
.buildkite
.github
.travis
account-decoder Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
accounts-bench chore: bump crossbeam-channel from 0.4.4 to 0.5.0 (#17665) 2021-06-02 19:36:28 +00:00
accounts-cluster-bench
banking-bench chore: bump crossbeam-channel from 0.4.4 to 0.5.0 (#17665) 2021-06-02 19:36:28 +00:00
banks-client
banks-interface Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
banks-server
bench-exchange
bench-streamer
bench-tps chore: bump serial_test from 0.4.0 to 0.5.1 (#17705) 2021-06-03 10:07:56 -06:00
ci
clap-utils
cli Improve program deployment error message (#17717) 2021-06-03 15:52:36 -07:00
cli-config Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
cli-output Bump indicatif from 0.15.0 to 0.16.2 (#17628) 2021-06-01 17:38:02 +00:00
client Bump indicatif from 0.15.0 to 0.16.2 (#17628) 2021-06-01 17:38:02 +00:00
core adds fallback logic if retransmit multicast fails (#17714) 2021-06-04 12:16:37 +00:00
crate-features
docs fix getBlock API reference (#17661) 2021-06-02 00:11:36 -07:00
dos
download-utils chore: bump tar from 0.4.28 to 0.4.35 (#17666) 2021-06-02 14:17:58 -06:00
explorer chore:(deps): bump @types/node from 15.9.0 to 15.12.0 in /explorer (#17738) 2021-06-04 08:30:51 +00:00
faucet Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
frozen-abi Bump sha2 from 0.9.2 to 0.9.5 (#17627) 2021-06-01 08:58:38 -06:00
genesis Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
genesis-utils
gossip adds fallback logic if retransmit multicast fails (#17714) 2021-06-04 12:16:37 +00:00
install chore: bump tar from 0.4.28 to 0.4.35 (#17666) 2021-06-02 14:17:58 -06:00
keygen
ledger Switch EpochSlots to be frozen slots, not completed slots (#17168) 2021-06-03 00:20:00 +00:00
ledger-tool Add subcommand "compute-slot-cost" to ledger tool (#17181) 2021-06-02 11:29:02 -05:00
local-cluster Rename ValidatorExit and move to sdk (#17728) 2021-06-04 03:06:13 +00:00
log-analyzer Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
logger
measure
merkle-root-bench
merkle-tree
metrics chore: bump serial_test from 0.4.0 to 0.5.1 (#17705) 2021-06-03 10:07:56 -06:00
multinode-demo
net
net-shaper Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
net-utils Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
notifier
perf Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
poh-bench
program-test Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
programs chore: bump libloading from 0.6.2 to 0.7.0 (#17704) 2021-06-03 18:08:31 -06:00
rayon-threadlimit
rbpf-cli Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
remote-wallet
rpc chore: bump crossbeam-channel from 0.4.4 to 0.5.0 (#17665) 2021-06-02 19:36:28 +00:00
runtime add info for vm.max_map_count incorrectly set. (#17727) 2021-06-04 03:22:12 +00:00
scripts Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
sdk Rename ValidatorExit and move to sdk (#17728) 2021-06-04 03:06:13 +00:00
stake-accounts
stake-monitor chore: bump serial_test from 0.4.0 to 0.5.1 (#17705) 2021-06-03 10:07:56 -06:00
storage-bigtable Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
storage-proto Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
streamer
sys-tuner
system-test
tokens Add create-stake command to solana-tokens CLI (#17550) 2021-06-01 22:42:31 +00:00
transaction-status Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
upload-perf
validator Rename ValidatorExit and move to sdk (#17728) 2021-06-04 03:06:13 +00:00
version Bump serde from 1.0.122 to 1.0.126 (#17618) 2021-05-31 22:41:25 +00:00
watchtower
web3.js chore: bump start-server-and-test from 1.12.3 to 1.12.4 in /web3.js (#17732) 2021-06-04 08:14:08 +00:00
.clippy.toml
.codecov.yml
.gitignore
.mergify.yml
.travis.yml
CONTRIBUTING.md
Cargo.lock chore: bump libloading from 0.6.2 to 0.7.0 (#17704) 2021-06-03 18:08:31 -06:00
Cargo.toml
LICENSE
README.md
RELEASE.md
SECURITY.md
cargo
cargo-build-bpf
cargo-test-bpf
fetch-perf-libs.sh
fetch-spl.sh
run.sh
test-abi.sh

README.md

Solana

Solana crate Solana documentation Build status codecov

Building

1. Install rustc, cargo and rustfmt.

$ curl https://sh.rustup.rs -sSf | sh
$ source $HOME/.cargo/env
$ rustup component add rustfmt

Please sure you are always using the latest stable rust version by running:

$ rustup update

On Linux systems you may need to install libssl-dev, pkg-config, zlib1g-dev, etc. On Ubuntu:

$ sudo apt-get update
$ sudo apt-get install libssl-dev libudev-dev pkg-config zlib1g-dev llvm clang make

On Mac M1s, make sure you set up your terminal & homebrew to use Rosetta. You can install it with:

$ softwareupdate --install-rosetta

2. Download the source code.

$ git clone https://github.com/solana-labs/solana.git
$ cd solana

3. Build.

$ cargo build

4. Run a minimal local cluster.

$ ./run.sh

Testing

Run the test suite:

$ cargo test

Starting a local testnet

Start your own testnet locally, instructions are in the online docs.

Accessing the remote development cluster

  • devnet - stable public cluster for development accessible via devnet.solana.com. Runs 24/7. Learn more about the public clusters

Benchmarking

First install the nightly build of rustc. cargo bench requires use of the unstable features only available in the nightly build.

$ rustup install nightly

Run the benchmarks:

$ cargo +nightly bench

Release Process

The release process for this project is described here.

Code coverage

To generate code coverage statistics:

$ scripts/coverage.sh
$ open target/cov/lcov-local/index.html

Why coverage? While most see coverage as a code quality metric, we see it primarily as a developer productivity metric. When a developer makes a change to the codebase, presumably it's a solution to some problem. Our unit-test suite is how we encode the set of problems the codebase solves. Running the test suite should indicate that your change didn't infringe on anyone else's solutions. Adding a test protects your solution from future changes. Say you don't understand why a line of code exists, try deleting it and running the unit-tests. The nearest test failure should tell you what problem was solved by that code. If no test fails, go ahead and submit a Pull Request that asks, "what problem is solved by this code?" On the other hand, if a test does fail and you can think of a better way to solve the same problem, a Pull Request with your solution would most certainly be welcome! Likewise, if rewriting a test can better communicate what code it's protecting, please send us that patch!

Disclaimer

All claims, content, designs, algorithms, estimates, roadmaps, specifications, and performance measurements described in this project are done with the Solana Foundation's ("SF") best efforts. It is up to the reader to check and validate their accuracy and truthfulness. Furthermore nothing in this project constitutes a solicitation for investment.

Any content produced by SF or developer resources that SF provides, are for educational and inspiration purposes only. SF does not encourage, induce or sanction the deployment, integration or use of any such applications (including the code comprising the Solana blockchain protocol) in violation of applicable laws or regulations and hereby prohibits any such deployment, integration or use. This includes use of any such applications by the reader (a) in violation of export control or sanctions laws of the United States or any other applicable jurisdiction, (b) if the reader is located in or ordinarily resident in a country or territory subject to comprehensive sanctions administered by the U.S. Office of Foreign Assets Control (OFAC), or (c) if the reader is or is working on behalf of a Specially Designated National (SDN) or a person subject to similar blocking or denied party prohibitions.

The reader should be aware that U.S. export control and sanctions laws prohibit U.S. persons (and other persons that are subject to such laws) from transacting with persons in certain countries and territories or that are on the SDN list. As a project based primarily on open-source software, it is possible that such sanctioned persons may nevertheless bypass prohibitions, obtain the code comprising the Solana blockchain protocol (or other project code or applications) and deploy, integrate, or otherwise use it. Accordingly, there is a risk to individuals that other persons using the Solana blockchain protocol may be sanctioned persons and that transactions with such persons would be a violation of U.S. export controls and sanctions law. This risk applies to individuals, organizations, and other ecosystem participants that deploy, integrate, or use the Solana blockchain protocol code directly (e.g., as a node operator), and individuals that transact on the Solana blockchain through light clients, third party interfaces, and/or wallet software.