Compare commits

...

1095 Commits
v0.13 ... v0.17

Author SHA1 Message Date
f83694f8e5 Lock blockexplorer version 2019-08-24 20:04:36 -07:00
ae3d0010a3 Revert "Disable osx deploy due to failing macOS CI"
This reverts commit 0a5c54a0ef.
2019-08-20 22:28:52 -07:00
dcffbab82e Update secure variable 2019-08-20 21:49:04 -07:00
98bae5ea98 Update secure variables 2019-08-20 21:49:00 -07:00
fa26cc05c3 Drop os version to resolve Appveyor Server build failure 2019-08-20 21:48:55 -07:00
e480e5444d Delete terminated GCP instances (#5490) (#5492)
automerge

(cherry picked from commit 6085109171)
2019-08-12 08:58:26 -07:00
cf9e6c9ab7 Increase the amount of lamports a validator starts with (#5468)
automerge
2019-08-08 12:04:48 -07:00
0a5c54a0ef Disable osx deploy due to failing macOS CI 2019-08-05 17:27:09 -07:00
7f7a868234 Skip sanity on blockstreamer node at cluster boot.
It may not have caught up to the bootstrap leader yet...
2019-08-05 17:10:36 -07:00
421ad7a0a1 Remove boot_from_snapshot 2019-08-05 16:43:27 -07:00
139c490d1d Remove unused var 2019-08-04 21:29:37 -07:00
8a873365bc Move testnet from ec2 tp gcp 2019-08-04 21:02:25 -07:00
fc2f922e15 Move edge/beta testnets from ec2 to gcp 2019-08-04 20:42:27 -07:00
4279847efd Reduce size of cpu-only gcp instances 2019-08-04 20:36:25 -07:00
bced640541 Reduce AWS node count 2019-08-03 23:51:22 -07:00
21e8bbf955 Change bank to not create default (#5409) (#5410)
automerge
2019-08-02 15:27:27 -07:00
a7c6067e59 getProgramAccounts to check for existing validator-info (#5404) (#5405)
automerge
2019-08-02 08:15:23 -07:00
e1475ca74b Remove sdk-c from the virtual manifest temporarily
For an unknown reason |cargo clippy| is getting stuck in CI
intermittently when trying to build this crate.
2019-08-01 21:10:13 -07:00
fd48ac1896 fix epoch_stakes again (#5396) (#5398)
automerge
2019-08-01 15:19:28 -07:00
2892c36d47 Change default location of solana.h to OUT_DIR (#5389) (#5392)
automerge
2019-08-01 15:02:10 -07:00
c2bd971696 Don't rebuild/retest release tags (#5385) (#5394)
(cherry picked from commit 5212b2716c)
2019-08-01 13:41:27 -07:00
f324099c30 Give crate publishing even more time 2019-08-01 11:18:12 -07:00
d30326ac5a Cargo.lock 2019-08-01 11:04:14 -07:00
0cb99e8ab8 Depersonalize paths 2019-08-01 08:34:47 -07:00
f82f620c7e Bump version to 0.17.2 2019-08-01 08:02:23 -07:00
beb8e89bf4 Bump version to 0.17.1 2019-08-01 07:48:42 -07:00
54ff4529b1 Plumb libra accounts to genesis (bp #5333) (#5379)
automerge
2019-07-31 22:44:14 -07:00
0942cbd89b Handle paying for move transactions with unique solana system transactions (#5317) (#5378)
automerge
2019-07-31 22:02:28 -07:00
88bbaf7add Teach solana-install about release channels (#5372) (#5375)
automerge
2019-07-31 18:18:25 -07:00
d1447b5e52 Synchronize and cleanup instruction processor lists (#5356) 2019-07-31 17:37:52 -07:00
c00bb42ecd Add command to create genesis accounts (#5343) (#5371)
automerge
2019-07-31 17:13:40 -07:00
1a0003fbcc fix epoch_stakes (#5355) (#5369)
automerge
2019-07-31 15:56:48 -07:00
a584ce6472 Ignore flaky test_replicator_startup_2_nodes (#5358)
automerge
2019-07-31 11:35:58 -07:00
63d1f029a9 Ignore flaky local cluster tests (#5347) (#5349)
* Add logging to local_cluster tests

* Ignore flaky test_leader_failure_4, test_repairman_catchup

And crashing banking benchmarks.

(cherry picked from commit 8d243221f0)
2019-07-30 23:08:59 -07:00
24ebf70016 Bump timeouts for publish docker/tarball builds 2019-07-30 20:10:09 -07:00
d18dc94209 Update testnet book source to release 0.17.0 (#5339) 2019-07-29 18:53:00 -06:00
8242fd19eb Move coverage back to the default queue (#5318) (#5320)
(cherry picked from commit 506b305959)
2019-07-28 23:17:45 -07:00
469e91cd8d Add --use_move mode to bench-tps (#5311) (#5316)
automerge
2019-07-28 14:15:57 -07:00
4889c2a29c Add move mode to bench-tps (bp #5250) (#5310)
automerge
2019-07-27 17:51:12 -07:00
3c6115c94a Pull all libra crates from crates.io (bp #5306) (#5307)
automerge
2019-07-27 15:48:41 -07:00
70b15317a9 Move credit-only and Move proposals to the implemented section of the book (#5308) (#5309)
automerge
2019-07-27 15:41:18 -07:00
a834e9ae10 Add libray_api (bp #5304) (#5305)
automerge
2019-07-27 13:30:59 -07:00
7796e87814 Revert "Default log level to to RUST_LOG=solana=info (#5296)" (#5302)
This reverts commit c63a38ae57.
2019-07-27 07:46:45 -07:00
64c770275b Integrate Move VM into main build (#5229)
* Integrate Move VM into top-level build

* Switch to protoc-free libra
2019-07-27 06:59:46 -06:00
855f7ff352 Move Move deps from a branch to a tag (#5300) 2019-07-26 23:51:42 -06:00
b59a99111c Bump url from 1.7.2 to 2.0.0 (#5247)
* Bump url from 1.7.2 to 2.0.0

Bumps [url](https://github.com/servo/rust-url) from 1.7.2 to 2.0.0.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v1.7.2...v2.0.0)

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

* Adapt to url 2.0.0
2019-07-26 21:46:38 -07:00
252257fe66 Rewrite multinode-demo/replicator.sh to avoid fullnode.sh (#5299) 2019-07-26 19:00:34 -07:00
e2c9d87d91 Move verify to finalize (#5297)
automerge
2019-07-26 17:51:07 -07:00
9d34b80ed6 Upgrade to all the latest packages our existing Cargo.toml will allow (#5298)
automerge
2019-07-26 17:21:01 -07:00
c63a38ae57 Default log level to to RUST_LOG=solana=info (#5296) 2019-07-26 16:29:16 -07:00
20da2604f8 storage-keypair argument should not be required (#5295)
automerge
2019-07-26 15:18:55 -07:00
33de2cad6d Replace TokenPair in exchange (#5292)
* simplify token pair representation, rename to AssetPair for forward compat.

* update bench exchange TokenPair use
2019-07-26 14:31:08 -06:00
aef7bae60d Let grace ticks to roll over into multiple leader slots (#5268)
* Let grace ticks to roll over into multiple leader slots

* address review comments
2019-07-26 11:33:51 -07:00
54ac7ed1ea Voting/storage keypair can now be provided by the user (#5288) 2019-07-26 11:05:02 -07:00
0180246680 Clean up argument parsing (#5290)
automerge
2019-07-26 10:37:03 -07:00
dab7de7496 Add confidence cache to BankForks (#5066)
* Add confidence cache to BankForks

* Include stake-weighted lockouts in cache

* Add cache test

* Move confidence cache updates to handle_votable_bank

* Prune confidence cache on prune_non_root()

* Spin thread to process aggregate_stake_lockouts

* Add long-running thread for stake_weighted_lockouts computation
2019-07-26 11:27:57 -06:00
feaf29792f Error cleanly on show vote/stake/storage account pubkey mismatch (#5289)
Also deverb vote/stake account variables
2019-07-26 09:34:12 -07:00
5f09aa36b3 Drop code supporting no leader rotation (#5286) 2019-07-26 09:26:27 -07:00
d6c74f438a Delete vestigal --vote-account argument (#5287)
automerge
2019-07-26 08:42:48 -07:00
349ebec629 Bump serde from 1.0.94 to 1.0.97 (#5285)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.94 to 1.0.97.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.94...v1.0.97)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-26 07:22:25 -06:00
f4554be72c add vote withdraw (#5284) 2019-07-25 23:20:47 -07:00
8537da19bb groom accounts_db (#5283) 2019-07-25 22:59:28 -07:00
d1eff5d607 Merge create-stake-account into delegate-stake (#5280) 2019-07-25 16:53:43 -07:00
19e4f70244 Change default behavior to remove a prerelease tag if present instead of a minor version bump 2019-07-25 16:33:24 -07:00
a233a1c822 Fix poh recorder not flushing virtual ticks immediately (#5277)
* Fix poh not flushing virtual ticks immediately

* Fix test_would_be_leader_soon
2019-07-25 11:08:44 -07:00
27bc0a22dd Add support for invoking and publishing Move modules (#5278) 2019-07-25 09:30:24 -07:00
7ee8383e02 Bump serde_derive from 1.0.94 to 1.0.97 (#5279)
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.94 to 1.0.97.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.94...v1.0.97)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-25 06:47:24 -06:00
bab0f6be1e Store Move account data in a deterministic order (#5276) 2019-07-24 21:43:14 -07:00
535df0026d Fixes for Blocktree space amplification and slot deletion (#5266)
* Fixes for Blocktree space amplification and slot deletion
2019-07-24 17:28:08 -07:00
3bd35dd7cc Remove usage of api.testnet.solana.com (#5274) 2019-07-24 17:06:26 -07:00
39d29fab82 Exchange update cont. (#5272)
* Trade -> Order for keyedAcct indices

* rename deserialize_trade -> deserialize_order

* rename do_order_cancel params

* rename vars *_trade -> *_order
2019-07-24 17:49:10 -06:00
fbfe1a59a6 bump timeout 2019-07-24 13:53:08 -07:00
77c79effc1 Update github token 2019-07-24 13:50:49 -07:00
83540087c3 Switch to forked libra packages (#5270)
* Switch to forked libra packages

* Don't Cargo.lock lib crates
2019-07-24 14:21:22 -06:00
937816e67b Post warning if window service isn't receiving any data (#5269)
automerge
2019-07-24 12:46:10 -07:00
c3a941086d Remove more unwraps (#5267)
automerge
2019-07-24 12:30:43 -07:00
1046c5e32c Adjust log levels (#5265)
automerge
2019-07-24 10:15:49 -07:00
baac8d2590 Upgrade libra (#5264)
automerge
2019-07-24 09:56:29 -07:00
610a02c518 Bump jsonrpc-ws-server from 12.0.0 to 12.1.0 (#5261)
Bumps [jsonrpc-ws-server](https://github.com/paritytech/jsonrpc) from 12.0.0 to 12.1.0.
- [Release notes](https://github.com/paritytech/jsonrpc/releases)
- [Commits](https://github.com/paritytech/jsonrpc/compare/v12.0.0...v12.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-24 10:52:44 -06:00
444bd7a702 Bump semver from 0.7.0 to 0.9.0 (#5260)
Bumps [semver](https://github.com/steveklabnik/semver) from 0.7.0 to 0.9.0.
- [Release notes](https://github.com/steveklabnik/semver/releases)
- [Commits](https://github.com/steveklabnik/semver/compare/v0.7.0...v0.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-24 10:52:20 -06:00
7afc61e0b9 Cap Move program's execution (#5259) 2019-07-24 08:06:03 -07:00
d4d9bec2a9 NDEBUG=1 2019-07-24 07:28:16 -07:00
d647a4ec57 Bump publish-crate.sh timeout 2019-07-23 22:12:34 -07:00
536b4c1a25 Export genesis creation function (#5252) 2019-07-23 21:34:17 -07:00
547a7a345f Add logs to indicate when the leader changes (#5253) 2019-07-23 22:19:20 -04:00
26e380e53c Sort bench-tps keypairs (#5254)
automerge
2019-07-23 17:46:33 -07:00
8a12ed029c make accounts_db own the directory paths (#5230)
* change paths to something accounts_db (the singleton) owns, fixes SIGILL

* fail deserialize if paths don't work
serialize paths, too

* test that paths are populated from a bank snapshot
2019-07-23 13:47:48 -07:00
b41e8333b1 Add support to install a specific Solana version directly from the Github releases (#5248) 2019-07-23 12:51:10 -07:00
8f646e21d7 Bump cc from 1.0.37 to 1.0.38 (#5245)
Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.37 to 1.0.38.
- [Release notes](https://github.com/alexcrichton/cc-rs/releases)
- [Commits](https://github.com/alexcrichton/cc-rs/compare/1.0.37...1.0.38)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-23 10:51:50 -07:00
5608af0246 Cleanup and fix Move account invoking (#5244)
* Remove deps, geneerate genesis, cleanup

* Fix tests, specify sender in ix data

* nits
2019-07-23 08:54:34 -06:00
17b9ea3e3b Update buildkite-secondary.yml 2019-07-23 07:33:13 -07:00
88d4d1db7a Update buildkite.yml 2019-07-23 00:20:05 -07:00
cab4c88c71 Bump timeouts 2019-07-22 23:52:30 -07:00
4ec5a899f5 Check longer 2019-07-22 23:41:42 -07:00
c2f74330ef Drop ring crate (#5242) 2019-07-22 23:11:40 -07:00
2c8e0bcf87 Introduce --config-dir to avoid shipping clear-config.sh (#5241) 2019-07-22 22:59:02 -07:00
4966ab528e validator.sh: Add --reset-ledger option (#5235)
* Add --recreate-ledger option

* --reset-ledger
2019-07-22 22:20:54 -07:00
5f81a67298 Add --no-deploy option to allow restarting nodes without a software update (#5182) 2019-07-22 21:38:26 -07:00
a0ccdccff1 Call book/build.sh from docker (#5237)
* Call book/build.sh from docker

* debug

* Revert "debug"

This reverts commit 32986b73b7.
2019-07-22 21:37:43 -07:00
735c7c9841 Add manual publish for book and create book-beta (#5112) 2019-07-22 17:45:00 -06:00
3a69459645 Surface validator pubkey in metrics (#5227) 2019-07-22 16:08:21 -07:00
21cef2fe21 Do not attempt to create solana user multiple times (#5228)
* Do not attempt to create solana user multiple times
2019-07-22 16:13:08 -06:00
038c6ea0a7 Bump solana_libra to v0.0.0.1 (#5225)
automerge
2019-07-22 14:17:06 -07:00
81f4fd56c7 Log the repairee pubkey when unable to serve them (#5222)
automerge
2019-07-22 14:13:29 -07:00
264a3d7dde Increase ticks_per_slot for banking benchmark (#5221) 2019-07-22 13:57:28 -07:00
43bf176fab more granular check for memoffset ignore in audit (#5219)
* more granular check for memoffset ignore in audit

* debugggin

* debugggin

* debugggin

* debugggin

* debugggin
2019-07-22 13:36:27 -07:00
baec17fdf4 Fix some nightly warnings (#5218) 2019-07-22 12:51:02 -07:00
186b514ebb Embed Move (#5150)
automerge
2019-07-22 12:01:52 -07:00
2d42c1e33e add root to terminology (#5209)
* add root to terminology

* review feedback
2019-07-22 09:36:20 -07:00
9cef522eee Bump walkdir from 2.2.8 to 2.2.9 (#5204)
Bumps [walkdir](https://github.com/BurntSushi/walkdir) from 2.2.8 to 2.2.9.
- [Release notes](https://github.com/BurntSushi/walkdir/releases)
- [Commits](https://github.com/BurntSushi/walkdir/compare/2.2.8...2.2.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-22 09:35:46 -07:00
a6302acfd5 Bump jsonrpc-http-server from 12.0.0 to 12.1.0 (#5211)
Bumps [jsonrpc-http-server](https://github.com/paritytech/jsonrpc) from 12.0.0 to 12.1.0.
- [Release notes](https://github.com/paritytech/jsonrpc/releases)
- [Commits](https://github.com/paritytech/jsonrpc/compare/v12.0.0...v12.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-22 10:34:27 -06:00
ac72265c6b Request a uniform timezone 2019-07-22 09:25:36 -07:00
09da6b4b48 Encourage setting an RPC port 2019-07-22 08:23:36 -07:00
0d8f5379a0 Add time units 2019-07-22 08:22:21 -07:00
02c7b89a8f Update location of TdS external accounts file url 2019-07-21 17:38:15 -07:00
90ae33c200 Update incoming_webhook 2019-07-21 11:27:19 -07:00
55c879ce2d Update S3 key 2019-07-21 11:18:17 -07:00
1b5a332239 Adjustments for appveyor server 2019-07-21 09:21:28 -07:00
595017499e accounts_index: RwLock per-account (#5198)
* accounts_index: RwLock per-account

Lots of lock contention on the accounts_index lock,
only take write-lock on accounts_index if we need to insert/remove an
account.
For updates, take a read-lock and then write-lock on the individual
account.

* Remove unneeded enumerate and add comments.
2019-07-20 17:58:39 -07:00
9b1471acae Upgrade to Rust 1.36.0 (#5206)
* Upgrade to Rust 1.36.0

* Move test-checks.sh back to stable

* update nightly version to 2019-07-19

* use both nightly and stable for checks
2019-07-20 18:53:16 -06:00
b766ac0899 rent (#5205) 2019-07-20 16:28:17 -07:00
e6b525a614 disable audit until crossbeam epoch release (#5208) 2019-07-20 15:50:26 -07:00
a07b17b9b5 Drop older slots in the ledger (#5188)
* Add facility to delete blocktree columns in range

* Add ledger cleanup service

* Add local_cluster test
2019-07-20 13:13:55 -07:00
9d2940d487 Show wallet commands for better log debugging 2019-07-19 20:21:51 -07:00
6969ece2dd Ensure CI_OS_NAME is set for appveyor server 2019-07-19 20:06:32 -07:00
48fc35884c Add Transaction Documentation (#5115) 2019-07-19 16:42:50 -06:00
0958905df8 Bump reqwest from 0.9.18 to 0.9.19 (#5201)
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.9.18 to 0.9.19.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.9.18...v0.9.19)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-19 16:13:34 -06:00
c95cda51c9 Fix internal node lamport funding and staking allocation logic (#5192)
* Plumb node funding from genesis

* Cleanup naming convention

*  Fix balance vs stake yml file logic

* Lamps not Stakes
2019-07-19 12:51:38 -06:00
3f54c0f1a6 Update struct order arbitrarily to match rpc output (#5197) 2019-07-19 11:45:04 -06:00
4684faa5e8 Bump jsonrpc-core from 12.0.0 to 12.1.0 (#5143)
Bumps [jsonrpc-core](https://github.com/paritytech/jsonrpc) from 12.0.0 to 12.1.0.
- [Release notes](https://github.com/paritytech/jsonrpc/releases)
- [Commits](https://github.com/paritytech/jsonrpc/compare/v12.0.0...v12.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-19 09:59:56 -07:00
111d0eb89b runtime: Add bench for accounts::hash_internal_state (#5157)
* runtime: Add bench for accounts::hash_internal_state

* fixup! cargo fmt

* fixup! cargo clippy

* fixup! Use a more representitive number of accounts

* fixup! More descriptive name for accounts creation helper
2019-07-19 10:32:29 -06:00
8b69998379 Lower recovery messages (#5181) 2019-07-19 09:20:14 -07:00
a21251dfea Fix up signal handling 2019-07-19 08:35:22 -07:00
06cd7c1020 Disable restart 2019-07-19 08:35:22 -07:00
782846f295 Document fetch-perf-libs.sh when building with CUDA 2019-07-19 08:35:22 -07:00
19e131d710 Bump jsonrpc-derive from 12.0.0 to 12.1.0 (#5193)
Bumps [jsonrpc-derive](https://github.com/paritytech/jsonrpc) from 12.0.0 to 12.1.0.
- [Release notes](https://github.com/paritytech/jsonrpc/releases)
- [Commits](https://github.com/paritytech/jsonrpc/compare/v12.0.0...v12.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-19 07:34:48 -07:00
9fd34cd985 Bump untrusted from 0.6.2 to 0.7.0 (#5194)
Bumps [untrusted](https://github.com/briansmith/untrusted) from 0.6.2 to 0.7.0.
- [Release notes](https://github.com/briansmith/untrusted/releases)
- [Commits](https://github.com/briansmith/untrusted/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-19 07:34:04 -07:00
adfb8ff2a1 Add getEpochInfo() and getLeaderSchedule() RPC methods (#5189)
* Add getLeaderSchedule() RPC method

* Add getEpochInfo() RPC method

* Add JSON RPC docs
2019-07-19 07:31:18 -07:00
83aa609540 Bump winreg from 0.6.0 to 0.6.1 (#5149)
Bumps [winreg](https://github.com/gentoo90/winreg-rs) from 0.6.0 to 0.6.1.
- [Release notes](https://github.com/gentoo90/winreg-rs/releases)
- [Commits](https://github.com/gentoo90/winreg-rs/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-18 21:24:40 -07:00
1e1cb7c57c Select stable rust version (#5180) 2019-07-18 21:19:07 -07:00
cdbd1b908a Ensure validator process is kill when stdout/stderr are redirected (#5179) 2019-07-18 21:18:48 -07:00
a12e7a2e33 Separate build and deploy steps in net/net.sh (#5184)
So one can keep the network up while a new experiment is building
2019-07-18 18:59:47 -07:00
25080f1a33 fix book typos (#5185) 2019-07-18 17:24:22 -07:00
afa05acb32 more replay_stage grooming (#5163) 2019-07-18 14:54:27 -07:00
d47caf2af8 add information to panic (#5177) 2019-07-18 14:41:32 -07:00
a3a91ba222 Fix misleading variable name (#5176)
automerge
2019-07-18 14:07:32 -07:00
751b54b60b Skip sleeping in replay stage if a bank was recently processed (#5161)
* Skip sleeping in replay stage if a bank was recently processed

* Remove return
2019-07-18 12:04:53 -07:00
488dd0e563 Keybase: s/id/username (#5165) 2019-07-18 12:16:13 -06:00
b58558ea4e net/: startnode/stopnode now works for blockstreamer/replicator nodes (#5146)
* startnode/stopnode now works for blockstreamer/replicator nodes

* Plumb --skip-ledger-verify through net/
2019-07-17 19:26:23 -07:00
6ad9dc18d8 Add ability to prune ledger (#5128)
* Add utility to prune the ledger

* Add tests

* Fix clippy

* Fix off by one

* Rework to force delete every column

* Minor fixup
2019-07-17 14:42:29 -07:00
027ebb6670 no more OUT_DIR (#5139)
* no more OUT_DIR

* no more OUT_DIR

* more information about failure
2019-07-17 14:27:58 -07:00
0ffd91df27 groom poh_recorder (#5127)
* groom poh_recorder

* fixup

* nits

* slot() from the outside means "the slot the recorder is working on"

* remove redundant check

* review comments, put next_tick back in the "is reset" check

* remove redundant check
2019-07-17 14:10:15 -07:00
10d85f8366 Add weighted shuffle support for values upto u64::MAX (#5151)
automerge
2019-07-17 12:44:28 -07:00
7aad427511 Bump libloading from 0.5.1 to 0.5.2 (#4950)
Bumps [libloading](https://github.com/nagisa/rust_libloading) from 0.5.1 to 0.5.2.
- [Release notes](https://github.com/nagisa/rust_libloading/releases)
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.5.1...0.5.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-17 09:29:45 -06:00
bbd0455418 Bump log from 0.4.6 to 0.4.7 (#5144)
Bumps [log](https://github.com/rust-lang/log) from 0.4.6 to 0.4.7.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang-nursery/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.6...0.4.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-17 09:25:57 -06:00
5174b3bc3f use precalculated max_tick_height (#5134) 2019-07-17 00:19:38 -07:00
f88c72c41e stress tweaks (#5140) 2019-07-16 22:04:40 -07:00
9f678cc32a Show stake pubkey 2019-07-16 20:10:15 -07:00
57036fbcc1 Check harder on crates.io for recently published crates (#5136) 2019-07-16 19:09:49 -07:00
349e5001d6 clear-config.sh now works with a secondary disk (#5135) 2019-07-16 19:09:14 -07:00
94db9cd412 Reduce banking_stage bench copy-paste code and fix programs bench (#4926) 2019-07-16 18:28:18 -07:00
b505a0df22 Throw more threads at hash_internal_state (#5023) 2019-07-16 16:58:30 -07:00
acf096c5f7 Add cross-program invocation proposal (#4922)
automerge
2019-07-16 16:36:05 -07:00
e8583f5cfe Bump tokio from 0.1.21 to 0.1.22 (#4935)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 0.1.21 to 0.1.22.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-16 16:48:11 -06:00
5825b967d2 Check for valid pid before kill in node stop script (#5126) 2019-07-16 14:31:15 -07:00
bf5bce50a4 Fix stake pruning test (#5124) 2019-07-16 13:20:03 -04:00
77ea8b9b3e Add LoaderInstruction::InvokeMain (#5116)
* Remove unreachable, untested runtime check

* tx_data -> ix_data

* Add LoaderInstruction::InvokeMain

* Add test and allow loaders to be registered statically.

* Fix clippy error
2019-07-16 10:45:32 -06:00
176cec6215 Update Rust-BPF Sysroot (#5122) 2019-07-16 07:42:22 -08:00
5ab4975c44 Improve validator-info CLI (#5121)
* Fix index OOB panic

* Handle 'get' empty validator-info responses properly

* Improve 'get' argument flow

* Improve arg help text

* Improve 'publish' argument flow

* Update book doc
2019-07-16 09:22:55 -06:00
7e60ee39d9 Add missing dash 2019-07-16 07:27:35 -07:00
3ea2933e2d It's 2019 2019-07-15 20:58:21 -07:00
fe87c05423 fix transaction_count (#5110)
* fix transaction_count

* add sig count to bank hash
2019-07-15 13:42:59 -07:00
6b86f85916 Add C API (#5072) 2019-07-15 13:17:17 -06:00
04649de6a6 Boot remote native loads, take 2 (#5106)
* Drop dependencies on remote native loads

* Remove remote native loads
2019-07-15 13:16:09 -06:00
92d78451b1 Update expected keybase-pubkey location (#5104)
automerge
2019-07-15 09:28:06 -07:00
0c87928132 Keybase pubkey file instructions and verification for validators (#5090)
* Document publishing a pubkey on keybase

* Verify keybase-pubkey
2019-07-14 23:48:50 -06:00
db7e78bf99 Add node zone and count to ENV (#5100)
* Add node zone and count to ENV
2019-07-14 22:40:18 -06:00
adecd4cfdc Pull testnet vars up to buildkite env (#5098) 2019-07-14 20:27:49 -06:00
40faaef9da Revert "Logging (#5017)" (#5096)
This reverts commit b50a3bae72.
2019-07-14 18:48:15 -07:00
9b54528c8e Fix some nightly warnings (#5093)
ONCE_INIT => Once::new
Box<Error> => Box<dyn Error>
2019-07-14 13:37:55 -07:00
440d006ec1 Plumb --no-snapshot in from CI (#5077)
* Plumb --no-snapshot in from CI
2019-07-14 13:17:30 -06:00
6c49b10784 Purge remaining uses of Locktower (#5076)
automerge
2019-07-13 00:24:15 -07:00
c858d1dbb3 Bump tempfile from 3.0.8 to 3.1.0 (#4882)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.0.8 to 3.1.0.
- [Release notes](https://github.com/Stebalien/tempfile/releases)
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/NEWS)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.0.8...v3.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-12 23:57:35 -07:00
741a0a8a4e Correctly decode update manifest (#5086)
automerge
2019-07-12 22:55:55 -07:00
16b6576839 use precalculated max_tick_height (#5084) 2019-07-12 22:25:48 -07:00
6accf21229 Add epoch voting history to show-vote-account (#5080) (#5085)
automerge
2019-07-12 22:01:12 -07:00
d2b21ce8d0 Stop trying to publish crates that are unpublishable 2019-07-12 21:53:09 -07:00
b01990d480 Avoid trying to republish crates already on crates.io 2019-07-12 21:43:16 -07:00
d7fdfb7e21 Give publish-crate more time 2019-07-12 20:28:10 -07:00
19fe468dbc Add design proposal to embed Libra's Move (#5067)
* Add design proposal to embed Libra's Move

* Apply review feedback

* Pipeline VM -> the runtime
* defines -> define
2019-07-12 21:12:55 -06:00
259a5130a8 whoops (#5083) 2019-07-12 19:08:51 -07:00
0d27515d09 tmp dirs target to farf (#5079) 2019-07-12 18:28:42 -07:00
1c966aac25 Facility to generate a blocktree prune list using ledger tool (#5041)
automerge
2019-07-12 16:58:13 -07:00
d2b6c2e0ce syscall work, rename syscall to sysvar, rename current to clock (#5074)
* syscall work, rename syscall to sysvar, rename current to clock

* missed one

* nit
2019-07-12 16:38:15 -07:00
7aecb87bce Add a version field to blobs (#5057) 2019-07-12 13:43:19 -07:00
4a02914b30 Add pub key authorized list 2019-07-12 12:34:17 -07:00
7c12ecbe81 Fix unnecessary computation (#5055) 2019-07-12 11:30:37 -07:00
f093377805 apt-get update before installing certbot (#5054)
* apt-get update before installing certbot
2019-07-12 11:50:40 -06:00
5ac173d208 Enable GPUs and secondary disks for TdS net, pull external account file (#5031)
* Enable V100 GPUs over 3 regions for TdS cluster

* Turn on secondary config-local drive for tds net

* Enable long args bypass for GPU machine details

* bypass quoted long arg

* Pull external account file from wget

* typo

* Symlink config-local instead of changing the path variables

* Fix link path
2019-07-12 09:38:47 -06:00
9f58318fc5 Add --no-snapshot to disable booting a validator from a snapshot (#5050)
automerge
2019-07-11 21:03:17 -07:00
ebcdc06dc3 Restore ledger-tool print and json commands (#5048)
* Restore ledger-tool print and  json commands

* Remove obsolete read_ledger()
2019-07-11 20:33:36 -07:00
22315d88e7 Fix credit only commit_credits race (#5028)
* Fix credit only drain race

* Refactor commit credits for tests

* Fix tests to use commit_credits_unsafe
2019-07-11 18:46:49 -07:00
0a36a78133 Fix replicator segment selection (#5046) 2019-07-11 18:31:41 -07:00
a25446f045 Pull in more Rust-BPF compatible built-ins (#5043) 2019-07-11 15:16:30 -08:00
2860d2fe27 Pull in support for Rust-BPF stack argument passing (#5038) 2019-07-11 14:27:18 -08:00
e4861f52e0 Add support for additional disks for config-local (#5030)
* Add support for additional disks for config-local

* Restore wrongly deleted lines

* Shellcheck

* add args in the right place dummy

* Fix nits

* typo

* var naming cleanup

* Add stub function for remaining cloud providers
2019-07-11 16:23:32 -06:00
5698d48dc8 merkle-tree: Make instantiation a little less painful (#5037)
automerge
2019-07-11 15:15:08 -07:00
5b95685e12 Add rewards to is_syscall_id() (#5035) 2019-07-11 13:47:22 -08:00
4c90898f0b Dynamic erasure set configuration (#5018)
* Use local erasure session to create/broadcast coding blobs

* Individual session for each recovery (as the config might be different)

* address review comments

* new constructors for session and coding generator

* unit test for dynamic erasure config
2019-07-11 13:58:33 -07:00
a191f3fd90 add node_pubkey to vote warning (#5033) 2019-07-11 13:12:26 -07:00
b2c776eabc Fix getProgramAccounts RPC (#5024)
* Use scan_accounts to load accounts by program_id

* Add bank test

* Use get_program_accounts in RPC
2019-07-11 12:58:28 -06:00
2c8d6f87e6 Add validator-info CLI (#4970)
* Add validator-info CLI

* Add GetProgramAccounts method to solana-client

* Update validator-info args, and add get subcommand

* Update ValidatorInfo lengths

* Add account filter for get --all

* Update testnet participation doc to reflect validator-info

* Flesh out tests

* Review comments
2019-07-11 12:38:52 -06:00
08f6de0acd Plumb scan_accounts into accounts_db, adding load from storage (#5029) 2019-07-11 12:16:02 -06:00
bd92f37553 Terminology (#4995)
* update exchange program: tradeOrder->Order, tradeRequest->OrderRequest, tradeCancel->OrderCancel

* Update bench-exchange: tradeOrder -> Order

* update bench exchange Readme
2019-07-10 23:22:33 -06:00
2abbc89dcd add accounts_index_scan_accounts (#5020) 2019-07-10 22:06:32 -07:00
8cad992170 reduce replicode in accounts, fix cast to i64 (#5025) 2019-07-10 21:22:58 -07:00
41d0db078e Wait for bootstrap leader to initialize before starting other validators (#5027) 2019-07-10 21:03:48 -07:00
8781aebe06 Pass SOLANA_METRICS_CONFIG along to oom-monitor.sh (#5021) 2019-07-10 20:11:55 -07:00
727c15ef8a start from random point in fork stores (#5010) 2019-07-10 18:44:49 -07:00
e4926e4110 Set exit when replicator run exits (#5016) 2019-07-10 16:27:18 -07:00
b50a3bae72 Logging (#5017)
* Add logging to replay_stage

* locktower logging
2019-07-10 15:52:31 -07:00
35ec7a5156 Decouple turns from segments in PoRep (#5004)
* Decouple Segments from Turns in Storage

* Get replicator local cluster tests running in a reasonable amount of time

* Fix unused imports

* Document new RPC APIs

* Check for exit while polling
2019-07-10 13:33:29 -07:00
a383ea532f Implement new Index Column (#4827)
* Implement new Index Column

* Correct slicing of blobs

* Mark coding blobs as coding when they're recovered

* Prevent broadcast stages from mixing coding and data blobs in blocktree

* Mark recovered blobs as present in the index

* Fix indexing error in recovery

* Fix broken tests, and some bug fixes

* increase min stack size for coverage runs
2019-07-10 11:08:17 -07:00
b1a678b2db Document getSlotsPerSegment in rpc api doc (#5005)
* Document getSlotsPerSegment in rpc api doc
2019-07-10 10:05:11 -07:00
e563a4dda3 Rename tds-testnet to tds (#5008) 2019-07-10 10:26:24 -06:00
dbe533385e Improve signature checks in config_api (#5001)
automerge
2019-07-10 01:00:49 -07:00
f537482c86 remove set_leader from cluster_info (#4998) 2019-07-09 22:06:47 -07:00
aebd70ddce Move letsencrypt arg to create_args 2019-07-09 21:27:12 -07:00
7d80cfb17a Include --letsencrypt ($1) 2019-07-09 20:54:11 -07:00
b8e7736af2 Move SLOTS_PER_SEGMENT to genesis (#4992)
automerge
2019-07-09 16:48:40 -07:00
32b55e6703 Fund solana-install deployments from the mint keypair to avoid airdrops (#4997) 2019-07-09 16:45:28 -07:00
0a949677f0 net/ plumbing to manage LetsEncrypt TLS certificates (#4985)
automerge
2019-07-09 15:45:46 -07:00
f777a1a74c groom replay_stage and poh_recorder (#4961)
* groom replay_stage and poh_recorder

* fixup

* fixup

* don't freeze() parent, need to review bank_forks and maybe vote...
2019-07-09 15:36:30 -07:00
d111223085 Fix always passing in remote filename, even if no accounts file (#4993)
* Fix always passing in remote filename, even if no accounts file

* typo
2019-07-09 16:07:31 -06:00
1ca7e9f67b Add testnet-tds support to testnet manager (#4762)
* Add testnet-tds support to testnet scripts
2019-07-09 14:39:55 -06:00
bc8f435d45 Shell script nits (#4982) 2019-07-09 12:09:13 -08:00
5e221bf219 Make config_api more robust (#4980)
* Make config_api more robust

* Add test and update store instruction
2019-07-09 13:37:18 -06:00
fc58b3e8c3 Fix typos 2019-07-09 09:35:52 -06:00
1033f52877 Add pubkey (#4971) 2019-07-09 00:54:22 -07:00
4771177f9d Update LLVM to v0.0.11 (#4976) 2019-07-08 23:22:49 -08:00
50c6b5d62d Work around missing lib on linux (Issue #4972) (#4975) 2019-07-08 22:24:57 -08:00
f9a2254688 Split out Rust BPF no-std stuff (#4968) 2019-07-08 20:28:05 -08:00
49250f62aa make commit_credits one trip through the rwlock (#4969) 2019-07-08 20:46:21 -07:00
22ef3c7c54 Blob verify (#4951)
* Ensure signable data is not out of range

* Add a broadcast stage that puts bad sizes in blobs

* Resign blob after modifyign size

* Remove assertions that fail when size != meta.size
2019-07-08 18:21:52 -07:00
417e8d5064 fix blocktree_processor test_process_entries_stress (#4967) 2019-07-08 18:11:58 -07:00
1feb9bea21 Harden Merkle Tree against second pre-image attacks (#4925)
* merkle-tree: Harden against second pre-image attacks

* core/chacha: Bump test golden hash
2019-07-08 19:00:06 -06:00
563c42b829 Consistant message format (#4965) 2019-07-08 16:07:45 -08:00
841e5e326c Program mutable lamports (#4964) 2019-07-08 15:52:25 -08:00
281deae102 Update config program to accommodate multiple signers (#4946)
* Update config program to accommodate multiple signers

* Update install CLI

* Remove account_type u32; add handling for unsigned keys in list

* ConfigKeys doc
2019-07-08 18:33:56 -05:00
c5ba2e0883 bank_forks test stability (#4959)
automerge
2019-07-08 15:55:49 -07:00
eb4edd75e6 make bank commit_credits non public (#4944)
* make bank commit_credits non pub

* track down create() failure

* move bank_client to process_transaction(), which commits credits
2019-07-08 15:37:54 -07:00
bb6bcd79c0 Handle replicator errors without panicking (#4955)
* Handle replicator errors without panicking

* Unwelcome println
2019-07-08 12:43:35 -07:00
ef7022d638 Refactor replicators to not block on startup (#4932)
* Refactor replicators to not block on startup

* Ignore setup failure
2019-07-08 10:17:25 -07:00
2aac094f63 Ensure blobs are deserializable without unwrapping (#4948)
* Return result from deserializing blobs in blocktree instead of assuming deserialization will succeed

* Mark bad deserialization as dead fork

* Add test for corrupted blobs in blocktree and replay_stage
2019-07-07 14:37:12 -07:00
fc180f4cbf Halve stake of malicious validator (#4937) 2019-07-05 15:45:39 -07:00
e26a0bf840 Bump env_logger from 0.6.1 to 0.6.2 (#4879)
Bumps [env_logger](https://github.com/sebasmagri/env_logger) from 0.6.1 to 0.6.2.
- [Release notes](https://github.com/sebasmagri/env_logger/releases)
- [Changelog](https://github.com/sebasmagri/env_logger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sebasmagri/env_logger/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-05 14:11:10 -06:00
3557975c1f install: more little window fixes (#4930)
* Only add .exe extension if no extension was given

* Switch to ctrlc crate for freebie Windows ^C handling
2019-07-03 17:45:08 -07:00
b4aebbd991 Increment InfluxDB to 1.7 (#4931) 2019-07-03 17:44:49 -07:00
db13b52e6a Bump serde_json from 1.0.39 to 1.0.40 (#4881)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.39 to 1.0.40.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.39...v1.0.40)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-03 16:15:56 -06:00
f1f6537837 Reduce default commission from 100% to 50% (#4929) 2019-07-03 14:18:08 -07:00
2ec5d2c7f5 start local_cluster nodes from genesis blocks (#4928) 2019-07-03 14:03:52 -07:00
42e5623e26 Update rust-bpf-sysroot to v0.5 (#4920) 2019-07-03 11:20:21 -08:00
ab9f2adc69 [Security] Bump smallvec from 0.6.9 to 0.6.10 (#4921)
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 0.6.9 to 0.6.10. **This update includes security fixes.**
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-03 12:12:48 -07:00
f551b34725 Fix issue in polling for transaction signatures (#4923)
- Specifically if multiple confirmation for the signature is requested
2019-07-02 20:56:10 -07:00
55b8ff72d0 Enable parallel tests to reduce test time (#4919)
* Add crate to serialize some tests

* Ignore unused attribute warning

* Enable parallel run in CI

* Try to fix lograte tests

* Fix interdependent counter tests
2019-07-02 17:35:03 -07:00
bf319ab06d Convert syscall accounts to credit only accounts (#4915) 2019-07-02 15:17:28 -07:00
12ef0c25b5 change vote commission to u8 (from u32) (#4887)
automerge
2019-07-02 14:18:11 -07:00
8620d0a3b2 Add curl retries 2019-07-02 08:37:18 -07:00
933ae51fcc Add .exe extension before checking for a program file on windows (#4902) 2019-07-02 08:04:27 -07:00
c1201e54fa Avoid signal-hook crate on windows (#4900) 2019-07-01 22:52:55 -07:00
3615445a12 Broadcast run for injecting fake blobs in turbine (#4889)
* Broadcast run for injecting fake blobs in turbine

* address review comments

* new local cluster test that uses fake blob broadcast

* added a test to make sure tvu_peers ordering is guaranteed
2019-07-01 17:54:03 -07:00
091999a17e fix Instruction and CompiledInstruction field names (#4895)
* s/program_ids_index/program_id for Instruction

* s/program_ids_index/program_id_index for CompiledInstruction
2019-07-01 18:34:22 -06:00
417066ad30 Fix bench-tps funding math; make generate_keypairs() and fund_keys() algorithms consistent (#4841)
* Fix funding math; make generate_keypairs and fund_keys consistent

* Add test, and fix inconsistencies it exposes

* De-pow math, and use assert_eq in tests for better failure msgs
2019-07-01 18:32:03 -06:00
2abe051a1f run command now kills child process on SIGTERM to cleanly exit (#4896)
automerge
2019-07-01 17:10:14 -07:00
65adce65fa Always send pull responses to the origin addr (#4894) 2019-07-01 16:49:05 -07:00
0c8f187993 remove syscall tick height (#4891) 2019-07-01 16:21:51 -07:00
cbd2938035 update book with stake stuff (#4893) 2019-07-01 15:16:41 -07:00
0999225794 Try to gracefully terminal child process before using SIGKILL (#4890) 2019-07-01 14:08:30 -07:00
38b44f2496 Reduce slot duration and consecutive leader slots (#4838)
* change consecutive leader slots to 4

* reduce polling frequency for transaction signature confirmation

* adjust wait time for transaction signature confirmation

* fix nominal test

* fix flakiness in wallet pay test
2019-07-01 13:21:00 -07:00
c1953dca8f Cleanup some of banking stage (#4878)
* Add committable transactions that cause errors like InstructionErrors back to retryable list on MaxHeightReached

* Remove unnecessary logic

* Add comments/renaming for clarity
2019-07-01 12:14:40 -07:00
19ea5fe0c0 Rework fullnode.sh to recover better from genesis block resets (#4884) 2019-07-01 11:54:00 -07:00
d7ed3b8024 Add RPC api to return program accounts (#4876)
automerge
2019-06-29 09:59:07 -07:00
a89589a1d5 Add Measure abstraction over measuring time intervals (#4851)
Allows one to swap in different implementations. This provides
the normal Insant::now() -> .elapsed() path.
2019-06-29 15:34:49 +02:00
41bda18046 Disable Enter prompt when stdin is not a tty (#4874) 2019-06-28 17:43:43 -07:00
0c832f4668 Don't prompt the user to update their PATH if --no-modify-path was supplied (#4872) 2019-06-28 16:45:01 -07:00
75b494d4a3 Lower warn to info, fetch from validator root instead of root + 1 (#4870)
* Lower warn to info, fetch from validator root instead of root + 1

* b/c -> because
2019-06-28 16:17:20 -07:00
f0191a98ab Bump serde from 1.0.93 to 1.0.94 (#4864)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.93 to 1.0.94.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.93...v1.0.94)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-28 15:07:16 -07:00
76413cbfac Ensure validator process is killed when fullnode.sh is killed (#4869)
automerge
2019-06-28 14:24:44 -07:00
0fa1af5d47 Cleanup num_threads() and batch_limit numbers (#4852) 2019-06-28 10:55:24 +02:00
af1c70f032 book: Add simple payment and state verification proposal (#4200)
automerge
2019-06-27 17:08:10 -07:00
278614fc7c Impl credit-only accounts in Budget (#4862) 2019-06-27 19:22:21 -04:00
baca35ef4d book: Make build a little less annoying (#4861)
automerge
2019-06-27 15:20:37 -07:00
66552d7047 Credit-Only Accounts: Cache account balance for thread-safe load/store (#4691)
* Implement CreditOnlyLocks

* Update credit-only atomic on account load

* Update credit-only atomic after bank.freeze_lock; store credits if all credit-only lock references are dropped

* Commit credit-only credits on bank freeze

* Update core to CreditAccountLocks

* Impl credit-only in System Transfer

* Rework CreditAccountLocks, test, and fix bugs

* Review comments: Pass CreditAccountLocks by reference; Tighten up insert block

* Only store credits on completed slot

* Check balance in bench_exchange funding to ensure commit_credits has completed

* Add is_debitable info to KeyedAccount meta to pass into programs

* Reinstate CreditOnlyLocks check on lock_account

* Rework CreditAccountLocks to remove strong_count usage

* Add multi-threaded credit-only locks test

* Improve RwLocks usage

* Review comments: panic if bad things happen; tighter code

* Assert lock_accounts race does not happen

* Revert panic if bad things happen; not a bad thing
2019-06-27 17:25:10 -04:00
979df17328 Bump serde_derive from 1.0.93 to 1.0.94 (#4856)
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.93 to 1.0.94.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.93...v1.0.94)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-27 13:18:19 -07:00
6cec61dcfc Re-enable tests (#4848) 2019-06-27 12:09:14 -07:00
a9b044f0ab Fix banking_stage benchmark sends (#4850)
Only one big batch was being sent so only 1
thread active at a time in the benchmark.
2019-06-27 10:37:33 +02:00
fbea9d8621 Page-pin packet memory for cuda (#4250)
* Page-pin packet memory for cuda

Bring back recyclers and pin offset buffers

* Add packet recycler to streamer

* Add set_pinnable to sigverify vecs to pin them

* Add packets reset test

* Add test for recycler and reduce the gc lock critical section
* Add comments/tests to cuda_runtime

* Add recycler to recv_blobs path.

* Add trace/names for debug and PacketsRecycler to bench-streamer

* Predict realloc and unpin beforehand.

* Add helper to reserve and pin

* Cap buffered packets length

* Call cuda wrapper functions
2019-06-27 09:32:32 +02:00
44a572416d Save snapshots followed by accounts to avoid stale account data (#4847)
* save snapshots before account stores

* update comment
2019-06-26 23:19:55 -07:00
97c97db97e Fix early exit clearing all buffered packets (#4810) 2019-06-26 22:39:50 -07:00
b8ae025f90 rsync of ledger/ and state.tgz now works on both macOS and Linux (#4845)
automerge
2019-06-26 22:10:24 -07:00
27221e28f6 Use default pubkey for solana-install sanity check 2019-06-26 21:49:22 -07:00
9a52b01171 Change to crossbeam channel in banking_threads VerifiedReceiver (#4822)
* Add crossbeam channel instead of channel in banking_stage
2019-06-26 18:42:27 -07:00
8cea650535 Handle NaN and inifinite point values (#4839) 2019-06-26 18:33:52 -07:00
531679eeaf Bump generic-array from 0.13.0 to 0.13.1 (#4801)
Bumps [generic-array](https://github.com/fizyk20/generic-array) from 0.13.0 to 0.13.1.
- [Release notes](https://github.com/fizyk20/generic-array/releases)
- [Changelog](https://github.com/fizyk20/generic-array/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fizyk20/generic-array/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-26 17:47:12 -06:00
850f77ab3b Minor refactor of duplicated reward claim logic (#4835)
automerge
2019-06-26 15:01:45 -07:00
4a10fd3272 Upload all artifacts 2019-06-26 14:37:18 -07:00
9e2eb9e4f9 Set CI_REPO_SLUG correctly for the solana-secondary pipeline 2019-06-26 14:37:18 -07:00
8120b57f17 Setup reward pools in genesis (#4831)
automerge
2019-06-26 13:51:17 -07:00
f651c0922a Airdrop more token in wallet sanity due to fee (#4830)
automerge
2019-06-26 13:32:58 -07:00
8d2ec20201 Tidied up intro paragraph (#4819)
I tidied up the intro paragraph!
2019-06-26 12:12:25 -07:00
dce1f80aac Made tiny change to second paragraph (#4820)
Replaced 'it's' with 'Solana
2019-06-26 12:12:11 -07:00
df1c473341 Add storage point tracking and tie in storage rewards to economics (#4824)
* Add storage point tracking and tie in storage rewards to epochs and economics

* Prevent validators from updating their validations for a segment

* Fix test

* Retain syscall scoping for readability

* Update Credits to own epoch tracking
2019-06-26 10:40:03 -07:00
8a64e1ddc3 add fee burning (#4818) 2019-06-26 10:13:21 -07:00
eb47538a82 Bump chrono from 0.4.6 to 0.4.7 (#4812)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.6 to 0.4.7.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/master/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.6...v0.4.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-26 07:58:41 -06:00
861d6468ca Stake weighted pruning for the gossip network (#4769)
* Stake weighted pruning

* Fix compile error

* Fix clippy errors

* Add helper for creating a connected staked network

* Bug fixes and test groundwork

* Small refactor

* Anatoly's feedback and tests

* Doc updates

* @rob-solana's feedback

* Fix test bug and add log trace

* @rob-solana's feedback
2019-06-26 00:30:16 -07:00
d6737b8cc9 Set epoch schedule in set_root in leader schedule cache (#4821) 2019-06-26 00:19:48 -07:00
30592f2b12 Integration tests for stake API (#4811)
* more tests for rewards redemption

* break circular deps

* code review
2019-06-25 23:00:35 -07:00
1f950781c2 Use temp path for append_vec tests (#4765)
* Use temp path for serialize test

* set account path
2019-06-25 16:11:57 -07:00
f20ba423ca Merklize PoH TX mixin hash (#4644) 2019-06-25 14:44:27 -06:00
c5e6ebb496 Create snapshots sparsely (#4815) 2019-06-25 12:10:17 -07:00
9e7f618cff Set proper count value for account stores (#4797)
* set count values for store accounts

* Use AppendVecId type
2019-06-25 07:21:45 -07:00
74a06e4230 Update thinclient to resend the same tx until its blockhash expires (#4807) 2019-06-24 16:46:34 -07:00
70f93cc126 remove mining_pool from stake_state (#4804) 2019-06-24 16:01:02 -07:00
3f8ff23125 Forward transactions to the leader for next Nth slot (#4806)
* review comments
2019-06-24 15:56:50 -07:00
29611fb61d tower consensus naming (#4598)
s/locktower/tower/g
2019-06-24 13:41:23 -07:00
407b1d3e6f Bump console from 0.7.5 to 0.7.7 (#4798)
Bumps [console](https://github.com/mitsuhiko/console) from 0.7.5 to 0.7.7.
- [Release notes](https://github.com/mitsuhiko/console/releases)
- [Commits](https://github.com/mitsuhiko/console/compare/0.7.5...0.7.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-24 05:40:15 -07:00
206e62271b Ignore flaky test_two_unbalanced_stakes (#4794)
automerge
2019-06-23 20:55:43 -07:00
4e78354ab6 Bump serde_derive from 1.0.92 to 1.0.93 (#4790)
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.92 to 1.0.93.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.92...v1.0.93)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-23 20:23:41 -07:00
1561d9c8d4 Remove --storage-mining-pool-lamports (#4792) 2019-06-23 20:19:53 -07:00
0e1480b84e Bump serde from 1.0.92 to 1.0.93 (#4791)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.92 to 1.0.93.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.92...v1.0.93)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-23 17:23:41 -07:00
fd6047d1c5 Add validation tip 2019-06-23 09:10:39 -07:00
b0467be393 Add quotes 2019-06-23 09:09:12 -07:00
1b0b095813 Setup v0.1[78] backport label 2019-06-23 09:04:43 -07:00
bd43724dfc Don't set automerge label the PR has status failures 2019-06-22 20:52:32 -07:00
11992946a4 Add storage reward pools (#4779) 2019-06-22 17:18:35 -07:00
0cc8a841ab set automerge label on mergify backport PRs (#4788) 2019-06-22 09:00:00 -07:00
23b6b85bf0 Prevent Travis/Appveyor from trying to build mergify branches (#4786) 2019-06-22 08:42:27 -07:00
96b56fa6f7 Update authorized public key (#4783) 2019-06-22 08:33:39 -07:00
405ca1bcb2 Add instructions and processor for stake deactivation (#4781)
automerge
2019-06-21 23:45:03 -07:00
c6316bb24b Initial mergify config 2019-06-21 22:50:17 -07:00
b7f169e06e Program instruction to withdraw un-staked lamports from stake account (#4780) 2019-06-21 22:28:34 -07:00
e4b466874c Remove storage-mining-pool-keypair arg 2019-06-21 21:38:03 -07:00
9911942dbd Increment cargo.toml files to v0.17.0 2019-06-22 04:35:25 +00:00
8acbb4ab2f Bank cap rpc (#4774)
* core/rpc: Name magic number for minted lamports in tests genesis block

* core/rpc: Expose bank::capitalization() via getSolTotalSupply RPC method

* book: Add entry for getTotalSupply RPC method
2019-06-21 21:00:26 -07:00
a49f5378e2 rewrite vote credits redemption to eat from rewards_pools on an epoch-sensitive basis (#4775)
* move redemption to rewards pools

* rewrite redemption, touch a few other things

* re-establish test coverage
2019-06-21 20:43:24 -07:00
f39e74f0d7 serde the full FeeCalculator (#4778)
automerge
2019-06-21 17:23:26 -07:00
22b767308a Add insturctions to run a replicator on testnet (#4733) 2019-06-21 16:32:23 -07:00
36aa876833 Avoid linking with CUDA directly 2019-06-21 15:26:22 -07:00
06ba0b7279 Remove holding cluster_info lock while forwarding packets (#4773) 2019-06-21 15:21:49 -07:00
a38e1a81ef Call do.sh from anywhere (#4771) 2019-06-21 12:26:17 -07:00
da925142d1 Update replicator ports and silence socket timeout on windows (#4770)
automerge
2019-06-21 11:28:52 -07:00
5feeb257bb Seperate out BPF Loader helpers (#4768) 2019-06-21 11:08:50 -07:00
06c547094a Add Merkle Tree implementation (#4749)
automerge
2019-06-21 10:22:21 -07:00
a40c5cf185 Update storage contract to use a deterministic BTreeMap (#4763) 2019-06-21 09:51:05 -07:00
deb83cdef6 Bump rayon from 1.0.3 to 1.1.0 (#4729)
automerge
2019-06-21 09:32:41 -07:00
20db335aed Bump reqwest from 0.9.17 to 0.9.18
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.9.17 to 0.9.18.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.9.17...v0.9.18)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-21 08:50:49 -07:00
407db65336 Add 128bit Rust BPF test (#4766)
automerge
2019-06-21 02:43:50 -07:00
9c5a3cd277 Update Rust BPF to v0.1.2 (#4767) 2019-06-21 02:15:42 -07:00
138a49e820 Fix paths (#4764) 2019-06-21 00:08:02 -07:00
36c9e22e3d Revert "Dynamic erasure (#4653)"
This reverts commit ada4d16c4c.
2019-06-20 20:53:03 -07:00
aa0f8538ed Fix client script arguments in the book (#4760) 2019-06-20 19:59:20 -07:00
4177c56c51 Use real panic that reports file/line (#4758) 2019-06-20 19:10:03 -07:00
425ac8d520 Remove need to use null when passing Rust strings (#4756) 2019-06-20 19:09:50 -07:00
ada4d16c4c Dynamic erasure (#4653)
Remove erasure-related constants

Remove unneeded `Iterator::collect` call

Document erasure module

Randomize coding blobs used for repair
2019-06-20 20:27:41 -05:00
4069ef2e02 Install xargo once (#4753) 2019-06-20 16:49:33 -07:00
ace98bba08 Upgrade BPF sysroot to v0.4 (#4754) 2019-06-20 16:41:49 -07:00
e59b53dfa8 BPF rust language updates (#4752) 2019-06-20 16:07:12 -07:00
aacb38864c Mark dead forks in replay stage (#4715)
* Add DeadSlots column family

* Filter dead forks from get_slots_since

* Mark erroring slots as dead in replay stage, add test

* Mark dead forks in progress instead of removing them

* Fix logging process_entries failures in replay_stage

* Unignore test_fail_entry_verification_leader
2019-06-20 15:50:41 -07:00
33d13a3aea Update inflation.rs 2019-06-20 12:37:24 -07:00
1f0f947ed2 add validator rewards pools (#4742)
* add validator rewards pools

* populate rewards syscall
2019-06-20 12:22:29 -07:00
6854c64a09 Bump coverage build timeout 2019-06-20 09:24:11 -07:00
4a32bc48d2 ignore unstable test_repairman_catchup 2019-06-20 09:24:11 -07:00
b430762a23 check rust programs (#4688) 2019-06-20 07:43:31 -07:00
f8523db51d Revert "remove build --all (#4737)" (#4745)
This reverts commit 63503ad589.
2019-06-19 23:21:10 -07:00
48b11d1841 Initialize paths for non existent accounts (#4744) 2019-06-19 23:15:22 -07:00
3600a926df protect against corruption (#4741) 2019-06-19 21:29:36 -07:00
c228792967 Add blocktree and repair_service to SUMMARY.md (#4738) 2019-06-19 20:10:04 -07:00
7ea522e851 add rewards syscall, groom some others (#4740) 2019-06-19 19:46:47 -07:00
63503ad589 remove build --all (#4737)
* remove build  all

* Update test-stable.sh
2019-06-19 17:36:25 -07:00
9800e09431 Thread pool for par_iter in EntrySlice::verify (#4732)
* Use thread pool for entry verify par iter

* some performance metrics

* check batch size and use CPU for smaller batches
2019-06-19 16:31:32 -07:00
2e2b1881f5 move genesis_block to builder pattern (#4736) 2019-06-19 15:40:39 -07:00
61483c18ca Change seed for retransmit to use blob signature (#4727)
* Switch seed for retransmit to use blob signature

* Use seed_len

* Use last bytes of signature as seed instead of first bytes
2019-06-19 15:36:06 -07:00
a5279bb835 Don't ship bench-streamer 2019-06-19 12:37:35 -07:00
357554b209 Cache target/ 2019-06-19 12:37:35 -07:00
41fbdc6e08 use stake (#4721) 2019-06-19 11:54:52 -07:00
8bd1c57448 Defer CUDA selection to env.sh, also always create env.sh 2019-06-19 08:47:27 -07:00
2562e48b9d Check for non zero count value 2019-06-19 08:47:12 -07:00
46bb79df29 Support for custom BroadcastStage in local cluster tests (#4716)
* Refactor BroadcastStage to support custom implementations, add FailEntryVerificationBroadcastRun implementation

* Plumb switch on broadcast type through validator

* Add test for validator generating non-verifiable entries to local_cluster

* Fix bad initializers

* Refactor broadcast run code into utils
2019-06-19 00:13:19 -07:00
6bc0d2a0cb exit with success even if no CUDA version detected 2019-06-18 21:18:13 -07:00
465cd45833 Various Snapshot generation improvements
* Only a single snapshot is maintained to avoid unbounded disk growth
* Snapshot is stored as a compressed tar archive for faster rsyncing
* Any validator node may now generate snapshots
* Updated testnet scripts to generate snapshots on the blockstreamer node
2019-06-18 20:11:09 -07:00
b4484b89c3 ' 2019-06-18 19:13:44 -07:00
c029f069f0 Cache .cargo for faster builds 2019-06-18 19:11:36 -07:00
fdb57bc5db Add Rust BPF Tick Height test (#4718) 2019-06-18 15:56:24 -07:00
e43a634944 Calculate bench client lamports based on signature fee (#4713)
* use fee calculator to compute max fee

* review comments

* shellcheck
2019-06-18 14:44:53 -07:00
2da7c7fbd3 Bump nix from 0.14.0 to 0.14.1 (#4642)
automerge
2019-06-18 11:36:26 -07:00
5683282c94 Update to solana-perf-libs v0.14.0, with support for both CUDA 10.0 and 10.1 2019-06-18 10:41:03 -07:00
44967abd1c update storage len 2019-06-17 22:48:27 -07:00
8b41a5d725 periodically save config in separate folders 2019-06-17 22:48:27 -07:00
07c183bb84 Fix test 2019-06-17 22:48:27 -07:00
7fd879b417 Restart validator nodes from snapshots 2019-06-17 22:48:27 -07:00
dc5c6e7cf8 validator restart 2019-06-17 22:48:27 -07:00
bd633d2b81 Add CI_REPO_SLUG (#4714)
automerge
2019-06-17 20:42:09 -07:00
feeaad619a Avoid panic if no rpc peers exist 2019-06-17 19:47:45 -07:00
b44d8c394e Only add --mining-pool arg when a mining pool keypair exists 2019-06-17 19:47:45 -07:00
0ff9c4cd8e add stake warmup and cool down (#4711) 2019-06-17 19:34:21 -07:00
9cafd1f85e Change check_txs to ignore recv errors and re-enable test (#4593)
Use more chunks to avoid duplicate signature failures:
Duplicate signatures can occur because bank.clear_signatures()
can occur before the bank has actually committed the signatures
to the status cache and then error out on the next set of transactions.
2019-06-17 19:04:21 -07:00
7fe10ba060 Don't start drone if primordial accounts are created for nodes (#4704)
* disable wallet sanity if no airdrops
2019-06-17 18:15:22 -07:00
cc48773b03 Add "download from replicator" utility (#4709)
automerge
2019-06-17 18:12:13 -07:00
8fbf0e2d9f Update replicators to use the storage blockhash to generate offsets (#4712) 2019-06-17 16:39:26 -07:00
d86358eedc add Account::new_data (#4701)
* add account_new_data

* fixup

* fixup
2019-06-17 15:58:05 -07:00
fe04fb4cd3 Refetch perf-libs when the release version is changed (#4706)
automerge
2019-06-17 14:31:41 -07:00
de3f7e9634 Update Rust program build script paths (#4707) 2019-06-17 14:24:00 -07:00
5e8fcdbe1d Set {min,max}_lamports_per_signature correctly when fees don't adjust (#4705)
automerge
2019-06-17 13:18:12 -07:00
3ee7256c0c Add cuda docs 2019-06-17 12:42:59 -07:00
2a7a9fdf03 Re-org SDK dir (#4690) 2019-06-17 11:04:38 -07:00
5bf87de136 Add obvious log message indicating CUDA feature state 2019-06-17 11:01:55 -07:00
97a136ea20 Set rustc-cfg=cuda explicitly, also code cleanup 2019-06-17 11:01:55 -07:00
735dfab02e decomma 2019-06-17 11:01:55 -07:00
b5f65ce49c Link cuda feature validator/ to core/ 2019-06-17 11:01:55 -07:00
a283863694 Add storage-mining-pool genesis params 2019-06-14 20:25:39 -07:00
25908feef9 Fund accounts with the worst-case fee 2019-06-14 19:52:44 -07:00
b91ad6fd96 Clear C dependency files from cache (#4692) 2019-06-14 19:11:16 -07:00
02abf422df Serialize genesis block using bincode (#4687)
* use mmap to read the genesis block, and deserialize
2019-06-14 14:22:52 -07:00
3fe5f886d7 change store to store_account (#4689) 2019-06-14 13:34:15 -07:00
4c6a6d63bf add MiningPools, fund validator MiningPools from inflation (#4676)
* add MiningPool fund validator MinigPools from inflation

* fixup

* finish rename of MINIMUM_SLOT_LENGTH to MINIMUM_SLOTS_PER_EPOCH

* deterministic miningpool location

* point_value, not credit_value... use f64
2019-06-14 11:38:37 -07:00
589a9d3a72 Create aligned number of keypairs so they all get funded (#4685) 2019-06-14 11:11:52 -07:00
bd884a56bf Install libssl1.1 better 2019-06-14 08:01:22 -07:00
119467df59 Add storage mining pool to genesis and implement automatic reward redeeming (#4683)
* Add storage mining pool to genesis and implement automatic reward collection

* Address review comments
2019-06-13 22:30:51 -07:00
ee68b9800e Wait for nodes to boot up before launching other nodes and client (#4682)
* Wait for nodes to bootup in testnet

* increase timeout (as with multiple clients it takes even longer)
2019-06-13 19:37:36 -07:00
c6b4a3a706 Witness account data in Budget (#4650)
* Add support for contracts based on account data to Budget

* Add program_id to account constraints

* No longer require a signature for the account data witness

* Rename bank::store to store_account

* fmt

* Add a doc

* clippy
2019-06-13 18:20:28 -07:00
b1ac8f933b Fix storage program space issues and limit storage transaction data (#4677) 2019-06-13 17:53:54 -07:00
9e3758983d Find max root and purge roots below it. (#4645)
* Test for forking accounts

* Find max root and purge roots below it.
2019-06-13 17:35:16 -07:00
34c0537e9b update book with staking changes (#4679) 2019-06-13 16:24:03 -07:00
8628f33d0b Fix HostId field in the testnet dashboard 2019-06-13 16:09:09 -07:00
ed05aeaef8 Permit datapoints with no fields 2019-06-13 16:09:09 -07:00
e1444a9b00 Add curl retries 2019-06-13 15:05:07 -07:00
9514169bf6 Ensure volume mountpoints exist 2019-06-13 15:05:07 -07:00
fa8394f526 Initial documentation for validator metrics 2019-06-13 15:05:07 -07:00
1cd8c1865e Generate random passwords and keep them out of the environment/program args 2019-06-13 12:37:39 -07:00
e3f895d7d4 Create bench exchange accounts in genesis block (#4655)
* fix script

* review comments
2019-06-13 11:51:35 -07:00
8abf22f34b Temporarily revert: Convert System Transfer accounts to credit-only (#4670) 2019-06-13 11:01:09 -06:00
a016bc2736 Add infra to publish metrics tarball 2019-06-13 10:00:24 -07:00
470debef16 Inline metrics/scripts dependencies 2019-06-13 10:00:24 -07:00
c147dc3028 Update README 2019-06-13 10:00:24 -07:00
bdd95b2286 Generate local dashboard to avoid duplication 2019-06-13 10:00:24 -07:00
efe676bc94 Minor script refactoring/refinement 2019-06-13 10:00:24 -07:00
fc34687687 Create write-only user, default to custom grafana 2019-06-13 10:00:24 -07:00
6042ccf496 Streamline grafana.ini 2019-06-13 10:00:24 -07:00
f1197e1b1f Adjust datasource name 2019-06-13 10:00:24 -07:00
8c1b9a0b67 Data plane verification (#4639)
* Add signature to blob

* Change Signable trait to support returning references to signable data

* Add signing to broadcast

* Verify signatures in window_service

* Add testing for signatures to erasure

* Add RPC for getting current slot, consume RPC call in test_repairman_catchup for more deterministic results
2019-06-12 16:43:05 -07:00
0da9ac1a47 Remove unnecessary parameter element (#4666)
* Stop passing pubkey ref unnecessarily

* Cargo.lock
2019-06-12 16:18:27 -06:00
c1f316721a Clean up some error handling (#4667)
Shouldn't call exit from a library function.
2019-06-12 15:01:59 -07:00
8e86014311 Update stakers_slot_offset if slots_per_epoch is adjusted (#4660) 2019-06-12 14:12:17 -07:00
d807217be7 Simplify and camelCase getEpochVoteAccounts RPC API (#4658)
* Simplify and camelCase getEpochVoteAccounts RPC API

* Set a commission for testing
2019-06-12 14:12:08 -07:00
bc44516eb4 Add test to exercise more args then registers (#4661) 2019-06-12 13:04:53 -07:00
b78a13d42c Nits (#4662) 2019-06-12 13:04:24 -07:00
0dcdc37fec Split BPF loader to match the rest of the programs (#4636) 2019-06-12 08:49:59 -07:00
dd1c3514a8 Use auto hashes-per-tick config for testnet testnet 2019-06-12 08:40:56 -07:00
767efab941 add inflation to genesis (#4652)
* add inflation to genesis

* avoid having to write new()
2019-06-11 21:42:31 -07:00
288a3bdcd9 Provision bench client accounts in genesis block (#4648)
* fixes to script

* shellcheck

* address review comments
2019-06-11 18:47:35 -07:00
8019bff391 Fixes for storage program and rework storage stage (#4654)
automerge
2019-06-11 18:27:47 -07:00
575a897ffc track market cap (#4643)
* track market cap

* fixup, rebase

* prettier
2019-06-11 17:04:13 -07:00
697228a484 rpc vote_accounts by ecurrent pocch, not stakers epoch (#4651) 2019-06-11 16:57:47 -07:00
ca907f37c3 fix cuda testnet compilation errors (#4649) 2019-06-11 15:30:39 -07:00
439e7cc26a Add dependent crate test (#4647)
automerge
2019-06-11 11:45:12 -07:00
3217a1d70c use highest staked node as bootstrap leader, remove bootstrap_leader from genesis_block (#4635)
* use highest staked node as bootstrap leader, remove bootstrap_leader from genesis_block

* clippy

* fixup

* fixup
2019-06-11 11:44:58 -07:00
6dbba86cc6 Cleanup rust-utils (#4646)
automerge
2019-06-11 11:42:30 -07:00
8cc863ea6c Bump libloading from 0.5.0 to 0.5.1 (#4640)
Bumps [libloading](https://github.com/nagisa/rust_libloading) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/nagisa/rust_libloading/releases)
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.5.0...0.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-11 11:21:45 -07:00
1d957b6b80 Bump byteorder from 1.3.1 to 1.3.2 (#4641)
Bumps [byteorder](https://github.com/BurntSushi/byteorder) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/BurntSushi/byteorder/releases)
- [Changelog](https://github.com/BurntSushi/byteorder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/byteorder/compare/1.3.1...1.3.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-11 11:21:26 -07:00
e56430c9fb make runtime depend on bpf_loader (#4601)
* make runtime depend on bpf_loader

* remove vote redundancy, move bpf_loader to genesis, export program\! from bpf_loader crate

* move bpf_loader specification into genesis

* bpf tests to use genesis with bpf

* need to avoid depending on programs, except for macros
2019-06-11 10:27:22 -07:00
e4d8ea11ac Make lamports_per_signature dynamic based on cluster load (#4562)
* Make lamports_per_signature dynamic based on cluster load

* Move transaction-fees.md to implemented
2019-06-10 22:18:32 -07:00
a4035a3c65 Remove record locks and parent locks from accounts (#4633)
* Revert "Fix parent record locks usage in child banks (#4159)"

This reverts commit 69eeb7cf08.

* Revert "Fix DuplicateSignatures caused by races on frozen banks (#3819)"

This reverts commit 083090817a.

* Remove unused imports
2019-06-10 22:05:46 -07:00
807c69d97c Slimmer implementation of credit-only accounts (#4592)
* Add credit-only debit/data check to verify_instruction

* Store credits and pass to accounts_db

* Add InstructionErrors and tests

* Relax account locks for credit-only accounts

* Collect credit-only account credits before passing to accounts_db to store properly

* Convert System Transfer  accounts to credit-only, and fixup test

* Functionalize collect_accounts to unit test

* Review comments

* Rebase
2019-06-10 20:50:02 -06:00
9259d342ac Facility to provision primordial accounts for fullnodes in genesis block (#4631)
* updated usage

* shellcheck

* support replicators

* disable airdrops if primordial accounts are used

* review comments
2019-06-10 19:42:49 -07:00
b4d4edb645 Restore cargo install to work around --features= 'feature' (#4627) 2019-06-10 18:49:08 -07:00
966b6999d1 Accounts index opt (#4621)
* Add accounts_index bench

* Don't take the accounts index lock unless needed

* Accounts_index remove insert return vec and add capacity stats

* Use hashbrown hashmap for accounts_index
2019-06-10 18:15:39 -07:00
73491e3ca1 bump libssl (#4634) 2019-06-10 18:03:13 -07:00
d1d53c3fb6 calculate stake from activated amount (#4630) 2019-06-10 16:17:29 -07:00
a77e576cd9 void key 2019-06-10 15:54:32 -07:00
9e14cde461 Revert "Fix roots never being purged (#4134)" (#4628)
automerge
2019-06-10 14:08:09 -07:00
a2a7c86c0d Move Testnet Participation under Getting Started 2019-06-10 13:53:31 -07:00
38aeed02fc Ignore dependabot branches 2019-06-10 12:50:48 -07:00
64d63966c7 Bump jsonrpc crates to 12.0.0 (#4553)
* Bump jsonrpc-pubsub from 11.0.0 to 12.0.0

Bumps [jsonrpc-pubsub](https://github.com/paritytech/jsonrpc) from 11.0.0 to 12.0.0.
- [Release notes](https://github.com/paritytech/jsonrpc/releases)
- [Commits](https://github.com/paritytech/jsonrpc/commits/v12.0.0)

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

* Update all jsonrpc crates
2019-06-10 13:22:57 -06:00
38ae54b720 Bump walkdir from 2.2.7 to 2.2.8 (#4615)
Bumps [walkdir](https://github.com/BurntSushi/walkdir) from 2.2.7 to 2.2.8.
- [Release notes](https://github.com/BurntSushi/walkdir/releases)
- [Commits](https://github.com/BurntSushi/walkdir/compare/2.2.7...2.2.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-06-10 12:19:45 -07:00
a18c0e34f4 add activate_stake to stake_api (#4600) 2019-06-10 12:17:29 -07:00
be3a0b6b10 Build/clean all (#4626)
automerge
2019-06-10 11:15:28 -07:00
9f6496d38a Panic filename (#4625)
automerge
2019-06-10 11:00:15 -07:00
1fa31c9410 .iter fixed, drop enumerate where not needed (#4624)
automerge
2019-06-10 10:19:58 -07:00
2b5e757d57 Adjust slack notification 2019-06-10 07:44:31 -07:00
0dbe5ee559 Add chacha-sys crate (#4620)
* af9ff9c7f9/src/cpu-crypt

* Add chacha-sys crate

* Remove chacha feature

* Remove erasure feature

* Add .gitignore
2019-06-10 07:14:02 -07:00
6926e89e86 Minor doc update 2019-06-08 19:36:37 -07:00
ec0007217d Modify HKEY_CURRENT_USER\Environment\PATH on Windows (#4614)
Thanks for the Windows registry editing code rustup.rs!
2019-06-08 19:25:02 -07:00
91b23f8316 Switch from solana-install to solana-install-init 2019-06-08 19:24:36 -07:00
2fd8d57504 Print path normally to avoid forward slash escaping 2019-06-08 19:22:17 -07:00
0595109f98 Add solana-install-init binary (#4613)
* Add solana-install-init binary

* Add Enter prompt on solana-install-init exit for Windows users
2019-06-08 19:01:22 -07:00
9f46b2a6ce Avoid weird paths on Windows (#4612)
automerge
2019-06-08 17:23:34 -07:00
a357d08524 Avoid unnecessary re-downloading if |solana-install init| is invoked repeatedly (#4611) 2019-06-08 17:15:16 -07:00
177c9cc026 -f 2019-06-08 16:33:22 -07:00
0c4cb76acf Add GPU based PoH verification (#4524)
* Add GPU poh verify

* Switch to single PoH verify function

* Add EntrySlice verify tests with hashes and txs

* Add poh-verify benchmarks
2019-06-08 10:21:43 -06:00
8676b5d40c Use more -f 2019-06-07 22:18:55 -07:00
efab896c9e Ignore unencrypted file 2019-06-07 21:38:30 -07:00
97b9d57b62 shellcheck 2019-06-07 21:35:51 -07:00
487826a539 Deploy windows updates 2019-06-07 20:46:58 -07:00
4acb764589 Pick up .exe extension 2019-06-07 20:13:47 -07:00
9de4c1dcd9 Add slack notification 2019-06-07 19:58:52 -07:00
e8c4302d6d Add Appveyor CI for Windows release artifacts 2019-06-07 19:47:26 -07:00
a9f73ea321 solana-keygen no longer blindly overwrites a keypair, or assumes "new" (#4599)
automerge
2019-06-07 17:54:54 -07:00
66c41b3e8c Enable iter test (#4542)
automerge
2019-06-07 16:44:14 -07:00
8435fbfa0b Travis window support is too unstable, disable for now 2019-06-07 15:17:27 -07:00
9a4c449135 Builtins (#4594)
automerge
2019-06-07 14:38:49 -07:00
ac6dbf8f04 Broadcast blobs even if the peers have no stake (#4597) 2019-06-07 14:12:27 -07:00
b55927370b Restore OS -> TARGET map 2019-06-07 13:22:40 -07:00
002fbc4d53 Add |wallet fees| subcommand for easy viewing of the current cluster fees (#4596) 2019-06-07 13:11:56 -07:00
53deb7919c Update book for Turbine (#4583) 2019-06-07 13:03:05 -07:00
8e46c44f3e Deploy mac OS solana-install update package to testnets (#4595) 2019-06-07 12:59:58 -07:00
37c2fa1d8d add current to bank syscalls (#4581) 2019-06-07 11:41:34 -07:00
fdaa939892 Bring in Travis CI to build Windows and mac OS release binaries (#4591)
* Bring in Travis CI to build Windows and mac OS release binaries

* Update .travis.yml
2019-06-07 11:32:47 -07:00
c9d63204eb Replace unneeded seqcst with relaxed on atomic operations (#4587) 2019-06-06 23:53:21 -07:00
cfab54511b Ignore bench_banking_stage_multi_accounts (#4590)
automerge
2019-06-06 21:47:07 -07:00
492cc93850 Limit short_vec length to u16, usize is overkill for our usage (#4588) 2019-06-06 20:18:41 -07:00
fd9fd43e83 add solana_name_id, reassociate names with modules, modularize id tests (#4580) 2019-06-06 19:27:49 -07:00
191483f4ee Facility to add accounts with specific balance to genesis block (#4585)
* Facility to add accounts with specific balance to genesis block

* address review comments
2019-06-06 19:24:09 -07:00
688f8a669a Add a storage accounts cache to Bank (#4578) 2019-06-06 17:40:01 -07:00
46eea85022 Improve error message 2019-06-06 17:06:56 -07:00
1c765124e7 Clean up .configured flag handling to work with an external identity keypair (#4579)
automerge
2019-06-06 14:51:48 -07:00
194491ae96 Removed some dead code (#4563)
* Removed some dead code

* remove dead code from Replicator
2019-06-06 14:26:12 -07:00
2ae595294c fullnode.rs: restart the node correctly on non-zero exit 2019-06-06 13:46:46 -07:00
ead947e710 Change default setting for real PoH in testnet scripts (#4573) 2019-06-06 12:49:46 -07:00
82df267ec9 s/avalanche/turbine (#4561)
* s/avalanche/turbine/g
2019-06-06 12:48:40 -07:00
53275cc678 Introduce normalized CI environment vars: ci/env.sh (#4571) 2019-06-06 12:20:47 -07:00
44835a91db Update PoRep entry in the book (#4560)
* Rework PoRep design doc

* Define the stages of the PoRep game

* Add that the stages are really transactions

* Update turn count

* Review comment + clarification

* More clarification

* Rephrase for clarity
2019-06-06 12:16:54 -07:00
ee42040e6b Give coverage build more time (#4572)
automerge
2019-06-06 11:07:32 -07:00
2b98a16ec6 Upgrade to rust stable 1.35.0 (#4568) 2019-06-06 09:24:38 -07:00
aa4a7b0c73 Disable |solana-install| check for edge/beta testnets (#4564)
The release tarball URL changes for these testnets, which causes the
normal |solana-install| check to fail and the testnet is unnecessarily
rebooted.
2019-06-05 15:31:29 -07:00
8f50c3dd2e Be explicit about return status 2019-06-05 14:12:06 -07:00
9c47ce30a7 shift 2019-06-05 12:06:54 -07:00
3433b08b8c remove unnecessary wrapper (#4559) 2019-06-05 11:43:41 -07:00
d26fd27bf9 Avoid sudo in tune-system.sh unless requested by the user (#4556) 2019-06-05 09:10:23 -07:00
5c98c1d306 Sanity check that runs on the blockstreamer node now checks that node instead of the bootstrap leader (#4551)
automerge
2019-06-04 22:46:48 -07:00
51aacfe3ca Use pure-rust reed-solomon-erasure for windows (#4548) 2019-06-04 21:49:27 -07:00
82bd2df986 Use Library::new() for windows (#4544) 2019-06-04 21:49:05 -07:00
aa88c40a9e multi_bind_in_range(): limit to 1 socket in windows (#4549) 2019-06-04 20:55:02 -07:00
8ec5a47027 Add EntryWriter::write() stub for windows (#4546) 2019-06-04 20:15:37 -07:00
5bd3eb4557 Up number of threads (#4541) 2019-06-04 18:01:28 -07:00
e9cb4a12dc Bump serde_derive from 1.0.91 to 1.0.92 (#4505)
automerge
2019-06-04 15:48:23 -07:00
de5cad9211 Add account owner to Storage Accounts (#4537)
* Add account owner to Storage Accounts

* Fix tests
2019-06-04 14:52:52 -07:00
e3365529de Enable transaction fees for multinode-demo/ and net/ (#4527)
* Collect fees at the end of a slot

* Enable transaction fees for multinode-demo/ and net/
2019-06-04 14:51:52 -07:00
ce2ce76958 Bump serde from 1.0.91 to 1.0.92 (#4504)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.91 to 1.0.92.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.91...v1.0.92)
2019-06-04 14:32:09 -07:00
16f2fb5c09 Bump tokio from 0.1.20 to 0.1.21 (#4489)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 0.1.20 to 0.1.21.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-0.1.20...tokio-0.1.21)
2019-06-04 14:31:29 -07:00
d77c98530f Bump libc from 0.2.55 to 0.2.58 (#4514)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.55 to 0.2.58.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.55...0.2.58)
2019-06-04 14:31:06 -07:00
fe40b75ac6 Bench TPS tweaks for transaction fees (#4538)
* use lamports_per_signature instead of hard coding it in bench client
2019-06-04 13:56:11 -07:00
e7129757c9 store_accounts to use try_available (#4523)
* store_accounts to use try_available

* tighter

* clippy
2019-06-04 11:21:12 -07:00
3635a68129 solana-install now compiles for Windows (#4531)
automerge
2019-06-04 08:51:20 -07:00
70a16e91a5 Randomize avalanche broadcast peer table for each blob (#4529)
* fix clippy warnings
2019-06-03 20:38:05 -07:00
41daf1ef0c Wait for crate to be locatable on crates.io after uploading (#4526)
* Wait for crate to be locatable on crates.io after uploading

* Fix nits and shellcheck

* shellchecker
2019-06-03 19:54:41 -06:00
ff77789718 Collect fees at the end of a slot (#4525) 2019-06-03 18:40:20 -07:00
a77775cb58 Move validation submissions into its own fn (#4528)
automerge
2019-06-03 18:27:06 -07:00
167e15a5ae Update replicator sampling and proof generation (#4522)
* Update replicator sampling and proof generation

* Clippy
2019-06-03 17:27:28 -07:00
dea663d509 Storage arranged by fork (#4518) 2019-06-03 15:34:32 -07:00
9754e551cb Fund vote accounts with 1 lamport only (#4512) 2019-06-03 14:48:01 -07:00
40a4ac15f1 Remove per transaction fee (#4521)
automerge
2019-06-03 13:00:08 -07:00
c56052ff16 remove from_account from stake_instruction (#4502) 2019-06-03 09:04:51 -07:00
482ef51502 register_tick() on the correct bank (#4506)
* skip syscall_id in hash and delta

* add more tests, skip syscalls
2019-06-03 09:04:26 -07:00
e4ca3900ae Reduce default validators from 5 to 2 2019-06-02 22:58:59 -07:00
3574469052 Add random distribution for avalanche peers (#4493)
* Add random distribution for avalanche peers

* fix clippy warnings

* bug fixes

* nits
2019-06-01 07:55:43 -07:00
e15246746d Enable non-zero fees for all testnets (#4513)
automerge
2019-05-31 22:33:55 -07:00
ec5cca41bc Separate bootstrap leader's stake lamports from its identity lamports (#4510)
* Revert "Prevent run.sh from running beyond the first epoch under normal use (#4498)"

This reverts commit d343c409e6.

* Separate bootstrap leader's stake lamports from its identity lamports
2019-05-31 19:58:52 -07:00
bc1368ba3e Make run.sh compatible with multinode-demo/validator.sh (#4507)
automerge
2019-05-31 16:51:09 -07:00
c0a161afe8 Enable fees in ci/localnet-sanity.sh (#4508)
automerge
2019-05-31 16:50:39 -07:00
d343c409e6 Prevent run.sh from running beyond the first epoch under normal use (#4498)
The local cluster that run.sh starts will typically only have a single
node, the bootstrap leader.  With epoch warmup enabled, run.sh will fail
after ~90 seconds once the warmup period has been exceeded due to lack
of votes from other validators.

As a workaround, disable epoch warmup and set slots-per-epoch to 1
million to keep run.sh alive for more than a fortnight.
2019-05-31 15:42:32 -07:00
64e8a21d73 Add tick height syscall (#4497)
* Remove tick_height from entrypoint signature

* Impl tick_height syscall and use in storage program

* Properly remove tick height from bpf handling
2019-05-31 16:29:21 -06:00
ce04d2bfc2 Add replicator support to net/ (#4494) 2019-05-31 15:27:31 -07:00
1c1d83bd56 skip syscall_id in hash and delta (#4500)
* skip syscall_id in hash and delta

* add more tests, skip syscalls
2019-05-31 12:26:45 -07:00
028e111fbc remove payer from vote instructions (#4475) 2019-05-31 11:45:17 -07:00
9670788bf5 Bump dirs from 1.0.5 to 2.0.1 (#4490)
Bumps [dirs](https://github.com/soc/dirs-rs) from 1.0.5 to 2.0.1.
- [Release notes](https://github.com/soc/dirs-rs/releases)
- [Commits](https://github.com/soc/dirs-rs/commits)
2019-05-31 08:57:35 -07:00
d2f9625878 minor update 2019-05-31 07:36:59 -07:00
182096dc1a Create bank snapshots (#4244)
* Revert "Revert "Create bank snapshots (#3671)" (#4243)"

This reverts commit 81fa69d347.

* keep saved and unsaved copies of status cache

* fix format check

* bench for status cache serialize

* misc cleanup

* remove appendvec storage on purge

* fix accounts restore

* cleanup

* Pass snapshot path as args

* Fix clippy
2019-05-30 21:31:35 -07:00
2d284ba6db Fix clear-config.sh 2019-05-30 15:31:41 -07:00
1de805e7cd Add fees syscall to expose cluster fees into programs (#4472) 2019-05-30 15:18:48 -07:00
d642125f68 publish-crate fixups 2019-05-30 15:15:58 -07:00
b8aff218e2 Shutdown all services before bailing replicator init (#4487)
automerge
2019-05-30 14:36:47 -07:00
045d4d5294 Unignore test test_repairman_catchup (#4484) 2019-05-30 13:21:12 -07:00
d67dd8ce1f Fix stable metrics dashboard for current channel use (#4483) 2019-05-30 13:16:26 -06:00
4d6679906b Clean up crates.io publishing (#4478)
* Clean up crates.io publishing

* Cargo.lock
2019-05-30 11:53:41 -07:00
4537f54532 Break noop_program -> runtime dependency (#4481) 2019-05-30 11:20:49 -07:00
39b40dfff8 Remove runtime dependency on storage (#4480) 2019-05-30 10:54:28 -07:00
c82f4a1b6d Unignore test_repairman_catchup 2019-05-29 21:59:41 -07:00
7a021dff05 Beautify Cargo.tomls with |cargo tomlfmt| (#4477) 2019-05-29 18:30:49 -07:00
348c2263ba Remove genesis blockhash (#4471)
* Remove genesis blockhash

* Remove genesis blockhash from tests

* Fix golden
2019-05-29 17:29:02 -07:00
b5324063f1 Use thread pools for rayon par_iter (#4473)
* Use thread pools for rayon par_iter

* address review comments

* cleanup
2019-05-29 17:16:36 -07:00
6ed071c4dd Fix storage stage operating on empty slots (#4474)
* Fix storage stage operating on empty slots

* Reduce fn argument count

* Fix tests
2019-05-29 15:01:20 -07:00
4404634b14 Coalesce packets better (#4456) 2019-05-29 12:17:50 -07:00
6a1de33138 tighten up packets_to_blobs (#4464)
* tighten up packets_to_blobs

* missed a test
2019-05-29 10:08:35 -07:00
c05c3e69ca add tests and groom naming (#4467) 2019-05-29 10:08:03 -07:00
534244b322 Fix set_roots to use cached bank parents instead of searching blocktree (#4466) 2019-05-29 09:43:22 -07:00
335dfdc4d5 Fix Gossip skipping push for some values (#4463)
* Make gossip skip over values from Pruned nodes

* Add test and init blooms to contain the origin
2019-05-28 18:39:40 -07:00
a7ef409c2b Drop influxcloud (#4460)
automerge
2019-05-28 16:26:59 -07:00
14594217db undelete votestate etc (#4457) 2019-05-28 16:01:27 -07:00
c8a03c7b3d Save RNG for generating random storage sampling offsets (#4450)
* Save RNG for generating random storage sampling offsets

* fix clippy

* fix stable-perf

* fix chacha
2019-05-28 14:14:46 -07:00
9fcd162412 update book with passive staking (#4451) 2019-05-28 14:02:04 -07:00
441fed7a5b check freeze before updating slot_hashes (#4448)
* check freeze before updating slot_hashes

* fixup
2019-05-28 12:25:55 -07:00
ff31ffbd54 add more information to dropped vote warning (#4449)
* add more information to dropped vote warning

* fixup
2019-05-28 12:25:34 -07:00
0e26ee854b Add test indicating need for credit-only account handling (#4441)
* Add test indicating need for credit-only account handling

* Add commented correct future test lines
2019-05-28 11:57:22 -04:00
5340800cea Add some optimizing to ThinClient (#4112)
Can create a multi-socketed ThinClient which will use request time
from get_recent_blockhash to tune for the best node to talk to.
2019-05-27 20:54:44 -07:00
13c2e50b38 Bump sys-info from 0.5.6 to 0.5.7 (#4445)
automerge
2019-05-27 20:31:12 -07:00
dd39b2b056 Revert --retry-on-http-error usage, Travis CI's wget doesn't recognize it 2019-05-27 19:35:04 -07:00
65f89d6729 Bump logging level of validator procsesing errors (#4442) 2019-05-27 16:19:38 -07:00
1eceb4831d Use nohup and sleep a little to improve stability when launching a node 2019-05-27 13:57:40 -07:00
50303c9ede data_dir -> data-dir 2019-05-27 07:31:50 -07:00
ed6a438c51 v0.16.0 2019-05-26 19:42:15 -07:00
2adb98a4a0 Ignore flaky test_repairman_catchup (#4439)
automerge
2019-05-26 12:24:20 -07:00
471465a5f4 net/: Add solana-install test to sanity (#4438)
* Add instance creation date to motd

* Setup localtime

* Add solana-install test
2019-05-26 11:17:07 -07:00
942785b626 sdk/bpf/scripts/install.sh: Retry downloads on transient 403 S3 failures seen in CI (#4436)
* Avoid caching perf-libs in CI

* Retry downloads on transient 403 S3 failures seen in CI
2019-05-25 14:41:09 -07:00
aa3c00231a Fix should_update check to update EpochSlots in gossip (#4435)
automerge
2019-05-25 06:44:40 -07:00
d772a27936 Plumb ClusterInfoRepairListener (#4428)
automerge
2019-05-24 19:20:09 -07:00
0302f13b97 add datapoint for corrupt vote_account (#4424) 2019-05-24 18:34:56 -07:00
16b25d0874 Clone with https for Travis/repo with submodules (#4431) 2019-05-24 21:18:31 -04:00
c2dcbee6af cd within the subshell 2019-05-24 18:10:25 -07:00
1f71d05299 remove copying of forwarded packets (#4425)
automerge
2019-05-24 17:35:09 -07:00
bfa1c025fd Add rust bpf allocator (#4426) 2019-05-24 16:21:42 -07:00
8611b40074 Add argument to net/net to specify number of nodes (#4429)
Allows for testing different node counts without recreating the network.
2019-05-24 16:20:14 -07:00
916844d399 Fix replicator account setup in fullnode.sh (#4430) 2019-05-24 15:40:49 -07:00
4c9b7c9d2b Submit all incoming proofs as valid (#4377) 2019-05-24 14:49:10 -07:00
9843c3a5cb Restrict transaction fee payers to system accounts (#4198)
automerge
2019-05-24 13:06:55 -07:00
f56955a17c Use absolute path to env.sh 2019-05-24 12:27:12 -07:00
9784bbf154 Pay for storage transactions with a system account (#4423)
automerge
2019-05-24 11:04:05 -07:00
45642c4da1 Add path to env.sh 2019-05-24 09:56:07 -07:00
8eac199e8b Include perf-libs in release tarball (#4422) 2019-05-24 09:28:52 -07:00
2e251ccc5c De-fullnode variable names (#4420) 2019-05-24 04:31:39 -07:00
cf4bb70d80 Rename id to pubkey in cluster_info_repair_listener (#4421) 2019-05-24 04:31:32 -07:00
57f8a15b96 Fix issues in ClusterInfoRepairListener (#4418)
* Sort repairmen before shuffling so order is the same across all validators

* Reduce repair redundancy to 1 for now

* Fix local cache of roots so that 1) Timestamps are only updated to acknowledge a repair was sent 2) Roots are updated even when timestamps aren't updated to keep in sync with network

* Refactor code, add test
2019-05-24 00:47:51 -07:00
cfe5afd34c _id => _pubkey variable renaming (#4419)
* wallet: rename *_account_id to *_account_pubkey

* s/from_id/from_pubkey/g

* s/node_id/node_pubkey/g

* s/stake_id/stake_pubkey/g

* s/voter_id/voter_pubkey/g

* s/vote_id/vote_pubkey/g

* s/delegate_id/delegate_pubkey/g

* s/account_id/account_pubkey/g

* s/to_id/to_pubkey/g

* s/my_id/my_pubkey/g

* cargo fmt

* s/staker_id/staker_pubkey/g

* s/mining_pool_id/mining_pool_pubkey/g

* s/leader_id/leader_pubkey/g

* cargo fmt

* s/funding_id/funding_pubkey/g
2019-05-23 23:20:04 -07:00
94beb4b8c2 More fullnode -> validator renaming (#4414)
* s/fullnode_config/validator_config/g

* s/FullnodeConfig/ValidatorConfig/g

* mv core/lib/fullnode.rs core/lib/validator.rs

* s/Fullnode/Validator/g

* Add replicator-x.sh

* Rename fullnode.md to validator.md

* cargo fmt
2019-05-23 22:05:16 -07:00
50207a30ef Rename solana-fullnode to solana-validator redux (#4417) 2019-05-23 21:28:18 -07:00
35e8f966e3 add freeze_lock() and fix par_process_entries() failure to detect self conflict (#4415)
* add freeze_lock and fix par_process_entries failure to detect self conflict

* fixup

* fixup
2019-05-23 17:35:15 -07:00
943cd0a24a Add credit-only info to AccountMetadata (#4405)
* Add credit-only flag to AccountMeta, default to false

* Sort keys by is_credit_only within signed/unsigned groupings

* Process and de-dupe program keys along with other account keys

* Add message helper functions

* Fix test

* Improve comment

* s/is_credit_only/is_debitable

* Add InstructionKeys helper struct, and simplify program_position method
2019-05-23 18:19:53 -04:00
0b892b2579 Reduce 100ms to 1ms. (#4412)
automerge
2019-05-23 15:15:26 -07:00
fb2eac20bb Rename solana-fullnode to solana-validator (#4411) 2019-05-23 15:06:01 -07:00
b37d2fde3d Add storage mining pool (#4364)
* Add storage mining pool

* Set gossip port

* Add create-storage-mining-pool-account wallet command

* Add claim-storage-reward wallet command

* Create storage account upfront

* Add storage program to genesis

* Use STORAGE_ACCOUNT_SPACE

* Fix tests

* Add wallet commands to create validator/replicator storage accounts

* Add create_validator_storage_account()

* Storage stage no longer implicitly creates a storage account
2019-05-23 14:50:23 -07:00
6b35e16676 Turn on real PoH in perf testnets (#4407)
* Turn on real PoH in perf testnets

* enable real PoH for all testnets except "testnet"
2019-05-23 13:22:52 -07:00
6a9e0bc593 Change EpochSlots to use BtreeSet so that serialization/deserialization returns the same order (#4404)
automerge
2019-05-23 03:50:41 -07:00
591fd72e0b Implement listener for serving repairs through Repairman protocol (#4306)
* Make listener for serving repairs through Repairman protocol
2019-05-23 03:10:16 -07:00
2ed77b040a create_genesis_block() now returns a struct (#4403) 2019-05-22 20:39:00 -07:00
7ada8510c4 add slot_hashes to bank, remove phony slot_hashes_from_vote_instruction (#4401) 2019-05-22 19:07:56 -07:00
b8f6c17dee Don't filter transactions if we are buffering it locally (#4395)
automerge
2019-05-22 17:54:28 -07:00
2f976ae460 Dashboard update for real PoH performance (#4397) 2019-05-22 16:18:57 -07:00
36019cb1e3 Tweaks to real PoH based on perf testing (#4396)
* Some counters for real poh perf analysis

* more metrics

* Comment on CPU affinity change, and reduce hash batch size based on TPS perf

* review comments
2019-05-22 15:54:24 -07:00
99d2428041 Transaction format changes toward Credit-Only accounts (#4386)
* Add num_readonly_accounts slice

* Impl programs in account_keys

* Emulate current account-loading functionality using program-account_keys (breaks exchange_program_api tests)

* Fix test

* Add temporary exchange faucet id

* Update chacha golden

* Split num_credit_only_accounts into separate fields

* Improve readability

* Move message field constants into Message

* Add MessageHeader struct and fixup comments
2019-05-22 18:23:16 -04:00
c121498b5b Check that Rust project exists (#4393) 2019-05-22 15:09:59 -07:00
eef2bdf690 Add CPU affinity for PoH service thread (#4394)
automerge
2019-05-22 14:21:43 -07:00
190656967d Bump nix from 0.13.0 to 0.14.0 (#4382)
Bumps [nix](https://github.com/nix-rust/nix) from 0.13.0 to 0.14.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.13.0...v0.14.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-22 14:07:35 -07:00
90e73515ed Remove ls which is innacurate since we never clean up the logs (#4392)
automerge
2019-05-22 13:11:20 -07:00
1d7a758c97 Bump perf libs version to fix out buffer sizing (#4385) 2019-05-22 13:00:03 -07:00
e5b7aead12 Cargo watch ignores local metrics (#4384) 2019-05-22 00:08:18 -07:00
578c2ad3ea add bank hash to votes (#4381) 2019-05-21 21:45:38 -07:00
de6838da78 change unwrap to expect where WSL sometimes aborts (#4375)
* change unwrap to expect where WSL sometimes aborts

* clippy
2019-05-21 21:34:51 -07:00
604071c5d8 Bump num-traits from 0.2.7 to 0.2.8 (#4379)
Bumps [num-traits](https://github.com/rust-num/num-traits) from 0.2.7 to 0.2.8.
- [Release notes](https://github.com/rust-num/num-traits/releases)
- [Changelog](https://github.com/rust-num/num-traits/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-traits/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-21 21:27:00 -07:00
41a377013f fix spelling (#4378)
automerge
2019-05-21 17:13:21 -07:00
52d453d06f Reduce broadcast prints (#4368) 2019-05-21 17:02:19 -07:00
58295b825d introduce syscalls (#4373) 2019-05-21 15:19:41 -07:00
f6c7812fcc Rename Broker to Swapper (#4371) 2019-05-21 14:21:41 -07:00
2f7561e4ee Split SDK's BPF Rust-utils (#4369) 2019-05-21 13:39:27 -07:00
1cbd2372fc Revert 4271 workaround (#4367)
* Revert "#4271 not reproducable, remove workaround (#4363)"

This reverts commit ef0580bd3d.

* Remove old comment
2019-05-21 11:53:53 -07:00
28f948aa7f Multi rust projects (#4362) 2019-05-21 11:22:33 -07:00
c9ba9e4eb7 Add storage space constant (#4366)
automerge
2019-05-21 11:07:13 -07:00
f877fb8c8f Don't print leader update message unless leader actually updates (#4365) 2019-05-21 11:06:56 -07:00
772ba41ede Cargo.lock 2019-05-21 08:08:07 -07:00
6374e69a69 Add mining pool wallet commands (#4360)
automerge
2019-05-21 07:32:38 -07:00
ef0580bd3d #4271 not reproducable, remove workaround (#4363) 2019-05-20 23:45:09 -07:00
1a77486f8e Make RootedSlotsIterator for traversing slots on the root fork (#4361) 2019-05-20 23:09:00 -07:00
ead15d294e add get_epoch_vote_accounts rpc (#4317)
* add get_epoch_vote_accounts rpc

* fixups

* documentation and type updates
2019-05-20 22:21:13 -07:00
1acfcf3acf Fix storage-keypair 2019-05-20 19:54:37 -07:00
d15e248cdb Add bootstrap storage account to genesis (#4359)
* Add bootstrap storage account to genesis

* Add storage account genesis command to run.sh

* Update airdrop for all validators

* Remove unhelpful Short for arg

* Set the correct program owner
2019-05-20 19:46:15 -07:00
f1e5edee14 Modify Roots Column To Support Multiple Roots (#4321)
* Fix 1) Roots column family to handle storing multiple slots, 2) Store all slots on the rooted path in the roots column family
2019-05-20 19:04:18 -07:00
7153abd483 Revert "Performance tweaks (#4340)" (#4350)
* Revert "Performance tweaks (#4340)"

This reverts commit 55cee5742f.

* Revert Rc change
2019-05-20 17:48:42 -07:00
90fb5d074d Bump num-traits from 0.2.6 to 0.2.7 (#4355)
Bumps [num-traits](https://github.com/rust-num/num-traits) from 0.2.6 to 0.2.7.
- [Release notes](https://github.com/rust-num/num-traits/releases)
- [Changelog](https://github.com/rust-num/num-traits/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-traits/compare/num-traits-0.2.6...num-traits-0.2.7)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-20 16:35:14 -06:00
af82b0dce9 Fix sending root slots instead of current slot (#4354)
automerge
2019-05-20 15:01:55 -07:00
d4da2fbacd fix bench warnings (#4356) 2019-05-20 14:32:23 -07:00
77efe95730 Order "install" correctly 2019-05-20 13:54:15 -07:00
86e03a6d1b support issuing vote instructions from system account (#4338)
* issue vote instructions from system account

* fixup

* bring back KeypairUtil
2019-05-20 13:32:32 -07:00
114e2989fa Improve PoH unit test asserts (#4351)
automerge
2019-05-20 13:02:44 -07:00
7024c73e9b Revert banking threads increase which seems to be slower in testing. (#4349) 2019-05-20 11:42:37 -07:00
6d418aa3f1 Use rust_stable 2019-05-20 10:48:48 -07:00
f079a78c5e Remove fee arg from system_transaction::* (#4346)
automerge
2019-05-20 10:03:19 -07:00
6365c4c061 Use cleanup (#4347) 2019-05-20 09:58:27 -07:00
55cee5742f Performance tweaks (#4340)
* Use Rc to prevent clone of Packets

* Fix min => max in banking_stage threads.

Coalesce packet buffers better since a larger batch will
be faster through banking and sigverify.

Deconstruct batches into banking_stage from sigverify since
sigverify likes to accumulate batches but then a single banking_stage
thread will be stuck with a large batch. Maximize parallelism by
creating more chunks of work for banking_stage.
2019-05-20 09:15:00 -07:00
034eda4546 Fix a couple replicator nits (#4345)
automerge
2019-05-20 08:55:45 -07:00
44ff25d044 Update readme
* rustfmt no longer in preview
* since virtual manifest, cargo commands no longer require `--all`
2019-05-19 19:41:15 -06:00
a7e160e5c4 Add datapoint metrics to dashboard (#4343)
automerge
2019-05-19 15:07:03 -07:00
6283cc916d Add SOLANA_METRICS_MAX_POINTS_PER_SECOND env var (#4342) 2019-05-19 13:56:52 -07:00
4b6aca6120 Bump tempfile from 3.0.7 to 3.0.8 (#4341)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.0.7 to 3.0.8.
- [Release notes](https://github.com/Stebalien/tempfile/releases)
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/NEWS)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.0.7...v3.0.8)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-18 19:56:51 -07:00
20b2be6e0b Enable real PoH on beta testnet as well 2019-05-18 19:45:00 -07:00
cbebc7a80c Expand shortArgs correctly 2019-05-18 19:00:48 -07:00
06eb2364f2 Handle missed slots in storage stage (#4337)
* Handle missed slots in storage stage

* Fix test compile

* Make test use the new missed slot support
2019-05-18 15:24:50 -07:00
167890ca63 Set rust_version 2019-05-18 14:48:53 -07:00
392a39dd54 Poh subsystem cleanup, genesis plumbing, enable real PoH on edge testnet (#4292)
* Remove unused PohServiceConfig::Step

* Clarify variable name

* Poh::hash() now takes an iteration counter

* man -> max

* Inline functions with single call site

* Move PohServiceConfig into GenesisBlock

* Add plumbing to enable real PoH on testnets

* Batch hashes to improve PoH hash rate

* Ensure a constant hashes_per_tick

* Remove PohEntry mixin field

* Poh/PohEntry no longer maintains tick_height

* Ensure a constant hashes_per_tick

* ci/localnet-sanity.sh: Use real PoH

* Rework Poh/PohService to keep PohRecorder unlocked as much as possible while hashing
2019-05-18 14:01:36 -07:00
7e1a7862db test_process_store_ok() now pays with a system account (#4339)
automerge
2019-05-17 20:17:50 -07:00
458ae3fdac Switch to instances with AVX-512 if possible for better interop with dev machines (#4328)
automerge
2019-05-17 20:06:07 -07:00
431cc82032 add Transaction::partial_sign() (#4333)
* add partial sign

* nits
2019-05-17 18:55:57 -07:00
18c6729d6c Bump tar from 0.4.25 to 0.4.26 (#4330)
Bumps [tar](https://github.com/alexcrichton/tar-rs) from 0.4.25 to 0.4.26.
- [Release notes](https://github.com/alexcrichton/tar-rs/releases)
- [Commits](https://github.com/alexcrichton/tar-rs/compare/0.4.25...0.4.26)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-17 17:46:12 -07:00
9476fe5ce3 Use log levels for datapoint metrics (#4335)
* Use log levels for datapoint metrics

* address review comments

* fix cyclomatic complexity
2019-05-17 17:34:05 -07:00
788290ad82 Rework Storage Program to accept multiple proofs per segment (#4319)
automerge
2019-05-17 14:52:54 -07:00
6b5bcfaa58 Bump libc from 0.2.54 to 0.2.55 (#4324)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.54 to 0.2.55.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.54...0.2.55)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-17 13:24:12 -07:00
4ed0cded9c Rm metrics docker even if not running (#4329) 2019-05-17 13:13:38 -07:00
035a364122 Add expect to get better errors on crash (#4327) 2019-05-17 12:49:41 -07:00
b114bc3674 Add benchmark for sigverify stage (#4320) 2019-05-17 11:09:42 -07:00
bc74ee7117 Common Rust-BPF utilities and types (#4325) 2019-05-17 11:04:29 -07:00
b2ce5dc9f5 Adjust log level for counter metrics (#4323) 2019-05-17 07:00:06 -07:00
e920191de0 Rate limit metrics per log level (#4313)
* Rate limit metrics per log level

* fix tests
2019-05-16 22:27:05 -07:00
39e85a3e53 kill some bs58 (#4316)
* kill some bs58

* fixup
2019-05-16 21:43:18 -07:00
41156da4ca Sync run.sh with fd3f2cb (#4322)
automerge
2019-05-16 21:32:23 -07:00
9271ba0039 Cleanup Rust BPF program building (#4318) 2019-05-16 17:35:42 -07:00
b3e45fd6b7 Add erroring tx to unexpected validator error logging (#4314)
* Add tx logging to error

* Add tx logging to unexpected validator errors
2019-05-16 14:59:22 -07:00
7bfb60f82e add impl FromStr for Signature (#4315)
automerge
2019-05-16 14:54:31 -07:00
359c50f1b3 cp -a includes -r (#4312) 2019-05-16 12:24:04 -07:00
fff1631a8b Return a better error when a program account isn't found (#4310) 2019-05-16 11:32:27 -06:00
7d42ae30d9 Update Rust-BPF to 2018 Edition (#4307) 2019-05-16 09:12:33 -07:00
87414de3e2 switch over to passive stakes (#4295)
* add failing test

* switch over to passive stakes

* test multiple stakers
2019-05-16 08:23:31 -07:00
a0ffbf50a5 Correctly remove replicator from data plane after its done repairing (#4301)
* Correctly remove replicator from data plane after its done repairing

* Update discover to report nodes and replicators separately

* Fix print and condition to be spy
2019-05-16 07:14:58 -07:00
d40b66ff7b Bump solana_rbpf from 0.1.10 to 0.1.11 (#4304)
Bumps [solana_rbpf](https://github.com/solana-labs/rbpf) from 0.1.10 to 0.1.11.
- [Release notes](https://github.com/solana-labs/rbpf/releases)
- [Commits](https://github.com/solana-labs/rbpf/commits/v0.1.11)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-16 01:07:10 -07:00
abd7f6b090 Change slot_meta_iterator() to return an iterator not a cursor (#4303)
automerge
2019-05-15 18:28:23 -07:00
d8735df1de Update replicator to use cluster_info instead of cached client (#4302) 2019-05-15 18:14:04 -07:00
481853e1b1 Bump reqwest from 0.9.16 to 0.9.17 (#4296)
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.9.16 to 0.9.17.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.9.16...v0.9.17)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-15 16:02:17 -07:00
778bcbce50 Reduce log level for frequent log message and frequency for metrics datapoint (#4300)
automerge
2019-05-15 16:01:17 -07:00
fd3f2cb910 Add Storage accounts for all nodes (#4298)
* Setup storage keypairs for all nodes

* Clean up naming

* clippy

* Update arg value_names
2019-05-15 15:19:29 -07:00
915956b94b Remove disable leader rotation option (#4299)
automerge
2019-05-15 15:16:45 -07:00
4576250342 Fix bug in storage processor and remove duplicate Constant (#4294)
* Fix bug in storage processor and remove duplicate Constant

* Add test

* Bump replicator timeout
2019-05-15 13:28:56 -07:00
2bef1b0433 Use rust-bpf-sysroot release branches (#4293) 2019-05-15 12:45:48 -07:00
628128b376 add passive staking to local_cluster (#4285)
* add passive staking to local_cluster

* add stake_program to genesis

* use equal stakes in local_cluster tests
2019-05-15 12:15:31 -07:00
916017ca2c Fix repair for a range of slots (#4286)
* Fix repair for a range of slots

* Delete RepairInfo
2019-05-15 11:37:20 -07:00
3204a00e73 Update rust-bpf-sysroot to latest (#4291) 2019-05-15 09:53:44 -07:00
1d327a5167 Bump bincode from 1.1.3 to 1.1.4 (#4290)
Bumps [bincode](https://github.com/TyOverby/bincode) from 1.1.3 to 1.1.4.
- [Release notes](https://github.com/TyOverby/bincode/releases)
- [Commits](https://github.com/TyOverby/bincode/compare/v1.1.3...v1.1.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-15 09:47:55 -06:00
6e4f9cedf2 Fix Plum Tree link 2019-05-15 08:15:22 -07:00
a79fbbafc9 SlotMeta is incorrectly updated on insertion of erasure blobs (#4289)
* Fix put_coding_blob_bytes to properly update slotmetas and chaining
2019-05-15 00:28:31 -07:00
1d54d29076 Fix reading ledger for chacha encrypt (#4288) 2019-05-14 16:59:17 -07:00
10b9a4806b Fix incorrect genesis blockhashes on restart (#4287) 2019-05-14 16:32:44 -07:00
0c1191c3ee rework staking_utils (#4283) 2019-05-14 16:15:51 -07:00
18b386cd10 remove unused make_active_set_entries (#4284) 2019-05-14 15:08:49 -07:00
714b8c7fc8 Bump tokio from 0.1.18 to 0.1.20 (#4280)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 0.1.18 to 0.1.20.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-0.1.18...tokio-0.1.20)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-14 15:30:56 -06:00
216e9a61a0 expose stake directly from bank (#4281) 2019-05-14 13:35:14 -07:00
0f498e6265 remove unused filter_zero_balance (#4279) 2019-05-14 10:44:29 -07:00
e8ad822111 get program names from programs (#4273)
* get program names from programs

* fixup
2019-05-14 10:44:16 -07:00
65a82ebf50 Fix broken tip (#4278)
automerge
2019-05-14 02:35:32 -07:00
727802684c Use 20 bytes signature slice for cache purposes (#4260) 2019-05-13 22:53:10 -07:00
e20a8329d3 Add API to iterate over slot's blobs (#4276) 2019-05-13 22:04:54 -07:00
88c2d0fad4 Add genesis blockhash to replicators and blob filter for window (#4275)
* Add genesis blockhash to replicators and blob filter for window

* Fixes to mining submission and ledger download

* Add todo over sleep

* Update log
2019-05-13 21:19:51 -07:00
3bd921264a Move EpochSchedule into own module (#4272) 2019-05-13 16:24:32 -07:00
7501ed65e5 Initialize and Update EpochSlots in RepairService (#4255)
* Initialize EpochSlots in RepairService

* Fix flaky test
2019-05-13 15:37:50 -07:00
2eaa64c4e8 valhashators -> validators 2019-05-13 15:29:23 -07:00
c9b86018c6 Filter out all unprocessed transactions before forwarding them (#4266)
* Filter out all unprocessed transactions before forwarding them

* fix clippy
2019-05-13 14:40:05 -07:00
a4fb01b42b Add +x 2019-05-13 14:30:44 -07:00
0d2574f8f0 get DLL names from programs that made the DLL (#4269)
* get program names from programs

* fixup
2019-05-13 14:17:44 -07:00
796000e96f Improve erasure metrics (#4268)
* Improve erasure metrics

* Simplify metrics submission
2019-05-13 16:04:43 -05:00
e2f00dc205 Cargo.toml implied (#4270)
automerge
2019-05-13 13:51:42 -07:00
5e91f8f59d Update reported tx count to exclude errors (#4201) 2019-05-13 13:23:52 -07:00
e2830f5b0e Add rate limit to metrics datapoint submission (#4237)
Cleanup

Raise limit on submission threshold

Pick nits and add metrics point

fmt

Fixup compiler warning

Cleanup if-else

Append new point to vec rather than submit
2019-05-13 14:17:25 -06:00
a2e3a92b01 Extend GetBlockHash RPC API to include the fee scehdule for using the returned blockhash (#4222) 2019-05-13 12:49:37 -07:00
23c696706b add stake_accounts to banks' caches (#4267) 2019-05-13 12:33:23 -07:00
1393d26f63 Remove obsolete internal multinode-demo/ logging (#4265) 2019-05-13 10:51:18 -07:00
1b68da7572 Use solana-ed25519-dalek v0.2.0 (#4264)
automerge
2019-05-13 09:51:59 -07:00
8542006259 Config instructions now only require one key (#4258) 2019-05-12 22:47:12 -07:00
426d06b89b Improve target/ cache logging 2019-05-12 22:16:23 -07:00
06378d6db6 Refine killNode logging 2019-05-12 21:21:31 -07:00
dccfe31e8c Increase target cache size for coverage build 2019-05-12 21:21:31 -07:00
1dce5976cf Disable node restart in localnet-sanity.sh 2019-05-12 21:21:31 -07:00
340d01665c Avoid generating default keypair 2019-05-12 21:21:31 -07:00
50f79e495e net/ improvements (#4257)
automerge
2019-05-11 22:54:50 -07:00
dd12db2f06 Correctly handle more zones than additional nodes 2019-05-11 14:47:27 -07:00
1afccb7351 Add more regions to the testnet 2019-05-11 14:12:13 -07:00
bfc65e829e Use zone[0] for any left over nodes 2019-05-11 14:07:36 -07:00
eb4515525d Bump ws from 0.8.0 to 0.8.1 (#4251)
Bumps [ws](https://github.com/housleyjk/ws-rs) from 0.8.0 to 0.8.1.
- [Release notes](https://github.com/housleyjk/ws-rs/releases)
- [Changelog](https://github.com/housleyjk/ws-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/housleyjk/ws-rs/compare/v0.8.0...v0.8.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-10 21:06:33 -07:00
55f5f6a033 Make links clickable 2019-05-10 19:49:45 -07:00
7ae421eaf6 Update release version in book (#4254) 2019-05-10 18:43:08 -06:00
e7da2c0931 Add validator registration link (#4229) 2019-05-10 15:14:03 -07:00
133be2df51 Check for transaction forwarding delay to detect an expired transaction before forwarding it (#4249)
Also refactored code for forwarding packets, and added test for it
2019-05-10 14:28:38 -07:00
06a93dcb43 Move to solana-ed25519-dalek (#4248) 2019-05-10 15:26:46 -06:00
ad7f04a245 Add genesis_blockhash to erasure blobs so they don't get filtered out by window_service (#4247) 2019-05-10 14:06:31 -07:00
0da6e1af14 Repair Design Proposal (#3402)
* Update information about existing repair protocol + new repairman proposal
2019-05-10 13:50:23 -07:00
576524f13b Updates to storage proposal with more storage contract details (#3373) 2019-05-10 09:19:06 -07:00
f567877d1d Cleanup metrics (#4230) 2019-05-10 08:33:58 -07:00
9881820444 RepairService saves db_iterator instead of reconstructing on every search (#4242) 2019-05-09 19:57:51 -07:00
ba8f49366d passive staking 4 (#4240)
* support passive staking with wallet, use it

* fixups

* clippy

* cleanup app generation in wallet, finish fullnode.sh staking

* _id and _keypair => pubkey
use keygen, not wallet to get pubkey

* found 'em
2019-05-09 19:31:42 -07:00
81fa69d347 Revert "Create bank snapshots (#3671)" (#4243)
This reverts commit abf2b300da.
2019-05-09 19:27:27 -07:00
abf2b300da Create bank snapshots (#3671)
* Be able to create bank snapshots

* fix clippy

* load snapshot on start

* regenerate account index from the storage

* Remove rc feature dependency

* cleanup

* save snapshot for slot 0
2019-05-09 19:27:06 -07:00
a8254fd258 Clear stale ledger on fullnode startup if necessary (#4238) 2019-05-09 17:09:36 -07:00
b15848de3b Bump tar from 0.4.24 to 0.4.25 (#4239)
Bumps [tar](https://github.com/alexcrichton/tar-rs) from 0.4.24 to 0.4.25.
- [Release notes](https://github.com/alexcrichton/tar-rs/releases)
- [Commits](https://github.com/alexcrichton/tar-rs/compare/0.4.24...0.4.25)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-09 17:07:31 -07:00
ab3c988146 API for getting first and last slots in epoch (#4241)
automerge
2019-05-09 16:06:57 -07:00
575a0e318b Add newly completed slots signal to Blocktree (#4225)
* Add channel to blocktree for communicating when slots are completed

* Refactor RepairService options into a RepairStrategy
2019-05-09 14:10:04 -07:00
a031b09190 Add replicator support to multinode demo (#4221)
automerge
2019-05-09 13:43:39 -07:00
df43e721e3 Exit 1 on ledger verification failure 2019-05-09 12:05:51 -07:00
5f72650c7f add derive Debug to Keypair (#4236) 2019-05-09 11:41:11 -07:00
5d0d467287 fix banking_stage benches (#4231) 2019-05-09 11:20:26 -07:00
994515d0f2 add impl PartialEq for Keypair (#4233)
* add-impl-PartialEq-for-Keypair

* clippy

* do the TODO, improve wrapper comments
2019-05-09 11:03:14 -07:00
1e949caa7f Move airdrop retries fully out of bash (#4234)
automerge
2019-05-09 09:48:27 -07:00
f2b727b534 Update mint keypair filename 2019-05-09 07:27:13 -07:00
f7680752e7 make gen_keypair_file take &str (#4232)
automerge
2019-05-08 23:00:48 -07:00
da4c37beec multinode-demo/ grooming (#4226)
* Rename leader to entrypoint

* The fullnode identity keypair can now be provided

* Rename _id to _keypair
2019-05-08 19:59:22 -07:00
d486d2b8ce Consolidate default arg parsing (#4224)
automerge
2019-05-08 19:12:43 -07:00
bba94c43b9 Add BankForks to RepairService (#4223)
automerge
2019-05-08 18:51:43 -07:00
9cdffc7d64 Don't push empty vecs into the unprocessed buffers (#4214) 2019-05-08 17:58:07 -07:00
5a86f2506d Remove unnecessary retrying (#4219) 2019-05-08 16:20:37 -07:00
518227eac0 add-rpc_client.get_account (#4218) 2019-05-08 15:50:23 -07:00
b8fd51e97d Add new gossip structure for supporting repairs (#4205)
* Add Epoch Slots to gossip

* Add new gossip structure to support Repair

* remove unnecessary clones

* Setup dummy fast repair in repair_service

* PR comments
2019-05-08 13:50:32 -07:00
965c1e0000 staking plumbing part 3, 3.5 (#4216) 2019-05-08 12:56:11 -07:00
a80176496d add /target/ to .gitignore files for all crates (#4217)
* add /target/ to .gitignore files for all crates

* shellcheck
2019-05-08 12:15:05 -07:00
5719b8f251 Change remote node's ssh config to allow more login retries (#4215)
automerge
2019-05-08 11:20:06 -07:00
1a2b131ceb Don't forward transactions that are expired or failed signature check (#4199) 2019-05-08 10:32:25 -07:00
349306ddf7 Bump proc-macro2 from 0.4.27 to 0.4.29 (#4180)
Bumps [proc-macro2](https://github.com/alexcrichton/proc-macro2) from 0.4.27 to 0.4.29.
- [Release notes](https://github.com/alexcrichton/proc-macro2/releases)
- [Commits](https://github.com/alexcrichton/proc-macro2/compare/0.4.27...0.4.29)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-08 09:03:30 -07:00
791ee411a5 Add root to bank forks (#4206) 2019-05-07 23:34:10 -07:00
f690c64375 Disable solana-upload-perf until performance can be debugged (#4210) 2019-05-07 23:02:09 -07:00
427963f554 Core depends on vote and budget program directly (#4204) 2019-05-07 22:41:47 -07:00
b0f2220ef6 Fix solana-upload-perf log folding. Upload bench output too (#4208) 2019-05-07 22:30:42 -07:00
908b48bf0e Increase test-stable build timeout 2019-05-07 22:23:43 -07:00
b49f8c0984 reduce replicode, introduce passive staking support (#4207) 2019-05-07 22:22:43 -07:00
7609a007c6 Add FeeCalculator to the genesis block (#4196) 2019-05-07 20:28:41 -07:00
674a49f8d7 Bump serde_derive from 1.0.90 to 1.0.91 (#4172)
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.90 to 1.0.91.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.90...v1.0.91)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-07 20:05:41 -07:00
d10bde656a Pass payer key into get_keys() (#4203) 2019-05-07 18:48:31 -07:00
401764ddb1 add create_delegate_stake_account (#4197) 2019-05-07 17:08:49 -07:00
69eeb7cf08 Fix parent record locks usage in child banks (#4159)
* Introduce record locks on txs that will be recorded

* Add tests for LockedAccountsResults

* Fix broken bench

* Exit process_entries on detecting conflicting locks within same entry
2019-05-07 15:51:35 -07:00
55e3b7d380 Storage transactions are now paid for by a system account (#4193)
* Pay program loading fees from a system account

* Pay transaction fees from a system account
2019-05-07 15:01:10 -07:00
d9e18a71ec Pay program loading fees from a system account (#4190) 2019-05-07 15:00:54 -07:00
2107e15bd3 Reduce Avalanche redundancy and implement traditional fanout (#4174)
* Reduce Avalanche redundancy and implement traditional fanout

* Revert tiny fanout

* Update diagrams and docs based on review comments
2019-05-07 13:24:58 -07:00
4f3b22d04e Minor code restyling, no functional changes 2019-05-07 12:35:29 -07:00
2c78a93001 GenesisBlock::new(X) => create_genesis_block(X) 2019-05-07 12:34:17 -07:00
2621aeee82 Set default wallet rpc port correctly 2019-05-07 11:37:51 -07:00
8e400fc4bd rework genesis (passive staking groundwork) (#4187)
* rework genesis

* fixup
2019-05-07 11:16:22 -07:00
29c2a63c8b Retry transactions that failed due to account lock (#4184)
* added test
2019-05-07 10:23:02 -07:00
736ada4e21 Bump dtoa from 0.4.3 to 0.4.4 (#4178)
Bumps [dtoa](https://github.com/dtolnay/dtoa) from 0.4.3 to 0.4.4.
- [Release notes](https://github.com/dtolnay/dtoa/releases)
- [Commits](https://github.com/dtolnay/dtoa/compare/0.4.3...0.4.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-07 07:31:57 -07:00
3df9b44d4c Bump nom from 4.2.2 to 4.2.3 (#4182)
Bumps [nom](https://github.com/Geal/nom) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/Geal/nom/releases)
- [Changelog](https://github.com/Geal/nom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Geal/nom/compare/4.2.2...4.2.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-07 07:31:48 -07:00
7225b89142 Bump globset from 0.4.2 to 0.4.3 (#4176)
Bumps [globset](https://github.com/BurntSushi/ripgrep) from 0.4.2 to 0.4.3.
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/compare/globset-0.4.2...globset-0.4.3)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-07 07:15:34 -07:00
0cc0d3ab7a Bump socket2 from 0.3.8 to 0.3.9 (#4186)
Bumps [socket2](https://github.com/alexcrichton/socket2-rs) from 0.3.8 to 0.3.9.
- [Release notes](https://github.com/alexcrichton/socket2-rs/releases)
- [Commits](https://github.com/alexcrichton/socket2-rs/compare/0.3.8...0.3.9)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-07 07:15:04 -07:00
88d9618788 Bump futures from 0.1.25 to 0.1.26 (#4179)
Bumps [futures](https://github.com/rust-lang-nursery/futures-rs) from 0.1.25 to 0.1.26.
- [Release notes](https://github.com/rust-lang-nursery/futures-rs/releases)
- [Changelog](https://github.com/rust-lang-nursery/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang-nursery/futures-rs/compare/0.1.25...0.1.26)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-07 07:14:48 -07:00
57038529e0 Bump hex-literal from 0.1.4 to 0.2.0 (#4185)
Bumps [hex-literal](https://github.com/RustCrypto/utils) from 0.1.4 to 0.2.0.
- [Release notes](https://github.com/RustCrypto/utils/releases)
- [Commits](https://github.com/RustCrypto/utils/compare/hex-literal-v0.1.4...hex-literal-v0.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-07 07:14:16 -07:00
5c25eae631 Bump tokio-sync from 0.1.4 to 0.1.5 (#4177)
Bumps [tokio-sync](https://github.com/tokio-rs/tokio) from 0.1.4 to 0.1.5.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-sync-0.1.4...tokio-sync-0.1.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-06 22:06:09 -07:00
b8b4d33f72 Bump h2 from 0.1.17 to 0.1.18 (#4175)
Bumps [h2](https://github.com/carllerche/h2) from 0.1.17 to 0.1.18.
- [Release notes](https://github.com/carllerche/h2/releases)
- [Changelog](https://github.com/hyperium/h2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/carllerche/h2/compare/v0.1.17...v0.1.18)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-06 21:42:22 -07:00
673a9417ef Bump serde from 1.0.90 to 1.0.91 (#4171)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.90 to 1.0.91.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.90...v1.0.91)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-06 21:41:30 -07:00
3fd9aada8b Add missing modules to workspace (#4183) 2019-05-06 22:40:54 -06:00
453fdb9e28 Add support for local metric collection/viewing (#4170) 2019-05-06 16:44:06 -07:00
3f6a79b078 Add a validator node proposal (#3035)
automerge
2019-05-06 13:41:28 -07:00
e9f80e5542 Don't use default ticks per slot in calculating next slot leader (#4169) 2019-05-06 11:23:06 -07:00
694d28acf8 remove some boilerplate (#4143) 2019-05-06 10:11:18 -07:00
88fdba5aca Temp: bump test-bench timeout 2019-05-06 10:00:00 -07:00
a19df7a36c Add type annotations for external crates (#4125) 2019-05-06 10:11:50 -06:00
9b50583641 wallet: add --url, remove --host/--rpc-host/--rpc-port/-rpc-tls (#4153)
Also by default the wallet now talks to testnet.solana.com instead of
localhost
2019-05-06 07:38:26 -07:00
71f9b44687 Add Confirmations parameter to RPC Subscriptions (#4154)
* Add optional depth parameter to pubsub, and store in subscriptions

* Pass bank_forks into rpc_subscription; add method to check depth before notify and impl for account subscriptions

* Impl check-depth for signature subscriptions

* Impl check-depth for program subscriptions

* Plumb fork id through accounts

* Use fork id and root to prevent repeated account notifications; also s/Depth/Confirmations

* Write tests in terms of bank_forks

* Fixup accounts tests

* Add pubsub-confirmations tests

* Update pubsub documentation
2019-05-06 08:31:50 -06:00
0139e5db21 Correct blockstreamer node args 2019-05-04 08:22:36 -07:00
586fb15c2c fullnode positional arguments may now be mixed with optional arguments (#4151) 2019-05-03 20:49:24 -07:00
297328ff9a Fix improper tick sleeping time in test (#4155)
automerge
2019-05-03 20:15:10 -07:00
6b3384c205 Bump serde_yaml from 0.8.8 to 0.8.9 (#4127)
Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.8.8 to 0.8.9.
- [Release notes](https://github.com/dtolnay/serde-yaml/releases)
- [Commits](https://github.com/dtolnay/serde-yaml/compare/0.8.8...0.8.9)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-03 19:45:09 -07:00
3ef961fe37 Record poh ticks even when the node is not in leader schedule (#4148)
* remove obsolete test
2019-05-03 16:41:19 -07:00
a7b695c27a Change replicators to slot-based (#4118) 2019-05-03 16:27:53 -07:00
5bb75a5894 Fix roots never being purged (#4134) 2019-05-03 15:17:37 -07:00
f3f416b7ba Rename --network argument to --entrypoint (#4149) 2019-05-03 15:00:19 -07:00
31b74bdf0b Display release date in the local timezone (#4144) 2019-05-03 14:54:25 -07:00
ed48d8323c Reduce locking in Blocktree (#4075)
* Reduce lock contention in blocktree

* Store root slot in separate column
2019-05-03 16:46:02 -05:00
f91627a230 Remove extra-fullnode-args.sh (#4142) 2019-05-03 13:32:59 -07:00
f9c093022c multinode-demo/: Merge bootstrap-leader.sh into fullnode.sh (#4139) 2019-05-03 12:33:48 -07:00
7fe3c75c6b Add a node-specific ip echo service to remove dependency on ifconfig.co (#4137) 2019-05-03 11:01:35 -07:00
c8ed41167a Factor tune_system() out of multinode-demo/ (#4138)
* Remove x bit from ulimit-n.sh

* Factor tune_system() out of multinode-demo/
2019-05-03 10:40:02 -07:00
5b2a82a951 Fix validator confirmation graph y axis scale (#4136) 2019-05-02 19:51:56 -07:00
441e76ebeb Index buffered transactions at the correct offset (#4126)
* tests
2019-05-02 19:05:53 -07:00
c2dfb9900e Revert "Change forwarded metrics to be in line with fetch stage metrics (#4068)" (#4135)
automerge
2019-05-02 17:36:19 -07:00
916458e132 Change erasure set size to 8:8 (#4129)
* Change erasure set size to 8:8

* Change tests to be agnostic to exact set size and ratio

* Add convenience methods for setting presence
2019-05-02 19:04:40 -05:00
ffb15578ce remove cargo install cargo-audit from CI (#4123) 2019-05-02 15:35:47 -07:00
abcbbb925f push latest, too (#4131) 2019-05-02 15:33:08 -07:00
059755fe59 install mdbook and svgbob_cli (#4128) 2019-05-02 15:32:31 -07:00
ae12dc2c75 Add specs to testnet participation guide (#4078) 2019-05-02 15:21:05 -07:00
37b5c6afaa install cargo audit (#4122) 2019-05-02 13:16:21 -07:00
92ed7b36a2 Bump libc from 0.2.53 to 0.2.54 (#4124)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.53 to 0.2.54.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.53...0.2.54)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-02 13:11:29 -06:00
379d2e6d95 add support for single-crate coverage to help iterate, update to latest grcov (#4085)
* add support for single-crate coverage to help iterate, update to latest grcov

* shellcheck

* fixup

* remove unused

* install grcov before setting RUSTFLAGS ;)

* rely on nightly having grcov installed
2019-05-01 23:33:28 -07:00
7f75cc8906 update nightly to 2019-05-01 (#4111)
* update nightly to 2019-05-01

* cargo fmt

* cargo fmt

* increase bench timeout
2019-05-01 20:08:42 -07:00
1ab5098576 Move get_clients into gossip_service (#4109) 2019-05-01 17:14:01 -07:00
598f765960 Fix net.sh for running on macos (#4107)
automerge
2019-05-01 16:03:35 -07:00
aac626c2c2 Add sample_txs function to perf_utils shared crate (#4104)
Shared code between bench-tps and bench-exchange
2019-05-01 15:58:35 -07:00
3eec3cfac2 Cleanup banking stage in lieu of recent transaction forwarding changes (#4101) 2019-05-01 15:13:10 -07:00
5eee9e62e5 Add swapper back-off (#4088)
* Add swapper back-off

* Reset back-off if bench-exchange suspects back-log

* nudge

* nudge
2019-05-01 14:29:57 -07:00
a7d18125d3 install grcov (#4097) 2019-05-01 14:27:17 -07:00
8202310073 Minor update to gossip spy command (#4103) 2019-05-01 14:25:26 -07:00
1e2ba110eb Bump reqwest from 0.9.15 to 0.9.16 (#4089)
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.9.15 to 0.9.16.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.9.15...v0.9.16)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-05-01 14:24:59 -06:00
62c9b7d850 Fix and un-ignore bench-tps local_cluster test (#4019)
* un-ignore bench-tps local_cluster test

And add bench_tps_fund_keys test.

* Unify generate_and_airdrop logic for tests
2019-05-01 13:21:45 -07:00
4f18fc836f Forward transactions to the next slot leader (#4092)
- this ensures that transactions will reach in time for the next node to process them
2019-05-01 11:37:29 -07:00
950d8494ba earlyoom: Stop using unsupported -k option (#4096)
automerge
2019-05-01 11:29:02 -07:00
cb528af4e2 fix accounts_db storage.reset() (#4094)
* fix accounts_db storage.reset()

* fix compilation errors, remove unused, fix test_accounts_grow() failure
2019-05-01 09:27:13 -07:00
ad27c30623 Cleanup bench-exchange messages (#4093) 2019-04-30 23:09:33 -07:00
9add8d0afc Add alternative to Spy Nodes that can fully participate in Gossip (#4087)
automerge
2019-04-30 16:42:56 -07:00
af2e7ea285 Add 1 decimal to validator confirmation (#4084) 2019-04-30 16:37:03 -07:00
675a78aaa1 get vote_instruction off bank for tests (#4086)
* get vote_instruction off bank for tests

* clippy
2019-04-30 15:11:08 -07:00
408bdbce7a Add non_default_stream parameter to cuda_verify (#4079) 2019-04-30 13:34:46 -07:00
1a259d4a3f Prevent Requests/Caching of leader schedules for epochs beyond confirmed roots (#4033)
automerge
2019-04-30 13:23:21 -07:00
c5f8b4960c Stop nodes in parallel 2019-04-30 10:42:59 -07:00
21f845ed39 Use more -w 2019-04-30 09:57:14 -07:00
7a369df9a7 Add flag to skip slow extras when deploying a large testnet 2019-04-30 09:26:50 -07:00
f02ec31c68 Flip if/else 2019-04-30 08:56:53 -07:00
d21fa4a177 v0.14: various net/ fixes for large clusters (#4080)
* net.sh: Add -F to discard validator nodes that didn't bootup successfully

* Relax sanity node count when validator bootup failure is permitted

* Less sanity for testnet-demo

* net.sh: Add -F to discard validator nodes that didn't bootup successfully
2019-04-29 21:38:32 -07:00
bd0871cbe7 Update release doc to include testnet update instuctions (#4066)
* Update release doc to include testnet update instuctions

* Fixup headers and pick nits

* Remove outdated testnet behavior
2019-04-29 19:40:18 -06:00
2604f8ac0a Move implemented functionality into the Implemented Proposals section (#4057) 2019-04-29 17:29:41 -06:00
a7574f8657 Cleanup metrics dashboard (#4072) 2019-04-29 15:52:04 -07:00
73f250f03a Make minimum warmup period 32 slots long (#4031)
* Make minimum warmup period 32 slots long

* PR fixes
2019-04-29 15:26:52 -07:00
bae0aadafa Remove Bench Exchange Contract Execution graph 2019-04-29 14:29:54 -07:00
5524146ddf push down noop's messages (#4069)
automerge
2019-04-29 14:10:36 -07:00
3b2adbc9df Change forwarded metrics to be in line with fetch stage metrics (#4068)
automerge
2019-04-29 13:50:14 -07:00
4e41c81bc7 Fix the output from Gossip Discovery (#4067)
automerge
2019-04-29 13:19:24 -07:00
c545e812d0 Expand bank benches to include async/sync and native_loader (#4026) 2019-04-29 13:09:11 -07:00
c2193a37ce cleanup unused function (#4064) 2019-04-29 12:45:14 -07:00
fabba82173 ignore non-descendants of roots in blocktree (#4032) 2019-04-29 12:29:14 -07:00
c3ec5ad846 testnet-demo: use more low quota nodes 2019-04-29 12:18:39 -07:00
c4945cc04a Bump tar from 0.4.23 to 0.4.24 (#4060)
Bumps [tar](https://github.com/alexcrichton/tar-rs) from 0.4.23 to 0.4.24.
- [Release notes](https://github.com/alexcrichton/tar-rs/releases)
- [Commits](https://github.com/alexcrichton/tar-rs/compare/0.4.23...0.4.24)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-29 10:34:30 -06:00
e2e55f81d0 Increase testnet-demo node count a little 2019-04-29 09:09:55 -07:00
d862565b16 Move Transact proposal to implemented (#4055)
And update names to reflect what was implemented.
2019-04-29 09:13:39 -06:00
0cc3956693 testnet-demo now runs across more GCE zones (#4053)
* testnet-demo now runs across more GCE zones

* Save zone info to config file

* Add geoip whitelist for common data centers

* Skip more of start

* Include -x for config

* Fetch private key from first validator node if necessary

* Correct -r propagation
2019-04-28 19:50:52 -07:00
4e5677f116 Sample random trade_infos for success (#4043)
Just looking at a single trade_info which may or may not succeed
can fail often.
2019-04-28 11:00:16 -07:00
acba1d6f9e Roots are added out of order to the accounts index (#4051)
* fix root race

* assert root order

* fixup! assert root order

* last root test

* update

* fix tests
2019-04-28 10:27:37 -07:00
3e14af5033 bast bank ancestor check (#4050) 2019-04-28 10:27:09 -07:00
6f56501034 Correctly terminate instances across multiple zones 2019-04-28 09:09:02 -07:00
0b7269b64e Switch testnet-demo to influxcloud 2019-04-27 22:12:50 -07:00
457a2d948b Correct us-central1-b zone name 2019-04-27 21:43:18 -07:00
528bdf34fd testnet-demo: skip over validator nodes that fail to boot 2019-04-27 21:34:23 -07:00
697cd17b59 Use GPU nodes for blockstreamer as well if rest of testnet has GPUs (#4046)
- The blockstreamer crashes otherwise, as sigverify() looks for CUDA libs
2019-04-27 20:45:38 -07:00
13fcfcb964 Blockstreamer annotation fix for non buildkite deployments (#4045) 2019-04-27 20:37:36 -07:00
9c1fd55768 testnet-demo: add more GCE zones, remove client 2019-04-27 16:52:09 -07:00
7f9a476660 Performance metrics computation methodology (#4041) 2019-04-27 16:37:51 -07:00
b07290df81 Add usage to net.sh when it encounters an invalid argument (#4042)
automerge
2019-04-27 16:12:13 -07:00
4b599a95b3 Bump libc from 0.2.51 to 0.2.53 (#4009)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.51 to 0.2.53.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.51...0.2.53)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-27 14:04:23 -06:00
64222cfff7 update lock file for 0.15 (#4039)
automerge
2019-04-27 11:43:12 -07:00
e81d434903 Add DNS resolution for network/drone arguments (#4038)
automerge
2019-04-27 10:06:58 -07:00
bf0dd158de Avoid inaccurate PATH nagging (#4034)
automerge
2019-04-27 09:11:02 -07:00
18e398131d Fix issues with bench-tps (#4005) 2019-04-27 08:39:29 -07:00
4a5837a286 Add " 2019-04-27 07:41:21 -07:00
656e2649a7 v0.15.0 2019-04-27 07:38:46 -07:00
d36af917ea Swap testnet-beta and testnet configuration 2019-04-26 23:24:35 -07:00
c81733b41a Add testnet-demo configuration 2019-04-26 22:59:26 -07:00
b6558a2ef3 Remove created lockfile 2019-04-26 21:36:20 -07:00
634d8e25ee testnet-deploy.sh updates 2019-04-26 21:29:42 -07:00
fea212e64e Initialize stopNetwork var 2019-04-26 21:10:36 -07:00
e3ab76f1a7 Pin recommended release version (#4021) 2019-04-26 21:10:31 -07:00
87f1bd58b9 Reduce submit frequency of counters that are very frequent and killing metrics DB (#4027) 2019-04-26 20:37:40 -07:00
a056c1f18f Don't send packets when msgs len is 0 (#4030)
And don't send metrics every iteration.
2019-04-26 17:27:31 -07:00
8b34fd2c75 Fix warnings on nightly (#4028) 2019-04-26 16:25:13 -07:00
b912ee7fdf Nit: Spelling (#4025) 2019-04-26 16:02:37 -07:00
3cf708f019 nit: remove copyposta (#4024) 2019-04-26 16:02:13 -07:00
070e0e9613 Skip *de*serializing too 2019-04-26 14:43:07 -07:00
3e678511d2 Add enable/disable key value pairs into the steps block (#4018) 2019-04-26 14:26:05 -06:00
4ce2105548 Switch from a S3 URL to release.solana.com for release assets (#4017)
automerge
2019-04-26 13:06:55 -07:00
721c6a7e2d Update metrics dashboard (#4012)
automerge
2019-04-26 10:32:49 -07:00
08f0fb1e14 Implement working lockfile for testnet lockout (#4013) 2019-04-26 11:22:23 -06:00
f5f5281f85 Add on-demand functionality to all testnets (#4003)
* Add on-demand functionality to all testnets
2019-04-26 10:02:23 -06:00
1684a7bd18 Move validators from testnet-beta to testnet (#4011)
* Move validators from testnet-beta to testnet

* Move testnet influxdb datasource to influxcloud
2019-04-26 09:02:12 -07:00
8b1724bb70 Serialize blocktree writes by locking the database (#4008)
Move several private methods to free functions
2019-04-26 10:52:10 -05:00
eebdfe8d73 wait for network recovery after restart (#4000) 2019-04-26 07:30:52 -07:00
82776b333d Merge the "cloud" grafana dashboard into the normal dashboard (#4007)
automerge
2019-04-25 21:14:36 -07:00
e71ab55288 Rename in-tree program_ids to be base-58 human readable (#4001) 2019-04-25 17:58:49 -07:00
fd60ef8a8d Allow metrics rate to differ from log rate (#3993)
And reduce metrics rate for exchange contract counters.
Since we can go 10s-100s thousands of contracts per second,
some metrics would be dropped if submitting every time.
2019-04-25 16:58:49 -07:00
aa0b67c93c Use newer blockhash for recent_confirmed_blockhash api (#3995)
Oldest blockhash is sometimes too old and does not allow
for transactions to go through.
2019-04-25 16:57:25 -07:00
15aa07f2a0 Fix node count metrics (#3997)
- the count was truncated to avalanche neighborhood size
2019-04-25 13:47:38 -07:00
e4536621df Log all uncommittable errors on validator (#3999) 2019-04-25 13:37:30 -07:00
a3c302c36a Add signature polling to SyncClient (#3996)
automerge
2019-04-25 12:46:40 -07:00
d12705f9b0 Remove wait loops in non-GPU instance creation and add SSD option as default disk type (#3992) 2019-04-25 13:43:42 -06:00
0add5c1dc8 Move testnet buildkite env variables back into the tree (#3989) 2019-04-25 11:44:58 -07:00
a9e63455a1 Get blockhash every batch and don't wait for tx threads (#3994)
* Get blockhash every batch and don't wait for tx threads

* nudge
2019-04-25 11:20:08 -07:00
4dc0495a1b Fix tar version check 2019-04-25 11:16:49 -07:00
5a79676b8a Custom error decoder (#3783)
automerge
2019-04-25 10:29:44 -07:00
b67b0bff05 Do not enable rpc exit on the blockstreamer node (#3977) 2019-04-25 09:30:59 -07:00
4c200635b7 Shuffle initial mention of solana-gossip (#3991)
automerge
2019-04-25 09:30:30 -07:00
b98200aca4 Use rm -rf (#3990) 2019-04-25 08:58:34 -07:00
d59c1cd412 Expose Rpc methods to rpc_request (#3988)
* Add new rpc methods to rpc-request

* A-Z
2019-04-25 08:52:53 -06:00
c4d9dff590 Cherry-pick #3934 (#3982)
* Fix inserting bogus is_last blobs into blocktree

* Check for pre-existing blob before insert

* Ignore test that performs concurrent writes on blocktree as that is not supported
2019-04-25 00:04:49 -07:00
cf91ff8694 Remove Thin Client from storage stage (#3976)
automerge
2019-04-24 22:34:10 -07:00
e867ce0944 Find unique zones and delete nodes in each zone (#3978) 2019-04-24 17:50:42 -07:00
29a25990d3 Add provision in testnet scripts to ignore validator nodes that failed to bootup (#3972)
* Skip writing to config file if the node didn't bootup
* Detect dead nodes quicker
2019-04-24 16:23:26 -07:00
9a40ad76bd Fix race in erasure metadata tracking (#3962)
* Fix erasure metadata race condition

* make erasure return the underlying error without wrapping it in the `solana::Error` type

* Add metric for erasure failures

* add tests to `ErasureMeta` indexing logic

* Add test to ensure erasure recovery failures don't cause panics
2019-04-24 17:53:01 -05:00
54b44977e0 Lower test time (#3967) 2019-04-24 12:19:31 -07:00
9c7ccc0e2b More metrics to track memory usage (#3966)
automerge
2019-04-24 11:11:30 -07:00
7710ef8b2b Bump num-derive from 0.2.4 to 0.2.5 (#3960)
Bumps [num-derive](https://github.com/rust-num/num-derive) from 0.2.4 to 0.2.5.
- [Release notes](https://github.com/rust-num/num-derive/releases)
- [Changelog](https://github.com/rust-num/num-derive/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-derive/compare/num-derive-0.2.4...num-derive-0.2.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-24 11:50:26 -06:00
c969975fde lockfree storage (#3963) 2019-04-24 11:51:57 -05:00
3eed6a6090 Annotate testnet buildkite logs with blockexplorer URL (#3964)
automerge
2019-04-24 08:09:37 -07:00
1661a7a55f Correct variable name 2019-04-24 07:39:29 -07:00
6293d324db Spellnig 2019-04-24 07:39:29 -07:00
c1ecfec3b0 Bump stable build timeout 2019-04-23 20:29:14 -07:00
05b4dbf148 Document an alternative mechanism to locate the validator's vote id 2019-04-23 19:35:20 -07:00
4efada6d84 Update keygen.rs 2019-04-23 19:24:42 -07:00
23c01473a0 Use cache for dll symbols (#3950)
Speeds up loaded programs.
2019-04-23 17:25:03 -07:00
f2e2106f62 Bench exchange tweaks (#3957) 2019-04-23 16:48:17 -07:00
0cbac26591 Add genesis blockhash to blobs (#3953) 2019-04-23 16:24:44 -07:00
4e7e5ace9d Add support for Azure instances in testnet creation (#3905)
* Add support for Azure instances in testnet creation

* Fixup

* Fix shellcheck errors

* More shellcheck and cleanup node creation and deletion

* More shellcheck and cleanup node creation and deletion

* Fixup instance wait API

* Fix revieew comments and add GPU installation extension
2019-04-23 16:41:45 -06:00
ab11327e34 Fix mismatch between leader/validator bank votability (#3942)
* Fix mismatch between leader/validator bank votability
2019-04-23 15:32:19 -07:00
3ba93aa8fe Facility to pass extra arguments to bench clients from net.sh command (#3952)
automerge
2019-04-23 15:13:29 -07:00
c309cd80aa Add getClusterNodes/getSlotLeader JSON RPC API (#3940)
* Minor cleanup

* Include _this_ node in the contact info trace

* Add getClusterNodes/getSlotLeader RPC API
2019-04-23 14:46:41 -07:00
d22a1c9b1f Use smaller batch size in sigverify stage if CUDA is not available (#3951) 2019-04-23 12:41:50 -07:00
29698fcd38 Cleanup stragglers from move-to-transfer rename (#3947) 2019-04-23 13:30:42 -06:00
7372ec9e1a Use poh would_be_leader check in banking stage to hold or forward txs (#3948) 2019-04-23 11:56:30 -07:00
840a64ee8b Optimize exchange contract (#3926) 2019-04-23 11:39:53 -07:00
524bc2b9a6 Bump hashbrown from 0.2.2 to 0.3.0 (#3931)
Bumps [hashbrown](https://github.com/Amanieu/hashbrown) from 0.2.2 to 0.3.0.
- [Release notes](https://github.com/Amanieu/hashbrown/releases)
- [Changelog](https://github.com/Amanieu/hashbrown/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/hashbrown/compare/v0.2.2...v0.3.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-23 10:15:33 -07:00
62a29a41d1 Bump tar from 0.4.22 to 0.4.23 (#3944)
Bumps [tar](https://github.com/alexcrichton/tar-rs) from 0.4.22 to 0.4.23.
- [Release notes](https://github.com/alexcrichton/tar-rs/releases)
- [Commits](https://github.com/alexcrichton/tar-rs/compare/0.4.22...0.4.23)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-23 10:15:12 -07:00
5406d82d89 fix race in get_exclusive_storage() and load() (#3941)
* Revert "Revert "account storage is not in sync with the index after gc (#3914)" (#3936)"

This reverts commit 4f47fc00bc.

* fix get_exclusive_storage

* clippy
2019-04-23 09:56:36 -07:00
de6af95061 Process forwarded packets only when the node is about to be the leader (#3935)
* Tests and metrics
2019-04-22 19:49:32 -07:00
43f7cd8149 Fix Retransmit slamming the leader with its own blobs (#3938) 2019-04-22 18:41:01 -07:00
69e67d06a7 Default to Docker based testnet deployment on unsupported Ubuntu versions (#3937)
* Run docker if Ubuntu version is unsupported

* ShellCheck fixes
2019-04-22 18:22:43 -07:00
4f47fc00bc Revert "account storage is not in sync with the index after gc (#3914)" (#3936)
This reverts commit 101d6b92ee.
2019-04-22 17:14:41 -07:00
4b04c37c36 verify that blobs match a known leader for the slot (#3927)
* validate that blobs match a known leader for the slot

* clippy
2019-04-22 15:21:10 -07:00
b27b515186 Add more dashboard text to metrics readme (#3925) 2019-04-22 14:55:19 -07:00
05bcb7f292 Add stop node command to solana-gossip (#3928) 2019-04-22 14:51:20 -07:00
95a16426f3 Cleanup bench-exchange (#3919)
* bench-exchange changes

Generate new keypair for each bench-exchange
Add metrics
Tweak network sleep parameters for better reliability.

* Bench-exchange contract metrics
2019-04-22 13:16:28 -07:00
bec094bb3e Start bench tps clients as default (#3917) 2019-04-21 20:18:52 -07:00
af9ebf1d1a Add status logging while processing a ledger (#3916) 2019-04-20 20:17:57 -07:00
6f2f7018e8 Update testnet-participation.md 2019-04-20 19:14:07 -07:00
101d6b92ee account storage is not in sync with the index after gc (#3914)
* account storage is not in sync with the index after gc

* builds

* clippy fmt

* test

* purge dead forks on store

* rm println

* also fixed count_stores

* comments
2019-04-20 20:50:50 -05:00
349e8a9462 Ensure forwarded Blobs don't break Erasure (#3907) 2019-04-20 16:44:06 -07:00
c0bffb56df Update Avalanche to use Epoch Stakes (#3900) 2019-04-19 22:31:40 -07:00
970cc32e65 Fix Data Plane computation when stakes are equal (#3913) 2019-04-19 21:07:21 -07:00
3ab492ccf8 save erasure set size, initialize coding blob erasures with that size (#3910)
* save erasure set size, initialize coding blob erasures with that size

* fixup

* fixup
2019-04-19 20:22:51 -07:00
d83a71d89f More AWS regions for testnet deployment (#3911)
- also some minor fixes to gce.sh
2019-04-19 17:46:14 -07:00
efbb573316 add an env::var driven localcluster test (#3906) 2019-04-19 15:47:03 -07:00
85554087d1 treat negatives like zero instead of crashing out (#3899) 2019-04-19 15:46:39 -07:00
c3155a6e39 silence sigverify disabled, make disabling sigverify easier (#3901)
* silence sigverify disabled, make disabling sigverify easier

* fixup
2019-04-19 14:18:19 -07:00
4abe95abec Helper function for filtering/creating clients in bench-exchange (#3903) 2019-04-19 14:05:07 -07:00
e0acd48944 Write bench-tps in terms of client (#3904)
* Write bench-tps in terms of client

* Add transactions_addr method for logging

* Move cluster config outside do_bench_tps

* Add BankClient test
2019-04-19 15:04:36 -06:00
afb00432d4 Add BankClient support to bench-exchange (#3902) 2019-04-19 13:18:20 -07:00
320bd66c84 handle zero num_will_fit (#3892)
* handle zero num_will_fit

* clippy
2019-04-19 12:02:33 -07:00
1a9ac62f60 Add bench-exchange support to the net framework (#3893) 2019-04-19 09:56:01 -07:00
809b051f10 Allow thin clients to be passed across thread boundaries (#3887)
* Remove ThinClient wrapper

* Allow RpcClient (and ThinClient) to be passed across thread boundaries

* Pass clients, not constructors

* Fix bad rebase
2019-04-19 08:54:21 -06:00
baac21209e Recreate SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_x86_64_unknown_linux_gnu (#3895) 2019-04-19 07:39:41 -07:00
5fb8baed04 Process async BankClient transactions in batches (#3738)
* Process async transactions in batches

This aims to process transactions at least as fast as LocalCluster

* Add benchmark
2019-04-19 07:29:07 -06:00
512bfc93cb Add a cache for leader schedules (#3841)
* Add a cache for leader schedules
2019-04-19 02:39:44 -07:00
0f88872650 Compatible network is now default (#3896) 2019-04-18 23:19:03 -07:00
f4e40d2c41 Add bench-exchange tx send metrics (#3890) 2019-04-18 22:31:25 -07:00
6eac5951ed Revert "Revert "revert-revert-erasure and erasure fixes (#3833)" (#3855)" (#3889)
This reverts commit 596f611ede.
2019-04-18 21:56:43 -07:00
475a74d37f Reduce packet recv batches (#3894)
* Reduce packet recv batches

* Fix type
2019-04-18 19:24:37 -07:00
b8ee952135 Dedup drone code (#3885) 2019-04-18 19:06:56 -06:00
15bed29afa Add rpc request debug to make_rpc_request (#3888) 2019-04-18 17:04:40 -07:00
6dbe7e8bee Better drone error when cap is hit. (#3884)
* Better drone error when cap is hit.

* Update drone/src/drone.rs

Co-Authored-By: sakridge <sakridge@gmail.com>
2019-04-18 16:05:45 -07:00
2cd556e43c Add drone cap parameter (#3876) 2019-04-18 15:42:20 -07:00
060793f451 Fix testnet automation scripts (#3886)
- missing machine type since change in gce.sh
2019-04-18 15:12:35 -07:00
7e409a13cd Ack on empty Gossip Pull Responses and keep Entrypoint around (#3881)
* Ack on empty Gossip Pull Responses and keep Entrypoint around

* Address comments and fix test

* Update core/src/cluster_info.rs

Co-Authored-By: sagar-solana <sagar@solana.com>

* Update core/src/cluster_info.rs

Co-Authored-By: sagar-solana <sagar@solana.com>
2019-04-18 15:12:17 -07:00
aab410380e Fix net for macos and local (#3872) 2019-04-18 14:49:35 -07:00
67b8ad6a0f fix entries.to_blobs() (#3882)
* * rename Entry::serialized_size() to Entry::to_blob_size() to better
    reduce confusion with bincode, et al. and to better reflect its
    real meaning

* fix implementation of to_blob_size() to actually return what happens
    when we do entries.to_blobs() (i.e. we serialize Vec<Entry>, not Entry)

* update tests to be more rigorous

* clippy
2019-04-18 14:45:41 -07:00
c1e39a3b98 git ignore more (#3870) 2019-04-18 14:23:34 -07:00
7e1a7b1f64 Add bench-exchange to installed bins (#3883)
Need to run exchange clients on remote machines.
2019-04-18 13:55:41 -07:00
a9cfae486c Revert-revert migrate to ed25519-dalek crate (#3877)
* Revert "Revert "Migrate from ring to ed25519-dalek, take 2 (#3844)" (#3868)"

This reverts commit 6a878602f2.

* Fix Signature::verify method
2019-04-18 14:37:20 -06:00
8514d27c2f Update testnet-participation.md 2019-04-18 13:16:15 -07:00
8999bfef65 Try to delete nodes in all cloud zones (#3874) 2019-04-18 13:16:14 -07:00
96425fb520 Don't panic the drone on a request that ends in error. (#3869) 2019-04-18 12:18:31 -07:00
ce505d24b1 Bump ws from 0.7.9 to 0.8.0 (#3866)
Bumps [ws](https://github.com/housleyjk/ws-rs) from 0.7.9 to 0.8.0.
- [Release notes](https://github.com/housleyjk/ws-rs/releases)
- [Changelog](https://github.com/housleyjk/ws-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/housleyjk/ws-rs/compare/v0.7.9...v0.8.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-18 13:16:30 -06:00
f2187780d2 Do not forward vote transactions (#3871) 2019-04-18 11:18:49 -07:00
6a878602f2 Revert "Migrate from ring to ed25519-dalek, take 2 (#3844)" (#3868)
This reverts commit e9b82bacda.
2019-04-18 11:47:34 -06:00
f8543a268f solana-gossip now displays other spy nodes and contact info age (#3867) 2019-04-18 09:48:21 -07:00
e9b82bacda Migrate from ring to ed25519-dalek, take 2 (#3844)
* Migrate from ring to ed25519-dalek

* Move gen_keypair_file test to a more appropriate location

* Fixup bench-exchange and add helper fn for single deterministic keypair

* Update golden
2019-04-18 10:38:32 -06:00
684e1c73dd Allow for custom cpu config on gce and use 20gb ram for clients (#3856) 2019-04-18 09:36:11 -07:00
901c74b653 Add packages and fix publish script (#3839)
* Add packages and fix publish script

* Fixup
2019-04-18 09:24:18 -06:00
2c0afe71b2 minor grooming 2019-04-18 07:31:42 -07:00
2f4a3ed190 Use a separate channel to process votes in banking stage (#3861)
- This will help expedite the vote processing on peer nodes
2019-04-17 21:07:45 -07:00
26a7eb6fa5 Don't use barrier transaction in testnet for perf testing (#3862) 2019-04-17 20:29:36 -07:00
aa21f5343a Remove broken read().unwrap() call to a non-shared packet 2019-04-17 21:24:40 -05:00
9c2809db21 Delete SharedPackets (#3843)
* Delete SharedPackets

* Fix bench and sigverify
2019-04-17 18:15:50 -07:00
9ccd362461 Correct ./net.sh sanity argument order 2019-04-17 18:10:38 -07:00
596f611ede Revert "revert-revert-erasure and erasure fixes (#3833)" (#3855)
This reverts commit 6bef16a6a1.
2019-04-17 18:04:30 -07:00
78d5ace754 Refactor multinode-demo/ scripts to avoid shipping fullnode-x.sh (#3835) 2019-04-17 18:03:58 -07:00
2b3218b5f2 Fix flaky tests by waiting for test node to boot (#3845) 2019-04-17 17:50:34 -07:00
d0fb55d9b1 Allow testnet creation with no validator nodes (#3846) 2019-04-17 17:38:18 -07:00
a2c8e3952f Fixes to TPS calculation and reporting (#3836)
Fixes to TPS calculations and reporting
2019-04-17 15:37:01 -07:00
beb8c7914e Disable testnet-sanity ledger verification, too slow 2019-04-17 15:19:37 -07:00
6bef16a6a1 revert-revert-erasure and erasure fixes (#3833)
* fix erasure, more tests for full blobs, more metrics

* Revert "Revert "Use Rust erasure library and turn on erasure (#3768)" (#3827)"

This reverts commit 4b8cb72977.
2019-04-17 15:13:54 -07:00
e03215c4c0 Remove iterations with leader rotation disabled 2019-04-17 15:07:51 -07:00
8d1fd29fa6 Add readme (#3838) 2019-04-17 14:42:04 -07:00
46f655eddd Add .gitignore to bench-exchange (#3837) 2019-04-17 14:34:04 -07:00
ca36a6f4e0 Run sanity only in the zone that contains the bootstrap leader and blockstreamer nodes (#3828) 2019-04-17 14:25:40 -07:00
fdb12b54fa Run multinode-demo from anywhere (#3831) 2019-04-17 14:23:32 -07:00
09dd4bb702 Fix build (#3834) 2019-04-17 15:17:04 -06:00
01657ddfe7 packet.rs optimizations (#3818)
* packet.rs optimizations

* remove redundant and aggressive metric submission

* remove metrics submit(), get compiling again, honor log level in inc()
2019-04-17 14:14:57 -07:00
51a2988bb2 Revert "Rename programs to instruction_processors (#3789)" (#3824)
This reverts commit 34344982a9.
2019-04-17 15:05:49 -06:00
083090817a Fix DuplicateSignatures caused by races on frozen banks (#3819)
* Duplicate parent account locks into children in new_from_parent, check parent locks in lock_account()
2019-04-17 13:45:33 -07:00
f3676e2d03 Enable bench exchange test (#3830) 2019-04-17 13:37:02 -07:00
4b8cb72977 Revert "Use Rust erasure library and turn on erasure (#3768)" (#3827)
This reverts commit b9bb5af4a5.
2019-04-17 12:52:12 -07:00
2518e95fb0 Add bench-exchange (#3826) 2019-04-17 11:28:26 -07:00
bc17edcda3 Add --keypair to avoid writing a new one to ~ in CI 2019-04-17 10:12:18 -07:00
eb185b9ea5 testnet-beta sanity no longer tries to check inactive zones 2019-04-17 09:30:41 -07:00
aa6c82cfdc Add show-vote-account command (#3814) 2019-04-17 07:45:07 -07:00
b9bb5af4a5 Use Rust erasure library and turn on erasure (#3768)
* split out erasure into new crate; add implementation using rust reed-solomon-library

* Track erasures with a &[bool] instead of indexes

* fix bug that reported the number of erasures incorrectly

* Introduce erasure `Session` for consistent config

* Increase test coverage; fix bugs

* Add ability to remove blobs from erasure meta tracking. test added

* Track deletion of coding blobs in blocktree via ErasureMeta. Added to
test

* Remove unused functions in blocktree

* add randomness to recovery thread to exercise recovery due to either new
data or coding blobs

* Add unit test for ErasureMeta index handling

* Re-enable test in broadcast stage
2019-04-16 23:00:24 -05:00
1e20d449ce bank_height / slot is the block drop rate (#3816)
* bank_height/slot would give is the block drop rate

* use metrics
2019-04-16 19:35:38 -07:00
e94f268346 reduce sigverify verbosity (#3813) 2019-04-16 18:25:53 -07:00
7ec198b9cc Minor doc fixes++ 2019-04-16 17:45:48 -07:00
b2e762ccc6 Minor doc fixes 2019-04-16 17:43:52 -07:00
bee411e826 Preserve extra dependency annotations (optional=,features=) during version bump (#3810) 2019-04-16 15:12:10 -07:00
34344982a9 Rename programs to instruction_processors (#3789)
* Rename programs to instruction_processors

* Updates around the code base to support instruction_processors rename

* Kabab instruction_processors

* Update Cargo.toml files and scripts to use instruction-processors

* Update Cargo.toml to use instruction-processors

* Update CI scripts to use instruction-processors
2019-04-16 22:39:00 +02:00
f73d38739a Split AccountsDB from Accounts (#3808)
Split AccountsDB from Accounts
2019-04-16 13:32:22 -07:00
63d66ece57 net/ testnet nodes now stake more lamports (#3812)
* Add --bootstrap-leader-lamports

* Generalize --no-stake into --stake NUM

* Use a large stake for net/ fullnodes

* Setup vote account before starting fullnode to avoid mixed log output
2019-04-16 13:03:01 -07:00
a4b5493ba1 Document unsafe usage in AppendVec (#3804)
* document unsafe usage

* clippy
2019-04-16 10:53:37 -07:00
8d613f3977 Selectively deploy beta testnet to GCE/AWS or both clouds (#3805) 2019-04-16 10:40:30 -07:00
0ff2bfdd0c Fewer unsafe hacks for AppendVec (#3801)
* storage account changes

* cleanup

* checks

* comments

* clippy

* tests

* woot!

* comments

* benches
2019-04-16 08:50:05 -07:00
141e25d567 Bump hashbrown from 0.2.1 to 0.2.2 (#3800)
Bumps [hashbrown](https://github.com/Amanieu/hashbrown) from 0.2.1 to 0.2.2.
- [Release notes](https://github.com/Amanieu/hashbrown/releases)
- [Changelog](https://github.com/Amanieu/hashbrown/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/hashbrown/compare/v0.2.1...v0.2.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-04-16 06:49:02 -07:00
c67cc694ae Remove stake from ./net sanity ephemeral validator (#3797) 2019-04-15 21:42:25 -07:00
d77359914f Log the spy node id by default for better debug (#3796) 2019-04-15 20:58:37 -07:00
9293a54234 Remove stray + 2019-04-15 20:28:11 -07:00
d9983905b3 Cargo.lock 2019-04-15 20:28:07 -07:00
3dc47a46d5 Revert "Revert "disable staking of blockstreamer node""
This reverts commit 03da63b41b.
2019-04-15 20:11:00 -07:00
8638b3bb19 Update Cargo.toml files for version = 0.14.0 2019-04-16 02:50:20 +00:00
632 changed files with 57236 additions and 20084 deletions

40
.appveyor.yml Normal file
View File

@ -0,0 +1,40 @@
version: '{build}'
branches:
only:
- master
- /^v[0-9.]+/
cache:
- '%USERPROFILE%\.cargo'
- '%APPVEYOR_BUILD_FOLDER%\target'
build_script:
- bash ci/publish-tarball.sh
notifications:
- provider: Slack
incoming_webhook:
secure: GJsBey+F5apAtUm86MHVJ68Uqa6WN1SImcuIc4TsTZrDhA8K1QWUNw9FFQPybUWDyOcS5dly3kubnUqlGt9ux6Ad2efsfRIQYWv0tOVXKeY=
channel: ci-status
on_build_success: false
on_build_failure: true
on_build_status_changed: true
deploy:
- provider: S3
access_key_id:
secure: fTbJl6JpFebR40J7cOWZ2mXBa3kIvEiXgzxAj6L3N7A=
secret_access_key:
secure: vItsBXb2rEFLvkWtVn/Rcxu5a5+2EwC+b7GsA0waJy9hXh6XuBAD0lnHd9re3g/4
bucket: release.solana.com
region: us-west-1
set_public: true
- provider: GitHub
auth_token:
secure: 81fEmPZ0cV1wLtNuUrcmtgxKF6ROQF1+/ft5m+fHX21z6PoeCbaNo8cTyLioWBj7
draft: false
prerelease: false
on:
appveyor_repo_tag: true

1
.buildkite/env/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/secrets_unencrypted.ejson

View File

@ -1,12 +1,14 @@
{
"_public_key": "ae29f4f7ad2fc92de70d470e411c8426d5d48db8817c9e3dae574b122192335f",
"environment": {
"CODECOV_TOKEN": "EJ[1:+7nLVR8NlnN48zgaJPPXF9JOZDXVNHDZLeARlCFHyRk=:rHBSqXK7uSnveA4qwUxARZjTNZcA0hXU:ko8lLGwPECpVm19znWBRxKEpMF7xpTHBCEzVOxRar2wDThw4lNDAKqTS61vtkJLtdkHtug==]",
"CRATES_IO_TOKEN": "EJ[1:+7nLVR8NlnN48zgaJPPXF9JOZDXVNHDZLeARlCFHyRk=:NzN6y0ooXJBYvxB589khepthSxhKFkLB:ZTTFZh2A/kB2SAgjJJAMbwAfanRlzxOCNMVcA2MXBCpQHJeeZGULg+0MLACYswfS]",
"GITHUB_TOKEN": "EJ[1:+7nLVR8NlnN48zgaJPPXF9JOZDXVNHDZLeARlCFHyRk=:iy0Fnxeo0aslTCvgXc5Ddj2ly6ZsQ8gK:GNOOj/kZUJ2rYKxTbLyVKtajWNoGQ3PcChwfEB4HdN18qDHlB96Z7gx01Pcf0qeIHODOWRtxlH4=]",
"INFLUX_DATABASE": "EJ[1:+7nLVR8NlnN48zgaJPPXF9JOZDXVNHDZLeARlCFHyRk=:Ly/TpIRF0oCxmiBWv225S3mX8s6pfQR+:+tXGB2c9rRCVDcgNO1IDOo89]",
"INFLUX_PASSWORD": "EJ[1:+7nLVR8NlnN48zgaJPPXF9JOZDXVNHDZLeARlCFHyRk=:ycrq1uQLoSfI932czD+krUOaJeLWpeq6:2iS7ukp/C7wVD3IT0GvQVcwccWGyLr4UocStF/XiDi0OB/N3YKIKN8SQU4ob1b6StAPZ/XOHmag=]",
"INFLUX_USERNAME": "EJ[1:+7nLVR8NlnN48zgaJPPXF9JOZDXVNHDZLeARlCFHyRk=:35hBKofakZ4Db/u0TOW53RXoNWzJTIcl:HWREcMTrgZ8DGB0ZupgSzNWr/tVyE06P]",
"SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_x86_64_unknown_linux_gnu": "EJ[1:+7nLVR8NlnN48zgaJPPXF9JOZDXVNHDZLeARlCFHyRk=:kRz8CyJYKAg/AiwgLrcRNDJAmlRX2zvX:uV1XV6y2Fb+dN4Z9BIMPBRiNS3n+NL8GlJXyu1i7meIsph1DzfLg4Thcp5Mj9nUsFNLgqQgjnsa5C4XNY/h5AgMSzRrJxVj7RhVTRmDJ5/Vjq6v7wCMRfBOvF3rITsV4zTwWSV8yafFmS+ZQ+QJTRgtYsuoYAUNZ06IEebfDHcuNwws72hEGoD9w43hOLSpyEOmXbtZ9h1lIRxrgsrhYDpBlU5LkhDeTXAX5M5dwYxyquJFRwd5quGDV5DYsCh9bAkbjAyjWYymVJ78U9YJIQHT9izzQqTDlMQN49EbLo7MDIaC7O7HVtb7unDJs+DRejbHacoyWVulqVVwu3GRiZezu8zdjwzGHphMMxOtKQaidnqYgflNp/O01I8wZRgR1alsGcmIhEhI8YV/IvQ==]"
"CODECOV_TOKEN": "EJ[1:8iZ6baJB4fbBV+XDsrUooyGAnGL/8Ol+4Qd0zKh5YjI=:ks2/ElgxwgxqgmFcxTHANNLmj23YH74h:U4uzRONRfiQyqy6HrPQ/e7OnBUY4HkW37R0iekkF3KJ9UGnHqT1UvwgVbDqLahtDIJ4rWw==]",
"CRATES_IO_TOKEN": "EJ[1:8iZ6baJB4fbBV+XDsrUooyGAnGL/8Ol+4Qd0zKh5YjI=:lKMh3aLW+jyRrfS/c7yvkpB+TaPhXqLq:j0v27EbaPgwRdHZAbsM0FlAnt3r9ScQrFbWJYOAZtM3qestEiByTlKpZ0eyF/823]",
"GITHUB_TOKEN": "EJ[1:8iZ6baJB4fbBV+XDsrUooyGAnGL/8Ol+4Qd0zKh5YjI=:Ll78c3jGpYqnTwR7HJq3mNNUC7pOv9Lu:GrInO2r8MjmP5c54szkyygdsrW5KQYkDgJQUVyFEPyG8SWfchyM9Gur8RV0a+cdwuxNkHLi4U2M=]",
"INFLUX_DATABASE": "EJ[1:8iZ6baJB4fbBV+XDsrUooyGAnGL/8Ol+4Qd0zKh5YjI=:IlH/ZLTXv3SwlY3TVyAPCX2KzLRY6iG3:gGmUGSU/kCfR/mTwKONaUC/X]",
"INFLUX_PASSWORD": "EJ[1:8iZ6baJB4fbBV+XDsrUooyGAnGL/8Ol+4Qd0zKh5YjI=:o2qm95GU4VrrcC4OU06jjPvCwKZy/CZF:OW2ga3kLOQJvaDEdGRJ+gn3L2ckFm8AJZtv9wj/GeUIKDH2A4uBPTHsAH9PMe6zujpuHGk3qbeg=]",
"INFLUX_USERNAME": "EJ[1:8iZ6baJB4fbBV+XDsrUooyGAnGL/8Ol+4Qd0zKh5YjI=:yDWW/uIHsJqOTDYskZoSx3pzoB1vztWY:2z31oTA3g0Xs9fCczGNJRcx8xf/hFCed]",
"SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_x86_64_unknown_linux_gnu": "EJ[1:8iZ6baJB4fbBV+XDsrUooyGAnGL/8Ol+4Qd0zKh5YjI=:RqRaHlYUvGPNFJa6gmciaYM3tRJTURUH:q78/3GTHCN3Uqx9z4nOBjPZcO1lOazNoB/mdhGRDFsnAqVd2hU8zbKkqLrZfLlGqyD8WQOFuw5oTJR9qWg6L9LcOyj3pGL8jWF2yjgZxdtNMXnkbSrCWLooWBBLT61jYQnEwg73gT8ld3Q8EVv3T+MeSMu6FnPz+0+bqQCAGgfqksP4hsUAJGzgZu+i0tNOdlT7fxnh5KJK/yFM/CKgN2sRwEjukA9hXsffyB61g2zqzTDJxCUDLbCVrCkA/bfUk7Of/t0W5t0nK1H3oyGZEc/lRMauCknDBka3Gz11dVss2QT19WQNh0u7bHVaT/U4lepX1j9Zv]",
"SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_x86_64_apple_darwin": "EJ[1:8iZ6baJB4fbBV+XDsrUooyGAnGL/8Ol+4Qd0zKh5YjI=:wFDl3INEnA3EQDHRX40avqGe1OMoJxyy:6ncCRVRTIRuYI5o/gayeuWCudWvmKNYr8KEHAWeTq34a5bdcKInBdKhjmjX+wLHqsEwQ5gcyhcxy4Ri2mbuN6AHazfZOZlubQkGlyUOAIYO5D5jkbyIh40DAtjVzo1MD/0HsW9zdGOzqUKp5xJJeDsbR4F153jbxa7fvwF90Q4UQjYFTKAtExEmHtDGSJG48ToVwTabTV/OnISMIggDZBviIv2QWHvXgK07b2mUj34rHJywEDGN1nj5rITTDdUeRcB1x4BAMOe94kTFPSTaj/OszvYlGECt8rkKFqbm092qL+XLfiBaImqe/WJHRCnAj6Don]",
"SOLANA_INSTALL_UPDATE_MANIFEST_KEYPAIR_x86_64_pc_windows_msvc": "EJ[1:8iZ6baJB4fbBV+XDsrUooyGAnGL/8Ol+4Qd0zKh5YjI=:wAh+dBuZopv6vruVOYegUcq/aBnbksT1:qIJfCfDvDWiqicMOkmbJs/0n7UJLKNmgMQaKzeQ8J7Q60YpXbtWzKVW3tS6lzlgf64m3MrPXyo1C+mWh6jkjsb18T/OfggZy1ZHM4AcsOC6/ldUkV5YtuxUQuAmd5jCuV/R7iuYY8Z66AcfAevlb+bnLpgIifdA8fh/IktOo58nZUQwZDdppAacmftsLc6Frn5Er6A6+EXpxK1nmnlmLJ4AJztqlh6X0r+JvE2O7qeoZUXrIegnkxo7Aay7I/dd8zdYpp7ICSiTEtfVN/xNIu/5QmTRU7gWoz7cPl9epq4aiEALzPOzb6KVOiRcsOg+TlFvLQ71Ik5o=]"
}
}

View File

@ -1,6 +1,8 @@
CI_BUILD_START=$(date +%s)
export CI_BUILD_START
source ci/env.sh
#
# Kill any running docker containers, which are potentially left over from the
# previous CI job
@ -31,3 +33,10 @@ export CI_BUILD_START
kill -9 "$victim" || true
done
)
# HACK: These are in our docker images, need to be removed from CARGO_HOME
# because we try to cache downloads across builds with CARGO_HOME
# cargo lacks a facility for "system" tooling, always tries CARGO_HOME first
cargo uninstall cargo-audit || true
cargo uninstall svgbob_cli || true
cargo uninstall mdbook || true

View File

@ -10,6 +10,8 @@
set -x
rsync -a --delete --link-dest="$PWD" target "$d"
du -hs "$d"
read -r cacheSizeInGB _ < <(du -s --block-size=1800000000 "$d")
echo "--- ${cacheSizeInGB}GB: $d"
)
#

View File

@ -14,14 +14,18 @@ export PS4="++"
(
set -x
d=$HOME/cargo-target-cache/"$BUILDKITE_LABEL"
MAX_CACHE_SIZE=18 # gigabytes
if [[ -d $d ]]; then
du -hs "$d"
read -r cacheSizeInGB _ < <(du -s --block-size=1000000000 "$d")
if [[ $cacheSizeInGB -gt 10 ]]; then
echo "$d has gotten too large, removing it"
read -r cacheSizeInGB _ < <(du -s --block-size=1800000000 "$d")
echo "--- ${cacheSizeInGB}GB: $d"
if [[ $cacheSizeInGB -gt $MAX_CACHE_SIZE ]]; then
echo "--- $d is too large, removing it"
rm -rf "$d"
fi
else
echo "--- $d not present"
fi
mkdir -p "$d"/target

View File

@ -10,7 +10,13 @@
set -e
cd "$(dirname "$0")"/..
buildkite-agent pipeline upload ci/buildkite.yml
if [[ -n $BUILDKITE_TAG ]]; then
buildkite-agent annotate --style info --context release-tag \
"https://github.com/solana-labs/solana/releases/$BUILDKITE_TAG"
buildkite-agent pipeline upload ci/buildkite-release.yml
else
buildkite-agent pipeline upload ci/buildkite.yml
fi
if [[ $BUILDKITE_BRANCH =~ ^pull ]]; then
# Add helpful link back to the corresponding Github Pull Request

11
.gitignore vendored
View File

@ -1,10 +1,12 @@
/target/
/ledger-tool/target/
/wallet/target/
/core/target/
/book/html/
/book/src/img/
/book/src/tests.ok
/farf/
/solana-release/
/solana-release.tar.bz2
/solana-metrics/
/solana-metrics.tar.bz2
/target/
**/*.rs.bk
.cargo
@ -21,3 +23,4 @@ log-*.txt
# intellij files
/.idea/
/solana.iml
/.vscode/

45
.mergify.yml Normal file
View File

@ -0,0 +1,45 @@
# Validate your changes with:
#
# $ curl -F 'data=@.mergify.yml' https://gh.mergify.io/validate
#
# https://doc.mergify.io/
pull_request_rules:
- name: remove outdated reviews
conditions:
- base=master
actions:
dismiss_reviews:
changes_requested: true
- name: set automerge label on mergify backport PRs
conditions:
- author=mergify[bot]
- head~=^mergify/bp/
- "#status-failure=0"
actions:
label:
add:
- automerge
- name: v0.16 backport
conditions:
- base=master
- label=v0.16
actions:
backport:
branches:
- v0.16
- name: v0.17 backport
conditions:
- base=master
- label=v0.17
actions:
backport:
branches:
- v0.17
- name: v0.18 backport
conditions:
- base=master
- label=v0.18
actions:
backport:
branches:
- v0.18

44
.travis.yml Normal file
View File

@ -0,0 +1,44 @@
os:
- osx
language: rust
cache: cargo
rust:
- 1.36.0
install:
- source ci/rust-version.sh
- test $rust_stable = $TRAVIS_RUST_VERSION # Update .travis.yml rust version above when this fails
script:
- source ci/env.sh
- ci/publish-tarball.sh
branches:
only:
- master
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
notifications:
slack:
on_success: change
secure: F4IjOE05MyaMOdPRL+r8qhs7jBvv4yDM3RmFKE1zNXnfUOqV4X38oQM1EI+YVsgpMQLj/pxnEB7wcTE4Bf86N6moLssEULCpvAuMVoXj4QbWdomLX+01WbFa6fLVeNQIg45NHrz2XzVBhoKOrMNnl+QI5mbR2AlS5oqsudHsXDnyLzZtd4Y5SDMdYG1zVWM01+oNNjgNfjcCGmOE/K0CnOMl6GPi3X9C34tJ19P2XT7MTDsz1/IfEF7fro2Q8DHEYL9dchJMoisXSkem5z7IDQkGzXsWdWT4NnndUvmd1MlTCE9qgoXDqRf95Qh8sB1Dz08HtvgfaosP2XjtNTfDI9BBYS15Ibw9y7PchAJE1luteNjF35EOy6OgmCLw/YpnweqfuNViBZz+yOPWXVC0kxnPIXKZ1wyH9ibeH6E4hr7a8o9SV/6SiWIlbYF+IR9jPXyTCLP/cc3sYljPWxDnhWFwFdRVIi3PbVAhVu7uWtVUO17Oc9gtGPgs/GrhOMkJfwQPXaudRJDpVZowxTX4x9kefNotlMAMRgq+Drbmgt4eEBiCNp0ITWgh17BiE1U09WS3myuduhoct85+FoVeaUkp1sxzHVtGsNQH0hcz7WcpZyOM+AwistJA/qzeEDQao5zi1eKWPbO2xAhi2rV1bDH6bPf/4lDBwLRqSiwvlWU=
deploy:
- provider: s3
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
bucket: release.solana.com
region: us-west-1
skip_cleanup: true
acl: public_read
local_dir: travis-s3-upload
on:
all_branches: true
- provider: releases
api_key: $GITHUB_TOKEN
skip_cleanup: true
file_glob: true
file: travis-release-upload/*
on:
tags: true

4183
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,40 +1,57 @@
[workspace]
members = [
".",
"bench-exchange",
"bench-streamer",
"bench-tps",
"chacha-sys",
"client",
"core",
"drone",
"fullnode",
"validator",
"genesis",
"genesis_programs",
"gossip",
"install",
"keygen",
"kvstore",
"ledger-tool",
"logger",
"merkle-tree",
"measure",
"metrics",
"netutil",
"programs/bpf",
"programs/bpf_loader",
"programs/bpf_loader_api",
"programs/bpf_loader_program",
"programs/budget_api",
"programs/budget_program",
"programs/config_api",
"programs/config_program",
"programs/exchange_api",
"programs/exchange_program",
"programs/token_api",
"programs/token_program",
"programs/failure_program",
"programs/move_loader_api",
"programs/move_loader_program",
"programs/librapay_api",
"programs/noop_program",
"programs/stake_api",
"programs/stake_program",
"programs/stake_tests",
"programs/storage_api",
"programs/storage_program",
"programs/token_api",
"programs/token_program",
"programs/vote_api",
"programs/vote_program",
"replicator",
"runtime",
"sdk",
"upload-perf",
"validator-info",
"vote-signer",
"wallet",
]
exclude = ["programs/bpf/rust/noop"]
exclude = [
"programs/bpf/rust/noop",
]

View File

@ -30,6 +30,40 @@ Before you jump into the code, review the online book [Solana: Blockchain Rebuil
(The _latest_ development version of the online book is also [available here](https://solana-labs.github.io/book-edge/).)
Release Binaries
===
Official release binaries are available at [Github Releases](https://github.com/solana-labs/solana/releases).
Additionally we provide pre-release binaries for the latest code on the edge and
beta channels. Note that these pre-release binaries may be less stable than an
official release.
### Edge channel
#### Linux (x86_64-unknown-linux-gnu)
* [solana.tar.bz2](http://release.solana.com/edge/solana-release-x86_64-unknown-linux-gnu.tar.bz2)
* [solana-install-init](http://release.solana.com/edge/solana-install-init-x86_64-unknown-linux-gnu) as a stand-alone executable
#### mac OS (x86_64-apple-darwin)
* [solana.tar.bz2](http://release.solana.com/edge/solana-release-x86_64-apple-darwin.tar.bz2)
* [solana-install-init](http://release.solana.com/edge/solana-install-init-x86_64-apple-darwin) as a stand-alone executable
#### Windows (x86_64-pc-windows-msvc)
* [solana.tar.bz2](http://release.solana.com/edge/solana-release-x86_64-pc-windows-msvc.tar.bz2)
* [solana-install-init.exe](http://release.solana.com/edge/solana-install-init-x86_64-pc-windows-msvc.exe) as a stand-alone executable
#### All platforms
* [solana-metrics.tar.bz2](http://release.solana.com.s3.amazonaws.com/edge/solana-metrics.tar.bz2)
### Beta channel
#### Linux (x86_64-unknown-linux-gnu)
* [solana.tar.bz2](http://release.solana.com/beta/solana-release-x86_64-unknown-linux-gnu.tar.bz2)
* [solana-install-init](http://release.solana.com/beta/solana-install-init-x86_64-unknown-linux-gnu) as a stand-alone executable
#### mac OS (x86_64-apple-darwin)
* [solana.tar.bz2](http://release.solana.com/beta/solana-release-x86_64-apple-darwin.tar.bz2)
* [solana-install-init](http://release.solana.com/beta/solana-install-init-x86_64-apple-darwin) as a stand-alone executable
#### Windows (x86_64-pc-windows-msvc)
* [solana.tar.bz2](http://release.solana.com/beta/solana-release-x86_64-pc-windows-msvc.tar.bz2)
* [solana-install-init.exe](http://release.solana.com/beta/solana-install-init-x86_64-pc-windows-msvc.exe) as a stand-alone executable
#### All platforms
* [solana-metrics.tar.bz2](http://release.solana.com.s3.amazonaws.com/beta/solana-metrics.tar.bz2)
Developing
===
@ -41,7 +75,7 @@ Install rustc, cargo and rustfmt:
```bash
$ curl https://sh.rustup.rs -sSf | sh
$ source $HOME/.cargo/env
$ rustup component add rustfmt-preview
$ rustup component add rustfmt
```
If your rustc version is lower than 1.34.0, please update it:
@ -66,7 +100,7 @@ $ cd solana
Build
```bash
$ cargo build --all
$ cargo build
```
Then to run a minimal local cluster
@ -80,7 +114,7 @@ Testing
Run the test suite:
```bash
$ cargo test --all
$ cargo test
```
Local Testnet
@ -93,12 +127,9 @@ Remote Testnets
We maintain several testnets:
* `testnet` - public stable testnet accessible via testnet.solana.com, with an https proxy for web apps at api.testnet.solana.com. Runs 24/7
* `testnet` - public stable testnet accessible via testnet.solana.com. Runs 24/7
* `testnet-beta` - public beta channel testnet accessible via beta.testnet.solana.com. Runs 24/7
* `testnet-edge` - public edge channel testnet accessible via edge.testnet.solana.com. Runs 24/7
* `testnet-perf` - permissioned stable testnet running a 24/7 soak test
* `testnet-beta-perf` - permissioned beta channel testnet running a multi-hour soak test weekday mornings
* `testnet-edge-perf` - permissioned edge channel testnet running a multi-hour soak test weekday mornings
## Deploy process

View File

@ -61,7 +61,7 @@ There are three release channels that map to branches as follows:
## Release Steps
### Changing channels
### Creating a new branch from master
#### Create the new branch
1. Pick your branch point for release on master.
@ -84,7 +84,13 @@ There are three release channels that map to branches as follows:
At this point, `ci/channel-info.sh` should show your freshly cut release branch as
"BETA_CHANNEL" and the previous release branch as "STABLE_CHANNEL".
### Updating channels (i.e. "making a release")
### Update documentation
Document the new recommended version by updating
```export SOLANA_RELEASE=[new scheduled TESTNET_TAG value]```
in book/src/testnet-participation.md on the release (beta) branch.
### Make the Release
We use [github's Releases UI](https://github.com/solana-labs/solana/releases) for tagging a release.
@ -99,13 +105,72 @@ We use [github's Releases UI](https://github.com/solana-labs/solana/releases) fo
release should be `<branchname>.X-rc.0`.
1. Verify release automation:
1. [Crates.io](https://crates.io/crates/solana) should have an updated Solana version.
1. ...
1. After testnet deployment, verify that testnets are running correct software.
http://metrics.solana.com should show testnet running on a hash from your
newly created branch.
1. Once the release has been made, update Cargo.toml on the release branch to the next
semantic version (e.g. 0.9.0 -> 0.9.1) by running
`./scripts/increment-cargo-version.sh patch`, then rebuild with `cargo
build` to cause a refresh of `Cargo.lock`.
1. Push your Cargo.toml change and the autogenerated Cargo.lock changes to the
release branch.
### Publish updated Book
We maintain three copies of the "book" as official documentation:
1) "Book" is the documentation for the latest official release. This should get manually updated whenever a new release is made. It is published here:
https://solana-labs.github.io/book/
2) "Book-edge" tracks the tip of the master branch and updates automatically.
https://solana-labs.github.io/book-edge/
3) "Book-beta" tracks the tip of the beta branch and updates automatically.
https://solana-labs.github.io/book-beta/
To manually trigger an update of the "Book", create a new job of the manual-update-book pipeline.
Set the tag of the latest release as the PUBLISH_BOOK_TAG environment variable.
```bash
PUBLISH_BOOK_TAG=v0.16.6
```
https://buildkite.com/solana-labs/manual-update-book
### Update software on testnet.solana.com
The testnet running on testnet.solana.com is set to use a fixed release tag
which is set in the Buildkite testnet-management pipeline.
This tag needs to be updated and the testnet restarted after a new release
tag is created.
#### Update testnet schedules
Go to https://buildkite.com/solana-labs and click through: Pipelines ->
testnet-management -> Pipeline Settings -> Schedules
Or just click here:
https://buildkite.com/solana-labs/testnet-management/settings/schedules
There are two scheduled jobs for testnet: a daily restart and an hourly sanity-or-restart. \
https://buildkite.com/solana-labs/testnet-management/settings/schedules/0efd7856-7143-4713-8817-47e6bdb05387
https://buildkite.com/solana-labs/testnet-management/settings/schedules/2a926646-d972-42b5-aeb9-bb6759592a53
On each schedule:
1. Set TESTNET_TAG environment variable to the desired release tag.
1. Example, TESTNET_TAG=v0.13.2
1. Set the Build Branch to the branch that TESTNET_TAG is from.
1. Example: v0.13
#### Restart the testnet
Trigger a TESTNET_OP=create-and-start to refresh the cluster with the new version
1. Go to https://buildkite.com/solana-labs/testnet-management
2. Click "New Build" and use the following settings, then click "Create Build"
1. Commit: HEAD
1. Branch: [channel branch as set in the schedules]
1. Environment Variables:
```
TESTNET=testnet
TESTNET_TAG=[same value as used in TESTNET_TAG in the schedules]
TESTNET_OP=create-and-start
```
### Alert the community
Notify Discord users on #validator-support that a new release for
testnet.solana.com is available

4
bench-exchange/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
/target/
/config/
/config-local/
/farf/

42
bench-exchange/Cargo.toml Normal file
View File

@ -0,0 +1,42 @@
[package]
authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-bench-exchange"
version = "0.17.2"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
publish = false
[dependencies]
bincode = "1.1.4"
bs58 = "0.2.0"
clap = "2.32.0"
env_logger = "0.6.2"
itertools = "0.8.0"
log = "0.4.7"
num-derive = "0.2"
num-traits = "0.2"
rand = "0.6.5"
rayon = "1.1.0"
serde = "1.0.97"
serde_derive = "1.0.97"
serde_json = "1.0.40"
serde_yaml = "0.8.9"
# solana-runtime = { path = "../solana/runtime"}
solana = { path = "../core", version = "0.17.2" }
solana-client = { path = "../client", version = "0.17.2" }
solana-drone = { path = "../drone", version = "0.17.2" }
solana-exchange-api = { path = "../programs/exchange_api", version = "0.17.2" }
solana-exchange-program = { path = "../programs/exchange_program", version = "0.17.2" }
solana-logger = { path = "../logger", version = "0.17.2" }
solana-metrics = { path = "../metrics", version = "0.17.2" }
solana-netutil = { path = "../netutil", version = "0.17.2" }
solana-runtime = { path = "../runtime", version = "0.17.2" }
solana-sdk = { path = "../sdk", version = "0.17.2" }
untrusted = "0.7.0"
ws = "0.8.1"
[features]
cuda = ["solana/cuda"]

480
bench-exchange/README.md Normal file
View File

@ -0,0 +1,480 @@
# token-exchange
Solana Token Exchange Bench
If you can't wait; jump to [Running the exchange](#Running-the-exchange) to
learn how to start and interact with the exchange.
### Table of Contents
[Overview](#Overview)<br>
[Premise](#Premise)<br>
[Exchange startup](#Exchange-startup)<br>
[Order Requests](#Trade-requests)<br>
[Order Cancellations](#Trade-cancellations)<br>
[Trade swap](#Trade-swap)<br>
[Exchange program operations](#Exchange-program-operations)<br>
[Quotes and OHLCV](#Quotes-and-OHLCV)<br>
[Investor strategies](#Investor-strategies)<br>
[Running the exchange](#Running-the-exchange)<br>
## Overview
An exchange is a marketplace where one asset can be traded for another. This
demo demonstrates one way to host an exchange on the Solana blockchain by
emulating a currency exchange.
The assets are virtual tokens held by investors who may post order requests to
the exchange. A Swapper monitors the exchange and posts swap requests for
matching orders. All the transactions can execute concurrently.
## Premise
- Exchange
- An exchange is a marketplace where one asset can be traded for another.
The exchange in this demo is the on-chain program that implements the
tokens and the policies for trading those tokens.
- Token
- A virtual asset that can be owned, traded, and holds virtual intrinsic value
compared to other assets. There are four types of tokens in this demo, A,
B, C, D. Each one may be traded for another.
- Token account
- An account owned by the exchange that holds a quantity of one type of token.
- Account request
- A request to create a token account
- Token request
- A request to deposit tokens of a particular type into a token account.
- Token pair
- A unique ordered list of two tokens. For the four types of tokens used in
this demo, the valid pairs are AB, AC, AD, BC, BD, CD.
- Direction of trade
- Describes which token in the pair the investor wants to sell and buy and can
be either "To" or "From". For example, if an investor issues a "To" trade
for "AB" then they which to exchange A tokens to B tokens. A "From" order
would read the other way, A tokens from B tokens.
- Price ratio
- An expression of the relative prices of two tokens. They consist of the
price of the primary token and the price of the secondary token. For
simplicity sake, the primary token's price is always 1, which forces the
secondary to be the common denominator. For example, if token A was worth
2 and token B was worth 6, the price ratio would be 1:3 or just 3. Price
ratios are represented as fixed point numbers. The fixed point scaler is
defined in
[exchange_state.rs](https://github.com/solana-labs/solana/blob/c2fdd1362a029dcf89c8907c562d2079d977df11/programs/exchange_api/src/exchange_state.rs#L7)
- Order request
- A Solana transaction executed by the exchange requesting the trade of one
type of token for another. order requests are made up of the token pair,
the direction of the trade, quantity of the primary token, the price ratio,
and the two token accounts to be credited/deducted. An example trade
request looks like "T AB 5 2" which reads "Exchange 5 A tokens to B tokens
at a price ratio of 1:2" A fulfilled trade would result in 5 A tokens
deducted and 10 B tokens credited to the trade initiator's token accounts.
Successful order requests result in an order.
- Order
- The result of a successful order request. orders are stored in
accounts owned by the submitter of the order request. They can only be
canceled by their owner but can be used by anyone in a trade swap. They
contain the same information as the order request.
- Price spread
- The difference between the two matching orders. The spread is the
profit of the Swapper initiating the swap request.
- Swap requirements
- Policies that result in a successful trade swap.
- Swap request
- A request to exchange tokens between to orders
- Trade swap
- A successful trade. A swap consists of two matching orders that meet
swap requirements. A trade swap may not wholly satisfy one or both of the
orders in which case the orders are adjusted appropriately. As
long as the swap requirements are met there will be an exchange of tokens
between accounts. Any price spread is deposited into the Swapper's profit
account. All trade swaps are recorded in a new account for posterity.
- Investor
- Individual investors who hold a number of tokens and wish to trade them on
the exchange. Investors operate as Solana thin clients who own a set of
accounts containing tokens and/or order requests. Investors post
transactions to the exchange in order to request tokens and post or cancel
order requests.
- Swapper
- An agent who facilitates trading between investors. Swappers operate as
Solana thin clients who monitor all the orders looking for a trade
match. Once found, the Swapper issues a swap request to the exchange.
Swappers are the engine of the exchange and are rewarded for their efforts by
accumulating the price spreads of the swaps they initiate. Swappers also
provide current bid/ask price and OHLCV (Open, High, Low, Close, Volume)
information on demand via a public network port.
- Transaction fees
- Solana transaction fees are paid for by the transaction submitters who are
the Investors and Swappers.
## Exchange startup
The exchange is up and running when it reaches a state where it can take
investor's trades and Swapper's swap requests. To achieve this state the
following must occur in order:
- Start the Solana blockchain
- Start the Swapper thin-client
- The Swapper subscribes to change notifications for all the accounts owned by
the exchange program id. The subscription is managed via Solana's JSON RPC
interface.
- The Swapper starts responding to queries for bid/ask price and OHLCV
The Swapper responding successfully to price and OHLCV requests is the signal to
the investors that trades submitted after that point will be analyzed. <!--This
is not ideal, and instead investors should be able to submit trades at any time,
and the Swapper could come and go without missing a trade. One way to achieve
this is for the Swapper to read the current state of all accounts looking for all
open orders.-->
Investors will initially query the exchange to discover their current balance
for each type of token. If the investor does not already have an account for
each type of token, they will submit account requests. Swappers as well will
request accounts to hold the tokens they earn by initiating trade swaps.
```rust
/// Supported token types
pub enum Token {
A,
B,
C,
D,
}
/// Supported token pairs
pub enum TokenPair {
AB,
AC,
AD,
BC,
BD,
CD,
}
pub enum ExchangeInstruction {
/// New token account
/// key 0 - Signer
/// key 1 - New token account
AccountRequest,
}
/// Token accounts are populated with this structure
pub struct TokenAccountInfo {
/// Investor who owns this account
pub owner: Pubkey,
/// Current number of tokens this account holds
pub tokens: Tokens,
}
```
For this demo investors or Swappers can request more tokens from the exchange at
any time by submitting token requests. In non-demos, an exchange of this type
would provide another way to exchange a 3rd party asset into tokens.
To request tokens, investors submit transfer requests:
```rust
pub enum ExchangeInstruction {
/// Transfer tokens between two accounts
/// key 0 - Account to transfer tokens to
/// key 1 - Account to transfer tokens from. This can be the exchange program itself,
/// the exchange has a limitless number of tokens it can transfer.
TransferRequest(Token, u64),
}
```
## Order Requests
When an investor decides to exchange a token of one type for another, they
submit a transaction to the Solana Blockchain containing an order request, which,
if successful, is turned into an order. orders do not expire but are
cancellable. <!-- orders should have a timestamp to enable trade
expiration --> When an order is created, tokens are deducted from a token
account and the order acts as an escrow. The tokens are held until the
order is fulfilled or canceled. If the direction is `To`, then the number
of `tokens` are deducted from the primary account, if `From` then `tokens`
multiplied by `price` are deducted from the secondary account. orders are
no longer valid when the number of `tokens` goes to zero, at which point they
can no longer be used. <!-- Could support refilling orders, so order
accounts are refilled rather than accumulating -->
```rust
/// Direction of the exchange between two tokens in a pair
pub enum Direction {
/// Trade first token type (primary) in the pair 'To' the second
To,
/// Trade first token type in the pair 'From' the second (secondary)
From,
}
pub struct OrderRequestInfo {
/// Direction of trade
pub direction: Direction,
/// Token pair to trade
pub pair: TokenPair,
/// Number of tokens to exchange; refers to the primary or the secondary depending on the direction
pub tokens: u64,
/// The price ratio the primary price over the secondary price. The primary price is fixed
/// and equal to the variable `SCALER`.
pub price: u64,
/// Token account to deposit tokens on successful swap
pub dst_account: Pubkey,
}
pub enum ExchangeInstruction {
/// order request
/// key 0 - Signer
/// key 1 - Account in which to record the swap
/// key 2 - Token account associated with this trade
TradeRequest(TradeRequestInfo),
}
/// Trade accounts are populated with this structure
pub struct TradeOrderInfo {
/// Owner of the order
pub owner: Pubkey,
/// Direction of the exchange
pub direction: Direction,
/// Token pair indicating two tokens to exchange, first is primary
pub pair: TokenPair,
/// Number of tokens to exchange; primary or secondary depending on direction
pub tokens: u64,
/// Scaled price of the secondary token given the primary is equal to the scale value
/// If scale is 1 and price is 2 then ratio is 1:2 or 1 primary token for 2 secondary tokens
pub price: u64,
/// account which the tokens were source from. The trade account holds the tokens in escrow
/// until either one or more part of a swap or the trade is canceled.
pub src_account: Pubkey,
/// account which the tokens the tokens will be deposited into on a successful trade
pub dst_account: Pubkey,
}
```
## Order cancellations
An investor may cancel a trade at anytime, but only trades they own. If the
cancellation is successful, any tokens held in escrow are returned to the
account from which they came.
```rust
pub enum ExchangeInstruction {
/// order cancellation
/// key 0 - Signer
/// key 1 -order to cancel
TradeCancellation,
}
```
## Trade swaps
The Swapper is monitoring the accounts assigned to the exchange program and
building a trade-order table. The order table is used to identify
matching orders which could be fulfilled. When a match is found the
Swapper should issue a swap request. Swap requests may not satisfy the entirety
of either order, but the exchange will greedily fulfill it. Any leftover tokens
in either account will keep the order valid for further swap requests in
the future.
Matching orders are defined by the following swap requirements:
- Opposite polarity (one `To` and one `From`)
- Operate on the same token pair
- The price ratio of the `From` order is greater than or equal to the `To` order
- There are sufficient tokens to perform the trade
Orders can be written in the following format:
`investor direction pair quantity price-ratio`
For example:
- `1 T AB 2 1`
- Investor 1 wishes to exchange 2 A tokens to B tokens at a ratio of 1 A to 1
B
- `2 F AC 6 1.2`
- Investor 2 wishes to exchange A tokens from 6 B tokens at a ratio of 1 A
from 1.2 B
An order table could look something like the following. Notice how the columns
are sorted low to high and high to low, respectively. Prices are dramatic and
whole for clarity.
|Row| To | From |
|---|-------------|------------|
| 1 | 1 T AB 2 4 | 2 F AB 2 8 |
| 2 | 1 T AB 1 4 | 2 F AB 2 8 |
| 3 | 1 T AB 6 6 | 2 F AB 2 7 |
| 4 | 1 T AB 2 8 | 2 F AB 3 6 |
| 5 | 1 T AB 2 10 | 2 F AB 1 5 |
As part of a successful swap request, the exchange will credit tokens to the
Swapper's account equal to the difference in the price ratios or the two orders.
These tokens are considered the Swapper's profit for initiating the trade.
The Swapper would initiate the following swap on the order table above:
- Row 1, To: Investor 1 trades 2 A tokens to 8 B tokens
- Row 1, From: Investor 2 trades 2 A tokens from 8 B tokens
- Swapper takes 8 B tokens as profit
Both row 1 trades are fully realized, table becomes:
|Row| To | From |
|---|-------------|------------|
| 1 | 1 T AB 1 4 | 2 F AB 2 8 |
| 2 | 1 T AB 6 6 | 2 F AB 2 7 |
| 3 | 1 T AB 2 8 | 2 F AB 3 6 |
| 4 | 1 T AB 2 10 | 2 F AB 1 5 |
The Swapper would initiate the following swap:
- Row 1, To: Investor 1 trades 1 A token to 4 B tokens
- Row 1, From: Investor 2 trades 1 A token from 4 B tokens
- Swapper takes 4 B tokens as profit
Row 1 From is not fully realized, table becomes:
|Row| To | From |
|---|-------------|------------|
| 1 | 1 T AB 6 6 | 2 F AB 1 8 |
| 2 | 1 T AB 2 8 | 2 F AB 2 7 |
| 3 | 1 T AB 2 10 | 2 F AB 3 6 |
| 4 | | 2 F AB 1 5 |
The Swapper would initiate the following swap:
- Row 1, To: Investor 1 trades 1 A token to 6 B tokens
- Row 1, From: Investor 2 trades 1 A token from 6 B tokens
- Swapper takes 2 B tokens as profit
Row 1 To is now fully realized, table becomes:
|Row| To | From |
|---|-------------|------------|
| 1 | 1 T AB 5 6 | 2 F AB 2 7 |
| 2 | 1 T AB 2 8 | 2 F AB 3 5 |
| 3 | 1 T AB 2 10 | 2 F AB 1 5 |
The Swapper would initiate the following last swap:
- Row 1, To: Investor 1 trades 2 A token to 12 B tokens
- Row 1, From: Investor 2 trades 2 A token from 12 B tokens
- Swapper takes 4 B tokens as profit
Table becomes:
|Row| To | From |
|---|-------------|------------|
| 1 | 1 T AB 3 6 | 2 F AB 3 5 |
| 2 | 1 T AB 2 8 | 2 F AB 1 5 |
| 3 | 1 T AB 2 10 | |
At this point the lowest To's price is larger than the largest From's price so
no more swaps would be initiated until new orders came in.
```rust
pub enum ExchangeInstruction {
/// Trade swap request
/// key 0 - Signer
/// key 1 - Account in which to record the swap
/// key 2 - 'To' order
/// key 3 - `From` order
/// key 4 - Token account associated with the To Trade
/// key 5 - Token account associated with From trade
/// key 6 - Token account in which to deposit the Swappers profit from the swap.
SwapRequest,
}
/// Swap accounts are populated with this structure
pub struct TradeSwapInfo {
/// Pair swapped
pub pair: TokenPair,
/// `To` order
pub to_trade_order: Pubkey,
/// `From` order
pub from_trade_order: Pubkey,
/// Number of primary tokens exchanged
pub primary_tokens: u64,
/// Price the primary tokens were exchanged for
pub primary_price: u64,
/// Number of secondary tokens exchanged
pub secondary_tokens: u64,
/// Price the secondary tokens were exchanged for
pub secondary_price: u64,
}
```
## Exchange program operations
Putting all the commands together from above, the following operations will be
supported by the on-chain exchange program:
```rust
pub enum ExchangeInstruction {
/// New token account
/// key 0 - Signer
/// key 1 - New token account
AccountRequest,
/// Transfer tokens between two accounts
/// key 0 - Account to transfer tokens to
/// key 1 - Account to transfer tokens from. This can be the exchange program itself,
/// the exchange has a limitless number of tokens it can transfer.
TransferRequest(Token, u64),
/// order request
/// key 0 - Signer
/// key 1 - Account in which to record the swap
/// key 2 - Token account associated with this trade
TradeRequest(TradeRequestInfo),
/// order cancellation
/// key 0 - Signer
/// key 1 -order to cancel
TradeCancellation,
/// Trade swap request
/// key 0 - Signer
/// key 1 - Account in which to record the swap
/// key 2 - 'To' order
/// key 3 - `From` order
/// key 4 - Token account associated with the To Trade
/// key 5 - Token account associated with From trade
/// key 6 - Token account in which to deposit the Swappers profit from the swap.
SwapRequest,
}
```
## Quotes and OHLCV
The Swapper will provide current bid/ask price quotes based on trade actively and
also provide OHLCV based on some time window. The details of how the bid/ask
price quotes are calculated are yet to be decided.
## Investor strategies
To make a compelling demo, the investors needs to provide interesting trade
behavior. Something as simple as a randomly twiddled baseline would be a
minimum starting point.
## Running the exchange
The exchange bench posts trades and swaps matches as fast as it can.
You might want to bump the duration up
to 60 seconds and the batch size to 1000 for better numbers. You can modify those
in client_demo/src/demo.rs::test_exchange_local_cluster.
The following command runs the bench:
```bash
$ RUST_LOG=solana_bench_exchange=info cargo test --release -- --nocapture test_exchange_local_cluster
```
To also see the cluster messages:
```bash
$ RUST_LOG=solana_bench_exchange=info,solana=info cargo test --release -- --nocapture test_exchange_local_cluster
```

1061
bench-exchange/src/bench.rs Normal file

File diff suppressed because it is too large Load Diff

218
bench-exchange/src/cli.rs Normal file
View File

@ -0,0 +1,218 @@
use clap::{crate_description, crate_name, crate_version, value_t, App, Arg, ArgMatches};
use solana::gen_keys::GenKeys;
use solana_drone::drone::DRONE_PORT;
use solana_sdk::signature::{read_keypair, Keypair, KeypairUtil};
use std::net::SocketAddr;
use std::process::exit;
use std::time::Duration;
pub struct Config {
pub entrypoint_addr: SocketAddr,
pub drone_addr: SocketAddr,
pub identity: Keypair,
pub threads: usize,
pub num_nodes: usize,
pub duration: Duration,
pub transfer_delay: u64,
pub fund_amount: u64,
pub batch_size: usize,
pub chunk_size: usize,
pub account_groups: usize,
pub client_ids_and_stake_file: String,
pub write_to_client_file: bool,
pub read_from_client_file: bool,
}
impl Default for Config {
fn default() -> Self {
Self {
entrypoint_addr: SocketAddr::from(([127, 0, 0, 1], 8001)),
drone_addr: SocketAddr::from(([127, 0, 0, 1], DRONE_PORT)),
identity: Keypair::new(),
num_nodes: 1,
threads: 4,
duration: Duration::new(u64::max_value(), 0),
transfer_delay: 0,
fund_amount: 100_000,
batch_size: 100,
chunk_size: 100,
account_groups: 100,
client_ids_and_stake_file: String::new(),
write_to_client_file: false,
read_from_client_file: false,
}
}
}
pub fn build_args<'a, 'b>() -> App<'a, 'b> {
App::new(crate_name!())
.about(crate_description!())
.version(crate_version!())
.arg(
Arg::with_name("entrypoint")
.short("n")
.long("entrypoint")
.value_name("HOST:PORT")
.takes_value(true)
.required(false)
.default_value("127.0.0.1:8001")
.help("Cluster entry point; defaults to 127.0.0.1:8001"),
)
.arg(
Arg::with_name("drone")
.short("d")
.long("drone")
.value_name("HOST:PORT")
.takes_value(true)
.required(false)
.default_value("127.0.0.1:9900")
.help("Location of the drone; defaults to 127.0.0.1:9900"),
)
.arg(
Arg::with_name("identity")
.short("i")
.long("identity")
.value_name("PATH")
.takes_value(true)
.help("File containing a client identity (keypair)"),
)
.arg(
Arg::with_name("threads")
.long("threads")
.value_name("<threads>")
.takes_value(true)
.required(false)
.default_value("1")
.help("Number of threads submitting transactions"),
)
.arg(
Arg::with_name("num-nodes")
.long("num-nodes")
.value_name("NUM")
.takes_value(true)
.required(false)
.default_value("1")
.help("Wait for NUM nodes to converge"),
)
.arg(
Arg::with_name("duration")
.long("duration")
.value_name("SECS")
.takes_value(true)
.default_value("60")
.help("Seconds to run benchmark, then exit; default is forever"),
)
.arg(
Arg::with_name("transfer-delay")
.long("transfer-delay")
.value_name("<delay>")
.takes_value(true)
.required(false)
.default_value("0")
.help("Delay between each chunk"),
)
.arg(
Arg::with_name("fund-amount")
.long("fund-amount")
.value_name("<fund>")
.takes_value(true)
.required(false)
.default_value("100000")
.help("Number of lamports to fund to each signer"),
)
.arg(
Arg::with_name("batch-size")
.long("batch-size")
.value_name("<batch>")
.takes_value(true)
.required(false)
.default_value("1000")
.help("Number of transactions before the signer rolls over"),
)
.arg(
Arg::with_name("chunk-size")
.long("chunk-size")
.value_name("<cunk>")
.takes_value(true)
.required(false)
.default_value("500")
.help("Number of transactions to generate and send at a time"),
)
.arg(
Arg::with_name("account-groups")
.long("account-groups")
.value_name("<groups>")
.takes_value(true)
.required(false)
.default_value("10")
.help("Number of account groups to cycle for each batch"),
)
.arg(
Arg::with_name("write-client-keys")
.long("write-client-keys")
.value_name("FILENAME")
.takes_value(true)
.help("Generate client keys and stakes and write the list to YAML file"),
)
.arg(
Arg::with_name("read-client-keys")
.long("read-client-keys")
.value_name("FILENAME")
.takes_value(true)
.help("Read client keys and stakes from the YAML file"),
)
}
pub fn extract_args<'a>(matches: &ArgMatches<'a>) -> Config {
let mut args = Config::default();
args.entrypoint_addr = solana_netutil::parse_host_port(matches.value_of("entrypoint").unwrap())
.unwrap_or_else(|e| {
eprintln!("failed to parse entrypoint address: {}", e);
exit(1)
});
args.drone_addr = solana_netutil::parse_host_port(matches.value_of("drone").unwrap())
.unwrap_or_else(|e| {
eprintln!("failed to parse drone address: {}", e);
exit(1)
});
if matches.is_present("identity") {
args.identity = read_keypair(matches.value_of("identity").unwrap())
.expect("can't read client identity");
} else {
args.identity = {
let seed = [42_u8; 32];
let mut rnd = GenKeys::new(seed);
rnd.gen_keypair()
};
}
args.threads = value_t!(matches.value_of("threads"), usize).expect("Failed to parse threads");
args.num_nodes =
value_t!(matches.value_of("num-nodes"), usize).expect("Failed to parse num-nodes");
let duration = value_t!(matches.value_of("duration"), u64).expect("Failed to parse duration");
args.duration = Duration::from_secs(duration);
args.transfer_delay =
value_t!(matches.value_of("transfer-delay"), u64).expect("Failed to parse transfer-delay");
args.fund_amount =
value_t!(matches.value_of("fund-amount"), u64).expect("Failed to parse fund-amount");
args.batch_size =
value_t!(matches.value_of("batch-size"), usize).expect("Failed to parse batch-size");
args.chunk_size =
value_t!(matches.value_of("chunk-size"), usize).expect("Failed to parse chunk-size");
args.account_groups = value_t!(matches.value_of("account-groups"), usize)
.expect("Failed to parse account-groups");
if let Some(s) = matches.value_of("write-client-keys") {
args.write_to_client_file = true;
args.client_ids_and_stake_file = s.to_string();
}
if let Some(s) = matches.value_of("read-client-keys") {
assert!(!args.write_to_client_file);
args.read_from_client_file = true;
args.client_ids_and_stake_file = s.to_string();
}
args
}

View File

@ -0,0 +1,87 @@
pub mod bench;
mod cli;
pub mod order_book;
#[cfg(test)]
#[macro_use]
extern crate solana_exchange_program;
use crate::bench::{airdrop_lamports, create_client_accounts_file, do_bench_exchange, Config};
use log::*;
use solana::gossip_service::{discover_cluster, get_multi_client};
use solana_sdk::signature::KeypairUtil;
fn main() {
solana_logger::setup();
solana_metrics::set_panic_hook("bench-exchange");
let matches = cli::build_args().get_matches();
let cli_config = cli::extract_args(&matches);
let cli::Config {
entrypoint_addr,
drone_addr,
identity,
threads,
num_nodes,
duration,
transfer_delay,
fund_amount,
batch_size,
chunk_size,
account_groups,
client_ids_and_stake_file,
write_to_client_file,
read_from_client_file,
..
} = cli_config;
let config = Config {
identity,
threads,
duration,
transfer_delay,
fund_amount,
batch_size,
chunk_size,
account_groups,
client_ids_and_stake_file,
read_from_client_file,
};
if write_to_client_file {
create_client_accounts_file(
&config.client_ids_and_stake_file,
config.batch_size,
config.account_groups,
config.fund_amount,
);
} else {
info!("Connecting to the cluster");
let (nodes, _replicators) =
discover_cluster(&entrypoint_addr, num_nodes).unwrap_or_else(|_| {
panic!("Failed to discover nodes");
});
let (client, num_clients) = get_multi_client(&nodes);
info!("{} nodes found", num_clients);
if num_clients < num_nodes {
panic!("Error: Insufficient nodes discovered");
}
if !read_from_client_file {
info!("Funding keypair: {}", config.identity.pubkey());
let accounts_in_groups = batch_size * account_groups;
const NUM_SIGNERS: u64 = 2;
airdrop_lamports(
&client,
&drone_addr,
&config.identity,
fund_amount * (accounts_in_groups + 1) as u64 * NUM_SIGNERS,
);
}
do_bench_exchange(vec![client], config);
}
}

View File

@ -0,0 +1,134 @@
use itertools::EitherOrBoth::{Both, Left, Right};
use itertools::Itertools;
use log::*;
use solana_exchange_api::exchange_state::*;
use solana_sdk::pubkey::Pubkey;
use std::cmp::Ordering;
use std::collections::BinaryHeap;
use std::{error, fmt};
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct ToOrder {
pub pubkey: Pubkey,
pub info: OrderInfo,
}
impl Ord for ToOrder {
fn cmp(&self, other: &Self) -> Ordering {
other.info.price.cmp(&self.info.price)
}
}
impl PartialOrd for ToOrder {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct FromOrder {
pub pubkey: Pubkey,
pub info: OrderInfo,
}
impl Ord for FromOrder {
fn cmp(&self, other: &Self) -> Ordering {
self.info.price.cmp(&other.info.price)
}
}
impl PartialOrd for FromOrder {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}
#[derive(Default)]
pub struct OrderBook {
// TODO scale to x token types
to_ab: BinaryHeap<ToOrder>,
from_ab: BinaryHeap<FromOrder>,
}
impl fmt::Display for OrderBook {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
writeln!(
f,
"+-Order Book--------------------------+-------------------------------------+"
)?;
for (i, it) in self
.to_ab
.iter()
.zip_longest(self.from_ab.iter())
.enumerate()
{
match it {
Both(to, from) => writeln!(
f,
"| T AB {:8} for {:8}/{:8} | F AB {:8} for {:8}/{:8} |{}",
to.info.tokens,
SCALER,
to.info.price,
from.info.tokens,
SCALER,
from.info.price,
i
)?,
Left(to) => writeln!(
f,
"| T AB {:8} for {:8}/{:8} | |{}",
to.info.tokens, SCALER, to.info.price, i
)?,
Right(from) => writeln!(
f,
"| | F AB {:8} for {:8}/{:8} |{}",
from.info.tokens, SCALER, from.info.price, i
)?,
}
}
write!(
f,
"+-------------------------------------+-------------------------------------+"
)?;
Ok(())
}
}
impl OrderBook {
// TODO
// pub fn cancel(&mut self, pubkey: Pubkey) -> Result<(), Box<dyn error::Error>> {
// Ok(())
// }
pub fn push(&mut self, pubkey: Pubkey, info: OrderInfo) -> Result<(), Box<dyn error::Error>> {
check_trade(info.direction, info.tokens, info.price)?;
match info.direction {
Direction::To => {
self.to_ab.push(ToOrder { pubkey, info });
}
Direction::From => {
self.from_ab.push(FromOrder { pubkey, info });
}
}
Ok(())
}
pub fn pop(&mut self) -> Option<(ToOrder, FromOrder)> {
if let Some(pair) = Self::pop_pair(&mut self.to_ab, &mut self.from_ab) {
return Some(pair);
}
None
}
pub fn get_num_outstanding(&self) -> (usize, usize) {
(self.to_ab.len(), self.from_ab.len())
}
fn pop_pair(
to_ab: &mut BinaryHeap<ToOrder>,
from_ab: &mut BinaryHeap<FromOrder>,
) -> Option<(ToOrder, FromOrder)> {
let to = to_ab.peek()?;
let from = from_ab.peek()?;
if from.info.price < to.info.price {
debug!("Trade not viable");
return None;
}
let to = to_ab.pop()?;
let from = from_ab.pop()?;
Some((to, from))
}
}

2
bench-streamer/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/target/
/farf/

View File

@ -2,17 +2,17 @@
authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-bench-streamer"
version = "0.13.0"
version = "0.17.2"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
[dependencies]
clap = "2.33.0"
solana = { path = "../core", version = "0.13.0" }
solana-logger = { path = "../logger", version = "0.13.0" }
solana-netutil = { path = "../netutil", version = "0.13.0" }
solana = { path = "../core", version = "0.17.2" }
solana-logger = { path = "../logger", version = "0.17.2" }
solana-netutil = { path = "../netutil", version = "0.17.2" }
[features]
cuda = ["solana/cuda"]
erasure = []

View File

@ -1,5 +1,6 @@
use clap::{crate_description, crate_name, crate_version, App, Arg};
use solana::packet::{Packet, SharedPackets, BLOB_SIZE, PACKET_DATA_SIZE};
use solana::packet::PacketsRecycler;
use solana::packet::{Packet, Packets, BLOB_SIZE, PACKET_DATA_SIZE};
use solana::result::Result;
use solana::streamer::{receiver, PacketReceiver};
use std::cmp::max;
@ -14,19 +15,19 @@ use std::time::SystemTime;
fn producer(addr: &SocketAddr, exit: Arc<AtomicBool>) -> JoinHandle<()> {
let send = UdpSocket::bind("0.0.0.0:0").unwrap();
let msgs = SharedPackets::default();
let msgs_ = msgs.clone();
msgs.write().unwrap().packets.resize(10, Packet::default());
for w in &mut msgs.write().unwrap().packets {
let mut msgs = Packets::default();
msgs.packets.resize(10, Packet::default());
for w in msgs.packets.iter_mut() {
w.meta.size = PACKET_DATA_SIZE;
w.meta.set_addr(&addr);
}
let msgs = Arc::new(msgs);
spawn(move || loop {
if exit.load(Ordering::Relaxed) {
return;
}
let mut num = 0;
for p in &msgs_.read().unwrap().packets {
for p in &msgs.packets {
let a = p.meta.addr();
assert!(p.meta.size < BLOB_SIZE);
send.send_to(&p.data[..p.meta.size], &a).unwrap();
@ -43,7 +44,7 @@ fn sink(exit: Arc<AtomicBool>, rvs: Arc<AtomicUsize>, r: PacketReceiver) -> Join
}
let timer = Duration::new(1, 0);
if let Ok(msgs) = r.recv_timeout(timer) {
rvs.fetch_add(msgs.read().unwrap().packets.len(), Ordering::Relaxed);
rvs.fetch_add(msgs.packets.len(), Ordering::Relaxed);
}
})
}
@ -74,6 +75,7 @@ fn main() -> Result<()> {
let mut read_channels = Vec::new();
let mut read_threads = Vec::new();
let recycler = PacketsRecycler::default();
for _ in 0..num_sockets {
let read = solana_netutil::bind_to(port, false).unwrap();
read.set_read_timeout(Some(Duration::new(1, 0))).unwrap();
@ -83,7 +85,13 @@ fn main() -> Result<()> {
let (s_reader, r_reader) = channel();
read_channels.push(r_reader);
read_threads.push(receiver(Arc::new(read), &exit, s_reader, "bench-streamer"));
read_threads.push(receiver(
Arc::new(read),
&exit,
s_reader,
recycler.clone(),
"bench-streamer-test",
));
}
let t_producer1 = producer(&addr, exit.clone());

4
bench-tps/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
/target/
/config/
/config-local/
/farf/

View File

@ -2,23 +2,33 @@
authors = ["Solana Maintainers <maintainers@solana.com>"]
edition = "2018"
name = "solana-bench-tps"
version = "0.13.0"
version = "0.17.2"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
[dependencies]
bincode = "1.1.4"
clap = "2.33.0"
rayon = "1.0.3"
serde_json = "1.0.39"
solana = { path = "../core", version = "0.13.0" }
solana-client = { path = "../client", version = "0.13.0" }
solana-drone = { path = "../drone", version = "0.13.0" }
solana-logger = { path = "../logger", version = "0.13.0" }
solana-metrics = { path = "../metrics", version = "0.13.0" }
solana-netutil = { path = "../netutil", version = "0.13.0" }
solana-sdk = { path = "../sdk", version = "0.13.0" }
log = "0.4.7"
rayon = "1.1.0"
serde = "1.0.97"
serde_derive = "1.0.97"
serde_json = "1.0.40"
serde_yaml = "0.8.9"
solana = { path = "../core", version = "0.17.2" }
solana-client = { path = "../client", version = "0.17.2" }
solana-drone = { path = "../drone", version = "0.17.2" }
solana-librapay-api = { path = "../programs/librapay_api", version = "0.17.2" }
solana-logger = { path = "../logger", version = "0.17.2" }
solana-metrics = { path = "../metrics", version = "0.17.2" }
solana-measure = { path = "../measure", version = "0.17.2" }
solana-netutil = { path = "../netutil", version = "0.17.2" }
solana-runtime = { path = "../runtime", version = "0.17.2" }
solana-sdk = { path = "../sdk", version = "0.17.2" }
solana-move-loader-program = { path = "../programs/move_loader_program", version = "0.17.2" }
solana-move-loader-api = { path = "../programs/move_loader_api", version = "0.17.2" }
[features]
cuda = ["solana/cuda"]
erasure = []

File diff suppressed because it is too large Load Diff

View File

@ -4,11 +4,12 @@ use std::time::Duration;
use clap::{crate_description, crate_name, crate_version, App, Arg, ArgMatches};
use solana_drone::drone::DRONE_PORT;
use solana_sdk::fee_calculator::FeeCalculator;
use solana_sdk::signature::{read_keypair, Keypair, KeypairUtil};
/// Holds the configuration for a single run of the benchmark
pub struct Config {
pub network_addr: SocketAddr,
pub entrypoint_addr: SocketAddr,
pub drone_addr: SocketAddr,
pub id: Keypair,
pub threads: usize,
@ -17,12 +18,17 @@ pub struct Config {
pub tx_count: usize,
pub thread_batch_sleep_ms: usize,
pub sustained: bool,
pub client_ids_and_stake_file: String,
pub write_to_client_file: bool,
pub read_from_client_file: bool,
pub target_lamports_per_signature: u64,
pub use_move: bool,
}
impl Default for Config {
fn default() -> Config {
Config {
network_addr: SocketAddr::from(([127, 0, 0, 1], 8001)),
entrypoint_addr: SocketAddr::from(([127, 0, 0, 1], 8001)),
drone_addr: SocketAddr::from(([127, 0, 0, 1], DRONE_PORT)),
id: Keypair::new(),
threads: 4,
@ -31,6 +37,11 @@ impl Default for Config {
tx_count: 500_000,
thread_batch_sleep_ms: 0,
sustained: false,
client_ids_and_stake_file: String::new(),
write_to_client_file: false,
read_from_client_file: false,
target_lamports_per_signature: FeeCalculator::default().target_lamports_per_signature,
use_move: false,
}
}
}
@ -40,12 +51,12 @@ pub fn build_args<'a, 'b>() -> App<'a, 'b> {
App::new(crate_name!()).about(crate_description!())
.version(crate_version!())
.arg(
Arg::with_name("network")
Arg::with_name("entrypoint")
.short("n")
.long("network")
.long("entrypoint")
.value_name("HOST:PORT")
.takes_value(true)
.help("Rendezvous with the network at this gossip entry point; defaults to 127.0.0.1:8001"),
.help("Rendezvous with the cluster at this entry point; defaults to 127.0.0.1:8001"),
)
.arg(
Arg::with_name("drone")
@ -53,7 +64,7 @@ pub fn build_args<'a, 'b>() -> App<'a, 'b> {
.long("drone")
.value_name("HOST:PORT")
.takes_value(true)
.help("Location of the drone; defaults to network:DRONE_PORT"),
.help("Location of the drone; defaults to entrypoint:DRONE_PORT"),
)
.arg(
Arg::with_name("identity")
@ -91,6 +102,11 @@ pub fn build_args<'a, 'b>() -> App<'a, 'b> {
.long("sustained")
.help("Use sustained performance mode vs. peak mode. This overlaps the tx generation with transfers."),
)
.arg(
Arg::with_name("use-move")
.long("use-move")
.help("Use Move language transactions to perform transfers."),
)
.arg(
Arg::with_name("tx_count")
.long("tx_count")
@ -106,6 +122,30 @@ pub fn build_args<'a, 'b>() -> App<'a, 'b> {
.takes_value(true)
.help("Per-thread-per-iteration sleep in ms"),
)
.arg(
Arg::with_name("write-client-keys")
.long("write-client-keys")
.value_name("FILENAME")
.takes_value(true)
.help("Generate client keys and stakes and write the list to YAML file"),
)
.arg(
Arg::with_name("read-client-keys")
.long("read-client-keys")
.value_name("FILENAME")
.takes_value(true)
.help("Read client keys and stakes from the YAML file"),
)
.arg(
Arg::with_name("target_lamports_per_signature")
.long("target-lamports-per-signature")
.value_name("LAMPORTS")
.takes_value(true)
.help(
"The cost in lamports that the cluster will charge for signature \
verification when the cluster is operating at target-signatures-per-slot",
),
)
}
/// Parses a clap `ArgMatches` structure into a `Config`
@ -116,9 +156,9 @@ pub fn build_args<'a, 'b>() -> App<'a, 'b> {
pub fn extract_args<'a>(matches: &ArgMatches<'a>) -> Config {
let mut args = Config::default();
if let Some(addr) = matches.value_of("network") {
args.network_addr = solana_netutil::parse_host_port(addr).unwrap_or_else(|e| {
eprintln!("failed to parse network address: {}", e);
if let Some(addr) = matches.value_of("entrypoint") {
args.entrypoint_addr = solana_netutil::parse_host_port(addr).unwrap_or_else(|e| {
eprintln!("failed to parse entrypoint address: {}", e);
exit(1)
});
}
@ -163,5 +203,22 @@ pub fn extract_args<'a>(matches: &ArgMatches<'a>) -> Config {
args.sustained = matches.is_present("sustained");
if let Some(s) = matches.value_of("write-client-keys") {
args.write_to_client_file = true;
args.client_ids_and_stake_file = s.to_string();
}
if let Some(s) = matches.value_of("read-client-keys") {
assert!(!args.write_to_client_file);
args.read_from_client_file = true;
args.client_ids_and_stake_file = s.to_string();
}
if let Some(v) = matches.value_of("target_lamports_per_signature") {
args.target_lamports_per_signature = v.to_string().parse().expect("can't parse lamports");
}
args.use_move = matches.is_present("use-move");
args
}

View File

@ -1,15 +1,136 @@
#[cfg(test)]
#[macro_use]
extern crate solana_move_loader_program;
mod bench;
mod cli;
use crate::bench::do_bench_tps;
use crate::bench::{
do_bench_tps, generate_and_fund_keypairs, generate_keypairs, Config, NUM_LAMPORTS_PER_ACCOUNT,
};
use solana::gossip_service::{discover_cluster, get_multi_client};
use solana_sdk::fee_calculator::FeeCalculator;
use solana_sdk::signature::{Keypair, KeypairUtil};
use std::collections::HashMap;
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
use std::process::exit;
/// Number of signatures for all transactions in ~1 week at ~100K TPS
pub const NUM_SIGNATURES_FOR_TXS: u64 = 100_000 * 60 * 60 * 24 * 7;
fn main() {
solana_logger::setup();
solana_metrics::set_panic_hook("bench-tps");
let matches = cli::build_args().get_matches();
let cli_config = cli::extract_args(&matches);
let cfg = cli::extract_args(&matches);
let cli::Config {
entrypoint_addr,
drone_addr,
id,
threads,
num_nodes,
duration,
tx_count,
thread_batch_sleep_ms,
sustained,
client_ids_and_stake_file,
write_to_client_file,
read_from_client_file,
target_lamports_per_signature,
use_move,
} = cli_config;
do_bench_tps(cfg);
if write_to_client_file {
let (keypairs, _) = generate_keypairs(&id, tx_count as u64 * 2);
let num_accounts = keypairs.len() as u64;
let max_fee = FeeCalculator::new(target_lamports_per_signature).max_lamports_per_signature;
let num_lamports_per_account = (num_accounts - 1 + NUM_SIGNATURES_FOR_TXS * max_fee)
/ num_accounts
+ NUM_LAMPORTS_PER_ACCOUNT;
let mut accounts = HashMap::new();
keypairs.iter().for_each(|keypair| {
accounts.insert(
serde_json::to_string(&keypair.to_bytes().to_vec()).unwrap(),
num_lamports_per_account,
);
});
let serialized = serde_yaml::to_string(&accounts).unwrap();
let path = Path::new(&client_ids_and_stake_file);
let mut file = File::create(path).unwrap();
file.write_all(&serialized.into_bytes()).unwrap();
return;
}
println!("Connecting to the cluster");
let (nodes, _replicators) =
discover_cluster(&entrypoint_addr, num_nodes).unwrap_or_else(|err| {
eprintln!("Failed to discover {} nodes: {:?}", num_nodes, err);
exit(1);
});
let (client, num_clients) = get_multi_client(&nodes);
if nodes.len() < num_clients {
eprintln!(
"Error: Insufficient nodes discovered. Expecting {} or more",
num_nodes
);
exit(1);
}
let (keypairs, move_keypairs, keypair_balance) = if read_from_client_file && !use_move {
let path = Path::new(&client_ids_and_stake_file);
let file = File::open(path).unwrap();
let accounts: HashMap<String, u64> = serde_yaml::from_reader(file).unwrap();
let mut keypairs = vec![];
let mut last_balance = 0;
accounts.into_iter().for_each(|(keypair, balance)| {
let bytes: Vec<u8> = serde_json::from_str(keypair.as_str()).unwrap();
keypairs.push(Keypair::from_bytes(&bytes).unwrap());
last_balance = balance;
});
// Sort keypairs so that do_bench_tps() uses the same subset of accounts for each run.
// This prevents the amount of storage needed for bench-tps accounts from creeping up
// across multiple runs.
keypairs.sort_by(|x, y| x.pubkey().to_string().cmp(&y.pubkey().to_string()));
(keypairs, None, last_balance)
} else {
generate_and_fund_keypairs(
&client,
Some(drone_addr),
&id,
tx_count,
NUM_LAMPORTS_PER_ACCOUNT,
use_move,
)
.unwrap_or_else(|e| {
eprintln!("Error could not fund keys: {:?}", e);
exit(1);
})
};
let config = Config {
id,
threads,
thread_batch_sleep_ms,
duration,
tx_count,
sustained,
use_move,
};
do_bench_tps(
vec![client],
config,
keypairs,
keypair_balance,
move_keypairs,
);
}

View File

@ -0,0 +1,19 @@
+------------------------------------------------------------------+
| |
| +-----------------+ Neighborhood 0 +-----------------+ |
| | +--------------------->+ | |
| | Validator 1 | | Validator 2 | |
| | +<---------------------+ | |
| +--------+-+------+ +------+-+--------+ |
| | | | | |
| | +-----------------------------+ | | |
| | +------------------------+------+ | |
| | | | | |
+------------------------------------------------------------------+
| | | |
v v v v
+---------+------+---+ +-+--------+---------+
| | | |
| Neighborhood 1 | | Neighborhood 2 |
| | | |
+--------------------+ +--------------------+

View File

@ -0,0 +1,15 @@
+--------------+
| |
+------------+ Leader +------------+
| | | |
| +--------------+ |
v v
+------------+----------------------------------------+------------+
| |
| +-----------------+ Neighborhood 0 +-----------------+ |
| | +--------------------->+ | |
| | Validator 1 | | Validator 2 | |
| | +<---------------------+ | |
| +-----------------+ +-----------------+ |
| |
+------------------------------------------------------------------+

View File

@ -1,28 +1,18 @@
+--------------+
| |
+------------+ Leader +------------+
| | | |
| +--------------+ |
v v
+--------+--------+ +--------+--------+
| +--------------------->+ |
+-----------------+ Validator 1 | | Validator 2 +-------------+
| | +<---------------------+ | |
| +------+-+-+------+ +---+-+-+---------+ |
| | | | | | | |
| | | | | | | |
| +---------------------------------------------+ | | |
| | | | | | | |
| | | | | +----------------------+ | |
| | | | | | | |
| | | | +--------------------------------------------+ |
| | | | | | | |
| | | +----------------------+ | | |
| | | | | | | |
v v v v v v v v
+--------------------+ +--------------------+ +--------------------+ +--------------------+
| | | | | | | |
| Neighborhood 1 | | Neighborhood 2 | | Neighborhood 3 | | Neighborhood 4 |
| | | | | | | |
+--------------------+ +--------------------+ +--------------------+ +--------------------+
+--------------------+
| |
+--------+ Neighborhood 0 +----------+
| | | |
| +--------------------+ |
v v
+---------+----------+ +----------+---------+
| | | |
| Neighborhood 1 | | Neighborhood 2 |
| | | |
+---+-----+----------+ +----------+-----+---+
| | | |
v v v v
+------------------+-+ +-+------------------+ +------------------+-+ +-+------------------+
| | | | | | | |
| Neighborhood 3 | | Neighborhood 4 | | Neighborhood 5 | | Neighborhood 6 |
| | | | | | | |
+--------------------+ +--------------------+ +--------------------+ +--------------------+

View File

@ -0,0 +1,18 @@
+------------+
| Bank-Merkle|
+------------+
^ ^
/ \
+-----------------+ +-------------+
| Bank-Diff-Merkle| | Block-Merkle|
+-----------------+ +-------------+
^ ^
/ \
+------+ +--------------------------+
| Hash | | Previous Bank-Diff-Merkle|
+------+ +--------------------------+
^ ^
/ \
+---------------+ +---------------+
| Hash(Account1)| | Hash(Account2)|
+---------------+ +---------------+

View File

@ -0,0 +1,19 @@
+---------------+
| Block-Merkle |
+---------------+
^ ^
/ \
+-------------+ +-------------+
| Entry-Merkle| | Entry-Merkle|
+-------------+ +-------------+
^ ^
/ \
+-------+ +-------+
| Hash | | Hash |
+-------+ +-------+
^ ^ ^ ^
/ | | \
+-----------------+ +-----------------+ +-----------------+ +---+
| Hash(T1, status)| | Hash(T2, status)| | Hash(T3, status)| | 0 |
+-----------------+ +-----------------+ +-----------------+ +---+

View File

@ -0,0 +1,60 @@
.------------.
| Upstream |
| Validators |
`----+-------`
|
|
.-----------------------------------.
| Validator | |
| v |
| .-----------. .------------. |
.--------. | | Fetch | | Repair | |
| Client +---->| Stage | | Stage | |
`--------` | `---+-------` `----+-------` |
| | | |
| v v |
| .-----------. .------------. |
| | TPU |<-->| Blockstore | |
| | | | | |
| `-----------` `----+-------` |
| | |
| v |
| .------------. |
| | Multicast | |
| | Stage | |
| `----+-------` |
| | |
`-----------------------------------`
|
v
.------------.
| Downstream |
| Validators |
`------------`
.------------.
| PoH |
| Service |
`-------+----`
^ |
| |
.-----------------------------------.
| TPU | | |
| | v |
.-------. | .-----------. .---+--------. | .------------.
| Fetch +---->| SigVerify +--->| Banking |<--->| Blockstore |
| Stage | | | Stage | | Stage | | | |
`-------` | `-----------` `-----+------` | `------------`
| | |
| | |
`-----------------------------------`
|
v
.------------.
| Banktree |
| |
`------------`

View File

@ -1,5 +1,5 @@
.--------------------------------------.
| Fullnode |
| Validator |
| |
.--------. | .-------------------. |
| |---->| | |

View File

@ -3,16 +3,4 @@ set -e
cd "$(dirname "$0")"
cargo_install_unless() {
declare crate=$1
shift
"$@" > /dev/null 2>&1 || \
cargo install "$crate"
}
export PATH=$CARGO_HOME/bin:$PATH
cargo_install_unless mdbook mdbook --help
cargo_install_unless svgbob_cli svgbob --help
make -j"$(nproc)"
make -j"$(nproc)" test

View File

@ -1,13 +1,17 @@
BOB_SRCS=$(wildcard art/*.bob)
MSC_SRCS=$(wildcard art/*.msc)
MD_SRCS=$(wildcard src/*.md)
SVG_IMGS=$(BOB_SRCS:art/%.bob=src/img/%.svg)
SVG_IMGS=$(BOB_SRCS:art/%.bob=src/img/%.svg) $(MSC_SRCS:art/%.msc=src/img/%.svg)
all: html/index.html
TARGET=html/index.html
TEST_STAMP=src/tests.ok
test: src/tests.ok
all: $(TARGET)
open: all
test: $(TEST_STAMP)
open: $(TEST_STAMP)
mdbook build --open
watch: $(SVG_IMGS)
@ -17,15 +21,19 @@ src/img/%.svg: art/%.bob
@mkdir -p $(@D)
svgbob < $< > $@
src/img/%.svg: art/%.msc
@mkdir -p $(@D)
mscgen -T svg -i $< -o $@
src/%.md: %.md
@mkdir -p $(@D)
@cp $< $@
src/tests.ok: $(SVG_IMGS) $(MD_SRCS)
$(TEST_STAMP): $(TARGET)
mdbook test
touch $@
html/index.html: src/tests.ok
$(TARGET): $(SVG_IMGS) $(MD_SRCS)
mdbook build
clean:

View File

@ -5,6 +5,8 @@
- [Terminology](terminology.md)
- [Getting Started](getting-started.md)
- [Testnet Participation](testnet-participation.md)
- [Testnet Replicator](testnet-replicator.md)
- [Example: Web Wallet](webwallet.md)
- [Programming Model](programs.md)
@ -16,19 +18,24 @@
- [Leader Rotation](leader-rotation.md)
- [Fork Generation](fork-generation.md)
- [Managing Forks](managing-forks.md)
- [Data Plane Fanout](data-plane-fanout.md)
- [Turbine Block Propagation](turbine-block-propagation.md)
- [Ledger Replication](ledger-replication.md)
- [Secure Vote Signing](vote-signing.md)
- [Staking Delegation and Rewards](stake-delegation-and-rewards.md)
- [Stake Delegation and Rewards](stake-delegation-and-rewards.md)
- [Performance Metrics](performance-metrics.md)
- [Anatomy of a Fullnode](fullnode.md)
- [Anatomy of a Validator](validator.md)
- [TPU](tpu.md)
- [TVU](tvu.md)
- [Blocktree](blocktree.md)
- [Gossip Service](gossip.md)
- [The Runtime](runtime.md)
- [Anatomy of a Transaction](transaction.md)
- [API Reference](api-reference.md)
- [Transaction](transaction-api.md)
- [Instruction](instruction-api.md)
- [Blockstreamer](blockstreamer.md)
- [JSON RPC API](jsonrpc-api.md)
- [JavaScript API](javascript-api.md)
@ -38,9 +45,6 @@
- [Ledger Replication](ledger-replication-to-implement.md)
- [Secure Vote Signing](vote-signing-to-implement.md)
- [Staking Rewards](staking-rewards.md)
- [Passive Stake Delegation and Rewards](passive-stake-delegation-and-rewards.md)
- [Reliable Vote Transmission](reliable-vote-transmission.md)
- [Persistent Account Storage](persistent-account-storage.md)
- [Cluster Economics](ed_overview.md)
- [Validation-client Economics](ed_validation_client_economics.md)
- [State-validation Protocol-based Rewards](ed_vce_state_validation_protocol_based_rewards.md)
@ -55,13 +59,21 @@
- [Economic Design MVP](ed_mvp.md)
- [References](ed_references.md)
- [Cluster Test Framework](cluster-test-framework.md)
- [Testing Programs](testing-programs.md)
- [Credit-only Accounts](credit-only-credit-debit-accounts.md)
- [Cluster Software Installation and Updates](installer.md)
- [Deterministic Transaction Fees](transaction-fees.md)
- [Validator](validator-proposal.md)
- [Simple Payment and State Verification](simple-payment-and-state-verification.md)
- [Cross-Program Invocation](cross-program-invocation.md)
- [Implemented Design Proposals](implemented-proposals.md)
- [Fork Selection](fork-selection.md)
- [Blocktree](blocktree.md)
- [Cluster Software Installation and Updates](installer.md)
- [Deterministic Transaction Fees](transaction-fees.md)
- [Tower BFT](tower-bft.md)
- [Leader-to-Leader Transition](leader-leader-transition.md)
- [Leader-to-Validator Transition](leader-validator-transition.md)
- [Testnet Participation](testnet-participation.md)
- [Passive Stake Delegation and Rewards](passive-stake-delegation-and-rewards.md)
- [Persistent Account Storage](persistent-account-storage.md)
- [Reliable Vote Transmission](reliable-vote-transmission.md)
- [Repair Service](repair-service.md)
- [Testing Programs](testing-programs.md)
- [Credit-only Accounts](credit-only-credit-debit-accounts.md)
- [Embedding the Move Langauge](embedding-move.md)

View File

@ -4,7 +4,7 @@ A validator votes on a PoH hash for two purposes. First, the vote indicates it
believes the ledger is valid up until that point in time. Second, since many
valid forks may exist at a given height, the vote also indicates exclusive
support for the fork. This document describes only the former. The latter is
described in [fork selection](fork-selection.md).
described in [Tower BFT](tower-bft.md).
## Current Design
@ -50,12 +50,11 @@ log the time since the NewBlock transaction was submitted.
### Finality and Payouts
Locktower is the proposed [fork selection](fork-selection.md) algorithm. It
proposes that payment to miners be postponed until the *stack* of validator
votes reaches a certain depth, at which point rollback is not economically
feasible. The vote program may therefore implement locktower. Vote instructions
would need to reference a global locktower account so that it can track
cross-block state.
[Tower BFT](tower-bft.md) is the proposed fork selection algorithm. It proposes
that payment to miners be postponed until the *stack* of validator votes reaches
a certain depth, at which point rollback is not economically feasible. The vote
program may therefore implement Tower BFT. Vote instructions would need to
reference a global Tower account so that it can track cross-block state.
## Challenges

View File

@ -12,7 +12,7 @@ To run a blockstreamer, include the argument `no-signer` and (optional)
`blockstream` socket location:
```bash
$ ./multinode-demo/fullnode-x.sh --no-signer --blockstream <SOCKET>
$ ./multinode-demo/validator-x.sh --no-signer --blockstream <SOCKET>
```
The stream will output a series of JSON objects:

View File

@ -20,7 +20,7 @@ least amount of internal plumbing exposed to the test.
Tests are provided an entry point, which is a `contact_info::ContactInfo`
structure, and a keypair that has already been funded.
Each node in the cluster is configured with a `fullnode::FullnodeConfig` at boot
Each node in the cluster is configured with a `fullnode::ValidatorConfig` at boot
time. At boot time this configuration specifies any extra cluster configuration
required for the test. The cluster should boot with the configuration when it
is run in-process or in a data center.
@ -61,18 +61,18 @@ let cluster_nodes = discover_nodes(&entry_point_info, num_nodes);
To enable specific scenarios, the cluster needs to be booted with special
configurations. These configurations can be captured in
`fullnode::FullnodeConfig`.
`fullnode::ValidatorConfig`.
For example:
```rust,ignore
let mut fullnode_config = FullnodeConfig::default();
fullnode_config.rpc_config.enable_fullnode_exit = true;
let mut validator_config = ValidatorConfig::default();
validator_config.rpc_config.enable_fullnode_exit = true;
let local = LocalCluster::new_with_config(
num_nodes,
10_000,
100,
&fullnode_config
&validator_config
);
```
@ -86,9 +86,9 @@ advertised gossip nodes.
Configure the RPC service:
```rust,ignore
let mut fullnode_config = FullnodeConfig::default();
fullnode_config.rpc_config.enable_rpc_gossip_push = true;
fullnode_config.rpc_config.enable_rpc_gossip_refresh_active_set = true;
let mut validator_config = ValidatorConfig::default();
validator_config.rpc_config.enable_rpc_gossip_push = true;
validator_config.rpc_config.enable_rpc_gossip_refresh_active_set = true;
```
Wire the RPCs and write a new test:

View File

@ -28,7 +28,7 @@ its copy.
## Joining a Cluster
Fullnodes and replicators enter the cluster via registration messages sent to
Validators and replicators enter the cluster via registration messages sent to
its *control plane*. The control plane is implemented using a *gossip*
protocol, meaning that a node may register with any existing node, and expect
its registration to propagate to all nodes in the cluster. The time it takes

View File

@ -0,0 +1,111 @@
# Cross-Program Invocation
## Problem
In today's implementation a client can create a transaction that modifies two
accounts, each owned by a separate on-chain program:
```rust,ignore
let message = Message::new(vec![
token_instruction::pay(&alice_pubkey),
acme_instruction::launch_missiles(&bob_pubkey),
]);
client.send_message(&[&alice_keypair, &bob_keypair], &message);
```
The current implementation does not, however, allow the `acme` program to
conveniently invoke `token` instructions on the client's behalf:
```rust,ignore
let message = Message::new(vec![
acme_instruction::pay_and_launch_missiles(&alice_pubkey, &bob_pubkey),
]);
client.send_message(&[&alice_keypair, &bob_keypair], &message);
```
Currently, there is no way to create instruction `pay_and_launch_missiles` that executes
`token_instruction::pay` from the `acme` program. The workaround is to extend the
`acme` program with the implementation of the `token` program, and create `token`
accounts with `ACME_PROGRAM_ID`, which the `acme` program is permitted to modify.
With that workaround, `acme` can modify token-like accounts created by the `acme`
program, but not token accounts created by the `token` program.
## Proposed Solution
The goal of this design is to modify Solana's runtime such that an on-chain
program can invoke an instruction from another program.
Given two on-chain programs `token` and `acme`, each implementing instructions
`pay()` and `launch_missiles()` respectively, we would ideally like to implement
the `acme` module with a call to a function defined in the `token` module:
```rust,ignore
use token;
fn launch_missiles(keyed_accounts: &[KeyedAccount]) -> Result<()> {
...
}
fn pay_and_launch_missiles(keyed_accounts: &[KeyedAccount]) -> Result<()> {
token::pay(&keyed_accounts[1..])?;
launch_missiles(keyed_accounts)?;
}
```
The above code would require that the `token` crate be dynamically linked,
so that a custom linker could intercept calls and validate accesses to
`keyed_accounts`. That is, even though the client intends to modify both
`token` and `acme` accounts, only `token` program is permitted to modify
the `token` account, and only the `acme` program is permitted to modify
the `acme` account.
Backing off from that ideal cross-program call, a slightly more
verbose solution is to expose token's existing `process_instruction()`
entrypoint to the acme program:
```rust,ignore
use token_instruction;
fn launch_missiles(keyed_accounts: &[KeyedAccount]) -> Result<()> {
...
}
fn pay_and_launch_missiles(keyed_accounts: &[KeyedAccount]) -> Result<()> {
let alice_pubkey = keyed_accounts[1].key;
let instruction = token_instruction::pay(&alice_pubkey);
process_instruction(&instruction)?;
launch_missiles(keyed_accounts)?;
}
```
where `process_instruction()` is built into Solana's runtime and responsible
for routing the given instruction to the `token` program via the instruction's
`program_id` field. Before invoking `pay()`, the runtime must also ensure that
`acme` didn't modify any accounts owned by `token`. It does this by calling
`runtime::verify_instruction()` and then afterward updating all the `pre_*`
variables to tentatively commit `acme`'s account modifications. After `pay()`
completes, the runtime must again ensure that `token` didn't modify any
accounts owned by `acme`. It should call `verify_instruction()` again, but this
time with the `token` program ID. Lastly, after `pay_and_launch_missiles()`
completes, the runtime must call `verify_instruction()` one more time, where it
normally would, but using all updated `pre_*` variables. If executing
`pay_and_launch_missiles()` up to `pay()` made no invalid account changes,
`pay()` made no invalid changes, and executing from `pay()` until
`pay_and_launch_missiles()` returns made no invalid changes, then the runtime
can transitively assume `pay_and_launch_missiles()` as whole made no invalid
account changes, and therefore commit all account modifications.
### Setting `KeyedAccount.is_signer`
When `process_instruction()` is invoked, the runtime must create a new
`KeyedAccounts` parameter using the signatures from the *original* transaction
data. Since the `token` program is immutable and existed on-chain prior to the
`acme` program, the runtime can safely treat the transaction signature as a
signature of a transaction with a `token` instruction. When the runtime sees
the given instruction references `alice_pubkey`, it looks up the key in the
transaction to see if that key corresponds to a transaction signature. In this
case it does and so sets `KeyedAccount.is_signer`, thereby authorizing the
`token` program to modify Alice's account.

View File

@ -1,84 +0,0 @@
# Data Plane Fanout
A Solana cluster uses a multi-layer mechanism called *data plane fanout* to
broadcast transaction blobs to all nodes in a very quick and efficient manner.
In order to establish the fanout, the cluster divides itself into small
collections of nodes, called *neighborhoods*. Each node is responsible for
sharing any data it receives with the other nodes in its neighborhood, as well
as propagating the data on to a small set of nodes in other neighborhoods.
During its slot, the leader node distributes blobs between the validator nodes
in one neighborhood (layer 1). Each validator shares its data within its
neighborhood, but also retransmits the blobs to one node in each of multiple
neighborhoods in the next layer (layer 2). The layer-2 nodes each share their
data with their neighborhood peers, and retransmit to nodes in the next layer,
etc, until all nodes in the cluster have received all the blobs.
<img alt="Two layer cluster" src="img/data-plane.svg" class="center"/>
## Neighborhood Assignment - Weighted Selection
In order for data plane fanout to work, the entire cluster must agree on how the
cluster is divided into neighborhoods. To achieve this, all the recognized
validator nodes (the TVU peers) are sorted by stake and stored in a list. This
list is then indexed in different ways to figure out neighborhood boundaries and
retransmit peers. For example, the leader will simply select the first nodes to
make up layer 1. These will automatically be the highest stake holders, allowing
the heaviest votes to come back to the leader first. Layer-1 and lower-layer
nodes use the same logic to find their neighbors and lower layer peers.
## Layer and Neighborhood Structure
The current leader makes its initial broadcasts to at most `DATA_PLANE_FANOUT`
nodes. If this layer 1 is smaller than the number of nodes in the cluster, then
the data plane fanout mechanism adds layers below. Subsequent layers follow
these constraints to determine layer-capacity: Each neighborhood contains
`NEIGHBORHOOD_SIZE` nodes and each layer may have up to `DATA_PLANE_FANOUT/2`
neighborhoods.
As mentioned above, each node in a layer only has to broadcast its blobs to its
neighbors and to exactly 1 node in each next-layer neighborhood, instead of to
every TVU peer in the cluster. In the default mode, each layer contains
`DATA_PLANE_FANOUT/2` neighborhoods. The retransmit mechanism also supports a
second, `grow`, mode of operation that squares the number of neighborhoods
allowed each layer. This dramatically reduces the number of layers needed to
support a large cluster, but can also have a negative impact on the network
pressure on each node in the lower layers. A good way to think of the default
mode (when `grow` is disabled) is to imagine it as chain of layers, where the
leader sends blobs to layer-1 and then layer-1 to layer-2 and so on, the `layer
capacities` remain constant, so all layers past layer-2 will have the same
number of nodes until the whole cluster is covered. When `grow` is enabled, this
becomes a traditional fanout where layer-3 will have the square of the number of
nodes in layer-2 and so on.
#### Configuration Values
`DATA_PLANE_FANOUT` - Determines the size of layer 1. Subsequent
layers have `DATA_PLANE_FANOUT/2` neighborhoods when `grow` is inactive.
`NEIGHBORHOOD_SIZE` - The number of nodes allowed in a neighborhood.
Neighborhoods will fill to capacity before new ones are added, i.e if a
neighborhood isn't full, it _must_ be the last one.
`GROW_LAYER_CAPACITY` - Whether or not retransmit should be behave like a
_traditional fanout_, i.e if each additional layer should have growing
capacities. When this mode is disabled (default), all layers after layer 1 have
the same capacity, keeping the network pressure on all nodes equal.
Currently, configuration is set when the cluster is launched. In the future,
these parameters may be hosted on-chain, allowing modification on the fly as the
cluster sizes change.
## Neighborhoods
The following diagram shows how two neighborhoods in different layers interact.
What this diagram doesn't capture is that each neighbor actually receives
blobs from one validator per neighborhood above it. This means that, to
cripple a neighborhood, enough nodes (erasure codes +1 per neighborhood) from
the layer above need to fail. Since multiple neighborhoods exist in the upper
layer and a node will receive blobs from a node in each of those neighborhoods,
we'd need a big network failure in the upper layers to end up with incomplete
data.
<img alt="Inner workings of a neighborhood"
src="img/data-plane-neighborhood.svg" class="center"/>

View File

@ -10,7 +10,7 @@ client's account.
A drone is a simple signing service. It listens for requests to sign
*transaction data*. Once received, the drone validates the request however it
sees fit. It may, for example, only accept transaction data with a
`SystemInstruction::Move` instruction transferring only up to a certain amount
`SystemInstruction::Transfer` instruction transferring only up to a certain amount
of tokens. If the drone accepts the transaction, it returns an `Ok(Signature)`
where `Signature` is a signature of the transaction data using the drone's
private key. If it rejects the transaction data, it returns a `DroneError`
@ -76,7 +76,7 @@ beyond a certain *age*.
If the transaction data size is smaller than the size of the returned signature
(or descriptive error), a single client can flood the network. Considering
that a simple `Move` operation requires two public keys (each 32 bytes) and a
that a simple `Transfer` operation requires two public keys (each 32 bytes) and a
`fee` field, and that the returned signature is 64 bytes (and a byte to
indicate `Ok`), consideration for this attack may not be required.

View File

@ -0,0 +1,66 @@
# Embedding the Move Language
## Problem
Solana enables developers to write on-chain programs in general purpose
programming languages such as C or Rust, but those programs contain
Solana-specific mechanisms. For example, there isn't another chain that asks
developers to create a Rust module with a `process_instruction(KeyedAccounts)`
function. Whenever practical, Solana should offer dApp developers more portable
options.
Until just recently, no popular blockchain offered a language that could expose
the value of Solana's massively parallel [runtime](runtime.md). Solidity
contracts, for example, do not separate references to shared data from contract
code, and therefore need to be executed serially to ensure deterministic
behavior. In practice we see that the most aggressively optimized EVM-based
blockchains all seem to peak out around 1,200 TPS - a small fraction of what
Solana can do. The Libra project, on the other hand, designed an on-chain
programming language called Move that is more suitable for parallel execution.
Like Solana's runtime, Move programs depend on accounts for all shared state.
The biggest design difference between Solana's runtime and Libra's Move VM is
how they manage safe invocations between modules. Solana took an operating
systems approach and Libra took the domain-specific language approach. In the
runtime, a module must trap back into the runtime to ensure the caller's module
did not write to data owned by the callee. Likewise, when the callee completes,
it must again trap back to the runtime to ensure the callee did not write to
data owned by the caller. Move, on the other hand, includes an advanced type
system that allows these checks to be run by its bytecode verifier. Because
Move bytecode can be verified, the cost of verification is paid just once, at
the time the module is loaded on-chain. In the runtime, the cost is paid each
time a transaction crosses between modules. The difference is similar in spirit
to the difference between a dynamically-typed language like Python versus a
statically-typed language like Java. Solana's runtime allows dApps to be
written in general purpose programming languages, but that comes with the cost
of runtime checks when jumping between programs.
This proposal attempts to define a way to embed the Move VM such that:
* cross-module invocations within Move do not require the runtime's
cross-program runtime checks
* Move programs can leverage functionality in other Solana programs and vice
versa
* Solana's runtime parallelism is exposed to batches of Move and non-Move
transactions
## Proposed Solution
### Move VM as a Solana loader
The Move VM shall be embedded as a Solana loader under the identifier
`MOVE_PROGRAM_ID`, so that Move modules can be marked as `executable` with the
VM as its `owner`. This will allow modules to load module dependencies, as well
as allow for parallel execution of Move scripts.
All data accounts owned by Move modules must set their owners to the loader,
`MOVE_PROGRAM_ID`. Since Move modules encapsulate their account data in the
same way Solana programs encapsulate theirs, the Move module owner should be
embedded in the account data. The runtime will grant write access to the Move
VM, and Move grants access to the module accounts.
### Interacting with Solana programs
To invoke instructions in non-Move programs, Solana would need to extend the
Move VM with a `process_instruction()` system call. It would work the same as
`process_instruction()` Rust BPF programs.

View File

@ -55,7 +55,7 @@ Validators can ignore forks at other points (e.g. from the wrong leader), or
slash the leader responsible for the fork.
Validators vote based on a greedy choice to maximize their reward described in
[forks selection](fork-selection.md).
[Tower BFT](tower-bft.md).
### Validator's View

View File

@ -47,8 +47,8 @@ nodes are started
$ cargo build --all
```
The network is initialized with a genesis ledger and fullnode configuration files.
These files can be generated by running the following script.
The network is initialized with a genesis ledger generated by running the
following script.
```bash
$ ./multinode-demo/setup.sh
@ -69,7 +69,7 @@ $ ./multinode-demo/drone.sh
### Singlenode Testnet
Before you start a fullnode, make sure you know the IP address of the machine you
Before you start a validator, make sure you know the IP address of the machine you
want to be the bootstrap leader for the demo, and make sure that udp ports 8000-10000 are
open on all the machines you want to test with.
@ -86,10 +86,10 @@ The drone does not need to be running for subsequent leader starts.
### Multinode Testnet
To run a multinode testnet, after starting a leader node, spin up some
additional full nodes in separate shells:
additional validators in separate shells:
```bash
$ ./multinode-demo/fullnode-x.sh
$ ./multinode-demo/validator-x.sh
```
To run a performance-enhanced full node on Linux,
@ -99,7 +99,7 @@ your system:
```bash
$ ./fetch-perf-libs.sh
$ SOLANA_CUDA=1 ./multinode-demo/bootstrap-leader.sh
$ SOLANA_CUDA=1 ./multinode-demo/fullnode-x.sh
$ SOLANA_CUDA=1 ./multinode-demo/validator.sh
```
### Testnet Client Demo
@ -145,7 +145,7 @@ Generally we are using `debug` for infrequent debug messages, `trace` for potent
messages and `info` for performance-related logging.
You can also attach to a running process with GDB. The leader's process is named
_solana-fullnode_:
_solana-validator_:
```bash
$ sudo gdb
@ -161,7 +161,7 @@ This will dump all the threads stack traces into gdb.txt
In this example the client connects to our public testnet. To run validators on the testnet you would need to open udp ports `8000-10000`.
```bash
$ ./multinode-demo/client.sh --network testnet.solana.com:8001 --duration 60
$ ./multinode-demo/client.sh --entrypoint testnet.solana.com:8001 --drone testnet.solana.com:9900 --duration 60 --tx_count 50
```
You can observe the effects of your client's transactions on our [dashboard](https://metrics.solana.com:3000/d/testnet/testnet-hud?orgId=2&from=now-30m&to=now&refresh=5s&var-testnet=testnet)

View File

@ -1,6 +1,6 @@
# Gossip Service
The Gossip Service acts as a gateway to nodes in the control plane. Fullnodes
The Gossip Service acts as a gateway to nodes in the control plane. Validators
use the service to ensure information is available to all other nodes in a cluster.
The service broadcasts information using a gossip protocol.
@ -22,7 +22,7 @@ gossip endpoint (a socket address).
Records shared over gossip are arbitrary, but signed and versioned (with a
timestamp) as needed to make sense to the node receiving them. If a node
recieves two records from the same source, it it updates its own copy with the
receives two records from the same source, it updates its own copy with the
record with the most recent timestamp.
## Gossip Service Interface
@ -34,8 +34,8 @@ Nodes send push messages to `PUSH_FANOUT` push peers.
Upon receiving a push message, a node examines the message for:
1. Duplication: if the message has been seen before, the node responds with
`PushMessagePrune` and drops the message
1. Duplication: if the message has been seen before, the node drops the message
and may respond with `PushMessagePrune` if forwarded from a low staked node
2. New data: if the message is new to the node
* Stores the new information with an updated version in its cluster info and
@ -51,7 +51,7 @@ Upon receiving a push message, a node examines the message for:
A nodes selects its push peers at random from the active set of known peers.
The node keeps this selection for a relatively long time. When a prune message
is received, the node drops the push peer that sent the prune. Prune is an
indication that there is another, faster path to that node than direct push.
indication that there is another, higher stake weighted path to that node than direct push.
The set of push peers is kept fresh by rotating a new node into the set every
`PUSH_MSG_TIMEOUT/2` milliseconds.
@ -116,8 +116,8 @@ Just like *pull message*, nodes are selected into the active set based on weight
## Notable differences from PlumTree
The active push protocol described here is based on (Plum
Tree)[https://haslab.uminho.pt/jop/files/lpr07a.pdf]. The main differences are:
The active push protocol described here is based on [Plum
Tree](https://haslab.uminho.pt/jop/files/lpr07a.pdf). The main differences are:
* Push messages have a wallclock that is signed by the originator. Once the
wallclock expires the message is dropped. A hop limit is difficult to implement

View File

@ -12,18 +12,18 @@ updates is managed using an on-chain update manifest program.
#### Fetch and run a pre-built installer using a bootstrap curl/shell script
The easiest install method for supported platforms:
```bash
$ curl -sSf https://raw.githubusercontent.com/solana-labs/solana/v0.13.0/install/solana-install-init.sh | sh
$ curl -sSf https://raw.githubusercontent.com/solana-labs/solana/v0.16.0/install/solana-install-init.sh | sh
```
This script will check github for the latest tagged release and download and run the
`solana-install` binary from there.
`solana-install-init` binary from there.
If additional arguments need to be specified during the installation, the
following shell syntax is used:
```bash
$ init_args=.... # arguments for `solana-installer init ...`
$ curl -sSf https://raw.githubusercontent.com/solana-labs/solana/v0.13.0/install/solana-install-init.sh | sh -s - ${init_args}
$ init_args=.... # arguments for `solana-install-init ...`
$ curl -sSf https://raw.githubusercontent.com/solana-labs/solana/v0.16.0/install/solana-install-init.sh | sh -s - ${init_args}
```
#### Fetch and run a pre-built installer from a Github release
@ -31,9 +31,9 @@ With a well-known release URL, a pre-built binary can be obtained for supported
platforms:
```bash
$ curl -o solana-install https://github.com/solana-labs/solana/releases/download/v0.13.0/solana-install-x86_64-apple-darwin
$ chmod +x ./solana-install
$ ./solana-install --help
$ curl -o solana-install-init https://github.com/solana-labs/solana/releases/download/v0.16.0/solana-install-init-x86_64-apple-darwin
$ chmod +x ./solana-install-init
$ ./solana-install-init --help
```
#### Build and run the installer from source
@ -49,7 +49,7 @@ $ cargo run -- --help
Given a solana release tarball (as created by `ci/publish-tarball.sh`) that has already been uploaded to a publicly accessible URL,
the following commands will deploy the update:
```bash
$ solana-keygen -o update-manifest.json # <-- only generated once, the public key is shared with users
$ solana-keygen new -o update-manifest.json # <-- only generated once, the public key is shared with users
$ solana-install deploy http://example.com/path/to/solana-release.tar.bz2 update-manifest.json
```
@ -58,7 +58,7 @@ $ solana-install deploy http://example.com/path/to/solana-release.tar.bz2 update
$ solana-install init --pubkey 92DMonmBYXwEMHJ99c9ceRSpAmk9v6i3RdvDdXaVcrfj # <-- pubkey is obtained from whoever is deploying the updates
$ export PATH=~/.local/share/solana-install/bin:$PATH
$ solana-keygen ... # <-- runs the latest solana-keygen
$ solana-install run solana-fullnode ... # <-- runs a fullnode, restarting it as necesary when an update is applied
$ solana-install run solana-validator ... # <-- runs a validator, restarting it as necesary when an update is applied
```
### On-chain Update Manifest
@ -119,7 +119,7 @@ It manages the following files and directories in the user's home directory:
#### Command-line Interface
```manpage
solana-install 0.13.0
solana-install 0.16.0
The solana cluster software installer
USAGE:
@ -130,7 +130,7 @@ FLAGS:
-V, --version Prints version information
OPTIONS:
-c, --config <PATH> Configuration file to use [default: /Users/mvines/Library/Preferences/solana/install.yml]
-c, --config <PATH> Configuration file to use [default: .../Library/Preferences/solana/install.yml]
SUBCOMMANDS:
deploy deploys a new update
@ -152,8 +152,8 @@ FLAGS:
-h, --help Prints help information
OPTIONS:
-d, --data_dir <PATH> Directory to store install data [default: /Users/mvines/Library/Application Support/solana]
-u, --url <URL> JSON RPC URL for the solana cluster [default: https://api.testnet.solana.com/]
-d, --data_dir <PATH> Directory to store install data [default: .../Library/Application Support/solana]
-u, --url <URL> JSON RPC URL for the solana cluster [default: http://testnet.solana.com:8899]
-p, --pubkey <PUBKEY> Public key of the update manifest [default: 9XX329sPuskWhH4DQh6k16c87dHKhXLBZTL3Gxmve8Gp]
```

View File

@ -0,0 +1,25 @@
# Instructions
For the purposes of building a [Transaction](transaction.md), a more
verbose instruction format is used:
* **Instruction:**
* **program_id:** The pubkey of the on-chain program that executes the
instruction
* **accounts:** An ordered list of accounts that should be passed to
the program processing the instruction, including metadata detailing
if an account is a signer of the transaction and if it is a credit
only account.
* **data:** A byte array that is passed to the program executing the
instruction
A more compact form is actually included in a `Transaction`:
* **CompiledInstruction:**
* **program_id_index:** The index of the `program_id` in the
`account_keys` list
* **accounts:** An ordered list of indices into `account_keys`
specifying the accounds that should be passed to the program
processing the instruction.
* **data:** A byte array that is passed to the program executing the
instruction

View File

@ -1,13 +1,13 @@
# What is Solana?
Solana is the name of an open source project that is implementing a new,
Solana is an open source project implementing a new,
high-performance, permissionless blockchain. Solana is also the name of a
company headquartered in San Francisco that maintains the open source project.
# About this Book
This book describes the Solana open source project, a blockchain built from the
ground up for scale. The book covers why it's useful, how to use it, how it
ground up for scale. The book covers why Solana is useful, how to use it, how it
works, and why it will continue to work long after the company Solana closes
its doors. The goal of the Solana architecture is to demonstrate there exists a
set of software algorithms that when used in combination to implement a

View File

@ -24,10 +24,20 @@ Methods
* [confirmTransaction](#confirmtransaction)
* [getAccountInfo](#getaccountinfo)
* [getBalance](#getbalance)
* [getClusterNodes](#getclusternodes)
* [getEpochInfo](#getepochinfo)
* [getLeaderSchedule](#getleaderschedule)
* [getProgramAccounts](#getprogramaccounts)
* [getRecentBlockhash](#getrecentblockhash)
* [getSignatureStatus](#getsignaturestatus)
* [getSlotLeader](#getslotleader)
* [getSlotsPerSegment](#getslotspersegment)
* [getStorageTurn](#getstorageturn)
* [getStorageTurnRate](#getstorageturnrate)
* [getNumBlocksSinceSignatureConfirmation](#getnumblockssincesignatureconfirmation)
* [getTransactionCount](#gettransactioncount)
* [getTotalSupply](#gettotalsupply)
* [getEpochVoteAccounts](#getepochvoteaccounts)
* [requestAirdrop](#requestairdrop)
* [sendTransaction](#sendtransaction)
* [startSubscriptionChannel](#startsubscriptionchannel)
@ -92,6 +102,32 @@ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "id":1, "
{"jsonrpc":"2.0","result":true,"id":1}
```
---
### getAccountInfo
Returns all information associated with the account of provided Pubkey
##### Parameters:
* `string` - Pubkey of account to query, as base-58 encoded string
##### Results:
The result field will be a JSON object with the following sub fields:
* `lamports`, number of lamports assigned to this account, as a signed 64-bit integer
* `owner`, array of 32 bytes representing the program this account has been assigned to
* `data`, array of bytes representing any data associated with the account
* `executable`, boolean indicating if the account contains a program (and is strictly read-only)
##### Example:
```bash
// Request
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "id":1, "method":"getAccountInfo", "params":["2gVkYWexTHR5Hb2aLeQN3tnngvWzisFKXDUPrgMHpdST"]}' http://localhost:8899
// Result
{"jsonrpc":"2.0","result":{"executable":false,"owner":[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"lamports":1,"data":[3,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,50,48,53,48,45,48,49,45,48,49,84,48,48,58,48,48,58,48,48,90,252,10,7,28,246,140,88,177,98,82,10,227,89,81,18,30,194,101,199,16,11,73,133,20,246,62,114,39,20,113,189,32,50,0,0,0,0,0,0,0,247,15,36,102,167,83,225,42,133,127,82,34,36,224,207,130,109,230,224,188,163,33,213,13,5,117,211,251,65,159,197,51,0,0,0,0,0,0]},"id":1}
```
---
### getBalance
@ -114,40 +150,112 @@ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "id":1, "
---
### getAccountInfo
Returns all information associated with the account of provided Pubkey
##### Parameters:
* `string` - Pubkey of account to query, as base-58 encoded string
##### Results:
The result field will be a JSON object with the following sub fields:
* `lamports`, number of lamports assigned to this account, as a signed 64-bit integer
* `owner`, array of 32 bytes representing the program this account has been assigned to
* `data`, array of bytes representing any data associated with the account
* `executable`, boolean indicating if the account contains a program (and is strictly read-only)
* `loader`, array of 32 bytes representing the loader for this program (if `executable`), otherwise all
##### Example:
```bash
// Request
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "id":1, "method":"getAccountInfo", "params":["2gVkYWexTHR5Hb2aLeQN3tnngvWzisFKXDUPrgMHpdST"]}' http://localhost:8899
// Result
{"jsonrpc":"2.0","result":{"executable":false,"loader":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"owner":[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"lamports":1,"data":[3,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,50,48,53,48,45,48,49,45,48,49,84,48,48,58,48,48,58,48,48,90,252,10,7,28,246,140,88,177,98,82,10,227,89,81,18,30,194,101,199,16,11,73,133,20,246,62,114,39,20,113,189,32,50,0,0,0,0,0,0,0,247,15,36,102,167,83,225,42,133,127,82,34,36,224,207,130,109,230,224,188,163,33,213,13,5,117,211,251,65,159,197,51,0,0,0,0,0,0]},"id":1}
```
---
### getRecentBlockhash
Returns a recent block hash from the ledger
### getClusterNodes
Returns information about all the nodes participating in the cluster
##### Parameters:
None
##### Results:
The result field will be an array of JSON objects, each with the following sub fields:
* `pubkey` - Node public key, as base-58 encoded string
* `gossip` - Gossip network address for the node
* `tpu` - TPU network address for the node
* `rpc` - JSON RPC network address for the node, or `null` if the JSON RPC service is not enabled
##### Example:
```bash
// Request
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "id":1, "method":"getClusterNodes"}' http://localhost:8899
// Result
{"jsonrpc":"2.0","result":[{"gossip":"10.239.6.48:8001","pubkey":"9QzsJf7LPLj8GkXbYT3LFDKqsj2hHG7TA3xinJHu8epQ","rpc":"10.239.6.48:8899","tpu":"10.239.6.48:8856"}],"id":1}
```
---
### getEpochInfo
Returns information about the current epoch
##### Parameters:
None
##### Results:
The result field will be an object with the following fields:
* `epoch`, the current epoch
* `slotIndex`, the current slot relative to the start of the current epoch
* `slotsInEpoch`, the number of slots in this epoch
##### Example:
```bash
// Request
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getEpochInfo"}' http://localhost:8899
// Result
{"jsonrpc":"2.0","result":{"epoch":3,"slotIndex":126,"slotsInEpoch":256},"id":1}
```
---
### getLeaderSchedule
Returns the leader schedule for the current epoch
##### Parameters:
None
##### Results:
The result field will be an array of leader public keys (as base-58 encoded
strings) for each slot in the current epoch
##### Example:
```bash
// Request
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getLeaderSchedule"}' http://localhost:8899
// Result
{"jsonrpc":"2.0","result":[...],"id":1}
```
---
### getProgramAccounts
Returns all accounts owned by the provided program Pubkey
##### Parameters:
* `string` - Pubkey of program, as base-58 encoded string
##### Results:
The result field will be an array of arrays. Each sub array will contain:
* `string` - a the account Pubkey as base-58 encoded string
and a JSON object, with the following sub fields:
* `lamports`, number of lamports assigned to this account, as a signed 64-bit integer
* `owner`, array of 32 bytes representing the program this account has been assigned to
* `data`, array of bytes representing any data associated with the account
* `executable`, boolean indicating if the account contains a program (and is strictly read-only)
##### Example:
```bash
// Request
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "id":1, "method":"getProgramAccounts", "params":["8nQwAgzN2yyUzrukXsCa3JELBYqDQrqJ3UyHiWazWxHR"]}' http://localhost:8899
// Result
{"jsonrpc":"2.0","result":[["BqGKYtAKu69ZdWEBtZHh4xgJY1BYa2YBiBReQE3pe383", {"executable":false,"owner":[50,28,250,90,221,24,94,136,147,165,253,136,1,62,196,215,225,34,222,212,99,84,202,223,245,13,149,99,149,231,91,96],"lamports":1,"data":[]], ["4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T", {"executable":false,"owner":[50,28,250,90,221,24,94,136,147,165,253,136,1,62,196,215,225,34,222,212,99,84,202,223,245,13,149,99,149,231,91,96],"lamports":10,"data":[]]]},"id":1}
```
---
### getRecentBlockhash
Returns a recent block hash from the ledger, and a fee schedule that can be used
to compute the cost of submitting a transaction using it.
##### Parameters:
None
##### Results:
An array consisting of
* `string` - a Hash as base-58 encoded string
* `FeeCalculator object` - the fee schedule for this block hash
##### Example:
```bash
@ -155,7 +263,7 @@ None
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getRecentBlockhash"}' http://localhost:8899
// Result
{"jsonrpc":"2.0","result":"GH7ome3EiwEr7tu9JuTh2dpYWBJK3z69Xm1ZE3MEE6JC","id":1}
{"jsonrpc":"2.0","result":["GH7ome3EiwEr7tu9JuTh2dpYWBJK3z69Xm1ZE3MEE6JC",{"lamportsPerSignature": 0}],"id":1}
```
---
@ -183,7 +291,87 @@ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "id":1, "
{"jsonrpc":"2.0","result":"SignatureNotFound","id":1}
```
---
-----
### getSlotLeader
Returns the current slot leader
##### Parameters:
None
##### Results:
* `string` - Node Id as base-58 encoded string
##### Example:
```bash
// Request
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getSlotLeader"}' http://localhost:8899
// Result
{"jsonrpc":"2.0","result":"ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS","id":1}
```
----
### getSlotsPerSegment
Returns the current storage segment size in terms of slots
##### Parameters:
None
##### Results:
* `u64` - Number of slots in a storage segment
##### Example:
```bash
// Request
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getSlotsPerSegment"}' http://localhost:8899
// Result
{"jsonrpc":"2.0","result":"1024","id":1}
```
----
### getStorageTurn
Returns the current storage turn's blockhash and slot
##### Parameters:
None
##### Results:
An array consisting of
* `string` - a Hash as base-58 encoded string indicating the blockhash of the turn slot
* `u64` - the current storage turn slot
##### Example:
```bash
// Request
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getStorageTurn"}' http://localhost:8899
// Result
{"jsonrpc":"2.0","result":["GH7ome3EiwEr7tu9JuTh2dpYWBJK3z69Xm1ZE3MEE6JC", "2048"],"id":1}
```
----
### getStorageTurnRate
Returns the current storage turn rate in terms of slots per turn
##### Parameters:
None
##### Results:
* `u64` - Number of slots in storage turn
##### Example:
```bash
// Request
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getStorageTurnRate"}' http://localhost:8899
// Result
{"jsonrpc":"2.0","result":"1024","id":1}
```
----
### getNumBlocksSinceSignatureConfirmation
Returns the current number of blocks since signature has been confirmed.
@ -225,6 +413,51 @@ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "m
---
### getTotalSupply
Returns the current total supply in Lamports
##### Parameters:
None
##### Results:
* `integer` - Total supply, as unsigned 64-bit integer
##### Example:
```bash
// Request
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getTotalSupply"}' http://localhost:8899
// Result
{"jsonrpc":"2.0","result":10126,"id":1}
```
---
### getEpochVoteAccounts
Returns the account info and associated stake for all the voting accounts in the current epoch.
##### Parameters:
None
##### Results:
The result field will be an array of JSON objects, each with the following sub fields:
* `votePubkey` - Vote account public key, as base-58 encoded string
* `nodePubkey` - Node public key, as base-58 encoded string
* `stake` - the stake, in lamports, delegated to this vote account
* `commission`, a 32-bit integer used as a fraction (commission/MAX_U32) for rewards payout
##### Example:
```bash
// Request
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getEpochVoteAccounts"}' http://localhost:8899
// Result
{"jsonrpc":"2.0","result":[{"commission":0,"nodePubkey":"Et2RaZJdJRTzTkodUwiHr4H6sLkVmijBFv8tkd7oSSFY","stake":42,"votePubkey":"B4CdWq3NBSoH2wYsVE1CaZSWPo2ZtopE4SJipQhZ3srF"}],"id":1}
```
---
### requestAirdrop
Requests an airdrop of lamports to a Pubkey
@ -270,6 +503,14 @@ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "m
After connect to the RPC PubSub websocket at `ws://<ADDRESS>/`:
- Submit subscription requests to the websocket using the methods below
- Multiple subscriptions may be active at once
- All subscriptions take an optional `confirmations` parameter, which defines
how many confirmed blocks the node should wait before sending a notification.
The greater the number, the more likely the notification is to represent
consensus across the cluster, and the less likely it is to be affected by
forking or rollbacks. If unspecified, the default value is 0; the node will
send a notification as soon as it witnesses the event. The maximum
`confirmations` wait length is the cluster's `MAX_LOCKOUT_HISTORY`, which
represents the economic finality of the chain.
---
@ -279,6 +520,8 @@ for a given account public key changes
##### Parameters:
* `string` - account Pubkey, as base-58 encoded string
* `integer` - optional, number of confirmed blocks to wait before notification.
Default: 0, Max: `MAX_LOCKOUT_HISTORY` (greater integers rounded down)
##### Results:
* `integer` - Subscription id (needed to unsubscribe)
@ -288,13 +531,15 @@ for a given account public key changes
// Request
{"jsonrpc":"2.0", "id":1, "method":"accountSubscribe", "params":["CM78CPUeXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNH12"]}
{"jsonrpc":"2.0", "id":1, "method":"accountSubscribe", "params":["CM78CPUeXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNH12", 15]}
// Result
{"jsonrpc": "2.0","result": 0,"id": 1}
```
##### Notification Format:
```bash
{"jsonrpc": "2.0","method": "accountNotification", "params": {"result": {"executable":false,"loader":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"owner":[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"lamports":1,"data":[3,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,50,48,53,48,45,48,49,45,48,49,84,48,48,58,48,48,58,48,48,90,252,10,7,28,246,140,88,177,98,82,10,227,89,81,18,30,194,101,199,16,11,73,133,20,246,62,114,39,20,113,189,32,50,0,0,0,0,0,0,0,247,15,36,102,167,83,225,42,133,127,82,34,36,224,207,130,109,230,224,188,163,33,213,13,5,117,211,251,65,159,197,51,0,0,0,0,0,0]},"subscription":0}}
{"jsonrpc": "2.0","method": "accountNotification", "params": {"result": {"executable":false,"owner":[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"lamports":1,"data":[3,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,50,48,53,48,45,48,49,45,48,49,84,48,48,58,48,48,58,48,48,90,252,10,7,28,246,140,88,177,98,82,10,227,89,81,18,30,194,101,199,16,11,73,133,20,246,62,114,39,20,113,189,32,50,0,0,0,0,0,0,0,247,15,36,102,167,83,225,42,133,127,82,34,36,224,207,130,109,230,224,188,163,33,213,13,5,117,211,251,65,159,197,51,0,0,0,0,0,0]},"subscription":0}}
```
---
@ -325,6 +570,8 @@ for a given account owned by the program changes
##### Parameters:
* `string` - program_id Pubkey, as base-58 encoded string
* `integer` - optional, number of confirmed blocks to wait before notification.
Default: 0, Max: `MAX_LOCKOUT_HISTORY` (greater integers rounded down)
##### Results:
* `integer` - Subscription id (needed to unsubscribe)
@ -334,6 +581,8 @@ for a given account owned by the program changes
// Request
{"jsonrpc":"2.0", "id":1, "method":"programSubscribe", "params":["9gZbPtbtHrs6hEWgd6MbVY9VPFtS5Z8xKtnYwA2NynHV"]}
{"jsonrpc":"2.0", "id":1, "method":"programSubscribe", "params":["9gZbPtbtHrs6hEWgd6MbVY9VPFtS5Z8xKtnYwA2NynHV", 15]}
// Result
{"jsonrpc": "2.0","result": 0,"id": 1}
```
@ -373,6 +622,8 @@ On `signatureNotification`, the subscription is automatically cancelled
##### Parameters:
* `string` - Transaction Signature, as base-58 encoded string
* `integer` - optional, number of confirmed blocks to wait before notification.
Default: 0, Max: `MAX_LOCKOUT_HISTORY` (greater integers rounded down)
##### Results:
* `integer` - subscription id (needed to unsubscribe)
@ -382,6 +633,8 @@ On `signatureNotification`, the subscription is automatically cancelled
// Request
{"jsonrpc":"2.0", "id":1, "method":"signatureSubscribe", "params":["2EBVM6cB8vAAD93Ktr6Vd8p67XPbQzCJX47MpReuiCXJAtcjaxpvWpcg9Ege1Nr5Tk3a2GFrByT7WPBjdsTycY9b"]}
{"jsonrpc":"2.0", "id":1, "method":"signatureSubscribe", "params":["2EBVM6cB8vAAD93Ktr6Vd8p67XPbQzCJX47MpReuiCXJAtcjaxpvWpcg9Ege1Nr5Tk3a2GFrByT7WPBjdsTycY9b", 15]}
// Result
{"jsonrpc": "2.0","result": 0,"id": 1}
```

View File

@ -45,7 +45,7 @@ The upsides compared to guards:
* The timeout is not fixed.
* The timeout is local to the leader, and therefore can be clever. The leader's
heuristic can take into account avalanche performance.
heuristic can take into account turbine performance.
* This design doesn't require a ledger hard fork to update.

View File

@ -96,7 +96,7 @@ ends up scheduled for the first two epochs because the leader schedule is also
generated at slot 0 for the next epoch. The length of the first two epochs can
be specified in the genesis block as well. The minimum length of the first
epochs must be greater than or equal to the maximum rollback depth as defined in
[fork selection](fork-selection.md).
[Tower BFT](tower-bft.md).
## Leader Schedule Generation Algorithm

View File

@ -57,7 +57,7 @@ Forwarding is preferred, as it would minimize network congestion, allowing the
cluster to advertise higher TPS capacity.
## Fullnode Loop
## Validator Loop
The PoH Recorder manages the transition between modes. Once a ledger is
replayed, the validator can run until the recorder indicates it should be

View File

@ -2,6 +2,12 @@
Replication behavior yet to be implemented.
### Storage epoch
The storage epoch should be the number of slots which results in around 100GB-1TB of
ledger to be generated for replicators to store. Replicators will start storing ledger
when a given fork has a high probability of not being rolled back.
### Validator behavior
3. Every NUM\_KEY\_ROTATION\_TICKS it also validates samples received from
@ -37,3 +43,100 @@ transacation proves the validator incorrectly validated a fake storage proof.
The replicator is rewarded and the validator's staking balance is slashed or
frozen.
### Storage proof contract logic
Each replicator and validator will have their own storage account. The validator's
account would be separate from their gossip id similiar to their vote account.
These should be implemented as two programs one which handles the validator as the keysigner
and one for the replicator. In that way when the programs reference other accounts, they
can check the program id to ensure it is a validator or replicator account they are
referencing.
#### SubmitMiningProof
```rust,ignore
SubmitMiningProof {
slot: u64,
sha_state: Hash,
signature: Signature,
};
keys = [replicator_keypair]
```
Replicators create these after mining their stored ledger data for a certain hash value.
The slot is the end slot of the segment of ledger they are storing, the sha\_state
the result of the replicator using the hash function to sample their encrypted ledger segment.
The signature is the signature that was created when they signed a PoH value for the
current storage epoch. The list of proofs from the current storage epoch should be saved
in the account state, and then transfered to a list of proofs for the previous epoch when
the epoch passes. In a given storage epoch a given replicator should only submit proofs
for one segment.
The program should have a list of slots which are valid storage mining slots.
This list should be maintained by keeping track of slots which are rooted slots in which a significant
portion of the network has voted on with a high lockout value, maybe 32-votes old. Every SLOTS\_PER\_SEGMENT
number of slots would be added to this set. The program should check that the slot is in this set. The set can
be maintained by receiving a AdvertiseStorageRecentBlockHash and checking with its bank/Tower BFT state.
The program should do a signature verify check on the signature, public key from the transaction submitter and the message of
the previous storage epoch PoH value.
#### ProofValidation
```rust,ignore
ProofValidation {
proof_mask: Vec<ProofStatus>,
}
keys = [validator_keypair, replicator_keypair(s) (unsigned)]
```
A validator will submit this transaction to indicate that a set of proofs for a given
segment are valid/not-valid or skipped where the validator did not look at it. The
keypairs for the replicators that it looked at should be referenced in the keys so the program
logic can go to those accounts and see that the proofs are generated in the previous epoch. The
sampling of the storage proofs should be verified ensuring that the correct proofs are skipped by
the validator according to the logic outlined in the validator behavior of sampling.
The included replicator keys will indicate the the storage samples which are being referenced; the
length of the proof\_mask should be verified against the set of storage proofs in the referenced
replicator account(s), and should match with the number of proofs submitted in the previous storage
epoch in the state of said replicator account.
#### ClaimStorageReward
```rust,ignore
ClaimStorageReward {
}
keys = [validator_keypair or replicator_keypair, validator/replicator_keypairs (unsigned)]
```
Replicators and validators will use this transaction to get paid tokens from a program state
where SubmitStorageProof, ProofValidation and ChallengeProofValidations are in a state where
proofs have been submitted and validated and there are no ChallengeProofValidations referencing
those proofs. For a validator, it should reference the replicator keypairs to which it has validated
proofs in the relevant epoch. And for a replicator it should reference validator keypairs for which it
has validated and wants to be rewarded.
#### ChallengeProofValidation
```rust,ignore
ChallengeProofValidation {
proof_index: u64,
hash_seed_value: Vec<u8>,
}
keys = [replicator_keypair, validator_keypair]
```
This transaction is for catching lazy validators who are not doing the work to validate proofs.
A replicator will submit this transaction when it sees a validator has approved a fake SubmitMiningProof
transaction. Since the replicator is a light client not looking at the full chain, it will have to ask
a validator or some set of validators for this information maybe via RPC call to obtain all ProofValidations for
a certain segment in the previous storage epoch. The program will look in the validator account
state see that a ProofValidation is submitted in the previous storage epoch and hash the hash\_seed\_value and
see that the hash matches the SubmitMiningProof transaction and that the validator marked it as valid. If so,
then it will save the challenge to the list of challenges that it has in its state.
#### AdvertiseStorageRecentBlockhash
```rust,ignore
AdvertiseStorageRecentBlockhash {
hash: Hash,
slot: u64,
}
```
Validators and replicators will submit this to indicate that a new storage epoch has passed and that the
storage proofs which are current proofs should now be for the previous epoch. Other transactions should
check to see that the epoch that they are referencing is accurate according to current chain state.

View File

@ -1,19 +1,18 @@
# Ledger Replication
At full capacity on a 1gbps network solana will generate 4 petabytes of data
per year. To prevent the network from centralizing around full nodes that have
per year. To prevent the network from centralizing around validators that have
to store the full data set this protocol proposes a way for mining nodes to
provide storage capacity for pieces of the network.
provide storage capacity for pieces of the data.
The basic idea to Proof of Replication is encrypting a dataset with a public
symmetric key using CBC encryption, then hash the encrypted dataset. The main
problem with the naive approach is that a dishonest storage node can stream the
encryption and delete the data as its hashed. The simple solution is to force
the hash to be done on the reverse of the encryption, or perhaps with a random
order. This ensures that all the data is present during the generation of the
proof and it also requires the validator to have the entirety of the encrypted
data present for verification of every proof of every identity. So the space
required to validate is `number_of_proofs * data_size`
encryption and delete the data as it's hashed. The simple solution is to periodically
regenerate the hash based on a signed PoH value. This ensures that all the data is present
during the generation of the proof and it also requires validators to have the
entirety of the encrypted data present for verification of every proof of every identity.
So the space required to validate is `number_of_proofs * data_size`
## Optimization with PoH
@ -29,13 +28,12 @@ core. The total space required for verification is `1_ledger_segment +
## Network
Validators for PoRep are the same validators that are verifying transactions.
They have some stake that they have put up as collateral that ensures that
their work is honest. If you can prove that a validator verified a fake PoRep,
then the validators stake can be slashed.
If a replicator can prove that a validator verified a fake PoRep, then the
validator will not receive a reward for that storage epoch.
Replicators are specialized *light clients*. They download a part of the ledger
and store it, and provide PoReps of storing the ledger. For each verified PoRep
replicators earn a reward of sol from the mining pool.
Replicators are specialized *light clients*. They download a part of the
ledger (a.k.a Segment) and store it, and provide PoReps of storing the ledger.
For each verified PoRep replicators earn a reward of sol from the mining pool.
## Constraints
@ -53,11 +51,10 @@ changes to determine what rate it can validate storage proofs.
### Constants
1. NUM\_STORAGE\_ENTRIES: Number of entries in a segment of ledger data. The
1. SLOTS\_PER\_SEGMENT: Number of slots in a segment of ledger data. The
unit of storage for a replicator.
2. NUM\_KEY\_ROTATION\_TICKS: Number of ticks to save a PoH value and cause a
key generation for the section of ledger just generated and the rotation of
another key in the set.
2. NUM\_KEY\_ROTATION\_SEGMENTS: Number of segments after which replicators
regenerate their encryption keys and select a new dataset to store.
3. NUM\_STORAGE\_PROOFS: Number of storage proofs required for a storage proof
claim to be successfully rewarded.
4. RATIO\_OF\_FAKE\_PROOFS: Ratio of fake proofs to real proofs that a storage
@ -66,75 +63,108 @@ mining proof claim has to contain to be valid for a reward.
proof.
6. NUM\_CHACHA\_ROUNDS: Number of encryption rounds performed to generate
encrypted state.
7. NUM\_SLOTS\_PER\_TURN: Number of slots that define a single storage epoch or
a "turn" of the PoRep game.
### Validator behavior
1. Validator joins the network and submits a storage validation capacity
transaction which tells the network how many proofs it can process in a given
period defined by NUM\_KEY\_ROTATION\_TICKS.
2. Every NUM\_KEY\_ROTATION\_TICKS the validator stores the PoH value at that
height.
3. Validator generates a storage proof confirmation transaction.
4. The storage proof confirmation transaction is integrated into the ledger.
6. Validator responds to RPC interfaces for what the last storage epoch PoH
value is and its entry\_height.
1. Validators join the network and begin looking for replicator accounts at each
storage epoch/turn boundary.
2. Every turn, Validators sign the PoH value at the boundary and use that signature
to randomly pick proofs to verify from each storage account found in the turn boundary.
This signed value is also submitted to the validator's storage account and will be used by
replicators at a later stage to cross-verify.
3. Every `NUM_SLOTS_PER_TURN` slots the validator advertises the PoH value. This is value
is also served to Replicators via RPC interfaces.
4. For a given turn N, all validations get locked out until turn N+3 (a gap of 2 turn/epoch).
At which point all validations during that turn are available for reward collection.
5. Any incorrect validations will be marked during the turn in between.
### Replicator behavior
1. Since a replicator is somewhat of a light client and not downloading all the
ledger data, they have to rely on other full nodes (validators) for
information. Any given validator may or may not be malicious and give incorrect
information, although there are not any obvious attack vectors that this could
accomplish besides having the replicator do extra wasted work. For many of the
operations there are a number of options depending on how paranoid a replicator
is:
ledger data, they have to rely on other validators and replicators for information.
Any given validator may or may not be malicious and give incorrect information, although
there are not any obvious attack vectors that this could accomplish besides having the
replicator do extra wasted work. For many of the operations there are a number of options
depending on how paranoid a replicator is:
- (a) replicator can ask a validator
- (b) replicator can ask multiple validators
- (c) replicator can subscribe to the full transaction stream and generate
the information itself
- (d) replicator can subscribe to an abbreviated transaction stream to
generate the information itself
2. A replicator obtains the PoH hash corresponding to the last key rotation
along with its entry\_height.
- (c) replicator can ask other replicators
- (d) replicator can subscribe to the full transaction stream and generate
the information itself (assuming the slot is recent enough)
- (e) replicator can subscribe to an abbreviated transaction stream to
generate the information itself (assuming the slot is recent enough)
2. A replicator obtains the PoH hash corresponding to the last turn with its slot.
3. The replicator signs the PoH hash with its keypair. That signature is the
seed used to pick the segment to replicate and also the encryption key. The
replicator mods the signature with the entry\_height to get which segment to
replicator mods the signature with the slot to get which segment to
replicate.
4. The replicator retrives the ledger by asking peer validators and
replicators. See 6.5.
5. The replicator then encrypts that segment with the key with chacha algorithm
in CBC mode with NUM\_CHACHA\_ROUNDS of encryption.
6. The replicator initializes a chacha rng with the signature from step 2 as
in CBC mode with `NUM_CHACHA_ROUNDS` of encryption.
6. The replicator initializes a chacha rng with the a signed recent PoH value as
the seed.
7. The replicator generates NUM\_STORAGE\_SAMPLES samples in the range of the
7. The replicator generates `NUM_STORAGE_SAMPLES` samples in the range of the
entry size and samples the encrypted segment with sha256 for 32-bytes at each
offset value. Sampling the state should be faster than generating the encrypted
segment.
8. The replicator sends a PoRep proof transaction which contains its sha state
at the end of the sampling operation, its seed and the samples it used to the
current leader and it is put onto the ledger.
9. During a given turn the replicator should submit many proofs for the same segment
and based on the `RATIO_OF_FAKE_PROOFS` some of those proofs must be fake.
10. As the PoRep game enters the next turn, the replicator must submit a
transaction with the mask of which proofs were fake during the last turn. This
transaction will define the rewards for both replicators and validators.
11. Finally for a turn N, as the PoRep game enters turn N + 3, replicator's proofs for
turn N will be counted towards their rewards.
### The PoRep Game
The Proof of Replication game has 4 primary stages. For each "turn" multiple PoRep
games can be in progress but each in a different stage.
The 4 stages of the PoRep Game are as follows:
1. Proof submission stage
- Replicators: submit as many proofs as possible during this stage
- Validators: No-op
2. Proof verification stage
- Replicators: No-op
- Validators: Select replicators and verify their proofs from the previous turn
3. Proof challenge stage
- Replicators: Submit the proof mask with justifications (for fake proofs submitted 2 turns ago)
- Validators: No-op
4. Reward collection stage
- Replicators: Collect rewards for 3 turns ago
- Validators: Collect rewards for 3 turns ago
For each turn of the PoRep game, both Validators and Replicators evaluate each
stage. The stages are run as separate transactions on the storage program.
### Finding who has a given block of ledger
1. Validators monitor the transaction stream for storage mining proofs, and
keep a mapping of ledger segments by entry\_height to public keys. When it sees
a storage mining proof it updates this mapping and provides an RPC interface
which takes an entry\_height and hands back a list of public keys. The client
then looks up in their cluster\_info table to see which network address that
corresponds to and sends a repair request to retrieve the necessary blocks of
ledger.
2. Validators would need to prune this list which it could do by periodically
looking at the oldest entries in its mappings and doing a network query to see
if the storage host is still serving the first entry.
1. Validators monitor the turns in the PoRep game and look at the rooted bank
at turn boundaries for any proofs.
2. Validators maintain a map of ledger segments and corresponding replicator public keys.
The map is updated when a Validator processes a replicator's proofs for a segment.
The validator provides an RPC interface to access the this map. Using this API, clients
can map a segment to a replicator's network address (correlating it via cluster_info table).
The clients can then send repair requests to the replicator to retrieve segments.
3. Validators would need to invalidate this list every N turns.
## Sybil attacks
For any random seed, we force everyone to use a signature that is derived from
a PoH hash. Everyone must use the same count, so the same PoH hash is signed by
every participant. The signatures are then each cryptographically tied to the
keypair, which prevents a leader from grinding on the resulting value for more
than 1 identity.
a PoH hash at the turn boundary. Everyone uses the same count, so the same PoH
hash is signed by every participant. The signatures are then each cryptographically
tied to the keypair, which prevents a leader from grinding on the resulting
value for more than 1 identity.
Since there are many more client identities then encryption identities, we need
to split the reward for multiple clients, and prevent Sybil attacks from
@ -155,8 +185,7 @@ the network can reward long lived client identities more than new ones.
showing the initial state for the hash.
- If a validator marks real proofs as fake, no on-chain computation can be done
to distinguish who is correct. Rewards would have to rely on the results from
multiple validators in a stake-weighted fashion to catch bad actors and
replicators from being locked out of the network.
multiple validators to catch bad actors and replicators from being denied rewards.
- Validator stealing mining proof results for itself. The proofs are derived
from a signature from a replicator, since the validator does not know the
private key used to generate the encryption key, it cannot be the generator of

View File

@ -76,21 +76,24 @@ this field can only modified by this entity
### StakeState
A StakeState takes one of two forms, StakeState::Delegate and StakeState::MiningPool.
A StakeState takes one of two forms, StakeState::Stake and StakeState::MiningPool.
### StakeState::Delegate
### StakeState::Stake
StakeState is the current delegation preference of the **staker**. StakeState
Stake is the current delegation preference of the **staker**. Stake
contains the following state information:
* Account::lamports - The staked lamports.
* `voter_id` - The pubkey of the VoteState instance the lamports are
* `voter_pubkey` - The pubkey of the VoteState instance the lamports are
delegated to.
* `credits_observed` - The total credits claimed over the lifetime of the
program.
* `stake` - The actual activated stake.
* Account::lamports - Lamports available for staking, including any earned as rewards.
### StakeState::MiningPool
There are two approaches to the mining pool. The bank could allow the
@ -105,11 +108,12 @@ tokens stored as `Account::lamports`.
The stakes and the MiningPool are accounts that are owned by the same `Stake`
program.
### StakeInstruction::Initialize
### StakeInstruction::DelegateStake(stake)
* `account[0]` - RW - The StakeState::Delegate instance.
`StakeState::Delegate::credits_observed` is initialized to `VoteState::credits`.
`StakeState::Delegate::voter_id` is initialized to `account[1]`
* `account[0]` - RW - The StakeState::Stake instance.
`StakeState::Stake::credits_observed` is initialized to `VoteState::credits`.
`StakeState::Stake::voter_pubkey` is initialized to `account[1]`
`StakeState::Stake::stake` is initialized to `stake`, as long as it's less than account[0].lamports
* `account[1]` - R - The VoteState instance.
@ -124,15 +128,15 @@ deposited into the StakeState and as validator commission is proportional to
* `account[0]` - RW - The StakeState::MiningPool instance that will fulfill the
reward.
* `account[1]` - RW - The StakeState::Delegate instance that is redeeming votes
* `account[1]` - RW - The StakeState::Stake instance that is redeeming votes
credits.
* `account[2]` - R - The VoteState instance, must be the same as
`StakeState::voter_id`
`StakeState::voter_pubkey`
Reward is payed out for the difference between `VoteState::credits` to
`StakeState::Delgate.credits_observed`, and `credits_observed` is updated to
`VoteState::credits`. The commission is deposited into the `VoteState` token
balance, and the reward is deposited to the `StakeState::Delegate` token balance. The
balance, and the reward is deposited to the `StakeState::Stake` token balance. The
reward and the commission is weighted by the `StakeState::lamports` divided by total lamports staked.
The Staker or the owner of the Stake program sends a transaction with this
@ -146,7 +150,7 @@ stake_state.credits_observed = vote_state.credits;
```
`credits_to_claim` is used to compute the reward and commission, and
`StakeState::Delegate::credits_observed` is updated to the latest
`StakeState::Stake::credits_observed` is updated to the latest
`VoteState::credits` value.
### Collecting network fees into the MiningPool
@ -175,13 +179,13 @@ many rewards to be claimed concurrently.
## Passive Delegation
Any number of instances of StakeState::Delegate programs can delegate to a single
Any number of instances of StakeState::Stake programs can delegate to a single
VoteState program without an interactive action from the identity controlling
the VoteState program or submitting votes to the program.
The total stake allocated to a VoteState program can be calculated by the sum of
all the StakeState programs that have the VoteState pubkey as the
`StakeState::Delegate::voter_id`.
`StakeState::Stake::voter_pubkey`.
## Example Callflow
@ -194,12 +198,12 @@ nodes since stake is used as weight in the network control and data planes. One
way to implement this would be for the StakeState to delegate to a pool of
validators instead of a single one.
Instead of a single `vote_id` and `credits_observed` entry in the StakeState
Instead of a single `vote_pubkey` and `credits_observed` entry in the StakeState
program, the program can be initialized with a vector of tuples.
```rust,ignore
Voter {
voter_id: Pubkey,
voter_pubkey: Pubkey,
credits_observed: u64,
weight: u8,
}

View File

@ -0,0 +1,29 @@
# Performance Metrics
Solana cluster performance is measured as average number of transactions per second
that the network can sustain (TPS). And, how long it takes for a transaction to be
confirmed by super majority of the cluster (Confirmation Time).
Each cluster node maintains various counters that are incremented on certain events.
These counters are periodically uploaded to a cloud based database. Solana's metrics
dashboard fetches these counters, and computes the performance metrics and displays
it on the dashboard.
## TPS
The leader node's banking stage maintains a count of transactions that it recorded.
The dashboard displays the count averaged over 2 second period in the TPS time series
graph. The dashboard also shows per second mean, maximum and total TPS as a running
counter.
## Confirmation Time
Each validator node maintains a list of active ledger forks that are visible to the node.
A fork is considered to be frozen when the node has received and processed all entries
corresponding to the fork. A fork is considered to be confirmed when it receives cumulative
super majority vote, and when one of its children forks is frozen.
The node assigns a timestamp to every new fork, and computes the time it took to confirm
the fork. This time is reflected as validator confirmation time in performance metrics.
The performance dashboard displays the average of each validator node's confirmation time
as a time series graph.

View File

@ -60,7 +60,7 @@ The read is satisfied by pointing to a memory-mapped location in the
## Root Forks
The [fork selection algorithm](fork-selection.md) eventually selects a fork as a
[Tower BFT](tower-bft.md) eventually selects a fork as a
root fork and the fork is squashed. A squashed/root fork cannot be rolled back.
When a fork is squashed, all accounts in its parents not already present in the

View File

@ -3,8 +3,8 @@
A client *app* interacts with a Solana cluster by sending it *transactions*
with one or more *instructions*. The Solana *runtime* passes those instructions
to user-contributed *programs*. An instruction might, for example, tell a
program to move *lamports* from one *account* to another or create an interactive
contract that governs how lamports are moved. Instructions are executed
program to transfer *lamports* from one *account* to another or create an interactive
contract that governs how lamports are transfered. Instructions are executed
atomically. If any instruction is invalid, any changes made within the
transaction are discarded.

View File

@ -0,0 +1,51 @@
# Repair Service
The RepairService is in charge of retrieving missing blobs that failed to be delivered by primary communication protocols like Avalanche. It is in charge of managing the protocols described below in the `Repair Protocols` section below.
# Challenges:
1) Validators can fail to receive particular blobs due to network failures
2) Consider a scenario where blocktree contains the set of slots {1, 3, 5}. Then Blocktree receives blobs for some slot 7, where for each of the blobs b, b.parent == 6, so then the parent-child relation 6 -> 7 is stored in blocktree. However, there is no way to chain these slots to any of the existing banks in Blocktree, and thus the `Blob Repair` protocol will not repair these slots. If these slots happen to be part of the main chain, this will halt replay progress on this node.
3) Validators that find themselves behind the cluster by an entire epoch struggle/fail to catch up because they do not have a leader schedule for future epochs. If nodes were to blindly accept repair blobs in these future epochs, this exposes nodes to spam.
# Repair Protocols
The repair protocol makes best attempts to progress the forking structure of Blocktree.
The different protocol strategies to address the above challenges:
1. Blob Repair (Addresses Challenge #1):
This is the most basic repair protocol, with the purpose of detecting and filling "holes" in the ledger. Blocktree tracks the latest root slot. RepairService will then periodically iterate every fork in blocktree starting from the root slot, sending repair requests to validators for any missing blobs. It will send at most some `N` repair reqeusts per iteration.
Note: Validators will only accept blobs within the current verifiable epoch (epoch the validator has a leader schedule for).
2. Preemptive Slot Repair (Addresses Challenge #2):
The goal of this protocol is to discover the chaining relationship of "orphan" slots that do not currently chain to any known fork.
* Blocktree will track the set of "orphan" slots in a separate column family.
* RepairService will periodically make `RequestOrphan` requests for each of the orphans in blocktree.
`RequestOrphan(orphan)` request - `orphan` is the orphan slot that the requestor wants to know the parents of
`RequestOrphan(orphan)` response - The highest blobs for each of the first `N` parents of the requested `orphan`
On receiving the responses `p`, where `p` is some blob in a parent slot, validators will:
* Insert an empty `SlotMeta` in blocktree for `p.slot` if it doesn't already exist.
* If `p.slot` does exist, update the parent of `p` based on `parents`
Note: that once these empty slots are added to blocktree, the `Blob Repair` protocol should attempt to fill those slots.
Note: Validators will only accept responses containing blobs within the current verifiable epoch (epoch the validator has a leader schedule for).
3. Repairmen (Addresses Challenge #3):
This part of the repair protocol is the primary mechanism by which new nodes joining the cluster catch up after loading a snapshot. This protocol works in a "forward" fashion, so validators can verify every blob that they receive against a known leader schedule.
Each validator advertises in gossip:
* Current root
* The set of all completed slots in the confirmed epochs (an epoch that was calculated based on a bank <= current root) past the current root
Observers of this gossip message with higher epochs (repairmen) send blobs to catch the lagging node up with the rest of the cluster. The repairmen are responsible for sending the slots within the epochs that are confrimed by the advertised `root` in gossip. The repairmen divide the responsibility of sending each of the missing slots in these epochs based on a random seed (simple blob.index iteration by N, seeded with the repairman's node_pubkey). Ideally, each repairman in an N node cluster (N nodes whose epochs are higher than that of the repairee) sends 1/N of the missing blobs. Both data and coding blobs for missing slots are sent. Repairmen do not send blobs again to the same validator until they see the message in gossip updated, at which point they perform another iteration of this protocol.
Gossip messages are updated every time a validator receives a complete slot within the epoch. Completed slots are detected by blocktree and sent over a channel to RepairService. It is important to note that we know that by the time a slot X is complete, the epoch schedule must exist for the epoch that contains slot X because WindowService will reject blobs for unconfirmed epochs. When a newly completed slot is detected, we also update the current root if it has changed since the last update. The root is made available to RepairService through Blocktree, which holds the latest root.

View File

@ -67,7 +67,7 @@ data array and assign it to a Program.
* `Assign` - Allows the user to assign an existing account to a program.
* `Move` - Moves lamports between accounts.
* `Transfer` - Transfers lamports between accounts.
## Program State Security

View File

@ -0,0 +1,172 @@
# Simple Payment and State Verification
It is often useful to allow low resourced clients to participate in a Solana
cluster. Be this participation economic or contract execution, verification
that a client's activity has been accepted by the network is typically
expensive. This proposal lays out a mechanism for such clients to confirm that
their actions have been committed to the ledger state with minimal resource
expenditure and third-party trust.
## A Naive Approach
Validators store the signatures of recently confirmed transactions for a short
period of time to ensure that they are not processed more than once. Validators
provide a JSON RPC endpoint, which clients can use to query the cluster if a
transaction has been recently processed. Validators also provide a PubSub
notification, whereby a client registers to be notified when a given signature
is observed by the validator. While these two mechanisms allow a client to
verify a payment, they are not a proof and rely on completely trusting a
fullnode.
We will describe a way to minimize this trust using Merkle Proofs to anchor the
fullnode's response in the ledger, allowing the client to confirm on their own
that a sufficient number of their preferred validators have confirmed a
transaction. Requiring multiple validator attestations further reduces trust in
the fullnode, as it increases both the technical and economic difficulty of
compromising several other network participants.
## Light Clients
A 'light client' is a cluster participant that does not itself run a fullnode.
This light client would provide a level of security greater than trusting a
remote fullnode, without requiring the light client to spend a lot of resources
verifying the ledger.
Rather than providing transaction signatures directly to a light client, the
fullnode instead generates a Merkle Proof from the transaction of interest to
the root of a Merkle Tree of all transactions in the including block. This Merkle
Root is stored in a ledger entry which is voted on by validators, providing it
consensus legitimacy. The additional level of security for a light client depends
on an initial canonical set of validators the light client considers to be the
stakeholders of the cluster. As that set is changed, the client can update its
internal set of known validators with [receipts](#receipts). This may become
challenging with a large number of delegated stakes.
Fullnodes themselves may want to use light client APIs for performance reasons.
For example, during the initial launch of a fullnode, the fullnode may use a
cluster provided checkpoint of the state and verify it with a receipt.
## Receipts
A receipt is a minimal proof that; a transaction has been included in a block,
that the block has been voted on by the client's preferred set of validators and
that the votes have reached the desired confirmation depth.
The receipts for both state and payments start with a Merkle Path from the
value into a Bank-Merkle that has been voted on and included in the ledger. A
chain of PoH Entries containing subsequent validator votes, deriving from the
Bank-Merkle, is the confirmation proof.
Clients can examine this ledger data and compute the finality using Solana's fork
selection rules.
### Payment Merkle Path
A payment receipt is a data structure that contains a Merkle Path from a
transaction to the required set of validator votes.
An Entry-Merkle is a Merkle Root including all transactions in the entry, sorted
by signature.
<img alt="Block Merkle Diagram" src="img/spv-block-merkle.svg" class="center"/>
A Block-Merkle is a Merkle root of all the Entry-Merkles sequenced in the block.
Transaction status is necessary for the receipt because the state receipt is
constructed for the block. Two transactions over the same state can appear in
the block, and therefore, there is no way to infer from just the state whether a
transaction that is committed to the ledger has succeeded or failed in modifying
the intended state. It may not be necessary to encode the full status code, but
a single status bit to indicate the transaction's success.
### State Merkle Path
A state receipt provides a confirmation that a specific state is committed at the
end of the block. Inter-block state transitions do not generate a receipt.
For example:
* A sends 5 Lamports to B
* B spends 5 Lamports
* C sends 5 Lamports to A
At the end of the block, A and B are in the exact same starting state, and any
state receipt would point to the same value for A or B.
The Bank-Merkle is computed from the Merkle Tree of the new state changes, along
with the Previous Bank-Merkle, and the Block-Merkle.
<img alt="Bank Merkle Diagram" src="img/spv-bank-merkle.svg" class="center"/>
A state receipt contains only the state changes occurring in the block. A direct
Merkle Path to the current Bank-Merkle guarantees the state value at that bank
hash, but it cannot be used to generate a “current” receipt to the latest state
if the state modification occurred in some previous block. There is no guarantee
that the path provided by the validator is the latest one available out of all
the previous Bank-Merkles.
Clients that want to query the chain for a receipt of the "latest" state would
need to create a transaction that would update the Merkle Path for that account,
such as a credit of 0 Lamports.
### Validator Votes
Leaders should coalesce the validator votes by stake weight into a single entry.
This will reduce the number of entries necessary to create a receipt.
### Chain of Entries
A receipt has a PoH link from the payment or state Merkle Path root to a list of
consecutive validation votes.
It contains the following:
* State -> Bank-Merkle
or
* Transaction -> Entry-Merkle -> Block-Merkle -> Bank-Merkle
And a vector of PoH entries:
* Validator vote entries
* Ticks
* Light entries
```rust,ignore
/// This Entry definition skips over the transactions and only contains the
/// hash of the transactions used to modify PoH.
LightEntry {
/// The number of hashes since the previous Entry ID.
pub num_hashes: u64,
/// The SHA-256 hash `num_hashes` after the previous Entry ID.
hash: Hash,
/// The Merkle Root of the transactions encoded into the Entry.
entry_hash: Hash,
}
```
The light entries are reconstructed from Entries and simply show the entry Merkle
Root that was mixed in to the PoH hash, instead of the full transaction set.
Clients do not need the starting vote state. The [fork selection](book/src/fork-selection.md) algorithm is
defined such that only votes that appear after the transaction provide finality
for the transaction, and finality is independent of the starting state.
### Verification
A light client that is aware of the supermajority set validators can verify a
receipt by following the Merkle Path to the PoH chain. The Bank-Merkle is the
Merkle Root and will appear in votes included in an Entry. The light client can
simulate [fork selection](book/src/fork-selection.md) for the consecutive votes
and verify that the receipt is confirmed at the desired lockout threshold.
### Synthetic State
Synthetic state should be computed into the Bank-Merkle along with the bank
generated state.
For example:
* Epoch validator accounts and their stakes and weights.
* Computed fee rates
These values should have an entry in the Bank-Merkle. They should live under
known accounts, and therefore have an exact address in the Merkle Path.

View File

@ -1,68 +1,197 @@
# Stake Delegation and Rewards
Stakers are rewarded for helping validate the ledger. They do it by delegating
their stake to fullnodes. Those fullnodes do the legwork and send votes to the
stakers' staking accounts. The rest of the cluster uses those stake-weighted
votes to select a block when forks arise. Both the fullnode and staker need
some economic incentive to play their part. The fullnode needs to be
compensated for its hardware and the staker needs to be compensated for risking
getting its stake slashed. The economics are covered in [staking
Stakers are rewarded for helping to validate the ledger. They do this by
delegating their stake to validator nodes. Those validators do the legwork of
replaying the ledger and send votes to a per-node vote account to which stakers
can delegate their stakes. The rest of the cluster uses those stake-weighted
votes to select a block when forks arise. Both the validator and staker need
some economic incentive to play their part. The validator needs to be
compensated for its hardware and the staker needs to be compensated for the risk
of getting its stake slashed. The economics are covered in [staking
rewards](staking-rewards.md). This chapter, on the other hand, describes the
underlying mechanics of its implementation.
## Vote and Rewards accounts
## Basic Design
The rewards process is split into two on-chain programs. The Vote program
solves the problem of making stakes slashable. The Rewards account acts as
custodian of the rewards pool. It is responsible for paying out each staker
once the staker proves to the Rewards program that it participated in
validating the ledger.
The general idea is that the validator owns a Vote account. The Vote account
tracks validator votes, counts validator generated credits, and provides any
additional validator specific state. The Vote account is not aware of any
stakes delegated to it and has no staking weight.
The Vote account contains the following state information:
A separate Stake account (created by a staker) names a Vote account to which the
stake is delegated. Rewards generated are proportional to the amount of
lamports staked. The Stake account is owned by the staker only. Some portion of the lamports
stored in this account are the stake.
* votes - The submitted votes.
## Passive Delegation
* `delegate_id` - An identity that may operate with the weight of this
account's stake. It is typically the identity of a fullnode, but may be any
identity involved in stake-weighted computations.
Any number of Stake accounts can delegate to a single
Vote account without an interactive action from the identity controlling
the Vote account or submitting votes to the account.
* `authorized_voter_id` - Only this identity is authorized to submit votes.
The total stake allocated to a Vote account can be calculated by the sum of
all the Stake accounts that have the Vote account pubkey as the
`StakeState::Stake::voter_pubkey`.
* `credits` - The amount of unclaimed rewards.
## Vote and Stake accounts
* `root_slot` - The last slot to reach the full lockout commitment necessary
for rewards.
The rewards process is split into two on-chain programs. The Vote program solves
the problem of making stakes slashable. The Stake account acts as custodian of
the rewards pool, and provides passive delegation. The Stake program is
responsible for paying out each staker once the staker proves to the Stake
program that its delegate has participated in validating the ledger.
The Rewards program is stateless and pays out reward when a staker submits its
Vote account to the program. Claiming a reward requires a transaction that
includes the following instructions:
### VoteState
1. `RewardsInstruction::RedeemVoteCredits`
2. `VoteInstruction::ClearCredits`
VoteState is the current state of all the votes the validator has submitted to
the network. VoteState contains the following state information:
The Rewards program transfers lamports from the Rewards account to the Vote
account's public key. The Rewards program also ensures that the `ClearCredits`
instruction follows the `RedeemVoteCredits` instruction, such that a staker may
not claim rewards for the same work more than once.
* `votes` - The submitted votes data structure.
* `credits` - The total number of rewards this vote program has generated over its
lifetime.
### Delegating Stake
* `root_slot` - The last slot to reach the full lockout commitment necessary for
rewards.
`VoteInstruction::DelegateStake` allows the staker to choose a fullnode to
validate the ledger on its behalf. By being a delegate, the fullnode is
entitled to collect transaction fees when its is leader. The larger the stake,
the more often the fullnode will be able to collect those fees.
* `commission` - The commission taken by this VoteState for any rewards claimed by
staker's Stake accounts. This is the percentage ceiling of the reward.
### Authorizing a Vote Signer
* Account::lamports - The accumulated lamports from the commission. These do not
count as stakes.
`VoteInstruction::AuthorizeVoter` allows a staker to choose a signing service
* `authorized_vote_signer` - Only this identity is authorized to submit votes. This field can only modified by this identity.
### VoteInstruction::Initialize
* `account[0]` - RW - The VoteState
`VoteState::authorized_vote_signer` is initialized to `account[0]`
other VoteState members defaulted
### VoteInstruction::AuthorizeVoteSigner(Pubkey)
* `account[0]` - RW - The VoteState
`VoteState::authorized_vote_signer` is set to to `Pubkey`, the transaction must by
signed by the Vote account's current `authorized_vote_signer`. <br>
`VoteInstruction::AuthorizeVoter` allows a staker to choose a signing service
for its votes. That service is responsible for ensuring the vote won't cause
the staker to be slashed.
## Limitations
Many stakers may delegate their stakes to the same fullnode. The fullnode must
send a separate vote to each staking account. If there are far more stakers
than fullnodes, that's a lot of network traffic. An alternative design might
have fullnodes submit each vote to just one account and then have each staker
submit that account along with their own to collect its reward.
### VoteInstruction::Vote(Vec<Vote>)
* `account[0]` - RW - The VoteState
`VoteState::lockouts` and `VoteState::credits` are updated according to voting lockout rules see [Tower BFT](tower-bft.md)
* `account[1]` - RO - A list of some N most recent slots and their hashes for the vote to be verified against.
### StakeState
A StakeState takes one of three forms, StakeState::Uninitialized, StakeState::Stake and StakeState::RewardsPool.
### StakeState::Stake
StakeState::Stake is the current delegation preference of the **staker** and
contains the following state information:
* Account::lamports - The lamports available for staking.
* `stake` - the staked amount (subject to warm up and cool down) for generating rewards, always less than or equal to Account::lamports
* `voter_pubkey` - The pubkey of the VoteState instance the lamports are
delegated to.
* `credits_observed` - The total credits claimed over the lifetime of the
program.
* `activated` - the epoch at which this stake was activated/delegated. The full stake will be counted after warm up.
* `deactivated` - the epoch at which this stake will be completely de-activated, which is `cool down` epochs after StakeInstruction::Deactivate is issued.
### StakeState::RewardsPool
To avoid a single network wide lock or contention in redemption, 256 RewardsPools are part of genesis under pre-determined keys, each with std::u64::MAX credits to be able to satisfy redemptions according to point value.
The Stakes and the RewardsPool are accounts that are owned by the same `Stake` program.
### StakeInstruction::DelegateStake(u64)
The Stake account is moved from Uninitialized to StakeState::Stake form. This is
how stakers choose their initial delegate validator node and activate their
stake account lamports.
* `account[0]` - RW - The StakeState::Stake instance. <br>
`StakeState::Stake::credits_observed` is initialized to `VoteState::credits`,<br>
`StakeState::Stake::voter_pubkey` is initialized to `account[1]`,<br>
`StakeState::Stake::stake` is initialized to the u64 passed as an argument above,<br>
`StakeState::Stake::activated` is initialized to current Bank epoch, and<br>
`StakeState::Stake::deactivated` is initialized to std::u64::MAX
* `account[1]` - R - The VoteState instance.
* `account[2]` - R - syscall::current account, carries information about current Bank epoch
### StakeInstruction::RedeemVoteCredits
The staker or the owner of the Stake account sends a transaction with this
instruction to claim rewards.
The Vote account and the Stake account pair maintain a lifetime counter of total
rewards generated and claimed. Rewards are paid according to a point value
supplied by the Bank from inflation. A `point` is one credit * one staked
lamport, rewards paid are proportional to the number of lamports staked.
* `account[0]` - RW - The StakeState::Stake instance that is redeeming rewards.
* `account[1]` - R - The VoteState instance, must be the same as `StakeState::voter_pubkey`
* `account[2]` - RW - The StakeState::RewardsPool instance that will fulfill the request (picked at random).
* `account[3]` - R - syscall::rewards account from the Bank that carries point value.
Reward is paid out for the difference between `VoteState::credits` to
`StakeState::Stake::credits_observed`, multiplied by `syscall::rewards::Rewards::validator_point_value`.
`StakeState::Stake::credits_observed` is updated to`VoteState::credits`. The commission is deposited into the Vote account token
balance, and the reward is deposited to the Stake account token balance.
```rust,ignore
let credits_to_claim = vote_state.credits - stake_state.credits_observed;
stake_state.credits_observed = vote_state.credits;
```
`credits_to_claim` is used to compute the reward and commission, and
`StakeState::Stake::credits_observed` is updated to the latest
`VoteState::credits` value.
### StakeInstruction::Deactivate
A staker may wish to withdraw from the network. To do so he must first deactivate his stake, and wait for cool down.
* `account[0]` - RW - The StakeState::Stake instance that is deactivating, the transaction must be signed by this key.
* `account[1]` - R - syscall::current account from the Bank that carries current epoch
StakeState::Stake::deactivated is set to the current epoch + cool down. The account's stake will ramp down to zero by
that epoch, and Account::lamports will be available for withdrawal.
### StakeInstruction::Withdraw(u64)
Lamports build up over time in a Stake account and any excess over activated stake can be withdrawn.
* `account[0]` - RW - The StakeState::Stake from which to withdraw, the transaction must be signed by this key.
* `account[1]` - RW - Account that should be credited with the withdrawn lamports.
* `account[2]` - R - syscall::current account from the Bank that carries current epoch, to calculate stake.
## Benefits of the design
* Single vote for all the stakers.
* Clearing of the credit variable is not necessary for claiming rewards.
* Each delegated stake can claim its rewards independently.
* Commission for the work is deposited when a reward is claimed by the delegated
stake.
## Example Callflow
<img alt="Passive Staking Callflow" src="img/passive-staking-callflow.svg" class="center"/>

View File

@ -1,8 +1,8 @@
# Staking Rewards
Initial Proof of Stake (PoS) (i.e. using in-protocol asset, SOL, to provide
secure consensus) design ideas outlined here. Solana will implement a proof of
stake reward/security scheme for node validators in the cluster. The purpose is
A Proof of Stake (PoS), (i.e. using in-protocol asset, SOL, to provide
secure consensus) design is outlined here. Solana implements a proof of
stake reward/security scheme for validator nodes in the cluster. The purpose is
threefold:
- Align validator incentives with that of the greater cluster through
@ -48,7 +48,7 @@ specific parameters will be necessary:
Solana's trustless sense of time and ordering provided by its PoH data
structure, along with its
[avalanche](https://www.youtube.com/watch?v=qt_gDRXHrHQ&t=1s) data broadcast
[turbine](https://www.youtube.com/watch?v=qt_gDRXHrHQ&t=1s) data broadcast
and transmission design, should provide sub-second transaction confirmation times that scale
with the log of the number of nodes in the cluster. This means we shouldn't
have to restrict the number of validating nodes with a prohibitive 'minimum
@ -64,7 +64,7 @@ capital-at-risk to prevent a logical/optimal strategy of multiple chain voting.
We intend to implement slashing rules which, if broken, result some amount of
the offending validator's deposited stake to be removed from circulation. Given
the ordering properties of the PoH data structure, we believe we can simplify
our slashing rules to the level of a voting lockout time assigned per vote.
our slashing rules to the level of a voting lockout time assigned per vote.
I.e. Each vote has an associated lockout time (PoH duration) that represents a
duration by any additional vote from that validator must be in a PoH that
@ -110,7 +110,7 @@ in a slashable amount as a function of either:
1. the fraction of validators, out of the total validator pool, that were also
slashed during the same time period (ala Casper)
2. the amount of time since the vote was cast (e.g. a linearly increasing % of
total deposited as slashable amount over time), or both.
total deposited as slashable amount over time), or both.
This is an area currently under exploration

View File

@ -91,6 +91,10 @@ History](#proof-of-history).
The time, i.e. number of [slots](#slot), for which a [leader
schedule](#leader-schedule) is valid.
#### finality
When nodes representing 2/3rd of the stake have a common [root](#root).
#### fork
A [ledger](#ledger) derived from common entries but then diverged.
@ -213,6 +217,15 @@ The public key of a [keypair](#keypair).
Storage mining client, stores some part of the ledger enumerated in blocks and
submits storage proofs to the chain. Not a full-node.
#### root
A [block](#block) or [slot](#slot) that has reached maximum [lockout](#lockout)
on a validator. The root is the highest block that is an ancestor of all active
forks on a validator. All ancestor blocks of a root are also transitively a
root. Blocks that are not an ancestor and not a descendant of the root are
excluded from consideration for consensus and can be discarded.
#### runtime
The component of a [fullnode](#fullnode) responsible for [program](#program)

View File

@ -15,39 +15,43 @@ reasons:
* The cluster rolled back the ledger
* A validator responded to queries maliciously
### The Transact Trait
### The AsyncClient and SyncClient Traits
To troubleshoot, the application should retarget a lower-level component, where
fewer errors are possible. Retargeting can be done with different
implementations of the Transact trait.
implementations of the AsyncClient and SyncClient traits.
When Futures 0.3.0 is released, the Transact trait may look like this:
Components implement the following primary methods:
```rust,ignore
trait Transact {
async fn send_transactions(txs: &[Transaction]) -> Vec<Result<(), TransactionError>>;
trait AsyncClient {
fn async_send_transaction(&self, transaction: Transaction) -> io::Result<Signature>;
}
trait SyncClient {
fn get_signature_status(&self, signature: &Signature) -> Result<Option<transaction::Result<()>>>;
}
```
Users send transactions and asynchrounously await their results.
Users send transactions and asynchrounously and synchrounously await results.
#### Transact with Clusters
#### ThinClient for Clusters
The highest level implementation targets a Solana cluster, which may be a
deployed testnet or a local cluster running on a development machine.
The highest level implementation, ThinClient, targets a Solana cluster, which
may be a deployed testnet or a local cluster running on a development machine.
#### Transact with the TPU
#### TpuClient for the TPU
The next level is the TPU implementation of Transact. At the TPU level, the
application sends transactions over Rust channels, where there can be no
surprises from network queues or dropped packets. The TPU implements all
"normal" transaction errors. It does signature verification, may report
The next level is the TPU implementation, which is not yet implemented. At the
TPU level, the application sends transactions over Rust channels, where there
can be no surprises from network queues or dropped packets. The TPU implements
all "normal" transaction errors. It does signature verification, may report
account-in-use errors, and otherwise results in the ledger, complete with proof
of history hashes.
### Low-level testing
### Testing with the Bank
#### BankClient for the Bank
Below the TPU level is the Bank. The Bank doesn't do signature verification or
generate a ledger. The Bank is a convenient layer at which to test new on-chain

View File

@ -1,136 +1,284 @@
## Testnet Participation
This document describes how to participate in the beta testnet as a
This document describes how to participate in the testnet as a
validator node.
Please note some of the information and instructions described here may change
in future releases.
### Beta Testnet Overview
The beta testnet features a validator running at beta.testnet.solana.com, which
### Overview
The testnet features a validator running at testnet.solana.com, which
serves as the entrypoint to the cluster for your validator.
Additionally there is a blockexplorer available at http://beta.testnet.solana.com/.
Additionally there is a blockexplorer available at
[http://testnet.solana.com/](http://testnet.solana.com/).
The beta testnet is configured to reset the ledger every 24hours, or sooner
should an hourly automated sanity test fail.
The testnet is configured to reset the ledger daily, or sooner
should the hourly automated cluster sanity test fail.
There is a **#validator-support** Discord channel available to reach other
testnet participants, [https://discord.gg/pquxPsq](https://discord.gg/pquxPsq).
Also we'd love it if you choose to register your validator node with us at
[https://forms.gle/LfFscZqJELbuUP139](https://forms.gle/LfFscZqJELbuUP139).
### Machine Requirements
Since the beta testnet is not intended for stress testing of max transaction
Since the testnet is not intended for stress testing of max transaction
throughput, a higher-end machine with a GPU is not necessary to participate.
However ensure the machine used is not behind a residential NAT to avoid NAT
traversal issues. A cloud-hosted machine works best. Ensure that IP ports
8000 through 10000 are not blocked for Internet traffic.
traversal issues. A cloud-hosted machine works best. **Ensure that IP ports
8000 through 10000 are not blocked for Internet inbound and outbound traffic.**
Prebuilt binaries are available for Linux x86_64 (Ubuntu 18.04 recommended).
MacOS or WSL users may build from source.
For a performance testnet with many transactions we have some preliminary recommended setups:
| | Low end | Medium end | High end | Notes |
| --- | ---------|------------|----------| -- |
| CPU | AMD Threadripper 1900x | AMD Threadripper 2920x | AMD Threadripper 2950x | Consider a 10Gb-capable motherboard with as many PCIe lanes and m.2 slots as possible. |
| RAM | 16GB | 32GB | 64GB | |
| OS Drive | Samsung 860 Evo 2TB | Samsung 860 Evo 4TB | Samsung 860 Evo 4TB | Or equivalent SSD |
| Accounts Drive(s) | None | Samsung 970 Pro 1TB | 2x Samsung 970 Pro 1TB | |
| GPU | 4x Nvidia 1070 or 2x Nvidia 1080 Ti or 2x Nvidia 2070 | 2x Nvidia 2080 Ti | 4x Nvidia 2080 Ti | Any number of cuda-capable GPUs are supported on Linux platforms. |
#### GPU Requirements
CUDA is required to make use of the GPU on your system. The provided Solana
release binaries are built on Ubuntu 18.04 with <a
href="https://developer.nvidia.com/cuda-toolkit-archive">CUDA Toolkit 10.1
update 1"</a>. If your machine is using a different CUDA version then you will
need to rebuild from source.
#### Confirm The Testnet Is Reachable
Before attaching a validator node, sanity check that the cluster is accessible
to your machine by running some simple commands. If any of the commands fail,
please retry 5-10 minutes later to confirm the testnet is not just restarting
itself before debugging further.
Fetch the current transaction count over JSON RPC:
```bash
$ curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1, "method":"getTransactionCount"}' http://testnet.solana.com:8899
```
Inspect the blockexplorer at [http://testnet.solana.com/](http://testnet.solana.com/) for activity.
View the [metrics dashboard](
https://metrics.solana.com:3000/d/testnet-beta/testnet-monitor-beta?var-testnet=testnet)
for more detail on cluster activity.
### Validator Setup
#### Obtaining The Software
##### Bootstrap with `solana-install`
The `solana-install` tool can be used to easily install and upgrade the cluster
software on Linux x86_64 systems.
software on Linux x86_64 and mac OS systems.
Install the latest release with a single shell command:
```bash
$ curl -sSf https://raw.githubusercontent.com/solana-labs/solana/v0.13.0/install/solana-install-init.sh | \
sh -c - --url https://api.beta.testnet.solana.com
$ curl -sSf https://raw.githubusercontent.com/solana-labs/solana/v0.17.0/install/solana-install-init.sh | sh -s
```
Alternatively build the `solana-install` program from source and run the
following command to obtain the same result:
```bash
$ solana-install init --url https://api.beta.testnet.solana.com
$ solana-install init
```
After a successful install, `solana-install update` may be used to easily update the cluster
software to a newer version.
software to a newer version at any time.
##### Download Prebuilt Binaries
Binaries are available for Linux x86_64 systems.
If you would rather not use `solana-install` to manage the install, you can manually download and install the binaries.
Download the binaries by navigating to https://github.com/solana-labs/solana/releases/latest, download
**solana-release-x86_64-unknown-linux-gnu.tar.bz2**, then extract the archive:
###### Linux
Download the binaries by navigating to
[https://github.com/solana-labs/solana/releases/latest](https://github.com/solana-labs/solana/releases/latest),
download **solana-release-x86_64-unknown-linux-gnu.tar.bz2**, then extract the
archive:
```bash
$ tar jxf solana-release-x86_64-unknown-linux-gnu.tar.bz2
$ cd solana-release/
$ export PATH=$PWD/bin:$PATH
```
##### Build From Source
If you are unable to use the prebuilt binaries or prefer to build it yourself from source, navigate to:
> https://github.com/solana-labs/solana/releases/latest
###### mac OS
Download the binaries by navigating to
[https://github.com/solana-labs/solana/releases/latest](https://github.com/solana-labs/solana/releases/latest),
download **solana-release-x86_64-apple-darwin.tar.bz2**, then extract the
archive:
```bash
$ tar jxf solana-release-x86_64-apple-darwin.tar.bz2
$ cd solana-release/
$ export PATH=$PWD/bin:$PATH
```
Download the source code tarball (solana-*[release]*.tar.gz) from our latest release tag. Extract the code and build the binaries with:
##### Build From Source
If you are unable to use the prebuilt binaries or prefer to build it yourself
from source, navigate to
[https://github.com/solana-labs/solana/releases/latest](https://github.com/solana-labs/solana/releases/latest),
and download the **Source Code** archive. Extract the code and build the
binaries with:
```bash
$ ./scripts/cargo-install-all.sh .
$ export PATH=$PWD/bin:$PATH
```
#### Confirm The Testnet Is Reachable
Before attaching a validator node, sanity check that the cluster is accessible
to your machine by running some simple wallet commands. If any of these
commands fail, please retry 5-10 minutes later to confirm the testnet is not
just restarting itself before debugging further.
Receive an airdrop of lamports from the testnet drone:
If building for CUDA (Linux only), fetch the perf-libs first then include the
`cuda` feature flag when building:
```bash
$ solana-wallet -n beta.testnet.solana.com airdrop 123
$ solana-wallet -n beta.testnet.solana.com balance
```
Fetch the current testnet transaction count over JSON RPC:
```bash
$ curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1, "method":"getTransactionCount"}' http://beta.testnet.solana.com:8899
```
Inspect the blockexplorer at http://beta.testnet.solana.com/ for activity.
Run the following command to join the gossip network and view all the other nodes in the cluster:
```bash
$ solana-gossip --network beta.testnet.solana.com:8001
$ ./fetch-perf-libs.sh
$ source ./target/perf-libs/env.sh
$ ./scripts/cargo-install-all.sh . cuda
$ export PATH=$PWD/bin:$PATH
```
### Starting The Validator
The following command will start a new validator node.
Sanity check that you are able to interact with the cluster by receiving a small
airdrop of lamports from the testnet drone:
```bash
$ solana-wallet airdrop 123
$ solana-wallet balance
```
Also try running following command to join the gossip network and view all the other nodes in the cluster:
```bash
$ solana-gossip --entrypoint testnet.solana.com:8001 spy
# Press ^C to exit
```
Now configure a key pair for your validator by running:
```bash
$ solana-keygen new -o ~/validator-keypair.json
```
Then use one of the following commands, depending on your installation
choice, to start the node:
If this is a `solana-install`-installation:
```bash
$ fullnode-x.sh --public-address --poll-for-new-genesis-block beta.testnet.solana.com:8001
$ validator.sh --identity ~/validator-keypair.json --config-dir ~/validator-config --rpc-port 8899 --poll-for-new-genesis-block testnet.solana.com
```
Alternatively, the `solana-install run` command can be used to run the validator
node while periodically checking for and applying software updates:
```bash
$ solana-install run fullnode-x.sh --public-address --poll-for-new-genesis-block beta.testnet.solana.com:8001
$ solana-install run validator.sh -- --identity ~/validator-keypair.json --config-dir ~/validator-config --rpc-port 8899 --poll-for-new-genesis-block testnet.solana.com
```
When not using `solana-install`:
If you built from source:
```bash
$ USE_INSTALL=1 ./multinode-demo/fullnode-x.sh --public-address --poll-for-new-genesis-block beta.testnet.solana.com:8001
$ NDEBUG=1 USE_INSTALL=1 ./multinode-demo/validator.sh --identity ~/validator-keypair.json --rpc-port 8899 --poll-for-new-genesis-block testnet.solana.com
```
Then from another console, confirm the IP address if your node is now visible in
the gossip network by running:
#### Enabling CUDA
By default CUDA is disabled. If your machine has a GPU with CUDA installed,
define the SOLANA_CUDA flag in your environment *before* running any of the
previusly mentioned commands
```bash
$ solana-gossip --network beta.testnet.solana.com:8001
$ export SOLANA_CUDA=1
```
Congratulations, you're now participating in the testnet cluster!
When your validator is started look for the following log message to indicate that CUDA is enabled:
`"[<timestamp> solana::validator] CUDA is enabled"`
#### Controlling local network port allocation
By default the validator will dynamically select available network ports in the
8000-10000 range, and may be overridden with `--dynamic-port-range`. For
example, `fullnode-x.sh --dynamic-port-range 11000-11010 ...` will restrict the
example, `validator.sh --dynamic-port-range 11000-11010 ...` will restrict the
validator to ports 11000-11011.
### Sharing Metrics From Your Validator
If you'd like to share metrics perform the following steps before starting the
validator node:
### Validator Monitoring
When `validator.sh` starts, it will output a validator configuration that looks
similar to:
```bash
export u="username obtained from the Solana maintainers"
export p="password obtained from the Solana maintainers"
export SOLANA_METRICS_CONFIG="db=testnet-beta,u=${u:?},p=${p:?}"
source scripts/configure-metrics.sh
======================[ validator configuration ]======================
identity pubkey: 4ceWXsL3UJvn7NYZiRkw7NsryMpviaKBDYr8GK7J61Dm
vote pubkey: 2ozWvfaXQd1X6uKh8jERoRGApDqSqcEy6fF1oN13LL2G
ledger: ...
accounts: ...
======================================================================
```
Inspect for your contributions to our [metrics dashboard](https://metrics.solana.com:3000/d/U9-26Cqmk/testnet-monitor-cloud?refresh=60s&orgId=2&var-hostid=All).
The **identity pubkey** for your validator can also be found by running:
```bash
$ solana-keygen pubkey ~/validator-keypair.json
```
From another console, confirm the IP address and **identity pubkey** of your validator is visible in the
gossip network by running:
```bash
$ solana-gossip --entrypoint testnet.solana.com:8001 spy
```
Provide the **vote pubkey** to the `solana-wallet show-vote-account` command to view
the recent voting activity from your validator:
```bash
$ solana-wallet show-vote-account 2ozWvfaXQd1X6uKh8jERoRGApDqSqcEy6fF1oN13LL2G
```
The vote pubkey for the validator can also be found by running:
```bash
# If this is a `solana-install`-installation run:
$ solana-keygen pubkey ~/.local/share/solana/install/active_release/config-local/validator-vote-keypair.json
# Otherwise run:
$ solana-keygen pubkey ./config-local/validator-vote-keypair.json
```
#### Validator Metrics
Metrics are available for local monitoring of your validator.
Docker must be installed and the current user added to the docker group. Then
download `solana-metrics.tar.bz2` from the Github Release and run
```bash
$ tar jxf solana-metrics.tar.bz2
$ cd solana-metrics/
$ ./start.sh
```
A local InfluxDB and Grafana instance is now running on your machine. Define
`SOLANA_METRICS_CONFIG` in your environment as described at the end of the
`start.sh` output and restart your validator.
Metrics should now be streaming and visible from your local Grafana dashboard.
#### Timezone For Log Messages
Log messages emitted by your validator include a timestamp. When sharing logs
with others to help triage issues, that timestamp can cause confusion as it does
not contain timezone information.
To make it easier to compare logs between different sources we request that
everybody use Pacific Time on their validator nodes. In Linux this can be
accomplished by running:
```bash
$ sudo ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
```
#### Publishing Validator Info
You can publish your validator information to the chain to be publicly visible
to other users.
Run the solana-validator-info CLI to populate a validator-info account:
```bash
$ solana-validator-info publish ~/validator-keypair.json <VALIDATOR_NAME> <VALIDATOR_INFO_ARGS>
```
Optional fields for VALIDATOR_INFO_ARGS:
* Website
* Keybase Username
* Details
##### Keybase
Including a Keybase username allows client applications (like the Solana Network
Explorer) to automatically pull in your validator public profile, including
cryptographic proofs, brand identity, etc. To connect your validator pubkey with
Keybase:
1. Join https://keybase.io/ and complete the profile for your validator
2. Add your validator **identity pubkey** to Keybase:
* Create an empty file on your local computer called `validator-<PUBKEY>`
* In Keybase, navigate to the Files section, and upload your pubkey file to
a `solana` subdirectory in your public folder: `/keybase/public/<KEYBASE_USERNAME>/solana`
* To check your pubkey, ensure you can successfully browse to
`https://keybase.pub/<KEYBASE_USERNAME>/solana/validator-<PUBKEY>`
3. Add or update your `solana-validator-info` with your Keybase username. The
CLI will verify the `validator-<PUBKEY>` file

View File

@ -0,0 +1,153 @@
## Testnet Replicator
This document describes how to setup a replicator in the testnet
Please note some of the information and instructions described here may change
in future releases.
### Overview
Replicators are specialized light clients. They download a part of the
ledger (a.k.a Segment) and store it. They earn rewards for storing segments.
The testnet features a validator running at testnet.solana.com, which
serves as the entrypoint to the cluster for your replicator node.
Additionally there is a blockexplorer available at
[http://testnet.solana.com/](http://testnet.solana.com/).
The testnet is configured to reset the ledger daily, or sooner
should the hourly automated cluster sanity test fail.
### Machine Requirements
Replicators don't need specialized hardware. Anything with more than
128GB of disk space will be able to participate in the cluster as a replicator node.
Currently the disk space requirements are very low but we expect them to change
in the future.
Prebuilt binaries are available for Linux x86_64 (Ubuntu 18.04 recommended),
macOS, and Windows.
#### Confirm The Testnet Is Reachable
Before starting a replicator node, sanity check that the cluster is accessible
to your machine by running some simple commands. If any of the commands fail,
please retry 5-10 minutes later to confirm the testnet is not just restarting
itself before debugging further.
Fetch the current transaction count over JSON RPC:
```bash
$ curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1, "method":"getTransactionCount"}' http://testnet.solana.com:8899
```
Inspect the blockexplorer at [http://testnet.solana.com/](http://testnet.solana.com/) for activity.
View the [metrics dashboard](
https://metrics.solana.com:3000/d/testnet-beta/testnet-monitor-beta?var-testnet=testnet)
for more detail on cluster activity.
### Replicator Setup
##### Obtaining The Software
##### Bootstrap with `solana-install`
The `solana-install` tool can be used to easily install and upgrade the cluster
software.
##### Linux and mac OS
```bash
$ curl -sSf https://raw.githubusercontent.com/solana-labs/solana/v0.17.0/install/solana-install-init.sh | sh -s
```
Alternatively build the `solana-install` program from source and run the
following command to obtain the same result:
```bash
$ solana-install init
```
##### Windows
Download and install **solana-install-init** from
[https://github.com/solana-labs/solana/releases/latest](https://github.com/solana-labs/solana/releases/latest)
After a successful install, `solana-install update` may be used to
easily update the software to a newer version at any time.
##### Download Prebuilt Binaries
If you would rather not use `solana-install` to manage the install, you can manually download and install the binaries.
##### Linux
Download the binaries by navigating to
[https://github.com/solana-labs/solana/releases/latest](https://github.com/solana-labs/solana/releases/latest),
download **solana-release-x86_64-unknown-linux-gnu.tar.bz2**, then extract the
archive:
```bash
$ tar jxf solana-release-x86_64-unknown-linux-gnu.tar.bz2
$ cd solana-release/
$ export PATH=$PWD/bin:$PATH
```
##### mac OS
Download the binaries by navigating to
[https://github.com/solana-labs/solana/releases/latest](https://github.com/solana-labs/solana/releases/latest),
download **solana-release-x86_64-apple-darwin.tar.bz2**, then extract the
archive:
```bash
$ tar jxf solana-release-x86_64-apple-darwin.tar.bz2
$ cd solana-release/
$ export PATH=$PWD/bin:$PATH
```
##### Windows
Download the binaries by navigating to
[https://github.com/solana-labs/solana/releases/latest](https://github.com/solana-labs/solana/releases/latest),
download **solana-release-x86_64-pc-windows-msvc.tar.bz2**, then extract it into a folder.
It is a good idea to add this extracted folder to your windows PATH.
### Starting The Replicator
Try running following command to join the gossip network and view all the other nodes in the cluster:
```bash
$ solana-gossip --entrypoint testnet.solana.com:8001 spy
# Press ^C to exit
```
Now configure the keypairs for your replicator by running:
Navigate to the solana install location and open a cmd prompt
```bash
$ solana-keygen new -o replicator-keypair.json
$ solana-keygen new -o storage-keypair.json
```
Use solana-keygen to show the public keys for each of the keypairs,
they will be needed in the next step:
- Windows
```bash
# The replicator's identity
$ solana-keygen pubkey replicator-keypair.json
$ solana-keygen pubkey storage-keypair.json
```
- Linux and mac OS
```bash
$ export REPLICATOR_IDENTITY=$(solana-keygen pubkey replicator-keypair.json)
$ export STORAGE_IDENTITY=$(solana-keygen pubkey storage-keypair.json)
```
Then set up the storage accounts for your replicator by running:
```bash
$ solana-wallet --keypair replicator-keypair.json airdrop 100000
$ solana-wallet --keypair replicator-keypair.json create-replicator-storage-account $REPLICATOR_IDENTITY $STORAGE_IDENTITY
```
Note: Every time the testnet restarts, run the wallet steps to setup the replicator accounts again.
To start the replicator:
```bash
$ solana-replicator --entrypoint testnet.solana.com:8001 --identity replicator-keypair.json --storage-keypair storage-keypair.json --ledger replicator-ledger
```
### Verify Replicator Setup
From another console, confirm the IP address and **identity pubkey** of your replicator is visible in the
gossip network by running:
```bash
$ solana-gossip --entrypoint testnet.solana.com:8001 spy
```
Provide the **storage account pubkey** to the `solana-wallet show-storage-account` command to view
the recent mining activity from your replicator:
```bash
$ solana-wallet --keypair storage-keypair.json show-storage-account $STORAGE_IDENTITY
```

View File

@ -1,7 +1,7 @@
# Fork Selection
# Tower BFT
This design describes a *Fork Selection* algorithm. It addresses the following
problems:
This design describes Solana's *Tower BFT* algorithm. It addresses the
following problems:
* Some forks may not end up accepted by the super-majority of the cluster, and
voters need to recover from voting on such forks.

View File

@ -0,0 +1,48 @@
# The Transaction
### Components of a `Transaction`
* **Transaction:**
* **message:** Defines the transaction
* **header:** Details the account types of and signatures required by
the transaction
* **num_required_signatures:** The total number of signatures
required to make the transaction valid.
* **num_credit_only_signed_accounts:** The last
`num_credit_only_signed_accounts` signatures refer to signing
credit only accounts. Credit only accounts can be used concurrently
by multiple parallel transactions, but their balance may only be
increased, and their account data is read-only.
* **num_credit_only_unsigned_accounts:** The last
`num_credit_only_unsigned_accounts` pubkeys in `account_keys` refer
to non-signing credit only accounts
* **account_keys:** List of pubkeys used by the transaction, including
by the instructions and for signatures. The first
`num_required_signatures` pubkeys must sign the transaction.
* **recent_blockhash:** The ID of a recent ledger entry. Validators will
reject transactions with a `recent_blockhash` that is too old.
* **instructions:** A list of [instructions](instruction.md) that are
run sequentially and committed in one atomic transaction if all
succeed.
* **signatures:** A list of signatures applied to the transaction. The
list is always of length `num_required_signatures`, and the signature
at index `i` corresponds to the pubkey at index `i` in `account_keys`.
The list is initialized with empty signatures (i.e. zeros), and
populated as signatures are added.
### Transaction Signing
A `Transaction` is signed by using an ed25519 keypair to sign the
serialization of the `message`. The resulting signature is placed at the
index of `signatures` matching the index of the keypair's pubkey in
`account_keys`.
### Transaction Serialization
`Transaction`s (and their `message`s) are serialized and deserialized
using the [bincode](https://crates.io/crates/bincode) crate with a
non-standard vector serialization that uses only one byte for the length
if it can be encoded in 7 bits, 2 bytes if it fits in 14 bits, or 3
bytes if it requires 15 or 16 bits. The vector serialization is defined
by Solana's
[short-vec](https://github.com/solana-labs/solana/blob/master/sdk/src/short_vec.rs).

View File

@ -8,17 +8,14 @@ client won't know how much was collected until the transaction is confirmed by
the cluster and the remaining balance is checked. It smells of exactly what we
dislike about Ethereum's "gas", non-determinism.
## Implementation Status
This design is not yet implemented, but is written as though it has been. Once
implemented, delete this comment.
### Congestion-driven fees
Each validator uses *signatures per slot* (SPS) to estimate network congestion
and *SPS target* to estimate the desired processing capacity of the cluster.
The validator learns the SPS target from the genesis block, whereas it
calculates SPS from the ledger data in the previous epoch.
calculates SPS from recently processed transactions. The genesis block also
defines a target `lamports_per_signature`, which is the fee to charge per
signature when the cluster is operating at *SPS target*.
### Calculating fees
@ -37,8 +34,11 @@ lamports as returned by the fee calculator.
In the first implementation of this design, the only fee parameter is
`lamports_per_signature`. The more signatures the cluster needs to verify, the
higher the fee. The exact number of lamports is determined by the ratio of SPS
to the SPS target. The cluster lowers `lamports_per_signature` when SPS is
below the target and raises it when at or above the target.
to the SPS target. At the end of each slot, the cluster lowers
`lamports_per_signature` when SPS is below the target and raises it when above
the target. The minimum value for `lamports_per_signature` is 50% of the target
`lamports_per_signature` and the maximum value is 10x the target
`lamports_per_signature'
Future parameters might include:

43
book/src/transaction.md Normal file
View File

@ -0,0 +1,43 @@
# Anatomy of a Transaction
Transactions encode lists of instructions that are executed
sequentially, and only committed if all the instructions complete
successfully. All account states are reverted upon the failure of a
transaction. Each Transaction details the accounts used, including which
must sign and which are credit only, a recent blockhash, the
instructions, and any signatures.
## Accounts and Signatures
Each transaction explicitly lists all accounts that it needs access to.
This includes accounts that are transferring tokens, accounts whose user
data is being modified, and the program accounts that are being called
by the instructions. Each account that is not an executable program can
be marked as a requiring a signature and/or as credit only. All accounts
marked as signers must have a valid signature in the transaction's list
of signatures before the transaction is considered valid. Any accounts
marked as credit only may only have their token value increased, and
their user data is read only. Accounts are locked by the runtime,
ensuring that they are not modified by a concurrent program while the
transaction is running. Credit only accounts can safely be shared, so
the runtime will allow multiple concurrent credit only locks on an
account.
## Recent Blockhash
A Transaction includes a recent blockhash to prevent duplication and to
give transactions lifetimes. Any transaction that is completely
identical to a previous one is rejected, so adding a newer blockhash
allows multiple transactions to repeat the exact same action.
Transactions also have lifetimes that are defined by the blockhash, as
any transaction whose blockhash is too old will be rejected.
## Instructions
Each instruction specifies a single program account (which must be
marked executable), a subset of the transaction's accounts that should
be passed to the program, and a data byte array instruction that is
passed to the program. The program interprets the data array and
operates on the accounts specified by the instructions. The program can
return successfully, or with an error code. An error return causes the
entire transaction to fail immediately.

View File

@ -0,0 +1,90 @@
# Turbine Block Propagation
A Solana cluster uses a multi-layer block propagation mechanism called *Turbine*
to broadcast transaction blobs to all nodes with minimal amount of duplicate
messages. The cluster divides itself into small collections of nodes, called
*neighborhoods*. Each node is responsible for sharing any data it receives with
the other nodes in its neighborhood, as well as propagating the data on to a
small set of nodes in other neighborhoods. This way each node only has to
communicate with a small number of nodes.
During its slot, the leader node distributes blobs between the validator nodes
in the first neighborhood (layer 0). Each validator shares its data within its
neighborhood, but also retransmits the blobs to one node in some neighborhoods
in the next layer (layer 1). The layer-1 nodes each share their data with their
neighborhood peers, and retransmit to nodes in the next layer, etc, until all
nodes in the cluster have received all the blobs.
## Neighborhood Assignment - Weighted Selection
In order for data plane fanout to work, the entire cluster must agree on how the
cluster is divided into neighborhoods. To achieve this, all the recognized
validator nodes (the TVU peers) are sorted by stake and stored in a list. This
list is then indexed in different ways to figure out neighborhood boundaries and
retransmit peers. For example, the leader will simply select the first nodes to
make up layer 0. These will automatically be the highest stake holders, allowing
the heaviest votes to come back to the leader first. Layer-0 and lower-layer
nodes use the same logic to find their neighbors and next layer peers.
To reduce the possibility of attack vectors, each blob is transmitted over a
random tree of neighborhoods. Each node uses the same set of nodes representing
the cluster. A random tree is generated from the set for each blob using
randomness derived from the blob itself. Since the random seed is not known in
advance, attacks that try to eclipse neighborhoods from certain leaders or
blocks become very difficult, and should require almost complete control of the
stake in the cluster.
## Layer and Neighborhood Structure
The current leader makes its initial broadcasts to at most `DATA_PLANE_FANOUT`
nodes. If this layer 0 is smaller than the number of nodes in the cluster, then
the data plane fanout mechanism adds layers below. Subsequent layers follow
these constraints to determine layer-capacity: Each neighborhood contains
`DATA_PLANE_FANOUT` nodes. Layer-0 starts with 1 neighborhood with fanout nodes.
The number of nodes in each additional layer grows by a factor of fanout.
As mentioned above, each node in a layer only has to broadcast its blobs to its
neighbors and to exactly 1 node in some next-layer neighborhoods,
instead of to every TVU peer in the cluster. A good way to think about this is,
layer-0 starts with 1 neighborhood with fanout nodes, layer-1 adds "fanout"
neighborhoods, each with fanout nodes and layer-2 will have
`fanout * number of nodes in layer-1` and so on.
This way each node only has to communicate with a maximum of `2 * DATA_PLANE_FANOUT - 1` nodes.
The following diagram shows how the Leader sends blobs with a Fanout of 2 to
Neighborhood 0 in Layer 0 and how the nodes in Neighborhood 0 share their data
with each other.
<img alt="Leader sends blobs to Neighborhood 0 in Layer 0" src="img/data-plane-seeding.svg" class="center"/>
The following diagram shows how Neighborhood 0 fans out to Neighborhoods 1 and 2.
<img alt="Neighborhood 0 Fanout to Neighborhood 1 and 2" src="img/data-plane-fanout.svg" class="center"/>
Finally, the following diagram shows a two layer cluster with a Fanout of 2.
<img alt="Two layer cluster with a Fanout of 2" src="img/data-plane.svg" class="center"/>
#### Configuration Values
`DATA_PLANE_FANOUT` - Determines the size of layer 0. Subsequent
layers grow by a factor of `DATA_PLANE_FANOUT`.
The number of nodes in a neighborhood is equal to the fanout value.
Neighborhoods will fill to capacity before new ones are added, i.e if a
neighborhood isn't full, it _must_ be the last one.
Currently, configuration is set when the cluster is launched. In the future,
these parameters may be hosted on-chain, allowing modification on the fly as the
cluster sizes change.
## Neighborhoods
The following diagram shows how two neighborhoods in different layers interact.
To cripple a neighborhood, enough nodes (erasure codes +1) from the neighborhood
above need to fail. Since each neighborhood receives blobs from multiple nodes
in a neighborhood in the upper layer, we'd need a big network failure in the upper
layers to end up with incomplete data.
<img alt="Inner workings of a neighborhood"
src="img/data-plane-neighborhood.svg" class="center"/>

View File

@ -0,0 +1,56 @@
# Anatomy of a Validator
## History
When we first started Solana, the goal was to de-risk our TPS claims. We knew
that between optimistic concurrency control and sufficiently long leader slots,
that PoS consensus was not the biggest risk to TPS. It was GPU-based signature
verification, software pipelining and concurrent banking. Thus, the TPU was
born. After topping 100k TPS, we split the team into one group working toward
710k TPS and another to flesh out the validator pipeline. Hence, the TVU was
born. The current architecture is a consequence of incremental development with
that ordering and project priorities. It is not a reflection of what we ever
believed was the most technically elegant cross-section of those technologies.
In the context of leader rotation, the strong distinction between leading and
validating is blurred.
## Difference between validating and leading
The fundamental difference between the pipelines is when the PoH is present. In
a leader, we process transactions, removing bad ones, and then tag the result
with a PoH hash. In the validator, we verify that hash, peel it off, and
process the transactions in exactly the same way. The only difference is that
if a validator sees a bad transaction, it can't simply remove it like the
leader does, because that would cause the PoH hash to change. Instead, it
rejects the whole block. The other difference between the pipelines is what
happens *after* banking. The leader broadcasts entries to downstream validators
whereas the validator will have already done that in RetransmitStage, which is
a confirmation time optimization. The validation pipeline, on the other hand,
has one last step. Any time it finishes processing a block, it needs to weigh
any forks it's observing, possibly cast a vote, and if so, reset its PoH hash
to the block hash it just voted on.
## Proposed Design
We unwrap the many abstraction layers and build a single pipeline that can
toggle leader mode on whenever the validator's ID shows up in the leader
schedule.
<img alt="Validator block diagram" src="img/validator-proposal.svg" class="center"/>
## Notable changes
* No threads are shut down to switch out of leader mode. Instead, FetchStage
should forward transactions to the next leader.
* Hoist FetchStage and BroadcastStage out of TPU
* Blocktree renamed to Blockstore
* BankForks renamed to Banktree
* TPU moves to new socket-free crate called solana-tpu.
* TPU's BankingStage absorbs ReplayStage
* TVU goes away
* New RepairStage absorbs Blob Fetch Stage and repair requests
* JSON RPC Service is optional - used for debugging. It should instead be part
of a separate `solana-blockstreamer` executable.
* New MulticastStage absorbs retransmit part of RetransmitStage
* MulticastStage downstream of Blockstore

View File

@ -1,10 +1,10 @@
# Anatomy of a Fullnode
# Anatomy of a Validator
<img alt="Fullnode block diagrams" src="img/fullnode.svg" class="center"/>
<img alt="Validator block diagrams" src="img/validator.svg" class="center"/>
## Pipelining
The fullnodes make extensive use of an optimization common in CPU design,
The validators make extensive use of an optimization common in CPU design,
called *pipelining*. Pipelining is the right tool for the job when there's a
stream of input data that needs to be processed by a sequence of steps, and
there's different hardware responsible for each. The quintessential example is
@ -19,9 +19,9 @@ dryer and the first is being folded. In this way, one can make progress on
three loads of laundry simultaneously. Given infinite loads, the pipeline will
consistently complete a load at the rate of the slowest stage in the pipeline.
## Pipelining in the Fullnode
## Pipelining in the Validator
The fullnode contains two pipelined processes, one used in leader mode called
The validator contains two pipelined processes, one used in leader mode called
the TPU and one used in validator mode called the TVU. In both cases, the
hardware being pipelined is the same, the network input, the GPU cards, the CPU
cores, writes to disk, and the network output. What it does with that hardware

View File

@ -284,6 +284,18 @@ ARGS:
<PATH> /path/to/program.o
```
```manpage
solana-wallet-fees
Display current cluster fees
USAGE:
solana-wallet fees
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
```
```manpage
solana-wallet-get-transaction-count
Get current transaction count

View File

@ -521,4 +521,4 @@ ul#searchresults span.teaser em {
}
.content pre {
padding: 0 28px;
}
}

View File

@ -152,4 +152,4 @@ blockquote {
*:active,
*:hover {
outline: none;
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,19 +0,0 @@
#!/usr/bin/env bash
#
# Builds perf-libs from the upstream source and installs them into the correct
# location in the tree
#
set -e
cd "$(dirname "$0")"
if [[ -d target/perf-libs ]]; then
echo "target/perf-libs/ already exists, to continue run:"
echo "$ rm -rf target/perf-libs"
exit 1
fi
set -x
git clone git@github.com:solana-labs/solana-perf-libs.git target/perf-libs
cd target/perf-libs
make -j"$(nproc)"
make DESTDIR=. install

2
chacha-sys/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/target/
/farf/

12
chacha-sys/Cargo.toml Normal file
View File

@ -0,0 +1,12 @@
[package]
name = "solana-chacha-sys"
version = "0.17.2"
description = "Solana chacha-sys"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
homepage = "https://solana.com/"
license = "Apache-2.0"
edition = "2018"
[build-dependencies]
cc = "1.0.38"

8
chacha-sys/build.rs Normal file
View File

@ -0,0 +1,8 @@
extern crate cc;
fn main() {
cc::Build::new()
.file("cpu-crypt/chacha20_core.c")
.file("cpu-crypt/chacha_cbc.c")
.compile("libcpu-crypt");
}

1
chacha-sys/cpu-crypt/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
release/

View File

@ -0,0 +1,25 @@
V:=debug
LIB:=cpu-crypt
CFLAGS_common:=-Wall -Werror -pedantic -fPIC
CFLAGS_release:=-march=native -O3 $(CFLAGS_common)
CFLAGS_debug:=-g $(CFLAGS_common)
CFLAGS:=$(CFLAGS_$V)
all: $V/lib$(LIB).a
$V/chacha20_core.o: chacha20_core.c chacha.h
@mkdir -p $(@D)
$(CC) $(CFLAGS) -c $< -o $@
$V/chacha_cbc.o: chacha_cbc.c chacha.h
@mkdir -p $(@D)
$(CC) $(CFLAGS) -c $< -o $@
$V/lib$(LIB).a: $V/chacha20_core.o $V/chacha_cbc.o
$(AR) rcs $@ $^
.PHONY:clean
clean:
rm -rf $V

View File

@ -0,0 +1,35 @@
#ifndef HEADER_CHACHA_H
# define HEADER_CHACHA_H
#include <string.h>
#include <inttypes.h>
# include <stddef.h>
# ifdef __cplusplus
extern "C" {
# endif
typedef unsigned int u32;
#define CHACHA_KEY_SIZE 32
#define CHACHA_NONCE_SIZE 12
#define CHACHA_BLOCK_SIZE 64
#define CHACHA_ROUNDS 500
void chacha20_encrypt(const u32 input[16],
unsigned char output[64],
int num_rounds);
void chacha20_encrypt_ctr(const uint8_t *in, uint8_t *out, size_t in_len,
const uint8_t key[CHACHA_KEY_SIZE], const uint8_t nonce[CHACHA_NONCE_SIZE],
uint32_t counter);
void chacha20_cbc128_encrypt(const unsigned char* in, unsigned char* out,
uint32_t len, const uint8_t* key,
unsigned char* ivec);
# ifdef __cplusplus
}
# endif
#endif

View File

@ -0,0 +1,102 @@
#include "chacha.h"
#define ROTL32(v, n) (((v) << (n)) | ((v) >> (32 - (n))))
#define ROTATE(v, c) ROTL32((v), (c))
#define XOR(v, w) ((v) ^ (w))
#define PLUS(x, y) ((x) + (y))
#define U32TO8_LITTLE(p, v) \
{ (p)[0] = ((v) ) & 0xff; (p)[1] = ((v) >> 8) & 0xff; \
(p)[2] = ((v) >> 16) & 0xff; (p)[3] = ((v) >> 24) & 0xff; }
#define U8TO32_LITTLE(p) \
(((u32)((p)[0]) ) | ((u32)((p)[1]) << 8) | \
((u32)((p)[2]) << 16) | ((u32)((p)[3]) << 24) )
#define QUARTERROUND(a,b,c,d) \
x[a] = PLUS(x[a],x[b]); x[d] = ROTATE(XOR(x[d],x[a]),16); \
x[c] = PLUS(x[c],x[d]); x[b] = ROTATE(XOR(x[b],x[c]),12); \
x[a] = PLUS(x[a],x[b]); x[d] = ROTATE(XOR(x[d],x[a]), 8); \
x[c] = PLUS(x[c],x[d]); x[b] = ROTATE(XOR(x[b],x[c]), 7);
// sigma contains the ChaCha constants, which happen to be an ASCII string.
static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
'2', '-', 'b', 'y', 't', 'e', ' ', 'k' };
void chacha20_encrypt(const u32 input[16],
unsigned char output[64],
int num_rounds)
{
u32 x[16];
int i;
memcpy(x, input, sizeof(u32) * 16);
for (i = num_rounds; i > 0; i -= 2) {
QUARTERROUND( 0, 4, 8,12)
QUARTERROUND( 1, 5, 9,13)
QUARTERROUND( 2, 6,10,14)
QUARTERROUND( 3, 7,11,15)
QUARTERROUND( 0, 5,10,15)
QUARTERROUND( 1, 6,11,12)
QUARTERROUND( 2, 7, 8,13)
QUARTERROUND( 3, 4, 9,14)
}
for (i = 0; i < 16; ++i) {
x[i] = PLUS(x[i], input[i]);
}
for (i = 0; i < 16; ++i) {
U32TO8_LITTLE(output + 4 * i, x[i]);
}
}
void chacha20_encrypt_ctr(const uint8_t *in, uint8_t *out, size_t in_len,
const uint8_t key[CHACHA_KEY_SIZE],
const uint8_t nonce[CHACHA_NONCE_SIZE],
uint32_t counter)
{
uint32_t input[16];
uint8_t buf[64];
size_t todo, i;
input[0] = U8TO32_LITTLE(sigma + 0);
input[1] = U8TO32_LITTLE(sigma + 4);
input[2] = U8TO32_LITTLE(sigma + 8);
input[3] = U8TO32_LITTLE(sigma + 12);
input[4] = U8TO32_LITTLE(key + 0);
input[5] = U8TO32_LITTLE(key + 4);
input[6] = U8TO32_LITTLE(key + 8);
input[7] = U8TO32_LITTLE(key + 12);
input[8] = U8TO32_LITTLE(key + 16);
input[9] = U8TO32_LITTLE(key + 20);
input[10] = U8TO32_LITTLE(key + 24);
input[11] = U8TO32_LITTLE(key + 28);
input[12] = counter;
input[13] = U8TO32_LITTLE(nonce + 0);
input[14] = U8TO32_LITTLE(nonce + 4);
input[15] = U8TO32_LITTLE(nonce + 8);
while (in_len > 0) {
todo = sizeof(buf);
if (in_len < todo) {
todo = in_len;
}
chacha20_encrypt(input, buf, 20);
for (i = 0; i < todo; i++) {
out[i] = in[i] ^ buf[i];
}
out += todo;
in += todo;
in_len -= todo;
input[12]++;
}
}

View File

@ -0,0 +1,72 @@
#include "chacha.h"
#if !defined(STRICT_ALIGNMENT) && !defined(PEDANTIC)
# define STRICT_ALIGNMENT 0
#endif
void chacha20_cbc128_encrypt(const unsigned char* in, unsigned char* out,
uint32_t len, const uint8_t* key,
unsigned char* ivec)
{
size_t n;
unsigned char *iv = ivec;
(void)key;
if (len == 0) {
return;
}
#if !defined(OPENSSL_SMALL_FOOTPRINT)
if (STRICT_ALIGNMENT &&
((size_t)in | (size_t)out | (size_t)ivec) % sizeof(size_t) != 0) {
while (len >= CHACHA_BLOCK_SIZE) {
for (n = 0; n < CHACHA_BLOCK_SIZE; ++n) {
out[n] = in[n] ^ iv[n];
//printf("%x ", out[n]);
}
chacha20_encrypt((const u32*)out, out, CHACHA_ROUNDS);
iv = out;
len -= CHACHA_BLOCK_SIZE;
in += CHACHA_BLOCK_SIZE;
out += CHACHA_BLOCK_SIZE;
}
} else {
while (len >= CHACHA_BLOCK_SIZE) {
for (n = 0; n < CHACHA_BLOCK_SIZE; n += sizeof(size_t)) {
*(size_t *)(out + n) =
*(size_t *)(in + n) ^ *(size_t *)(iv + n);
//printf("%zu ", *(size_t *)(iv + n));
}
chacha20_encrypt((const u32*)out, out, CHACHA_ROUNDS);
iv = out;
len -= CHACHA_BLOCK_SIZE;
in += CHACHA_BLOCK_SIZE;
out += CHACHA_BLOCK_SIZE;
}
}
#endif
while (len) {
for (n = 0; n < CHACHA_BLOCK_SIZE && n < len; ++n) {
out[n] = in[n] ^ iv[n];
}
for (; n < CHACHA_BLOCK_SIZE; ++n) {
out[n] = iv[n];
}
chacha20_encrypt((const u32*)out, out, CHACHA_ROUNDS);
iv = out;
if (len <= CHACHA_BLOCK_SIZE) {
break;
}
len -= CHACHA_BLOCK_SIZE;
in += CHACHA_BLOCK_SIZE;
out += CHACHA_BLOCK_SIZE;
}
memcpy(ivec, iv, CHACHA_BLOCK_SIZE);
}
void chacha20_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t in_len,
const uint8_t key[CHACHA_KEY_SIZE], uint8_t* ivec)
{
chacha20_cbc128_encrypt(in, out, in_len, key, ivec);
}

21
chacha-sys/src/lib.rs Normal file
View File

@ -0,0 +1,21 @@
extern "C" {
fn chacha20_cbc_encrypt(
input: *const u8,
output: *mut u8,
in_len: usize,
key: *const u8,
ivec: *mut u8,
);
}
pub fn chacha_cbc_encrypt(input: &[u8], output: &mut [u8], key: &[u8], ivec: &mut [u8]) {
unsafe {
chacha20_cbc_encrypt(
input.as_ptr(),
output.as_mut_ptr(),
input.len(),
key.as_ptr(),
ivec.as_mut_ptr(),
);
}
}

View File

@ -12,7 +12,7 @@
set -e
cd "$(dirname "$0")"/..
if ci/is-pr.sh; then
if [[ -n $CI_PULL_REQUEST ]]; then
affectedFiles="$(buildkite-agent meta-data get affected_files)"
echo "Affected files in this PR: $affectedFiles"

View File

@ -1,20 +0,0 @@
#!/usr/bin/env bash
#
# Audits project dependencies for security vulnerabilities
#
set -e
cd "$(dirname "$0")/.."
source ci/_
cargo_install_unless() {
declare crate=$1
shift
"$@" > /dev/null 2>&1 || \
_ cargo install "$crate"
}
cargo_install_unless cargo-audit cargo audit --version
_ cargo audit

15
ci/buildkite-release.yml Normal file
View File

@ -0,0 +1,15 @@
# Build steps that run on a release tag
#
# All the steps in `buildkite.yml` are skipped and we jump directly to the
# secondary build steps since it's assumed the commit that was tagged is known
# to be good so there's no need to rebuild and retest it.
steps:
- trigger: "solana-secondary"
branches: "!pull/*"
async: true
build:
message: "${BUILDKITE_MESSAGE}"
commit: "${BUILDKITE_COMMIT}"
branch: "${BUILDKITE_BRANCH}"
env:
TRIGGERED_BUILDKITE_TAG: "${BUILDKITE_TAG}"

View File

@ -1,16 +1,19 @@
#
# Build steps that run after the primary pipeline on pushes and tags.
# Pull requests to not run these steps.
steps:
- command: "sdk/docker-solana/build.sh"
timeout_in_minutes: 20
timeout_in_minutes: 60
name: "publish docker"
- command: "ci/publish-crate.sh"
timeout_in_minutes: 40
timeout_in_minutes: 120
name: "publish crate"
branches: "!master"
- command: "ci/publish-bpf-sdk.sh"
timeout_in_minutes: 5
name: "publish bpf sdk"
- command: "ci/publish-tarball.sh"
timeout_in_minutes: 25
timeout_in_minutes: 60
name: "publish tarball"
- command: "ci/publish-book.sh"
timeout_in_minutes: 15

View File

@ -1,27 +1,30 @@
# Build steps that run on pushes and pull requests.
#
# Release tags use buildkite-release.yml instead
steps:
- command: "ci/shellcheck.sh"
name: "shellcheck"
timeout_in_minutes: 5
- command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_stable_docker_image ci/test-checks.sh"
- command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_nightly_docker_image ci/test-checks.sh"
name: "checks"
timeout_in_minutes: 15
timeout_in_minutes: 35
- wait
- command: "ci/test-stable-perf.sh"
name: "stable-perf"
timeout_in_minutes: 20
timeout_in_minutes: 30
artifact_paths: "log-*.txt"
agents:
- "queue=cuda"
- command: "ci/test-bench.sh"
name: "bench"
timeout_in_minutes: 20
timeout_in_minutes: 60
- command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_stable_docker_image ci/test-stable.sh"
name: "stable"
timeout_in_minutes: 25
timeout_in_minutes: 40
artifact_paths: "log-*.txt"
- command: ". ci/rust-version.sh; ci/docker-run.sh $$rust_nightly_docker_image ci/test-coverage.sh"
name: "coverage"
timeout_in_minutes: 20
timeout_in_minutes: 40
# TODO: Fix and re-enable test-large-network.sh
# - command: "ci/test-large-network.sh || true"
# name: "large-network [ignored]"

View File

@ -89,11 +89,11 @@ BETA_CHANNEL_LATEST_TAG=${beta_tag:+v$beta_tag}
STABLE_CHANNEL_LATEST_TAG=${stable_tag:+v$stable_tag}
if [[ $BUILDKITE_BRANCH = "$STABLE_CHANNEL" ]]; then
if [[ $CI_BRANCH = "$STABLE_CHANNEL" ]]; then
CHANNEL=stable
elif [[ $BUILDKITE_BRANCH = "$EDGE_CHANNEL" ]]; then
elif [[ $CI_BRANCH = "$EDGE_CHANNEL" ]]; then
CHANNEL=edge
elif [[ $BUILDKITE_BRANCH = "$BETA_CHANNEL" ]]; then
elif [[ $CI_BRANCH = "$BETA_CHANNEL" ]]; then
CHANNEL=beta
fi

View File

@ -64,11 +64,14 @@ fi
ARGS+=(
--env BUILDKITE
--env BUILDKITE_AGENT_ACCESS_TOKEN
--env BUILDKITE_BRANCH
--env BUILDKITE_COMMIT
--env BUILDKITE_JOB_ID
--env BUILDKITE_TAG
--env CI
--env CI_BRANCH
--env CI_BUILD_ID
--env CI_COMMIT
--env CI_JOB_ID
--env CI_PULL_REQUEST
--env CI_REPO_SLUG
--env CODECOV_TOKEN
--env CRATES_IO_TOKEN
)

Some files were not shown because too many files have changed in this diff Show More