389bedda5e
* refactor: extract store_stake_accounts fn
* refactor: extract store_vote_account fn
* refactor: extract reward history update fn
* remove avg point value from pay_valiator fn. not used
* clippy: slice
* clippy: slice
* remove abort() from test-validator (#27124)
* chore: bump bytes from 1.1.0 to 1.2.1 (#27172)
* chore: bump bytes from 1.1.0 to 1.2.1
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.1.0 to 1.2.1.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.1.0...v1.2.1)
---
updated-dependencies:
- dependency-name: bytes
dependency-type: direct:production
update-type: version-update:semver-minor
...
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>
* Share Ancestors API get with contains_key (#27161)
consolidate similar fns
* Rename to `MAX_BLOCK_ACCOUNTS_DATA_SIZE_DELTA` (#27175)
* chore: bump libc from 0.2.129 to 0.2.131 (#27162)
* chore: bump libc from 0.2.129 to 0.2.131
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.129 to 0.2.131.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.129...0.2.131)
---
updated-dependencies:
- dependency-name: libc
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>
* reverts wide fanout in broadcast when the root node is down (#26359)
A change included in
https://github.com/solana-labs/solana/pull/20480
was that when the root node in turbine broadcast tree is down, the
leader will broadcast the shred to all nodes in the first layer.
The intention was to mitigate the impact of dead nodes on shreds
propagation, because if the root node is down, then the entire cluster
will miss out the shred.
On the other hand, if x% of stake is down, this will cause 200*x% + 1
packets/shreds ratio at the broadcast stage which might contribute to
line-rate saturation and packet drop.
To avoid this bandwidth saturation issue, this commit reverts that logic
and always broadcasts shreds from the leader only to the root node.
As before we rely on erasure codes to recover shreds lost due to staked
nodes being offline.
* add getTokenLargestAccounts rpc method to rust client (#26840)
* add get token largest accounts rpc call to client
* split to include with commitment
* Bump spl-token-2022 (#27181)
* Bump token-2022 to 0.4.3
* Allow cargo to bump stuff to v1.11.5
* VoteProgram.safeWithdraw function to safeguard against accidental vote account closures (#26586)
feat: safe withdraw function
Co-authored-by: aschonfeld <andrew@proofofalpha.io>
* chore: bump futures from 0.3.21 to 0.3.23 (#27182)
* chore: bump futures from 0.3.21 to 0.3.23
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.21 to 0.3.23.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.21...0.3.23)
---
updated-dependencies:
- dependency-name: futures
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>
* chore: bump nix from 0.24.2 to 0.25.0 (#27179)
* chore: bump nix from 0.24.2 to 0.25.0
Bumps [nix](https://github.com/nix-rust/nix) from 0.24.2 to 0.25.0.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.24.2...v0.25.0)
---
updated-dependencies:
- dependency-name: nix
dependency-type: direct:production
update-type: version-update:semver-minor
...
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>
* Parse ConfidentialTransaction instructions (#26825)
Parse ConfidentialTransfer instructions
* snapshots: serialize version file first (#27192)
serialize version file first
* serialize incremental_snapshot_hash (#26839)
* serialize incremental_snapshot_hash
* pr feedback
* derives Error trait for ClusterInfoError and core::result::Error (#27208)
* Add clean_accounts_for_tests() (#27200)
* Rust v1.63.0 (#27148)
* Upgrade to Rust v1.63.0
* Add nightly_clippy_allows
* Resolve some new clippy nightly lints
* Increase QUIC packets completion timeout
Co-authored-by: Michael Vines <mvines@gmail.com>
* docs: updated "transaction fees" page (#26861)
* docs: transaction fees, compute units, compute budget
* docs: added messages definition
* Revert "docs: added messages definition"
This reverts commit 3c56156dfaaf17158c5eafbc5877080a83607a06.
* docs: added messages definition
* Update docs/src/transaction_fees.md
Co-authored-by: Jacob Creech <82475023+jacobcreech@users.noreply.github.com>
* fix: updates from feedback
Co-authored-by: Jacob Creech <82475023+jacobcreech@users.noreply.github.com>
* sdk: Fix args after "--" in build-bpf and test-bpf (#27221)
* Flaky Unit Test test_rpc_subscriptions (#27214)
Increase unit test timeout from 5 seconds to 10 seconds
* chore: only buildkite pipelines use sccache in docker-run.sh (#27204)
chore: only buildkite ci use sccache
* clean feature: `prevent_calling_precompiles_as_programs` (#27100)
* clean feature: prevent_calling_precompiles_as_programs
* fix tests
* fix test
* remove comment
* fix test
* feedback
* Add get_account_with_commitment to BenchTpsClient (#27176)
* Fix a corner-case panic in get_entries_in_data_block() (#27195)
#### Problem
get_entries_in_data_block() panics when there's inconsistency between
slot_meta and data_shred.
However, as we don't lock on reads, reading across multiple column families is
not atomic (especially for older slots) and thus does not guarantee consistency
as the background cleanup service could purge the slot in the middle. Such
panic was reported in #26980 when the validator serves a high load of RPC calls.
#### Summary of Changes
This PR makes get_entries_in_data_block() panic only when the inconsistency
between slot-meta and data-shred happens on a slot older than lowest_cleanup_slot.
* Verify snapshot slot deltas (#26666)
* store-tool: log lamports for each account (#27168)
log lamports for each account
* add an assert for a debug feature to avoid wasted time (#27210)
* remove redundant call that bumps age to future (#27215)
* Use from_secs api to create duration (#27222)
use from_secs api to create duration
* reorder slot # in debug hash data path (#27217)
* create helper fn for clarity (#27216)
* Verifying snapshot bank must always specify the snapshot slot (#27234)
* Remove `Bank::ensure_no_storage_rewards_pool()` (#26468)
* cli: Add subcommands for address lookup tables (#27123)
* cli: Add subcommand for creating address lookup tables
* cli: Add additional subcommands for address lookup tables
* short commands
* adds hash domain to ping-pong protocol (#27193)
In order to maintain backward compatibility, for now the responding node
will hash the token both with and without domain so that the other node
will accept the response regardless of its upgrade status.
Once the cluster has upgraded to the new code, we will remove the legacy
domain = false case.
* Revert "Rust v1.63.0 (#27148)" (#27245)
This reverts commit
|
||
---|---|---|
.buildkite | ||
.github | ||
account-decoder | ||
accounts-bench | ||
accounts-cluster-bench | ||
banking-bench | ||
banks-client | ||
banks-interface | ||
banks-server | ||
bench-streamer | ||
bench-tps | ||
bloom | ||
bucket_map | ||
ci | ||
clap-utils | ||
clap-v3-utils | ||
cli | ||
cli-config | ||
cli-output | ||
client | ||
client-test | ||
core | ||
docs | ||
dos | ||
download-utils | ||
entry | ||
explorer | ||
faucet | ||
frozen-abi | ||
genesis | ||
genesis-utils | ||
geyser-plugin-interface | ||
geyser-plugin-manager | ||
gossip | ||
install | ||
keygen | ||
ledger | ||
ledger-tool | ||
local-cluster | ||
log-analyzer | ||
logger | ||
measure | ||
merkle-root-bench | ||
merkle-tree | ||
metrics | ||
multinode-demo | ||
net | ||
net-shaper | ||
net-utils | ||
notifier | ||
perf | ||
poh | ||
poh-bench | ||
program-runtime | ||
program-test | ||
programs | ||
rayon-threadlimit | ||
rbpf-cli | ||
remote-wallet | ||
rpc | ||
rpc-test | ||
runtime | ||
scripts | ||
sdk | ||
send-transaction-service | ||
stake-accounts | ||
storage-bigtable | ||
storage-proto | ||
streamer | ||
sys-tuner | ||
system-test | ||
test-validator | ||
tokens | ||
transaction-dos | ||
transaction-status | ||
upload-perf | ||
validator | ||
version | ||
watchtower | ||
web3.js | ||
zk-token-sdk | ||
.clippy.toml | ||
.codecov.yml | ||
.gitignore | ||
.mergify.yml | ||
.travis.yml | ||
CONTRIBUTING.md | ||
Cargo.lock | ||
Cargo.toml | ||
LICENSE | ||
README.md | ||
RELEASE.md | ||
SECURITY.md | ||
cargo | ||
cargo-build-bpf | ||
cargo-build-sbf | ||
cargo-test-bpf | ||
cargo-test-sbf | ||
fetch-perf-libs.sh | ||
fetch-spl.sh | ||
run.sh | ||
rustfmt.toml | ||
test-abi.sh | ||
vercel.json |
README.md
Building
1. Install rustc, cargo and rustfmt.
$ curl https://sh.rustup.rs -sSf | sh
$ source $HOME/.cargo/env
$ rustup component add rustfmt
When building the master branch, please make sure you are using the latest stable rust version by running:
$ rustup update
When building a specific release branch, you should check the rust version in ci/rust-version.sh
and if necessary, install that version by running:
$ rustup install VERSION
Note that if this is not the latest rust version on your machine, cargo commands may require an override in order to use the correct version.
On Linux systems you may need to install libssl-dev, pkg-config, zlib1g-dev, protobuf etc. On Ubuntu:
$ sudo apt-get update
$ sudo apt-get install libssl-dev libudev-dev pkg-config zlib1g-dev llvm clang cmake make libprotobuf-dev protobuf-compiler
2. Download the source code.
$ git clone https://github.com/solana-labs/solana.git
$ cd solana
3. Build.
$ cargo build
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 the 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") good faith 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 inspirational 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 the 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.