Compare commits

...

2760 Commits

Author SHA1 Message Date
fee86726f2 improve multi executor cache addition (#22381)
(cherry picked from commit 4a9f4e2505)

Co-authored-by: Jack May <jack@solana.com>
2022-01-08 12:52:16 +00:00
8a470d3ae8 add excutor creation trace timings 2022-01-08 04:46:31 -07:00
8c6df1f234 bank: prime new executor cache entry use-counts (#22374)
Co-authored-by: Trent Nelson <trent@solana.com>
2022-01-08 10:14:05 +00:00
7cbfab0958 remove per program timings from blockstore processor ledger replay (#22370) (#22371)
(cherry picked from commit 813006b33b)

Co-authored-by: carllin <carl@solana.com>
2022-01-08 08:33:31 +00:00
6130466a21 Executor cache metrics (backport #22332) (#22367)
* Add helper macro for `AddAssign`ing with saturating arithmetic

* bank: Add executors cache metrics

Co-authored-by: Trent Nelson <trent@solana.com>
2022-01-08 02:19:36 +00:00
299a59f458 removes CowCachedExecutors (backport #22343) (#22362)
* removes CowCachedExecutors (#22343)

Copy-on-write semantics for cached executors can be implemented by a
simple Arc<CachedExecutors> as opposed to CowCachedExecutors:
https://github.com/solana-labs/solana/blob/f1e2598ba/runtime/src/bank.rs#L244-L247

This will also avoid the need for double locking as in:
https://github.com/solana-labs/solana/blob/f1e2598ba/runtime/src/bank.rs#L3490-L3491
https://github.com/solana-labs/solana/blob/f1e2598ba/runtime/src/bank.rs#L3525-L3526

(cherry picked from commit c2389fc209)

# Conflicts:
#	runtime/src/bank.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2022-01-07 16:18:00 +00:00
b30c726d22 Add aarch64-apple-darwin publish tarball step (#22355)
(cherry picked from commit e2aa932e97)

Co-authored-by: Michael Vines <mvines@gmail.com>
2022-01-07 10:13:46 +00:00
069bb5e32f Increase timeout of local-cluster-slow CI step 2022-01-07 15:31:28 +08:00
cad0e7f04f cache executors on failed transactions (backport #22308) (#22327)
* cache executors on failed transactions (#22308)

(cherry picked from commit 12e160269e)

# Conflicts:
#	program-runtime/src/invoke_context.rs
#	programs/bpf_loader/src/lib.rs
#	runtime/src/bank.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2022-01-06 15:38:39 -08:00
c90fa6643e Retain executor cache counts (#22322) (#22340)
(cherry picked from commit f1e2598baa)

Co-authored-by: Jack May <jack@solana.com>
2022-01-06 19:11:05 +00:00
54db774203 Split up local cluster tests into separate CI steps (backport #22295) (#22302)
* Split up local cluster tests into separate CI steps (#22295)

* Split up local cluster tests into separate CI steps

* Update buildkite-pipeline.sh

(cherry picked from commit 0e1afcbb26)

# Conflicts:
#	local-cluster/tests/local_cluster.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2022-01-06 15:26:56 +00:00
57b5ce5731 [ledger-tool]compare_blocks (#22229) (#22329)
* 1.made load_credentials accept credential path as a parameter. 2.partial implement bigtable comparasion function

* finding missing blocks in bigtables in a specified range

* refactor compare-blocks,add unit test for missing_blocks and fmt

* compare-block fix last block bug

* refactor compare-block and improve wording

* Update ledger-tool/src/bigtable.rs

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

* update compare-block command-line description

* style:improve wording/naming/code style

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
(cherry picked from commit d9220652ad)

Co-authored-by: pieceofr <komimi.p@gmail.com>
2022-01-06 08:47:08 +00:00
e0d933f940 perf: skip updating already cached executors if unmodified (backport #22300) (#22315)
* Skip updating already cached executors if unmodified

(cherry picked from commit f2ed6f09ee)

# Conflicts:
#	program-runtime/src/invoke_context.rs
#	runtime/src/bank.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2022-01-06 02:04:55 +00:00
e2559f20df fix(rpc): recreate dead and uncleaned subscriptions (#22281) (#22293)
(cherry picked from commit c1995c647b)

Co-authored-by: Nikita <bananaelecitrus@gmail.com>
2022-01-05 10:23:34 +00:00
7b9ca3e9d9 Flip iter operations to keep associated address/header/packets together (backport #22245) (#22256)
* Flip iter operations to keep associated address/header/packets together (#22245)

Flip iter operations to keep associated address/header/packets together

Before this change, if cast_socket_addr() returned a None for any
address/header pair, the subsequent zip() would misalign the
address/header pair and packet. So, this change zips all three together,
then does filter_map() so keep things aligned.

Additionally, compute total_size inline to avoid running through packets
a second time.

(cherry picked from commit 20b61e28b6)

# Conflicts:
#	streamer/src/recvmmsg.rs

* removes backport merge conflicts

Co-authored-by: steviez <steven@solana.com>
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2022-01-04 16:31:59 +00:00
f0de9b43be Lower vote-only-mode to 400 (#22210) (#22271)
(cherry picked from commit 2486e21ffe)

Co-authored-by: sakridge <sakridge@gmail.com>
2022-01-04 14:17:31 +00:00
6d7b64b140 Fix bug, add error specific timings (#22225) (#22251)
(cherry picked from commit 005592998d)

Co-authored-by: carllin <carl@solana.com>
2022-01-04 09:23:49 +00:00
f506851ca1 removes epoch_authorized_voters from VoteTracker (backport #22192) (#22250)
* removes epoch_authorized_voters from VoteTracker (#22192)

https://github.com/solana-labs/solana/pull/22169
verifies authorized-voter early on in vote-listener pipeline; and so
VoteTracker no longer needs to maintain and check for epoch authorized
voters.

(cherry picked from commit 69d71f8f86)

# Conflicts:
#	core/src/cluster_info_vote_listener.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2022-01-04 02:02:56 +00:00
b70113e201 Correctly set CI_COMMIT when Buildkite provides HEAD instead of a real commit 2022-01-03 17:40:35 -08:00
6093c7a218 Switch from arm64-apple-darwin to aarch64-apple-darwin to align with Rust's target names 2022-01-03 17:27:09 -08:00
b9777e10ee Add support for arm64-apple-darwin release/channel artifacts 2022-01-03 17:27:05 -08:00
d840d56565 Use experimential docker virtualization framework for arm64
(cherry picked from commit ed0b47c6f8)
2022-01-03 17:27:00 -08:00
afb8df0c62 Correctly set CI_OS_NAME for macOs buildkite agents 2022-01-03 17:26:54 -08:00
84d535b89e re-calibrate limit based on mainnet data (backport #21995) (#22211)
* re-calibrate limit based on mainnet data, see issue #21917

(cherry picked from commit d743c2917c)

# Conflicts:
#	runtime/src/block_cost_limits.rs

* set secp256k1 cost similar to sigverify

(cherry picked from commit a2a7e91ad6)

* removes backport merge conflicts

Co-authored-by: Tao Zhu <tao@solana.com>
2022-01-03 19:03:41 +00:00
de1a9f84ac Bump rbpf to v0.2.21 (#22216) (#22218)
(cherry picked from commit 9139be89b7)
2022-01-01 21:43:28 +00:00
22bbd91843 Count compute units even when transaction errors (backport #22182) (#22198)
* Resolve conflicts

* Return err

Co-authored-by: carllin <carl@solana.com>
2022-01-01 13:16:56 +00:00
1babd07faf Increment execution timings on errors as well (backport #22053) (#22071)
* Increment execution timings on errors as well (#22053)

(cherry picked from commit 37f6777ceb)

# Conflicts:
#	programs/bpf_loader/src/lib.rs

* Fix conflicts

Co-authored-by: carllin <carl@solana.com>
2022-01-01 13:04:34 +00:00
0592b5568f Bump local cluster timeout (#22214) 2022-01-01 06:02:38 -05:00
ce98feac4e Exit early on BigTable error (#22200) (#22208)
(cherry picked from commit 0b1b36f088)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2022-01-01 02:05:36 +00:00
a53dd611c0 uses enum for shred type (backport #21333) (#22147)
* uses enum for shred type

Current code is using u8 which does not have any type-safety and can
contain invalid values:
https://github.com/solana-labs/solana/blob/66fa062f1/ledger/src/shred.rs#L167

Checks for invalid shred-types are scattered through the code:
https://github.com/solana-labs/solana/blob/66fa062f1/ledger/src/blockstore.rs#L849-L851
https://github.com/solana-labs/solana/blob/66fa062f1/ledger/src/shred.rs#L346-L348

The commit uses enum for shred type with #[repr(u8)]. Backward
compatibility is maintained by implementing Serialize and Deserialize
compatible with u8, and adding a test to assert that.

(cherry picked from commit 57057f8d39)

# Conflicts:
#	core/src/retransmit_stage.rs
#	gossip/src/cluster_info.rs
#	ledger/Cargo.toml
#	ledger/src/blockstore.rs
#	ledger/src/shred.rs

* changes Blockstore::is_shred_duplicate arg type to ShredType

(cherry picked from commit 48dfdfb4d5)

# Conflicts:
#	ledger/src/blockstore.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-12-31 16:47:45 +00:00
ec970f9d69 checks for authorized voter early on in the vote-listener pipeline (backport #22169) (#22188)
* checks for authorized voter early on in the vote-listener pipeline (#22169)

Before votes are verified that they are signed by the authorized voter,
they might be dropped in verified-vote-packets code. If there are
enough many spam votes from unauthorized voters, this may potentially
drop valid votes but keep the false ones.
https://github.com/solana-labs/solana/blob/57986f982/core/src/verified_vote_packets.rs#L165-L168

(cherry picked from commit c0c6038654)

# Conflicts:
#	core/src/cluster_info_vote_listener.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-12-30 17:52:36 +00:00
7793a11b65 Bump solana_rbpf to version v0.2.20 (#22166) 2021-12-30 17:34:11 +01:00
4deac1daa4 Update install/src/command.rs
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
(cherry picked from commit 29edb130cc)
2021-12-30 07:30:38 -08:00
4c36a93665 Add connect timeout and change overall timeout to None
(cherry picked from commit 3c1416091e)
2021-12-30 07:30:38 -08:00
052309227f fix: Installer increase download req timeout from 30 seconds to 6 minutes
(cherry picked from commit a1912f8400)
2021-12-30 07:30:38 -08:00
3b895104f3 ClusterInfoVoteListener send only missing votes to BankingStage (backport #20873) (#22135)
* ClusterInfoVoteListener send only missing votes to BankingStage (#20873)

(cherry picked from commit b30c94ce55)

# Conflicts:
#	core/src/cluster_info_vote_listener.rs
#	core/src/verified_vote_packets.rs
#	gossip/src/cluster_info.rs
#	local-cluster/tests/local_cluster.rs
#	runtime/src/bank.rs

* Resolve conflicts

* Remove Select

* Fixup tests

Co-authored-by: carllin <carl@solana.com>
2021-12-30 06:38:49 +00:00
24b0fc8927 get_signatures_for_address does not correctly account for result sets that span local and Bigtable sources (backport #22115) (#22167)
* get_signatures_for_address does not correctly account for result sets that span local and Bigtable sources (#22115)

* get_signatures_for_address does not correctly account for result sets that span Blockstore and Bigtable.

This causes Bigtable to return `RowNotFound` until the new tx is uploaded.

Check that `before` exists in Bigtable, and if not, set it to `None` to return the full data set.

References #21442
Closes #22110

* Differentiate between before sig not found and no newer signatures

* Dedupe bigtable results to account for potential upload race

Co-authored-by: Tyera Eulberg <tyera@solana.com>
(cherry picked from commit bac6821e19)

# Conflicts:
#	ledger/src/blockstore.rs

* Fix conflicts

Co-authored-by: Omar Kilani <omar.kilani@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-12-29 13:03:32 -07:00
271ae3c2fc Ignore spl downstream build (#22173) 2021-12-29 12:44:46 -07:00
a305fa0472 implements copy-on-write for vote-accounts (backport #19362) #22139 (#22139)
Bank::vote_accounts redundantly clones vote-accounts HashMap even though
an immutable reference will suffice:
https://github.com/solana-labs/solana/blob/95c998a19/runtime/src/bank.rs#L5174-L5186

This commit implements copy-on-write semantics for vote-accounts by
wrapping the underlying HashMap in Arc<...>.

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-12-28 21:18:37 +00:00
262b157d21 renames solana_runtime::vote_account::VoteAccount and makes it private (backport #19153) (#22141)
* makes solana_runtime::vote_account::VoteAccount private

VoteAccount is an implementation detail, and should not be public.
Only ArcVoteAccount is the public type.

(cherry picked from commit 1403eaeefc)

# Conflicts:
#	runtime/src/vote_account.rs

* renames solana_runtime::vote_account::VoteAccount

Rename:
  VoteAccount    -> VoteAccountInner  # the private type
  ArcVoteAccount -> VoteAccount       # the public type
(cherry picked from commit 00e5e12906)

# Conflicts:
#	core/src/progress_map.rs
#	ledger/src/blockstore_processor.rs
#	ledger/src/staking_utils.rs
#	runtime/src/bank.rs
#	runtime/src/epoch_stakes.rs
#	runtime/src/serde_snapshot/tests.rs
#	runtime/src/stakes.rs
#	runtime/src/vote_account.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-12-28 18:26:23 +00:00
bfb02029bf adds methods to obtain data/coding shreds indices from ErasureMeta (backport #21254) (#22132)
* marks ErasureMeta.size as unused

ErasureMeta.size is unused and redundant:
https://github.com/solana-labs/solana/blob/150951333/ledger/src/blockstore_meta.rs#L57-L58

(cherry picked from commit 7e98b77b33)

* removes Default implementaion of ErasureConfig

The Default implementation of ErasureConfig is off and never useful:
https://github.com/solana-labs/solana/blob/150951333/ledger/src/erasure.rs#L49-L68

(cherry picked from commit d25d9be555)

* adds methods to obtain data/coding shreds indices from ErasureMeta

(cherry picked from commit 3fc858eb60)

# Conflicts:
#	ledger/src/blockstore_meta.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-12-28 01:15:09 +00:00
039244417e removes redundant args from Shredder::try_recovery (backport #21226) (#22126)
* removes redundant args from Shredder::try_recovery (#21226)

Shredder::try_recovery is already taking a Vec<Shred> as an argument. All the
other arguments are embedded in the shreds, and are so redundant.

(cherry picked from commit 5fb0ab9d00)

# Conflicts:
#	ledger/src/shred.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-12-27 21:02:33 +00:00
1e1f383970 rewrites Shredder::try_recovery (backport #21082) (#22125)
* rewrites Shredder::try_recovery (#21082)

For every missing data-shred, Shredder::try_recovery calls into
new_empty_data_shred which does a redundant serialization into payload
buffer which is then immediately overwritten by the erasure recovery:
https://github.com/solana-labs/solana/blob/696501500/ledger/src/shred.rs#L372-L417

Additionally, the implementation is unnecessary complex hindering
upcoming changes to erasure coding generation
https://github.com/solana-labs/solana/blob/696501500/ledger/src/shred.rs#L814-L938

The commit simplifies the Shredder::try_recovery implementation.

(cherry picked from commit 11a53de0e3)

# Conflicts:
#	ledger/src/erasure.rs
#	ledger/src/shred.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-12-27 16:42:22 +00:00
891b0a5152 optimizes and simplifies SlotMeta::completed_data_indexes ops (#21059) (#22100)
SlotMeta::completed_data_indexes is defined as a Vec<u32>:
https://github.com/solana-labs/solana/blob/a8d78e89d/ledger/src/blockstore_meta.rs#L31-L32

which results in inefficient updates:
https://github.com/solana-labs/solana/blob/a8d78e89d/ledger/src/blockstore.rs#L3245-L3326

This commit changes the type to BTreeSet<u32> for efficient and simpler
updates and lookups.

The change should be backward compatible because Vec<T> and BTreeSet<T>
are both serialized as seq:
https://github.com/serde-rs/serde/blob/ce0844b9e/serde/src/ser/impls.rs#L207-L208
https://github.com/serde-rs/serde/blob/ce0844b9e/serde/src/ser/impls.rs#L216-L217

(cherry picked from commit 484ead01ed)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-12-26 17:22:22 +00:00
685e40cbf2 validator: add contact-info query to admin port 2021-12-23 20:23:48 +00:00
17d698d20a report mem stats (#21258) (#22066)
(cherry picked from commit f8dcb2f38b)

# Conflicts:
#	Cargo.lock
#	core/Cargo.toml
#	core/src/system_monitor_service.rs
#	runtime/src/bucket_map_holder_stats.rs

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-12-23 18:16:56 +00:00
cf34ae7d6f chore: bump lru from 0.7.0 to 0.7.1 (backport #22018) (#22079)
* chore: bump lru from 0.7.0 to 0.7.1 (#22018)

Bumps [lru](https://github.com/jeromefroe/lru-rs) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/jeromefroe/lru-rs/releases)
- [Changelog](https://github.com/jeromefroe/lru-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jeromefroe/lru-rs/compare/0.7.0...0.7.1)

---
updated-dependencies:
- dependency-name: lru
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 69d0b08dd8)

# Conflicts:
#	Cargo.lock
#	core/Cargo.toml
#	gossip/Cargo.toml

* Fix conflicts

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-12-23 02:57:40 +00:00
acd03fc29b Check file size of snapshot_version when unarchiving snapshot (backport #21925) (#21987) 2021-12-20 14:22:34 -06:00
ddef156305 new net-stats require a new table (backport #21996) (#21999)
* new net-stats require a new table (#21996)

(cherry picked from commit 3fe942ab30)

# Conflicts:
#	core/src/system_monitor_service.rs

* merge

Co-authored-by: Jeff Biseda <jbiseda@gmail.com>
2021-12-18 10:29:29 +00:00
33cd3a161e Add json support for feature sets; also print output after feature list (#21905) (#21974)
* Add json support for feature sets; also print output after feature list

* Move stringifying into Display implementation

(cherry picked from commit dcd2854829)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-12-17 06:48:18 +00:00
31a0906410 Revert "Revert "Add Accountsdb plugin documentations (#21746) (#21798)""
This reverts commit 09c68ce696.
2021-12-16 19:28:48 -07:00
a0669af872 Revert "Revert "Rename Packets to PacketBatch (backport #21794) (#21804)""
This reverts commit 13d40d6a66.
2021-12-16 19:28:48 -07:00
0f6f0545d1 Revert "Revert "resolve conflicts (#21795)""
This reverts commit b73d23d50a.
2021-12-16 19:28:48 -07:00
89524d7b61 Revert "Revert "Nits in message-processor (backport #21755) (#21761)""
This reverts commit d3e92f4250.
2021-12-16 19:28:48 -07:00
4a66832fb0 Revert "Revert "Add more reporting for invalid stake cache members and prune them (backport #21654) (#21740)""
This reverts commit 8028f218a4.
2021-12-16 19:28:48 -07:00
df40ede6ea Revert "Revert "simulateTransaction now returns the correct error code if accounts are provided as input (#21715)""
This reverts commit 6deb0a9f5d.
2021-12-16 19:28:48 -07:00
93a8fd6a2b Revert "Revert "SDK: Add stdlib.h include to pull in abort() (backport #21700) (#21704)""
This reverts commit 402d72bc48.
2021-12-16 19:28:48 -07:00
985fae2dcf Revert "Revert "Ensure we have keys to activate these features (#21669) (#21673)""
This reverts commit a0b73d5658.
2021-12-16 19:28:48 -07:00
90730899f1 Revert "Revert "Reject vote withdraws that create non-rent-exempt accounts (backport #21639) (#21644)""
This reverts commit ae11cc3297.
2021-12-16 19:28:48 -07:00
b7cf6e7d9a Revert "Revert "Fixup flaky tests (backport #21617) (#21646)""
This reverts commit 156caeb710.
2021-12-16 19:28:48 -07:00
fb59f2ad59 Restore ALL behavior; add enum variant, comments, and help text to make behavior clearer (#21854) 2021-12-16 19:28:48 -07:00
0e9fd84228 Revert "Revert "Add offline and fee-payer utilities to CLI vote module (backport #21579) (#21648)""
This reverts commit 64c5e7d9a9.
2021-12-16 19:28:48 -07:00
5e9d20378d Revert "Revert "Remove activated feature for filtering invalid stakes from rewards (#21641) (#21650)""
This reverts commit 7bc9da3a97.
2021-12-16 19:28:48 -07:00
01e932c6a4 Revert "Revert "adds back position field to coding-shred-header (backport #21600) (#21619)""
This reverts commit c901227d0f.
2021-12-16 19:28:48 -07:00
e3e9d32f33 Revert "Revert "Use gnu tar""
This reverts commit 05a43e071c.
2021-12-16 19:28:48 -07:00
a523d09902 Revert "Revert "solana-test-validator no longer limits the size of the genesis archive""
This reverts commit c2891c392c.
2021-12-16 19:28:48 -07:00
3ed9a47082 Revert "Revert "Unvendor OpenSSL for Windows to avoid CI troubles with perl.exe""
This reverts commit 4f28ed1044.
2021-12-16 19:28:48 -07:00
9985f5fa5c Revert "Revert "Remove deprecated slow epoch boundary methods (backport #21568) (#21595)""
This reverts commit 77a3adb5a6.
2021-12-16 19:28:48 -07:00
0958760592 Revert "Revert "Update OSX build to XCode 12""
This reverts commit d1e0941289.
2021-12-16 19:28:48 -07:00
9f53f3455a Revert "Revert "Reformat imports to a consistent style for imports""
This reverts commit d7377d4794.
2021-12-16 19:28:48 -07:00
9fff4aa8b8 Revert "Revert "Ledger-tool: only require ledger dir when necessary (backport #21575) (#21578)""
This reverts commit eae3166bdc.
2021-12-16 19:28:48 -07:00
704d05f52d Revert "Revert "exempts AccountsHashes from stake check (#21565) (#21570)""
This reverts commit fdc05ecd5a.
2021-12-16 19:28:48 -07:00
50d62bdd13 Revert "Revert "cli: always print feature version info with status query (#21554)""
This reverts commit ef760fba32.
2021-12-16 19:28:48 -07:00
33c28da055 Revert "Revert "Add missing InstructionError::IllegalOwner conversion (backport #21524) (#21548)""
This reverts commit afd17ec5d9.
2021-12-16 19:28:48 -07:00
dd8e7f650a Revert "Revert "Build OpenSSL statically (backport #21533) (#21541)""
This reverts commit 8af4716710.
2021-12-16 19:28:48 -07:00
7621fa3c25 Revert "Revert "Fix more BPF alignment issues on arm64""
This reverts commit bdaac86f84.
2021-12-16 19:28:48 -07:00
58e46e107c Revert "Revert "Update builtins.rs""
This reverts commit c60314c4a1.
2021-12-16 19:28:48 -07:00
3c5ac9ab27 Revert "Revert "Quash M1 build warning""
This reverts commit bcacaf78e9.
2021-12-16 19:28:48 -07:00
cc931ff47f Revert "Revert "fix checks in process_vote_authorize (backport #21465) (#21486)""
This reverts commit 451ea7c9b2.
2021-12-16 19:28:48 -07:00
37727fbbc3 Revert "Revert "Add set_account to solana-program-test (#21415)""
This reverts commit 480895cc25.
2021-12-16 19:28:48 -07:00
c39d9eab04 Revert "Revert "Use underscore for hacky rust-analyzer script (#21386) (#21445)""
This reverts commit fbc519523f.
2021-12-16 19:28:48 -07:00
a70e4c05d4 Revert "Revert "Fix transaction log collector indexing (backport #21420) (#21423)""
This reverts commit 49e9adbba4.
2021-12-16 19:28:48 -07:00
961509abbd Revert "Revert "Fix typo: a -> an (#21422) (#21424)""
This reverts commit afa87c6a0b.
2021-12-16 19:28:48 -07:00
20681ea2ce Revert "Revert "init: Check all releases (#21417) (#21419)""
This reverts commit 336c39446b.
2021-12-16 19:28:48 -07:00
32bcfb757b Revert "Revert "Add bank drop service (#21322) (#21360)""
This reverts commit a7eb10a787.
2021-12-16 19:28:48 -07:00
eefb9875bf Revert "Revert "Add timing for accounts add_root (backport #21379) (#21391)""
This reverts commit 589eeb2432.
2021-12-16 19:28:48 -07:00
957914b3b5 Revert "Revert "Use max_complete_transaction_status_slot in BigTableUploadService (#21401) (#21411)""
This reverts commit fa83e05d2c.
2021-12-16 19:28:48 -07:00
f4113d24b4 Revert "Revert "Accept only decimal digits in file names inside snapshot (#21213) (#21281)""
This reverts commit 23be4d89ef.
2021-12-16 19:28:48 -07:00
2a43a89eca Revert "Revert "Bump bpf-tools to v1.20 (#21361)""
This reverts commit 24ace5cfaa.
2021-12-16 19:28:48 -07:00
4a93be9f77 Revert "Revert "Add BigTable query logs and counter (backport #21394) (#21398)""
This reverts commit 312f2fc6f6.
2021-12-16 19:28:48 -07:00
f03b6d701d Revert "Revert "Add timing metrics to bank creation and rewards calculation (#21066) (#21378)""
This reverts commit dfa1bc1bbd.
2021-12-16 19:28:48 -07:00
83676aed53 Revert "Revert "spl-token: New program feature flag (backport #21354) (#21376)""
This reverts commit 36838427d4.
2021-12-16 19:28:48 -07:00
a931b3f868 Revert "Revert "Fix authority in bpf_loader_upgradeable::close_any (#21344) (#21353)""
This reverts commit 3d526883e3.
2021-12-16 19:28:48 -07:00
feef0ea478 Revert "Revert "Spit log data charge into two (#21349) (#21352)""
This reverts commit 03db11eb3a.
2021-12-16 19:28:48 -07:00
c3c1b820fc Revert "Revert "Add ledger tool to remove dead slot (#20810) (#20813)""
This reverts commit 7210a883eb.
2021-12-16 19:28:48 -07:00
548c0afac2 Revert "Revert "Charge for sol_log_data translates (#21328) (#21335)""
This reverts commit fbf93f89a9.
2021-12-16 19:28:48 -07:00
6bc52d4d47 Bump version to v1.8.12 2021-12-15 09:25:32 -08:00
423a4d6546 Bumps solana_rbpf to v0.2.19 (#21880) 2021-12-14 14:06:08 -08:00
16f6bdf0b8 Bumps solana_rbpf to v0.2.18 (#21778) 2021-12-14 14:06:08 -08:00
63629351f8 Bumps solana_rbpf to v0.2.17 (#21672)
(cherry picked from commit 31b8fd3109)

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
2021-12-14 14:06:08 -08:00
2d93db9dec Feature gates for rbpf v0.2.16 (#21590)
- Adds feature reject_section_virtual_address_file_offset_mismatch.
- Adds feature start_verify_shift32_imm.
- Enables enable_symbol_and_section_labels only in the rbpf-cli.
2021-12-14 14:06:08 -08:00
558a52d5cb Bumps solana_rbpf to v0.2.16 (#21492) 2021-12-14 14:06:08 -08:00
b00087e1ca Bump solana_rbpf to version v0.2.15 (#21289)
Bumps [solana_rbpf](https://github.com/solana-labs/rbpf) from 0.2.14 to 0.2.15.
- [Release notes](https://github.com/solana-labs/rbpf/releases)
- [Commits](https://github.com/solana-labs/rbpf/compare/v0.2.14...v0.2.15)

---
updated-dependencies:
- dependency-name: solana_rbpf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-14 14:06:08 -08:00
e2850c84d2 Adds a feature gate to reject the deployment of programs with unresolved syscall symbols. (#21298) 2021-12-14 14:06:08 -08:00
f9b7e24846 Bump solana_rbpf to version v0.2.14 (#18869)
* Feature gate for verify_mul64_imm_nonzero as discussed in #17520.
2021-12-14 14:06:08 -08:00
843f26c2de Bump solana_rbpf to version 0.2.13 (#18068)
* Moves syscall_registry into the rbpf Executable constructor.

* Adds the reject_unresolved_syscalls flag which is only set when deploying programs via the CLI.
2021-12-14 14:06:08 -08:00
a09e8397fb Bump solana_rbpf to version 0.2.12 (#17585)
Unify BPF verifiers.
2021-12-14 14:06:08 -08:00
ef626e144d Serialize cargo-build-bpf tests (backported from master) 2021-12-14 12:42:12 -08:00
4cae58bfe9 Bump version to 1.8.11 2021-12-13 12:58:29 -08:00
f97d28caf4 reports bpf execution units without tx-wide-compute-cap feature 2021-12-13 12:56:46 -06:00
16abcac802 Bump version to 1.8.10 2021-12-13 12:46:23 -06:00
a5e6a188c1 Bump version to 1.8.9 2021-12-13 12:46:23 -06:00
9f44d60a39 Bump version to 1.8.8 2021-12-13 12:46:23 -06:00
9284c6fffb Bump version to 1.8.7 2021-12-13 12:46:23 -06:00
2c49ab1ab4 Bump version to 1.8.6 2021-12-13 12:46:23 -06:00
9832ac54a4 Revert "Bump version to v1.8.6 (#21329)"
This reverts commit 336ee01aae.
2021-12-13 12:46:23 -06:00
fbf93f89a9 Revert "Charge for sol_log_data translates (#21328) (#21335)"
This reverts commit 0565fe3320.
2021-12-13 12:46:23 -06:00
7210a883eb Revert "Add ledger tool to remove dead slot (#20810) (#20813)"
This reverts commit d1ca16e9f8.
2021-12-13 12:46:23 -06:00
03db11eb3a Revert "Spit log data charge into two (#21349) (#21352)"
This reverts commit b63617a3e1.
2021-12-13 12:46:23 -06:00
3d526883e3 Revert "Fix authority in bpf_loader_upgradeable::close_any (#21344) (#21353)"
This reverts commit f3ea9bc995.
2021-12-13 12:46:23 -06:00
36838427d4 Revert "spl-token: New program feature flag (backport #21354) (#21376)"
This reverts commit 42a67d30fc.
2021-12-13 12:46:23 -06:00
dfa1bc1bbd Revert "Add timing metrics to bank creation and rewards calculation (#21066) (#21378)"
This reverts commit 85302d6d17.
2021-12-13 12:46:23 -06:00
312f2fc6f6 Revert "Add BigTable query logs and counter (backport #21394) (#21398)"
This reverts commit 27b2561650.
2021-12-13 12:46:23 -06:00
24ace5cfaa Revert "Bump bpf-tools to v1.20 (#21361)"
This reverts commit 04cc50126b.
2021-12-13 12:46:23 -06:00
23be4d89ef Revert "Accept only decimal digits in file names inside snapshot (#21213) (#21281)"
This reverts commit d4192e3ac4.
2021-12-13 12:46:23 -06:00
fa83e05d2c Revert "Use max_complete_transaction_status_slot in BigTableUploadService (#21401) (#21411)"
This reverts commit 73d469991f.
2021-12-13 12:46:23 -06:00
589eeb2432 Revert "Add timing for accounts add_root (backport #21379) (#21391)"
This reverts commit 002693ab7d.
2021-12-13 12:46:23 -06:00
a7eb10a787 Revert "Add bank drop service (#21322) (#21360)"
This reverts commit b030d4be7c.
2021-12-13 12:46:23 -06:00
336c39446b Revert "init: Check all releases (#21417) (#21419)"
This reverts commit 6e656deb59.
2021-12-13 12:46:23 -06:00
afa87c6a0b Revert "Fix typo: a -> an (#21422) (#21424)"
This reverts commit 26f32a3288.
2021-12-13 12:46:23 -06:00
49e9adbba4 Revert "Fix transaction log collector indexing (backport #21420) (#21423)"
This reverts commit 484856e4d4.
2021-12-13 12:46:23 -06:00
fbc519523f Revert "Use underscore for hacky rust-analyzer script (#21386) (#21445)"
This reverts commit 90f791a6a9.
2021-12-13 12:46:23 -06:00
480895cc25 Revert "Add set_account to solana-program-test (#21415)"
This reverts commit 6293b9d218.
2021-12-13 12:46:23 -06:00
451ea7c9b2 Revert "fix checks in process_vote_authorize (backport #21465) (#21486)"
This reverts commit b1bf420524.
2021-12-13 12:46:23 -06:00
bcacaf78e9 Revert "Quash M1 build warning"
This reverts commit 713b61677e.
2021-12-13 12:46:23 -06:00
c60314c4a1 Revert "Update builtins.rs"
This reverts commit a54fa45d5a.
2021-12-13 12:46:23 -06:00
bdaac86f84 Revert "Fix more BPF alignment issues on arm64"
This reverts commit e5aa5efbac.
2021-12-13 12:46:23 -06:00
dc633e3385 Revert "Bump version to v1.8.7"
This reverts commit 008139f506.
2021-12-13 12:46:23 -06:00
8af4716710 Revert "Build OpenSSL statically (backport #21533) (#21541)"
This reverts commit e368de5f9c.
2021-12-13 12:46:23 -06:00
afd17ec5d9 Revert "Add missing InstructionError::IllegalOwner conversion (backport #21524) (#21548)"
This reverts commit b3904d80e6.
2021-12-13 12:46:23 -06:00
ef760fba32 Revert "cli: always print feature version info with status query (#21554)"
This reverts commit fe923bc56c.
2021-12-13 12:46:23 -06:00
fdc05ecd5a Revert "exempts AccountsHashes from stake check (#21565) (#21570)"
This reverts commit 416fccfc01.
2021-12-13 12:46:23 -06:00
eae3166bdc Revert "Ledger-tool: only require ledger dir when necessary (backport #21575) (#21578)"
This reverts commit 5a7b487e3d.
2021-12-13 12:46:23 -06:00
d7377d4794 Revert "Reformat imports to a consistent style for imports"
This reverts commit 139d15cd84.
2021-12-13 12:46:23 -06:00
d1e0941289 Revert "Update OSX build to XCode 12"
This reverts commit 4d3352e0e0.
2021-12-13 12:46:23 -06:00
77a3adb5a6 Revert "Remove deprecated slow epoch boundary methods (backport #21568) (#21595)"
This reverts commit b6d040b0d7.
2021-12-13 12:46:23 -06:00
4f28ed1044 Revert "Unvendor OpenSSL for Windows to avoid CI troubles with perl.exe"
This reverts commit 585695445f.
2021-12-13 12:46:23 -06:00
c2891c392c Revert "solana-test-validator no longer limits the size of the genesis archive"
This reverts commit 0cefd46d9d.
2021-12-13 12:46:23 -06:00
05a43e071c Revert "Use gnu tar"
This reverts commit 8d6b54837c.
2021-12-13 12:46:23 -06:00
6aaff6183d Revert "Bump solana_rbpf to version 0.2.12 (#17585)"
This reverts commit 231a3bda8e.
2021-12-13 12:46:23 -06:00
de8dc27ecf Revert "Bump solana_rbpf to version 0.2.13 (#18068)"
This reverts commit 765fbc9a8c.
2021-12-13 12:46:23 -06:00
cc75f576e2 Revert "Bump solana_rbpf to version v0.2.14 (#18869)"
This reverts commit 9d66458a40.
2021-12-13 12:46:23 -06:00
4a186c5834 Revert "Adds a feature gate to reject the deployment of programs with unresolved syscall symbols. (#21298)"
This reverts commit 06a3e9b178.
2021-12-13 12:46:23 -06:00
7e2e7dffa6 Revert "Bump solana_rbpf to version v0.2.15 (#21289)"
This reverts commit e52b3fd1d8.
2021-12-13 12:46:23 -06:00
c6141925a9 Revert "Bumps solana_rbpf to v0.2.16 (#21492)"
This reverts commit f04e06e0c2.
2021-12-13 12:46:23 -06:00
e68cd335d5 Revert "Feature gates for rbpf v0.2.16 (#21590)"
This reverts commit 6777ca244f.
2021-12-13 12:46:23 -06:00
3369826bd1 Revert "Bump version to v1.8.8 (#21609)"
This reverts commit b8306a99d8.
2021-12-13 12:46:23 -06:00
c901227d0f Revert "adds back position field to coding-shred-header (backport #21600) (#21619)"
This reverts commit 6d1e1287bc.
2021-12-13 12:46:23 -06:00
7bc9da3a97 Revert "Remove activated feature for filtering invalid stakes from rewards (#21641) (#21650)"
This reverts commit 9959ede9ce.
2021-12-13 12:46:23 -06:00
64c5e7d9a9 Revert "Add offline and fee-payer utilities to CLI vote module (backport #21579) (#21648)"
This reverts commit 1ab8c01ab7.
2021-12-13 12:46:23 -06:00
156caeb710 Revert "Fixup flaky tests (backport #21617) (#21646)"
This reverts commit 922c74caea.
2021-12-13 12:46:23 -06:00
ae11cc3297 Revert "Reject vote withdraws that create non-rent-exempt accounts (backport #21639) (#21644)"
This reverts commit 83e01442a7.
2021-12-13 12:46:23 -06:00
a0b73d5658 Revert "Ensure we have keys to activate these features (#21669) (#21673)"
This reverts commit eeb2bef63e.
2021-12-13 12:46:23 -06:00
fe5363ec6a Revert "Bumps solana_rbpf to v0.2.17 (#21672) (#21679)"
This reverts commit 387d5af52e.
2021-12-13 12:46:23 -06:00
402d72bc48 Revert "SDK: Add stdlib.h include to pull in abort() (backport #21700) (#21704)"
This reverts commit 32f507dc51.
2021-12-13 12:46:23 -06:00
c0794d6fbb Revert "Bump version to v1.8.9 (#21703)"
This reverts commit 69027e3f7e.
2021-12-13 12:46:23 -06:00
6deb0a9f5d Revert "simulateTransaction now returns the correct error code if accounts are provided as input (#21715)"
This reverts commit 7ac43b16d2.
2021-12-13 12:46:23 -06:00
be3209712d Revert "reports bpf execution units without tx-wide-compute-cap feature (#21731)"
This reverts commit 87471ed7fb.
2021-12-13 12:46:23 -06:00
8028f218a4 Revert "Add more reporting for invalid stake cache members and prune them (backport #21654) (#21740)"
This reverts commit 43e7368f3a.
2021-12-13 12:46:23 -06:00
3b5bafe510 Revert "Bump solana_rbpf to version v0.2.18 (#21778)"
This reverts commit 2b2536ac42.
2021-12-13 12:46:23 -06:00
d3e92f4250 Revert "Nits in message-processor (backport #21755) (#21761)"
This reverts commit 87c71647e8.
2021-12-13 12:46:23 -06:00
400418fe2f Revert "Bump version to 1.8.10 (#21790)"
This reverts commit 73acae9b5d.
2021-12-13 12:46:23 -06:00
b73d23d50a Revert "resolve conflicts (#21795)"
This reverts commit e9d8a7a641.
2021-12-13 12:46:23 -06:00
13d40d6a66 Revert "Rename Packets to PacketBatch (backport #21794) (#21804)"
This reverts commit 39e27b130f.
2021-12-13 12:46:23 -06:00
09c68ce696 Revert "Add Accountsdb plugin documentations (#21746) (#21798)"
This reverts commit 51cab5d16d.
2021-12-13 12:46:23 -06:00
801dc58b78 cli: Order displayed feature list by status (#21810) (#21829)
(cherry picked from commit 1149c1880d)

Co-authored-by: Justin Starry <justin@solana.com>
2021-12-13 16:32:01 +00:00
51cab5d16d Add Accountsdb plugin documentations (#21746) (#21798)
* Add Accountsdb plugin documentations (#21746)

Add the public facing documentation about the plugin framework: explaining the interface, how to load plugin and the example PostgreSQL plugin implementation.
Updated the rust documentation for the plugin interfaces for accounts and slot.
This changes are targeted for v1.8. Information about transactions will be updated later.

* fmt issue
2021-12-11 14:32:42 -08:00
39e27b130f Rename Packets to PacketBatch (backport #21794) (#21804)
* Rename Packets to PacketBatch (#21794)

(cherry picked from commit 254ef3e7b6)

# Conflicts:
#	core/src/ancestor_hashes_service.rs
#	core/src/banking_stage.rs
#	core/src/cluster_info_vote_listener.rs
#	core/src/fetch_stage.rs
#	core/src/serve_repair.rs
#	core/src/shred_fetch_stage.rs
#	core/src/sigverify_stage.rs
#	core/src/verified_vote_packets.rs
#	core/src/window_service.rs
#	gossip/src/cluster_info.rs
#	ledger/src/entry.rs
#	streamer/src/streamer.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-12-11 17:32:17 +00:00
e9d8a7a641 resolve conflicts (#21795) 2021-12-11 10:43:45 -05:00
73acae9b5d Bump version to 1.8.10 (#21790) 2021-12-10 18:44:32 -06:00
87c71647e8 Nits in message-processor (backport #21755) (#21761)
* Nits in message-processor (#21755)

* Fixup typo

* Simplify types slightly

(cherry picked from commit c1386d66e6)

# Conflicts:
#	runtime/src/bank.rs
#	runtime/src/message_processor.rs

* Fix conflicts

* Use alias more broadly

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-12-10 21:19:44 +00:00
2b2536ac42 Bump solana_rbpf to version v0.2.18 (#21778) 2021-12-10 15:02:47 -06:00
43e7368f3a Add more reporting for invalid stake cache members and prune them (backport #21654) (#21740)
* Add more reporting for invalid stake cache members and prune them (#21654)

* Add more reporting for invalid stake cache members

* feedback

(cherry picked from commit 6fc329180b)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock
#	runtime/Cargo.toml
#	runtime/src/bank.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-12-10 14:13:33 -05:00
87471ed7fb reports bpf execution units without tx-wide-compute-cap feature (#21731) 2021-12-09 14:51:44 -06:00
7ac43b16d2 simulateTransaction now returns the correct error code if accounts are provided as input (#21715)
(cherry picked from commit 824994db69)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-12-09 02:19:07 +00:00
69027e3f7e Bump version to v1.8.9 (#21703) 2021-12-08 18:33:05 +01:00
32f507dc51 SDK: Add stdlib.h include to pull in abort() (backport #21700) (#21704)
* SDK: Add stdlib.h include to pull in `abort()` (#21700)

(cherry picked from commit 923720f529)

# Conflicts:
#	sdk/bpf/c/inc/sol/assert.h

* Fix merge conflict

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-12-08 17:26:31 +00:00
387d5af52e Bumps solana_rbpf to v0.2.17 (#21672) (#21679)
(cherry picked from commit 31b8fd3109)

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
2021-12-07 23:36:40 +00:00
eeb2bef63e Ensure we have keys to activate these features (#21669) (#21673)
(cherry picked from commit 45e56c599d)

Conflicts:
	sdk/src/feature_set.rs

Co-authored-by: Sean Young <sean@mess.org>
2021-12-07 21:15:43 +00:00
83e01442a7 Reject vote withdraws that create non-rent-exempt accounts (backport #21639) (#21644)
* Reject vote withdraws that create non-rent-exempt accounts (#21639)

* Reject vote withdraws that create non-rent-exempt accounts

* fix mocked instruction test

(cherry picked from commit e123883b26)

# Conflicts:
#	program-runtime/src/invoke_context.rs
#	programs/vote/src/vote_instruction.rs
#	sdk/src/feature_set.rs

* resolve conflicts

* fix old rust issue

Co-authored-by: Justin Starry <justin@solana.com>
2021-12-07 11:28:40 -05:00
922c74caea Fixup flaky tests (backport #21617) (#21646)
* Fix fork race condition in optimistic violation tower tests (#19192)

* Fix fork race condition in optimistic violation tower tests

* clippy

* pr comments

* Fixup flaky tests (#21617)

* Fixup flaky tests

* Fixup listeners

Co-authored-by: Ashwin Sekar <ashwin@solana.com>
Co-authored-by: carllin <carl@solana.com>
2021-12-07 05:00:49 +00:00
1ab8c01ab7 Add offline and fee-payer utilities to CLI vote module (backport #21579) (#21648)
* Add offline and fee-payer utilities to CLI vote module (#21579)

* create-vote-account: add offline, nonce, fee_payer capabilities

* vote-authorize: add offline, nonce, fee-payer

* vote-update-things: add offline, nonce, fee-payer

* withdraw-vote: add offline, nonce, fee-payer

* close-vote-acct: add fee-payer

* Allow WithdrawVoteAccount to empty account, since offline operations cannot perform account state queries as in CloseVoteAccount

* Fix lint

* Update offline-signing docs

* Add some parse unit tests

* Add offline integration test

(cherry picked from commit 873fe81bc0)

# Conflicts:
#	cli/src/cli.rs
#	cli/src/vote.rs
#	cli/tests/vote.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-12-07 02:07:26 +00:00
9959ede9ce Remove activated feature for filtering invalid stakes from rewards (#21641) (#21650)
(cherry picked from commit a1adcb23b6)

Co-authored-by: Justin Starry <justin@solana.com>
2021-12-07 00:54:41 +00:00
6d1e1287bc adds back position field to coding-shred-header (backport #21600) (#21619)
* adds back position field to coding-shred-header (#21600)

https://github.com/solana-labs/solana/pull/17004
removed position field from coding-shred-header because as it stands the
field is redundant and unused.
However, with the upcoming changes to erasure coding schema this field
will no longer be redundant and needs to be populated.

(cherry picked from commit cd17f63d81)

# Conflicts:
#	core/src/window_service.rs
#	ledger/src/blockstore.rs
#	ledger/src/shred.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-12-05 17:12:12 +00:00
b8306a99d8 Bump version to v1.8.8 (#21609) 2021-12-04 10:00:35 -07:00
6777ca244f Feature gates for rbpf v0.2.16 (#21590)
- Adds feature reject_section_virtual_address_file_offset_mismatch.
- Adds feature start_verify_shift32_imm.
- Enables enable_symbol_and_section_labels only in the rbpf-cli.
2021-12-04 00:41:04 -07:00
f04e06e0c2 Bumps solana_rbpf to v0.2.16 (#21492) 2021-12-04 00:41:04 -07:00
e52b3fd1d8 Bump solana_rbpf to version v0.2.15 (#21289)
Bumps [solana_rbpf](https://github.com/solana-labs/rbpf) from 0.2.14 to 0.2.15.
- [Release notes](https://github.com/solana-labs/rbpf/releases)
- [Commits](https://github.com/solana-labs/rbpf/compare/v0.2.14...v0.2.15)

---
updated-dependencies:
- dependency-name: solana_rbpf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-04 00:41:04 -07:00
06a3e9b178 Adds a feature gate to reject the deployment of programs with unresolved syscall symbols. (#21298) 2021-12-04 00:41:04 -07:00
9d66458a40 Bump solana_rbpf to version v0.2.14 (#18869)
* Feature gate for verify_mul64_imm_nonzero as discussed in #17520.
2021-12-04 00:41:04 -07:00
765fbc9a8c Bump solana_rbpf to version 0.2.13 (#18068)
* Moves syscall_registry into the rbpf Executable constructor.

* Adds the reject_unresolved_syscalls flag which is only set when deploying programs via the CLI.
2021-12-04 00:41:04 -07:00
231a3bda8e Bump solana_rbpf to version 0.2.12 (#17585)
Unify BPF verifiers.
2021-12-04 00:41:04 -07:00
8d6b54837c Use gnu tar 2021-12-03 23:33:33 -08:00
0cefd46d9d solana-test-validator no longer limits the size of the genesis archive
When using `--clone` with a large number of accounts it is possible to
surpass the default 10MB limit

(cherry picked from commit 4dcf594856)
2021-12-03 13:52:58 -08:00
585695445f Unvendor OpenSSL for Windows to avoid CI troubles with perl.exe
(cherry picked from commit c9bfc99c72)
2021-12-03 13:03:30 -08:00
b6d040b0d7 Remove deprecated slow epoch boundary methods (backport #21568) (#21595)
* Remove deprecated slow epoch boundary methods (#21568)

(cherry picked from commit 1430b58a6d)

# Conflicts:
#	core/src/replay_stage.rs
#	core/src/tvu.rs
#	core/src/validator.rs
#	local-cluster/src/validator_configs.rs
#	runtime/src/bank.rs
#	runtime/src/stakes.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-12-03 15:54:33 -05:00
4d3352e0e0 Update OSX build to XCode 12
Vendored OpenSSL is failing to build on the Travis default OS X image
2021-12-03 10:03:15 -08:00
139d15cd84 Reformat imports to a consistent style for imports
rustfmt.toml configuration:
        imports_granularity = "One"
         group_imports = "One"
2021-12-03 09:41:09 -08:00
5a7b487e3d Ledger-tool: only require ledger dir when necessary (backport #21575) (#21578)
* Ledger-tool: only require ledger dir when necessary (#21575)

* Don't canonicalize ledger_path unless ledger_path will be used

* Single use statement

(cherry picked from commit 2b269dbe0e)

# Conflicts:
#	ledger-tool/src/main.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-12-03 03:25:56 +00:00
416fccfc01 exempts AccountsHashes from stake check (#21565) (#21570)
Otherwise getHealth fails if account hashes are not propagated.

(cherry picked from commit 9886366977)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-12-02 20:42:27 +00:00
fe923bc56c cli: always print feature version info with status query (#21554)
(cherry picked from commit 04c0f124c4)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-12-02 05:12:55 +00:00
b3904d80e6 Add missing InstructionError::IllegalOwner conversion (backport #21524) (#21548)
* Add missing InstructionError::IllegalOwner conversion (#21524)

* Add missing InstructionError code

* Add test that will fail on missing conversion

* Move enum-iterator to dev-only

(cherry picked from commit 0fc1c2e1fb)

# Conflicts:
#	Cargo.lock

* Fix conflict

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-12-02 04:19:15 +00:00
e368de5f9c Build OpenSSL statically (backport #21533) (#21541)
* Remove unused bpfloader openssl dependency

(cherry picked from commit 0212a71d3e)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock
#	programs/bpf_loader/Cargo.toml

* Build openssl statically

(cherry picked from commit 3d21b062cc)

* rebase

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-12-01 22:05:35 +00:00
008139f506 Bump version to v1.8.7 2021-12-01 11:44:18 -08:00
e5aa5efbac Fix more BPF alignment issues on arm64 2021-11-30 17:26:01 -08:00
a54fa45d5a Update builtins.rs 2021-11-30 00:55:07 -08:00
713b61677e Quash M1 build warning
(cherry picked from commit e31b469f56)

# Conflicts:
#	ledger/src/builtins.rs
2021-11-30 00:55:07 -08:00
b1bf420524 fix checks in process_vote_authorize (backport #21465) (#21486)
* fix checks in process_vote_authorize (#21465)

(cherry picked from commit 09799590ac)

# Conflicts:
#	cli/src/vote.rs

* resolve conflicts

Co-authored-by: DimAn <diman@diman.io>
Co-authored-by: Justin Starry <justin@solana.com>
2021-11-29 21:06:13 +00:00
6293b9d218 Add set_account to solana-program-test (#21415)
For writing tests, it is often desirable to create a certain situation
that would be tedious, or even impossible to create by sending
individual transactions.

For example, a common attack vector on Solana is to create a copy of
some existing account that stores configuration data, but manipulate the
data stored there, and then to call a program and pass in the
manipulated account, instead of the real account.

If one wants to test this, one option is to write a program that you can
call to write arbitrary data into a new account account (and possibly
change its owner), then include that program in the test context, and
send a transaction to call it. This is extremely tedious, and developers
are not going to bother doing it. I myself would rather fork
solana-program-test to add this `set_account` method, than to write that
program. Having a “god mode” method to just write an account, lowers the
barrier to writing comprehensive tests.

A second reason for introducing this method, is defense in depth. There
may be states of the bank that are not reachable *yet* by only sending
transactions, but that you might want to test against either way. For
example, right now, the balance of a stake account cannot decrease
without going through the stake program. But what if Solana were to
introduce slashing in the future, and you want to ensure your program is
robust against decreases in stake account balance? Right now there is no
way to test this, but by introducing this “god mode” to write accounts,
the situation becomes testable.

(cherry picked from commit e7fa412465)
2021-11-28 22:25:20 -08:00
90f791a6a9 Use underscore for hacky rust-analyzer script (#21386) (#21445)
Using dashes prevents the code from building, which is annoying
if you quickly want to test some hack.
With underscore we get the same effect but the code still builds.

(cherry picked from commit 46aed1b7f9)

Co-authored-by: Benno Fünfstück <benno.fuenfstueck@gmail.com>
2021-11-26 12:43:42 +00:00
484856e4d4 Fix transaction log collector indexing (backport #21420) (#21423)
* bank: factor tx log getter out to method on `TransactionLogCollector`

(cherry picked from commit efedb55705)

# Conflicts:
#	runtime/src/bank.rs

* bank: Add failing test for `TransactionLogCollector::get_logs_for_address()`

(cherry picked from commit dafdc15dfe)

# Conflicts:
#	runtime/src/bank.rs

* bank: don't panic when getting logs from malformed TransactionLogCollector

(cherry picked from commit e558ad4c71)

* bank: `TransactionLogCollector` - only push address mappings after pushing a log message

(cherry picked from commit 41cc7af7cd)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-11-25 08:57:37 +00:00
26f32a3288 Fix typo: a -> an (#21422) (#21424)
(cherry picked from commit 88f8c89f18)

Co-authored-by: Aiham <aiham@users.noreply.github.com>
2021-11-25 06:35:12 +00:00
6e656deb59 init: Check all releases (#21417) (#21419)
(cherry picked from commit 69e1b68fbb)

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-11-25 01:45:49 +00:00
b030d4be7c Add bank drop service (#21322) (#21360)
(cherry picked from commit 0bda0c3e0c)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-11-24 16:58:42 +00:00
002693ab7d Add timing for accounts add_root (backport #21379) (#21391)
* Add timing for accounts add_root (#21379)

(cherry picked from commit c4d68063c7)

# Conflicts:
#	runtime/src/accounts.rs
#	runtime/src/accounts_db.rs

* Resolve conflicts

Co-authored-by: sakridge <sakridge@gmail.com>
Co-authored-by: Carl Lin <carl@solana.com>
2021-11-24 16:00:45 +00:00
73d469991f Use max_complete_transaction_status_slot in BigTableUploadService (#21401) (#21411)
* Use max_complete_transaction_status_slot in BigTableUploadService

* Use node root to limit BigTableUploadService

(cherry picked from commit 9e043d2055)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-11-24 02:35:42 +00:00
d4192e3ac4 Accept only decimal digits in file names inside snapshot (#21213) (#21281)
This also should make snapshot validation a bit faster.

(cherry picked from commit 9b1bf98aa2)

Co-authored-by: Ivan Mironov <mironov.ivan@gmail.com>
2021-11-23 22:36:52 +00:00
04cc50126b Bump bpf-tools to v1.20 (#21361) 2021-11-23 18:24:08 +00:00
27b2561650 Add BigTable query logs and counter (backport #21394) (#21398)
* Add BigTable query logs and counter (#21394)

* Add LedgerStorage logs

* Add storage-bigtable metric

(cherry picked from commit f3f8d2e4f3)

# Conflicts:
#	storage-bigtable/Cargo.toml

* Fix conflict

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-11-23 01:17:17 +00:00
85302d6d17 Add timing metrics to bank creation and rewards calculation (#21066) (#21378)
(cherry picked from commit cd6f931223)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-11-21 21:00:12 +00:00
42a67d30fc spl-token: New program feature flag (backport #21354) (#21376)
* spl-token: New program feature flag (#21354)

* spl-token: Add feature flag for new release

* Remove all spl token version declarations

(cherry picked from commit 02bc4e3fc1)

# Conflicts:
#	account-decoder/Cargo.toml
#	accounts-cluster-bench/Cargo.toml
#	accounts-cluster-bench/src/main.rs
#	rpc/Cargo.toml
#	rpc/src/rpc.rs
#	runtime/src/accounts_index.rs
#	runtime/src/bank.rs
#	runtime/src/lib.rs
#	sdk/src/feature_set.rs
#	tokens/Cargo.toml
#	tokens/src/spl_token.rs
#	transaction-status/Cargo.toml

* Fix merge issues

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-11-21 16:00:58 +00:00
f3ea9bc995 Fix authority in bpf_loader_upgradeable::close_any (#21344) (#21353)
(cherry picked from commit 1a7cefded7)

Co-authored-by: Kirill Fomichev <fanatid@ya.ru>
2021-11-19 09:10:48 -08:00
b63617a3e1 Spit log data charge into two (#21349) (#21352)
(cherry picked from commit e9c00d1e69)

Co-authored-by: Jack May <jack@solana.com>
2021-11-18 23:58:44 +00:00
d1ca16e9f8 Add ledger tool to remove dead slot (#20810) (#20813)
(cherry picked from commit b5f21d5e34)

Co-authored-by: carllin <carl@solana.com>
2021-11-18 21:46:41 +00:00
0565fe3320 Charge for sol_log_data translates (#21328) (#21335)
(cherry picked from commit 91fe1278f1)

Co-authored-by: Jack May <jack@solana.com>
2021-11-18 20:27:50 +00:00
336ee01aae Bump version to v1.8.6 (#21329) 2021-11-17 17:16:20 -07:00
76c5c94a8a remove store_cached stall (#21323)
* Bump tokio

* remove store_cached stall

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-11-17 14:45:54 -06:00
c3b1906f1d Bump tokio (#21324) 2021-11-17 11:08:40 -07:00
318d26f0ff Reverts #21302 (#21320) 2021-11-17 10:31:07 +01:00
c53174dc56 Fixup processed docs (#21316) (#21317)
(cherry picked from commit 6546c3cbae)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-11-17 07:11:48 +00:00
baa4c6eaf2 Bump solana_rbpf to version 0.2.13 (#18068) (#21302)
* Moves syscall_registry into the rbpf Executable constructor.

* Adds the reject_unresolved_syscalls flag which is only set when deploying programs via the CLI.

(cherry picked from commit 8d5c04e257)

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
2021-11-17 01:23:15 +00:00
064cce41f7 add --no-os-network-stats-reporting option (backport #21296) (#21303)
* add --no-os-network-stats-reporting option (#21296)

(cherry picked from commit d5de0c8e12)

# Conflicts:
#	core/src/system_monitor_service.rs
#	ledger-tool/src/main.rs
#	validator/src/main.rs

* resolve merge conflicts

Co-authored-by: Jeff Biseda <jbiseda@gmail.com>
2021-11-16 23:00:54 +00:00
d291bcf26e Remove feature switch handling for checking vote init (#20557) (#20563)
(cherry picked from commit db9336c99e)

Co-authored-by: Justin Starry <justin@solana.com>
2021-11-16 21:10:27 +00:00
40c86a0605 Fix BPF parameter alignment to work regardless of target ABI (#21271) (#21299)
(cherry picked from commit 7e600bd451)

Co-authored-by: Ben Newhouse <newhouseb@gmail.com>
2021-11-16 21:06:42 +00:00
80c3591391 Bump version to 1.8.5 (#21295) 2021-11-16 11:58:57 -07:00
741f9ea57f update config by testnet (#20699) (#20729)
(cherry picked from commit e225ed7ab0)

Co-authored-by: Tao Zhu <82401714+taozhu-chicago@users.noreply.github.com>
2021-11-16 17:40:06 +00:00
0e6b476cbf More set_root metrics (backport #21286) (#21290)
* More set_root metrics (#21286)

(cherry picked from commit 398af132a5)

# Conflicts:
#	core/src/replay_stage.rs

* Fix conflict

Co-authored-by: sakridge <sakridge@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-11-16 02:29:33 +00:00
8bfba571f2 Make cargo-build-bpf clean up after failed installation of bpf-tools (#21143) (#21157)
(cherry picked from commit 55d19e61da)

Co-authored-by: Dmitri Makarov <dmakarov@users.noreply.github.com>
2021-11-15 23:45:15 +00:00
1a0eabe340 add new macro: pubkey! (backport #21245) (#21288) 2021-11-15 13:42:30 -08:00
a05c08e711 Bump bpf-tools to v1.19 (#21256) (#21264)
Toolchain upgrade to rust 1.56.0 and clang 13.0.

(cherry picked from commit 3f4f05865d)

Co-authored-by: Dmitri Makarov <dmakarov@users.noreply.github.com>
2021-11-15 20:59:58 +00:00
6a6dd86262 throttle store_cached when cache size is too large (#21188) (#21279)
* throttle store_cached when cache size is too large

* reduce max delay

* 100ms max

* 10ms max delay

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-11-15 19:57:27 +00:00
5d6b52f9af docs: Replaces "is_rooted" with "is_connected" (#20762) (#21283)
(cherry picked from commit 119549403d)

Co-authored-by: Arthur Burkart <arthur@presynce.com>
2021-11-15 10:26:55 -08:00
8072635967 Add validator options to change priority of snapshot packager and RPC threads (v1.8) (#21020)
* Add function for changing thread's nice value

Linux only.

* Add validator option to change niceness of snapshot packager thread

* Add validator option to change niceness of RPC server threads

Fixes https://github.com/solana-labs/solana/issues/14556

* Run `./scripts/cargo-for-all-lock-files.sh tree`
2021-11-15 09:50:45 -08:00
a86fdebb3b Bump timeout on test_rpc_subscriptions (#21259) (#21262)
* Extend timeout

* Add log

(cherry picked from commit 156b8ead42)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-11-13 14:23:48 +00:00
31b3ada6d9 Update various terms to "known" (backport #21257) (#21261)
* Update various terms to "known" (#21257)

* Update snapshot bootstrap terminology

* Update only known rpc terminology

* Update replica-node

(cherry picked from commit ae3777cadb)

# Conflicts:
#	replica-node/src/replica_util.rs
#	validator/src/bootstrap.rs

* Fix conflicts

* Remove dangling file

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-11-13 07:12:54 +00:00
2992a7154a Refactor vote state to remove double negative (backport #21244) (#21250)
* Refactor vote state to remove double negative (#21244)

(cherry picked from commit ef29d2d172)

# Conflicts:
#	runtime/src/stakes.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-11-13 01:27:23 +00:00
21cd423e67 Rename "trusted" to "known" in validators/ (backport #21197) (#21255)
* Rename "trusted" to "known" in `validators/` (#21197)

* Replaced trusted with known validator

* Format Convention

(cherry picked from commit b0ca335463)

# Conflicts:
#	core/src/accounts_hash_verifier.rs
#	core/src/serve_repair.rs
#	rpc/src/rpc_service.rs
#	validator/src/bootstrap.rs

* Fix conflicts

Co-authored-by: Michael Keleti <16996410+mkeleti@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-11-12 21:36:53 +00:00
09ef4d12f7 Bump version to 1.8.4 (#21232) (#21235)
Co-authored-by: sakridge <sakridge@gmail.com>
2021-11-10 15:20:41 -07:00
de94c4e867 Add set_root bank drop logging (#21144) (#21194)
(cherry picked from commit 706b60b5c8)

Co-authored-by: carllin <carl@solana.com>
2021-11-10 11:58:28 -07:00
74684a107c Revert "Bump version to 1.8.4 (#21232)"
This reverts commit 19b3ba0442.
2021-11-10 11:19:39 -07:00
19b3ba0442 Bump version to 1.8.4 (#21232) 2021-11-10 16:38:44 +01:00
784c745efa Disable JIT compiler on unsupported platforms (#21215) (#21218)
(cherry picked from commit b4d09388aa)

Co-authored-by: Kirill Fomichev <fanatid@ya.ru>
2021-11-09 13:29:49 +00:00
a7b3436b1e report pubsub stats every 2s (backport #21192) (#21196)
* report pubsub stats every 2s (#21192)

(cherry picked from commit 7659a2edc2)

* remove use of Duration::MAX

Co-authored-by: Jeff Biseda <jbiseda@gmail.com>
2021-11-06 15:22:07 +00:00
89b2a3d0ae Refactor RentDebits to use hashmap instead of vec (v1.8 backport) (#21176)
* Refactor `RentDebits` to use hashmap instead of vec (v1.8 backport)

* Fix rent debits test (#21177)
2021-11-05 08:52:14 +00:00
56fc58a2b5 Simplify replay vote tracking by using packet metadata (backport #21112) (#21149)
* Simplify replay vote tracking by using packet metadata (#21112)

(cherry picked from commit 140a5f633d)

# Conflicts:
#	core/src/banking_stage.rs
#	ledger-tool/src/main.rs
#	rpc/src/rpc.rs
#	runtime/src/bank.rs
#	runtime/src/bank_utils.rs
#	runtime/src/stakes.rs
#	sdk/src/transaction/sanitized.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-11-05 00:16:34 +00:00
53e0c9710e Fix typo in bankless-leader.md (#21152) (#21160)
Reseting -> Resetting

(cherry picked from commit ae207b7dbb)

Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
2021-11-03 23:16:43 +00:00
c14864a608 Add accounts stats for space amplification (#21151) 2021-11-03 16:41:29 +01:00
780302af56 Add set_root timing metrics (#21119) (#21135)
(cherry picked from commit 1e5212e60d)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-11-02 20:17:04 +00:00
90557564c3 Accountsdb plugin postgres improvement (#21034) (#21096)
Summary of Changes

Added the reference postgresql.conf
Prepare slot update statement to reduce overhead in updating slot
Support custom connection string
Allow the plugin to panic on replication issues to ensure consistency
2021-11-02 01:07:21 -07:00
6d2fd078be Update deprecated variant in RpcClient doctests (#21121) (#21131)
(cherry picked from commit 96e5342292)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-11-01 23:48:30 -06:00
4a874e9ba1 Fixup filter deprecated since (#21123) (#21128)
(cherry picked from commit 1b47f7f2cd)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-11-02 04:23:32 +00:00
22510678b4 docs: Update language around immutable programs (#21116) (#21118)
(cherry picked from commit ec86ff8fb3)

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-11-01 21:01:27 +00:00
69b973a3a6 Parallel notifications in RPC PubSub (backport #20543) (#21092)
* Parallel notifications in RPC PubSub (#20543)

* generate rpc notifications in parallel

* Use multithreaded runtime for pubsub

* add metric for time since creation of rpc notification to queue

* measure notification entry processing

* fix: add n_threads config argument

* configure rayon thread pool for rpc notifications

* add config option for pubsub notification threads

* rename metric to created_to_queue_time_us

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

* rename metric to notification_entry_processing_time_us

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

* use value_of for rpc_pubsub_notification_threads parsing

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

* rename threads to sol-sub-notif-N

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

* fix rpc tests for TimestampedNotificationEntry

* rustfmt

* use rayon thread limit for rpc

Co-authored-by: Pavel Strakhov <p.strakhov@iconic.vc>
Co-authored-by: Alexander Polakov <a.polakov@zubr.io>
Co-authored-by: Nikita Podoliako <bananaelecitrus@gmail.com>
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
(cherry picked from commit 9fabff5129)

# Conflicts:
#	Cargo.lock
#	rpc/Cargo.toml

* Fix conflicts

Co-authored-by: Pavel Strakhov <ri@idzaaus.org>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-11-01 20:19:51 +00:00
cc7ed71cb7 Fix serum-dex downstream build (#21115) 2021-11-01 17:54:22 +00:00
b6fe051d24 Document next_account_info(s) (#21076) (#21080)
(cherry picked from commit 62c8fb4792)

Co-authored-by: Brian Anderson <andersrb@gmail.com>
2021-10-29 22:22:09 +00:00
506d39ea82 Add missing websocket methods to rust RPC PubSub client (backport #21065) (#21073)
* Add missing websocket methods to rust RPC PubSub client (#21065)

- Added accountSubscribe,  programSubscribe, slotSubscribe and rootSubscribe to rust RpcClient
 - Removed duplication on cleanup threads
 - Moved RPCVote from rpc/ to client/rpc_response

(cherry picked from commit a0f9e0e8ee)

# Conflicts:
#	Cargo.lock
#	client-test/Cargo.toml
#	core/tests/client.rs

* Fix conflicts

* Make test result not depend on TestValidator setup

Co-authored-by: Manuel Gil <manugildev@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-29 21:46:59 +00:00
a595e06b48 Check whether vote-authorize-voter-checked new vote authority is_interactive (#21051) (#21057)
* Check interactive signer for vote-authorize-voter-checked

* Recommend checked vote reauthorization

(cherry picked from commit 0b8fcf0808)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-28 23:10:25 +00:00
da08f3dc2b seeds rng for test_build_crds_filter test (#21031) (#21048)
(cherry picked from commit eea3fb327f)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-10-28 22:06:13 +00:00
8dd3c1ece1 Bump version to v1.8.3 (#21040) 2021-10-28 11:17:11 -06:00
42a2c29234 Different error if block status is not yet available (#20407) (#21029)
* Different error if block is not available

* Add slot to error message

* Make and use helper function

* Check finalized path as well

Co-authored-by: Tyera Eulberg <tyera@solana.com>
(cherry picked from commit 700e42d556)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-10-27 20:58:15 +00:00
a1f1264962 Swap banking stage vote channels (#20987) (#21000)
(cherry picked from commit 261dd96ae3)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-10-27 20:17:38 +00:00
66caead016 Add compute budget noops (backport #20992) (#21014)
* Add compute budget program as a noop (#20992)

(cherry picked from commit 1e2bef76e3)

# Conflicts:
#	sdk/src/feature_set.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-10-27 12:47:35 -07:00
de1f60fb2d Refactor cost tracker metrics reporting (backport #20802) (#20933)
* - cost_tracker is data member of a bank, it can report metrics when bank is frozen (#20802)

- removed cost_tracker_stats and histogram
- move stats reporting outside of bank freeze

(cherry picked from commit c2bfce90b3)

# Conflicts:
#	Cargo.lock
#	core/src/banking_stage.rs
#	core/src/replay_stage.rs
#	core/src/tvu.rs
#	ledger-tool/src/main.rs
#	programs/bpf/Cargo.lock
#	runtime/Cargo.toml
#	runtime/src/cost_tracker.rs

* manual fix merge conflicts

Co-authored-by: Tao Zhu <82401714+taozhu-chicago@users.noreply.github.com>
Co-authored-by: Tao Zhu <tao@solana.com>
2021-10-27 16:48:20 +00:00
7528016e2d Add counter for dropped duplicated packets, fix dropped_packets_count (#20834) (#21023)
(cherry picked from commit 71d0bd4605)
2021-10-27 11:36:37 -05:00
adc57899fe tpu-client: Add send_messages_with_spinner from program / stake-o-matic (backport #20960) (#21002)
* tpu-client: Move `send_messages_with_spinner` from program (#20960)

We have too many ways of sending transactions, and too many
reimplementations of the same logic all over the place.

The program deploy logic and stake-o-matic currently make the
most use of the TPU client, so this merges their implementations into
one place to be reused by both.  Yay for consolidation!

(cherry picked from commit 5f7b60576f)

# Conflicts:
#	cli/src/program.rs
#	client/src/mock_sender.rs

* Fix merge issues, use older APIs

* Update mock sender fee to match block height

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-10-27 12:22:17 +00:00
afe229a89e Document entrypoint!, custom_heap_default!, and custom_panic_default! (#21003) (#21015)
(cherry picked from commit ced1505b75)

Co-authored-by: Brian Anderson <andersrb@gmail.com>
2021-10-27 07:49:14 +00:00
5dd00e9230 Force a recent version of the openssl crate to allow this to build on M1 macs (backport #21008) (#21012)
* Force a recent version of the openssl crate to allow this to build on M1 macs

(cherry picked from commit 920159fc63)

# Conflicts:
#	Cargo.lock
#	programs/bpf_loader/Cargo.toml

* Run cargo check

(cherry picked from commit 8efc577374)

# Conflicts:
#	programs/bpf/Cargo.lock

* Resolve merge conflicts

Co-authored-by: Matt Wilde <matthewcwilde@gmail.com>
Co-authored-by: Michael Vines <mvines@gmail.com>
2021-10-27 02:55:49 +00:00
0a698fc48f Instruction sysvar fixes, additions (backport #20958) (#21001)
* Instruction sysvar fixes, additions (#20958)

(cherry picked from commit 4fe3354c8f)

# Conflicts:
#	programs/bpf/rust/sysvar/src/lib.rs
#	programs/bpf/tests/programs.rs
#	sdk/program/src/sysvar/instructions.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-10-27 01:00:01 +00:00
1666fc5483 Restore getProgramAccounts spl-token secondary-index functionality (backport #20993) (#21005)
* Restore getProgramAccounts spl-token secondary-index functionality (#20993)

* Allow get_spl_token_X_filters to match on any encoding, and optimize earlier

* Remove redundant optimize calls

* Compress match statements

* Add method docs, including note to use optimize_filters before spl-token checks

* Add logs

(cherry picked from commit b2f6cfb9ff)

# Conflicts:
#	rpc/src/rpc.rs

* Fix conflict

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-26 23:43:45 +00:00
467abd1f5b feat: update getClusterNodes
(cherry picked from commit dec104c580)
2021-10-26 13:18:19 -07:00
19432f2e5f Add CrdsData::IncrementalSnapshotHashes (backport #20374) (#20994)
* Add CrdsData::IncrementalSnapshotHashes (#20374)

(cherry picked from commit 4e3818e5c1)

# Conflicts:
#	gossip/src/cluster_info.rs

* removes backport merge conflicts

Co-authored-by: Brooks Prumo <brooks@solana.com>
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-10-26 20:07:09 +00:00
7e7f8ef5f0 Report timing info for stakes cache updates from txs (backport #20856) (#20884)
* Report timing info for stakes cache updates from txs (#20856)

(cherry picked from commit 735016661b)

# Conflicts:
#	runtime/src/bank.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-10-26 20:04:32 +00:00
9e81798d6d fix(docs): missing import (#20788) (#20996)
add missing import of `Connection`

(cherry picked from commit 521b7b79cc)

Co-authored-by: Colin Ogoo <ogoo.colin@gmail.com>
2021-10-26 19:10:27 +00:00
8986bd301c adds metrics tracking gossip crds writes and votes (backport #20953) (#20982)
* adds metrics tracking crds writes and votes (#20953)

(cherry picked from commit 1297a13586)

# Conflicts:
#	core/src/cluster_nodes.rs
#	gossip/benches/crds_shards.rs
#	gossip/src/cluster_info.rs
#	gossip/src/cluster_info_metrics.rs
#	gossip/src/crds_entry.rs
#	gossip/src/crds_gossip.rs
#	gossip/src/crds_gossip_pull.rs
#	gossip/src/crds_gossip_push.rs
#	gossip/src/crds_shards.rs
#	gossip/tests/crds_gossip.rs
#	rpc/src/rpc_service.rs

* updates itertools version in gossip

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-10-26 17:41:45 +00:00
6baad8e239 doubles crds unique pubkey capacity (#20947) (#20981)
(cherry picked from commit 43168e6365)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-10-26 15:14:29 +00:00
782d143489 Accountsdb plugin write ordering (#20948) (#20964)
Use the write_version in the Accounts's meta data so that account write with lower write_version would not overwrite the higher ones.
2021-10-26 00:05:40 -07:00
b15e87631c [solana-test-validator] add support for keypair file parsing for --bpf-program address argument (#20962)
(cherry picked from commit 58aa2b964b)

Co-authored-by: Paul Schaaf <paulsimonschaaf@gmail.com>
2021-10-26 01:09:56 +00:00
d18f553e2d Extend TestBroadcastReceiver::recv timeout (#20957) (#20961)
* Extend TestBroadcastReceiver timeout

* Add elapsed log

(cherry picked from commit 337b94b3bc)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-26 00:51:29 +00:00
e84c57b659 Hide deploy from cli subcommands (#20901) (#20951)
(cherry picked from commit af405f0ed7)

Co-authored-by: Jack May <jack@solana.com>
2021-10-25 20:03:44 +00:00
66630804de Accountsdb plugin postgres -- bulk insertion at startup (#20763) (#20931)
* Accountsdb plugin postgres -- bulk insertion at startup (#20763)

Use bulk insertion to Postgres at startup to reduce time taken for initial snapshot restore for postgres plugin. Avoid duplicate writes of accounts at startup. Doing account plugin notification and indexing in parallel.

Improved error handling for postgres plugin to show the real db issues for debug purpose
Added more metrics for postgres plugin.
Refactored plugin centric code out to a sub module from accounts_db and added unit tests

* Fixed the unit test failures
2021-10-25 09:18:32 -07:00
72158e3bf9 CLI: Add SW versions to feature status output (backport #20878) (#20905)
* cli: struct the tuples

(cherry picked from commit b9eb6242f5)

* cli: add software version(s) to feature status

(cherry picked from commit 152da44b62)

# Conflicts:
#	cli/Cargo.toml

* cli: sort feature status output

(cherry picked from commit 30d277b9fd)

* cli: improve feature status arithmatic readability

(cherry picked from commit d98c8b861c)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-10-25 05:04:08 +00:00
df6063a622 removes backport merge conflicts 2021-10-24 21:29:29 -07:00
55a1f03eee adds metrics for number of outgoing shreds in retransmit stage (#20882)
(cherry picked from commit 5e1cf39c74)

# Conflicts:
#	core/src/retransmit_stage.rs
2021-10-24 21:29:29 -07:00
d20cccc26b Add check for shred data header size (#20668)
(cherry picked from commit 588168b99d)
2021-10-24 20:16:41 -07:00
6c4a8b2d72 feat(docs): add transactionCount to getEpochInfo response
(cherry picked from commit aa13c90dd7)
2021-10-24 20:15:12 -07:00
307cda52ac Fixed bug in AccountInfo::serialize() (#20923)
Closes #20917

(cherry picked from commit edf5bc242c)

Co-authored-by: Eugene Lomov <eugene.v.lomov@gmail.com>
2021-10-25 02:26:18 +00:00
026385effd ci: Increase timeout duration for coverage step (#20888)
(cherry picked from commit 4fbf44dc75)
2021-10-24 17:44:36 -07:00
0363d8d373 Use config limit instead of default (#20900) (#20907)
(cherry picked from commit 9dd87bcdb5)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-23 21:05:07 +00:00
5c3f15e9c5 Support port number in postgres connection (#20662) (#20704)
* Support port number in postgres connection

* Addressed a few comments from Trent

(cherry picked from commit ad0a88f1f2)

Co-authored-by: Lijun Wang <83639177+lijunwangs@users.noreply.github.com>
2021-10-23 18:35:30 +00:00
47e80be023 Fix response examples for getTokenAccountsByOwner and getTokenAccountsByDelegate (#20919)
(cherry picked from commit 63f94a4db3)

Co-authored-by: Slavomir <gagliardetto@users.noreply.github.com>
2021-10-23 16:43:13 +00:00
460dcad578 solana-test-validator --log now includes version/argument information
(cherry picked from commit 86bf071d77)
2021-10-22 13:46:29 -07:00
257d19ca48 Update 'Developing with Rust' GitHub links (#20860) (#20875)
* Update old GitHub links in 'Developing with Rust' docs

* exclude_entrypoint -> no-entrypoint in 'Developing with Rust'

(cherry picked from commit f729dec321)

Co-authored-by: Brian Anderson <andersrb@gmail.com>
2021-10-22 08:13:38 +00:00
de2aa898a7 Add counter for new transactions in SendTransactionService (#20852) (#20859)
* Add counter for inserted transactions

* Add counter for tx recv

(cherry picked from commit 8959d5e21c)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-22 05:03:26 +00:00
23b6ce7980 Bump version to 1.8.2 2021-10-21 00:43:40 -06:00
8cba6cca76 rpc-send-tx-svc server-side retry knobs (backport #20818) (#20830)
* rpc-send-tx-svc: add with_config constructor

(cherry picked from commit fe098b5ddc)

# Conflicts:
#	Cargo.lock
#	core/Cargo.toml
#	replica-node/Cargo.toml
#	rpc/src/rpc_service.rs
#	rpc/src/send_transaction_service.rs
#	validator/Cargo.toml

* rpc-send-tx-svc: server-side retry knobs

(cherry picked from commit 2744a2128c)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-10-21 02:15:03 +00:00
85048c667c cli: account for rpc nodes when considering feature set adoption (#20774)
(cherry picked from commit 5794bba65c)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-10-20 17:41:47 -06:00
440ccd189e Add program heap bump instruction (backport #20607) (#20815)
* Add program heap bump instruction (#20607)

(cherry picked from commit 58164517e4)

* nudge

Co-authored-by: Jack May <jack@solana.com>
2021-10-20 23:05:57 +00:00
d5fc81e12a Reduce budget request instruction length (#20636) (#20644)
(cherry picked from commit c231cfe235)

Co-authored-by: Jack May <jack@solana.com>
2021-10-20 12:17:29 -07:00
53f4bde471 add checked instructions sysvar api (backport #20790) (#20816)
* add checked instructions sysvar api (#20790)

(cherry picked from commit a8098f37d0)

# Conflicts:
#	programs/bpf/rust/sysvar/src/lib.rs
#	runtime/src/accounts.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-10-20 18:11:51 +00:00
232731e869 adds more metrics to blockstore insert shreds stats (backport #20701) (#20751)
* adds more metrics to blockstore insert shreds stats (#20701)

(cherry picked from commit 231b58b5f1)

# Conflicts:
#	ledger/src/blockstore.rs

* removes backport merge conflicts

* removes error logs

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-10-20 08:12:32 +00:00
63835ec214 prior to panicing with cap mismatch, try other calculation (#20292) (#20804)
(cherry picked from commit fa5b091b4c)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-10-20 02:26:23 +00:00
6de9ef62e8 docs: Amend RPC Transaction History proposal (#20794) (#20812)
# Problem

The initial proposal ruled out implementing BigTable queries for
the `getBlockTime` RPC, but then it was implemented a couple months
later. Indicating that the functionality was never implemented in
the "implemented-proposals" document is a little confusing, so let's
bring the document in line with what actually happened. 🦾

# Summary of Changes

Remove the blurb about how `getBlockTime` was going to be deprecated
and add it to the list of calls that didn't yet support BigTable
queries at the time the proposal was written.

(cherry picked from commit 0c7bade0b2)

Co-authored-by: Arthur Burkart <arthur@presynce.com>
2021-10-20 02:07:17 +00:00
0759b666ce Expand Rust API docs entry point (#20770) (#20801)
(cherry picked from commit cc4bb5a451)

Co-authored-by: Brian Anderson <andersrb@gmail.com>
2021-10-20 01:53:55 +00:00
c7e3d4cf79 Add docs to solana_clap_utils::keypair (backport #20665) (#20789)
* Add docs to solana_clap_utils::keypair (#20665)

* Add docs to solana_clap_utils::keypair

* Apply suggestions from code review

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

* Move imports to module level in solana_clap_utils::keypair::tests

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
(cherry picked from commit 96c6ba6eb2)

# Conflicts:
#	clap-utils/src/keypair.rs

* Fix conflicts

Co-authored-by: Brian Anderson <andersrb@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-20 01:45:14 +00:00
63e37b2b20 Remove @brief annotations from Rust API docs (backport #20769) (#20807)
* Remove @brief annotations from Rust API docs (#20769)

(cherry picked from commit d9b0fc0e3e)

# Conflicts:
#	programs/bpf/rust/invoke/src/instructions.rs
#	programs/bpf/rust/invoke/src/processor.rs
#	programs/bpf/rust/realloc/src/instructions.rs
#	programs/bpf/rust/realloc/src/lib.rs
#	programs/bpf/rust/realloc/src/processor.rs
#	programs/bpf/rust/realloc_invoke/src/instructions.rs
#	programs/bpf/rust/realloc_invoke/src/lib.rs
#	programs/bpf/rust/realloc_invoke/src/processor.rs
#	sdk/cargo-build-bpf/tests/crates/fail/src/lib.rs
#	sdk/src/precompiles.rs

* Fix conflicts

Co-authored-by: Brian Anderson <andersrb@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-19 19:17:33 -06:00
436ec212f4 report udp stats from validator (backport #20587) (#20799)
* report udp stats from validator (#20587)

(cherry picked from commit 4cac66244d)

# Conflicts:
#	core/src/validator.rs

* resolve merge conflicts

Co-authored-by: Jeff Biseda <jbiseda@gmail.com>
2021-10-20 00:57:38 +00:00
564cc95b00 runtime: Add foundation stake pool withdraw authority (#20797)
(cherry picked from commit cb2bd65858)
2021-10-19 17:56:09 -07:00
28eb6ff796 Invoke cost tracker from its bank (backport #20627) (#20800)
* - make cost_tracker a member of bank, remove shared instance from TPU; (#20627)

- decouple cost_model from cost_tracker; allowing one cost_model
  instance being shared within a validator;
- update cost_model api to calculate_cost(&self...)->transaction_cost

(cherry picked from commit 7496b5784b)

# Conflicts:
#	core/src/banking_stage.rs
#	ledger-tool/src/main.rs
#	runtime/src/bank.rs
#	runtime/src/cost_model.rs
#	runtime/src/cost_tracker.rs

* manual fix merge conflicts

Co-authored-by: Tao Zhu <82401714+taozhu-chicago@users.noreply.github.com>
Co-authored-by: Tao Zhu <tao@solana.com>
2021-10-20 00:22:38 +00:00
de32ab4d57 Separate out interrupted slots broadcast metrics (#20537) (#20798)
(cherry picked from commit 838ff3b871)

Co-authored-by: carllin <carl@solana.com>
2021-10-19 22:26:49 +00:00
cabe2d5d04 Use node LTS (#20803) (#20806)
(cherry picked from commit 2c2bcd20e6)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-19 15:51:59 -06:00
ece4ecb792 stake: Add BorshSerialize trait to structs (#20784) (#20792)
(cherry picked from commit dc1b8ddea1)

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-10-19 20:23:24 +00:00
ba366f49ad Ignore RUSTSEC-2020-0159
(cherry picked from commit 7baeb04f26)
2021-10-18 13:50:31 -07:00
8e666f47e0 optimistic-confirmation-and-slashing - fix typos (#20741) (#20765)
(cherry picked from commit 84660bbf3d)

Co-authored-by: Elliot Lee <github.public@intelliot.com>
2021-10-18 17:49:45 +00:00
0619705ce5 Simplify ed25519 instruction index
Allow u16::MAX to be specified for the instruction index. This makes it
possible to specify the current instruction, so it is not necessary to
know the instruction number.
2021-10-18 15:41:24 +01:00
188089389f feat: support for builtin ed25519 program
Conflicts:
	web3.js/src/index.ts
2021-10-18 15:41:24 +01:00
0a6bb84aec feat: add ed25519 signature verify program
Solang requires a method for verify ed25519 signatures. Add a new
builtin program at address Ed25519SigVerify111111111111111111111111111
which takes any number of ed25519 signature, public key, and message.
If any of the signatures fails to verify, an error is returned.

The changes for the web3.js package will go into another commit, since
the tests test against a released solana node. Adding web3.js ed25519
testing will break CI.

(cherry picked from commit b491354e51)

Conflicts:
	Cargo.lock
	Cargo.toml
	programs/bpf/Cargo.lock
	runtime/Cargo.toml
	sdk/src/feature_set.rs
	sdk/src/transaction.rs
	sdk/src/transaction/sanitized.rs
2021-10-18 15:41:24 +01:00
c8f6a0817b verify_precompiles needs FeatureSet
Rather than pass in individual features, pass in the entire feature set
so that we can add the ed25519 program feature in a later commit.

(cherry picked from commit 0f62771f42)

 Conflicts:
	banks-server/src/banks_server.rs
	core/src/banking_stage.rs
	programs/secp256k1/src/lib.rs
	rpc/src/rpc.rs
	runtime/src/bank.rs
	sdk/src/transaction.rs
	sdk/src/transaction/sanitized.rs
2021-10-18 15:41:24 +01:00
5350250a06 Improve program-test process_transaction() speed by reducing sleep duration in banks-server (backport #20508) (#20733)
* Improve program-test process_transaction() speed by reducing sleep duration in banks-server (#20508)

* banks_server: Reduce sleep duration for local server

This speeds up process_transaction_with_commitment_and_context()
and thus most program tests by a lot.

* Plumb tick duration through poh config and signature polling

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
(cherry picked from commit bea181eba9)

# Conflicts:
#	banks-server/src/banks_server.rs
#	program-test/src/lib.rs

* Fix merge issues

Co-authored-by: Christian Kamm <ckamm@delightful-solutions.de>
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-10-15 21:36:59 +00:00
f8fccc7e91 docs: prefer solana gossip to solana-gossip spy (#20734)
(cherry picked from commit 9543fd9cdd)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-10-15 19:42:20 +00:00
eaa6d1a4b5 adds counters for errors in window-service run_insert (#20670) (#20724)
(cherry picked from commit 0f03971c3c)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-10-15 18:09:11 +00:00
b66c9539c2 program-test: Fix getting new blockhash post-warp (#20710) (#20723)
(cherry picked from commit 0419e6c22e)

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-10-15 16:13:09 +00:00
bdea60cc19 Rpc: filters performance improvement (#20185) (#20703)
* Add Base58,Base64,Bytes to MemcmpEncodedBytes

* Rpc: decode memcmp before filtering accounts

* Add deprecated attribute

* Add Memcmp::bytes

* Fix clippy for deprecated

* Another clippy fix

* merge RpcFilterError::DataTooLarge

* add deprecation for Base58DataTooLarge

* change filter data size limit

* strict data size len for base58

* add magic numbers

* fix tests

(cherry picked from commit e9a427b9c8)

Co-authored-by: Kirill Fomichev <fanatid@ya.ru>
2021-10-14 21:48:13 +00:00
63ac5e4561 clap-utils: trim single-quotes from signer uris on windows (#20695)
(cherry picked from commit 6649dfa899)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-10-14 20:23:15 +00:00
88e6f41bec Include token owners in TransactionTokenBalances (backport #20642) (#20677)
* Include token owners in TransactionTokenBalances (#20642)

* Cache owners in TransactionTokenBalances

* Light cleanup

* Use return struct, and remove pub

* Single-use statements

* Why not, just do the whole crate

* Add metrics

* Make datapoint_debug to prevent spam unless troubleshooting

(cherry picked from commit e806fa6904)

# Conflicts:
#	ledger/src/blockstore.rs
#	transaction-status/Cargo.toml
#	transaction-status/src/token_balances.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-14 07:09:13 +00:00
e0280a68ba Accountsdb plugin metrics (#20606) (#20664)
Added metrics for accountsdb plugin
Handle and log postgres db errors
Print account pubkeys nicely in logging
2021-10-13 14:35:46 -07:00
aa8d04d44b uses nanos precision for timestamp when submitting metrics to influxdb (#20623) (#20659)
Current datapoint_info! is apparently overwriting itself when run inside
a loop. For example in
https://github.com/solana-labs/solana/blob/005d6863f/core/src/window_service.rs#L101-L107
only one of the slots will show up in influxdb.

This is apparently because of metrics code using milliseconds as the
timestamp, as mentioned here:
https://github.com/solana-labs/solana/issues/19789#issuecomment-922482013

(cherry picked from commit cd87525f54)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-10-13 20:47:01 +00:00
778f37b12d fix unstable test (#20645) (#20663)
(cherry picked from commit 220fd41bbc)

Co-authored-by: Tao Zhu <82401714+taozhu-chicago@users.noreply.github.com>
2021-10-13 20:02:42 +00:00
ebe77a0985 Proposal: log binary data for Solidity
Rename "Program return data: " to "Program return: " since "data" is
redundant.

(cherry picked from commit b89177c8de)

Conflicts:
	programs/bpf_loader/src/syscalls.rs
	sdk/bpf/c/inc/sol/log.h
	sdk/program/Cargo.toml
	sdk/src/feature_set.rs
	sdk/src/process_instruction.rs
2021-10-13 14:34:36 +01:00
400a88786a aggregate cost_tracker to bank (backport #20527) (#20622)
* - move cost tracker into bank, so each bank has its own cost tracker; (#20527)

- move related modules to runtime

(cherry picked from commit 005d6863fd)

# Conflicts:
#	Cargo.lock
#	core/benches/banking_stage.rs
#	core/src/banking_stage.rs
#	core/src/lib.rs
#	core/src/tvu.rs
#	ledger-tool/src/main.rs
#	ledger/src/blockstore_processor.rs
#	programs/bpf/Cargo.lock
#	runtime/Cargo.toml
#	runtime/src/cost_model.rs

* manual fix merge conflicts

Co-authored-by: Tao Zhu <82401714+taozhu-chicago@users.noreply.github.com>
Co-authored-by: Tao Zhu <tao@solana.com>
2021-10-13 05:07:09 +00:00
29eae21057 Ignore delinquent stake on exit (backport #20367) (#20612)
* Ignore delinquent stake on exit (#20367)

* add --ignore-delinquency flag to validator exit and wait-for-restart-window sub commands

* Fix a merge issue

* Add missing variable declaration

* Remove empty line to help CI checks pass

* run rustfmt

* Change argument wording for clarity and verbosity

* Change --ignore-delinquent-stake to --max-delinquent-stake

* cargo fmtgit add validator/src/main.rsgit add validator/src/main.rs

* Adjust per mvines

* Formatting

* Improve input validation

* Please automate cargo fmt somehow

(cherry picked from commit fc5dd7f3bc)

# Conflicts:
#	validator/src/main.rs

* Fixes cherry-pick conflict

Co-authored-by: Michael <68944931+michaelh-laine@users.noreply.github.com>
Co-authored-by: Steven Czabaniuk <steven@solana.com>
2021-10-12 20:30:47 +00:00
0d1dbb6160 Fix return data too large test
(cherry picked from commit d09687c30e)
2021-10-12 18:31:42 +01:00
927d3b5e0d Add return data implementation
This consists of:
 - syscalls
 - passing return data from invoked to invoker
 - printing to stable log
 - rust and C SDK changes

(cherry picked from commit 53b47b87b2)
2021-10-12 18:31:42 +01:00
df929bda38 Do not shell out for tar (#19043)
When making a snapshot archive, we used to shell out and call `tar -S`
for sparse file support.  The tar crate supports sparse files, so no
need to do this anymore.

Fixes #10860

(cherry picked from commit 68cc71409e)

# Conflicts:
#	runtime/src/snapshot_utils.rs
2021-10-12 15:36:51 +00:00
200c5c9fd6 solana-validator wait-for-restart-window command now accepts an optional --identity argument (backport #18684) (#20610)
* wait-for-restart-window command now accepts an optional --identity argument

(cherry picked from commit c418e8f370)

# Conflicts:
#	validator/src/main.rs

* Fixed cherry-pick conflicts

Co-authored-by: Michael Vines <mvines@gmail.com>
Co-authored-by: Steven Czabaniuk <steven@solana.com>
2021-10-12 07:07:40 +00:00
9acf708344 Remove support for dynamically loaded native programs (backport #20444) (#20560)
* Remove support for dynamically loaded native programs (#20444)

(cherry picked from commit 785fcb63f5)

# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	program-runtime/src/instruction_processor.rs
#	programs/failure/Cargo.toml
#	programs/failure/tests/failure.rs
#	programs/noop/Cargo.toml
#	programs/ownable/Cargo.toml
#	programs/ownable/src/ownable_processor.rs
#	runtime/src/bank.rs
#	runtime/tests/noop.rs
#	sdk/src/feature_set.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-10-11 23:55:39 +00:00
af4c1785b6 Reorder RpcClient method defs for more logical docs. (backport #20549) (#20597)
* Reorder RpcClient method defs for more logical docs. (#20549)

Methods follow this order:

- Constructors
- send_and_confirm variations
- send variations
- confirm variations
- simulate variations
- queries

(cherry picked from commit 1417c1456d)

# Conflicts:
#	client/src/rpc_client.rs

* Fix conflicts

Co-authored-by: Brian Anderson <andersrb@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-11 21:33:10 +00:00
b8f68860a4 docs: Remove outdated instructions for managing stake accounts (#20555) (#20600)
(cherry picked from commit 03d3e0098e)

Co-authored-by: Justin Starry <justin@solana.com>
2021-10-11 20:17:02 +00:00
547f33d1d1 Adjust solana validators output to account for the 1k+ validators on mainnet (#20576)
(cherry picked from commit bdf8b1da6b)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-10-11 16:51:18 +00:00
67738a229c fix(docs): getInflationRate epoch type from f64 => u64 (#20589) (#20590)
(cherry picked from commit 185c9f9e8f)

Co-authored-by: Yihau Chen <a122092487@gmail.com>
2021-10-11 16:03:41 +00:00
50803c3f58 Rework AVX/AVX2 detection again
(cherry picked from commit c16510152e)
2021-10-10 15:28:14 -07:00
50cb612ae1 Accountsdb stream plugin improvement (#20419) (#20573)
* Accountsdb stream plugin improvement (#20419)

Support using connection pooling and use multiple threads to do Postgres db operations. The performance is improved from 1500 RPS to 40,000 RPS measured during validator start.

Support multiple plugins at the same time.

* Fixed a fmt issue
2021-10-10 15:24:12 -07:00
e5dc8d731b Web3 docs updated with quickstart guide (#19457) (#20571) 2021-10-09 16:01:35 -06:00
f9dcb8228f Added web3 reference guide (#19970) (#20568)
Co-authored-by: cryptogosu <82475023+cryptogosu@users.noreply.github.com>
2021-10-09 15:24:50 -06:00
68e8a05848 Fix solana docker image (#20551)
The docker image fails with:

/usr/bin/solana-run.sh: line 66: ./fetch-spl.sh: No such file or directory

In the solana docker image, scripts/run.sh is copied to
/usr/bin/solana-run.sh and fetch-spl.sh to /usr/bin/fetch-spl.sh. This
means that the line:

cd "$(dirname "$0")/.."

means we're doing a "cd /usr", which means we can't find fetch-spl.sh or
spl-genesis-args.sh (i.e., the error above).

(cherry picked from commit 2762f6f96f)

Co-authored-by: Sean Young <sean@mess.org>
2021-10-09 04:05:10 +00:00
bfc5f9fb6c v1.8: Bump crates to resolve audit failures (#20552)
* Bump nix

* Bump sha2 to resolve warning
2021-10-09 00:27:30 +00:00
c3cc7d52fe Revert "docs: Explain what solana-stake-accounts new does (#20401)" (#20554) (#20556)
This reverts commit 00c6536528.

(cherry picked from commit 17314f4a95)

Co-authored-by: Justin Starry <justin@solana.com>
2021-10-08 19:46:48 +00:00
4268cf1d8b docs: Explain what solana-stake-accounts new does (#20401) (#20547)
(cherry picked from commit 00c6536528)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-10-08 15:54:03 +00:00
c693ecc4c8 fixes backports code changes (#20541) 2021-10-08 15:30:27 +00:00
afe866ad02 Enable easy full-rpc services on testnet nodes (#20530) 2021-10-07 19:36:23 -06:00
6a73bf767b adds metrics for number of nodes vs number of pubkeys (backport #20512) (#20524)
* adds metrics for number of nodes vs number of pubkeys (#20512)

(cherry picked from commit 0da661de62)

# Conflicts:
#	gossip/src/cluster_info_metrics.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-10-07 22:27:48 +00:00
7d0494fcaa Merge AccountsDb plugin framework to v1.8 (#20518)
Merge AccountsDb plugin framework to v1.8 (#20518)
Summary of Changes

Create a plugin mechanism in the accounts update path so that accounts data can be streamed out to external data stores (be it Kafka or Postgres). The plugin mechanism allows

Data stores of connection strings/credentials to be configured,
Accounts with patterns to be streamed
PostgreSQL implementation of the streaming for different destination stores to be plugged in.

The code comprises 4 major parts:

accountsdb-plugin-intf: defines the plugin interface which concrete plugin should implement.
accountsdb-plugin-manager: manages the load/unload of plugins and provide interfaces which the validator can notify of accounts update to plugins.
accountsdb-plugin-postgres: the concrete plugin implementation for PostgreSQL
The validator integrations: updated streamed right after snapshot restore and after account update from transaction processing or other real updates.
The plugin is optionally loaded on demand by new validator CLI argument -- there is no impact if the plugin is not loaded.
2021-10-07 14:15:05 -07:00
33d8e242c5 Fixup docs on deprecated JSON-RPC methods (backport #20515) (#20521)
* Update expected removal version to match backward-compatibility policy (#20515)

(cherry picked from commit d56ad8ff4f)

# Conflicts:
#	docs/src/developing/clients/jsonrpc-api.md

* Fix conflict

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-10-07 20:37:01 +00:00
ef55045724 rebase 2021-10-07 07:44:12 -07:00
81d2c3261c Derive Pod/Zeroable for Pubkey
(cherry picked from commit f966859829)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock
#	sdk/program/Cargo.toml
2021-10-07 07:44:12 -07:00
348ba57b12 Bump version to 1.8.1 2021-10-06 17:57:06 -07:00
4a8ff62ad3 Add RecentItems metrics (#20484) (#20490) 2021-10-06 17:07:33 -06:00
db85d659b9 Cost model 1.7 (#20188)
* Cost Model to limit transactions which are not parallelizeable (#16694)

* * Add following to banking_stage:
  1. CostModel as immutable ref shared between threads, to provide estimated cost for transactions.
  2. CostTracker which is shared between threads, tracks transaction costs for each block.

* replace hard coded program ID with id() calls

* Add Account Access Cost as part of TransactionCost. Account Access cost are weighted differently between read and write, signed and non-signed.

* Establish instruction_execution_cost_table, add function to update or insert instruction cost, unit tested. It is read-only for now; it allows Replay to insert realtime instruction execution costs to the table.

* add test for cost_tracker atomically try_add operation, serves as safety guard for future changes

* check cost against local copy of cost_tracker, return transactions that would exceed limit as unprocessed transaction to be buffered; only apply bank processed transactions cost to tracker;

* bencher to new banking_stage with max cost limit to allow cost model being hit consistently during bench iterations

* replay stage feed back program cost (#17731)

* replay stage feeds back realtime per-program execution cost to cost model;

* program cost execution table is initialized into empty table, no longer populated with hardcoded numbers;

* changed cost unit to microsecond, using value collected from mainnet;

* add ExecuteCostTable with fixed capacity for security concern, when its limit is reached, programs with old age AND less occurrence will be pushed out to make room for new programs.

* investigate system performance test degradation  (#17919)

* Add stats and counter around cost model ops, mainly:
- calculate transaction cost
- check transaction can fit in a block
- update block cost tracker after transactions are added to block
- replay_stage to update/insert execution cost to table

* Change mutex on cost_tracker to RwLock

* removed cloning cost_tracker for local use, as the metrics show clone is very expensive.

* acquire and hold locks for block of TXs, instead of acquire and release per transaction;

* remove redundant would_fit check from cost_tracker update execution path

* refactor cost checking with less frequent lock acquiring

* avoid many Transaction_cost heap allocation when calculate cost, which
is in the hot path - executed per transaction.

* create hashmap with new_capacity to reduce runtime heap realloc.

* code review changes: categorize stats, replace explicit drop calls, concisely initiate to default

* address potential deadlock by acquiring locks one at time

* Persist cost table to blockstore (#18123)

* Add `ProgramCosts` Column Family to blockstore, implement LedgerColumn; add `delete_cf` to Rocks
* Add ProgramCosts to compaction excluding list alone side with TransactionStatusIndex in one place: `excludes_from_compaction()`

* Write cost table to blockstore after `replay_stage` replayed active banks; add stats to measure persist time
* Deletes program from `ProgramCosts` in blockstore when they are removed from cost_table in memory
* Only try to persist to blockstore when cost_table is changed.
* Restore cost table during validator startup

* Offload `cost_model` related operations from replay main thread to dedicated service thread, add channel to send execute_timings between these threads;
* Move `cost_update_service` to its own module; replay_stage is now decoupled from cost_model.

* log warning when channel send fails (#18391)

* Aggregate cost_model into cost_tracker (#18374)

* * aggregate cost_model into cost_tracker, decouple it from banking_stage to prevent accidental deadlock. * Simplified code, removed unused functions

* review fixes

* update ledger tool to restore cost table from blockstore (#18489)

* update ledger tool to restore cost model from blockstore when compute-slot-cost

* Move initialize_cost_table into cost_model, so the function can be tested and shared between validator and ledger-tool

* refactor and simplify a test

* manually fix merge conflicts

* Per-program id timings (#17554)

* more manual fixing

* solve a merge conflict

* featurize cost model

* more merge fix

* cost model uses compute_unit to replace microsecond as cost unit
(#18934)

* Reject blocks for costs above the max block cost (#18994)

* Update block max cost limit to fix performance regession (#19276)

* replace function with const var for better readability (#19285)

* Add few more metrics data points (#19624)

* periodically report sigverify_stage stats (#19674)

* manual merge

* cost model nits (#18528)

* Accumulate consumed units (#18714)

* tx wide compute budget (#18631)

* more manual merge

* ignore zerorize drop security

* - update const cost values with data collected by #19627
- update cost calculation to closely proposed fee schedule #16984

* add transaction cost histogram metrics (#20350)

* rebase to 1.7.15

* add tx count and thread id to stats (#20451)
each stat reports and resets when slot changes

* remove cost_model feature_set

* ignore vote transactions from cost model

Co-authored-by: sakridge <sakridge@gmail.com>
Co-authored-by: Jeff Biseda <jbiseda@gmail.com>
Co-authored-by: Jack May <jack@solana.com>
2021-10-06 15:55:29 -06:00
a4df784e82 Bump version to 1.8.0 2021-10-06 15:48:23 -06:00
414674eba1 Fix dos data-type for non-gossip mode (#20465) (#20478)
(cherry picked from commit b178f3f2d3)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-10-06 19:00:34 +00:00
d922971ec6 Optimize stakes cache and rewards at epoch boundaries (backport #20432) (#20472)
* Optimize stakes cache and rewards at epoch boundaries (backport #20432)

* fix conflicts
2021-10-06 16:15:27 +00:00
95ac00d30a Make rewards tracer async friendly (backport #20452) (#20456)
* Make rewards tracer async friendly (#20452)

(cherry picked from commit 250a8503fe)

# Conflicts:
#	Cargo.lock
#	ledger-tool/Cargo.toml
#	runtime/src/bank.rs

* fix conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-10-06 11:20:50 +00:00
1ca4f7d110 Install openssl for travisci windows builds (#20420) (#20458)
(cherry picked from commit df73d8e8a1)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-10-05 22:30:23 -06:00
8999f07ed2 Remove nodejs (#20399) (#20433)
(cherry picked from commit 6df0ce5457)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-10-05 08:56:57 +00:00
9f4f8fc9e9 Add struct and convenience methods to track stake activation status (backport #20392) (#20425)
* Add struct and convenience methods to track stake activation status (#20392)

* Add struct and convenience methods to track stake activation status

* fix nits

* rename

(cherry picked from commit 0ddb34a0b4)

# Conflicts:
#	runtime/src/stakes.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-10-05 04:33:30 +00:00
00b03897e1 Default --rpc-bind-address to 127.0.0.1 when --private-rpc is provided and --bind-address is not
(cherry picked from commit 221343e849)
2021-10-04 16:58:46 -07:00
6181df68cf Staking docs: link to overview (#20426)
(cherry picked from commit 2d5b471c09)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-10-04 23:22:21 +00:00
1588b00f2c fix syntax error in bash_profile (#20386)
if there is no newline at the end of the file, this export is glued to the rest of the code and generates a syntax error like this

```bash
if [ -f ~/.git-completion.bash ]; then
  . ~/.git-completion.bash
fiexport PATH="/Users/user/.local/share/solana/install/active_release/bin:$PATH"
```

(cherry picked from commit 87c0d8d9e7)

Co-authored-by: OleG <emptystamp@gmail.com>
2021-10-02 04:50:39 +00:00
ef306aa7cb Deploy error is buffer is too small (#20358) (#20362)
* Deploy error is buffer is too small

* missing file

(cherry picked from commit de8331eeaf)

# Conflicts:
#	cli/tests/fixtures/noop.so

Co-authored-by: Jack May <jack@solana.com>
2021-10-01 05:25:11 +00:00
e718f4b04a terminology.md: remove CBC block and unneeded filename (#20269) (#20349)
(cherry picked from commit a7f2d9f55f)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-30 23:19:12 +00:00
51593a882b Properly enable unprefixed_malloc_on_supported_platforms in tikv-jemallocator (#20351) (#20354)
Trivial typo fix.

Fixes: 4bf6d0c4d7 ("adds unprefixed_malloc_on_supported_platforms to jemalloc (#20317)")
(cherry picked from commit 8ae88632cb)

Co-authored-by: Ivan Mironov <mironov.ivan@gmail.com>
2021-09-30 20:26:11 +00:00
1c15cc6e9a add unchecked invokes (#20313) (#20337)
(cherry picked from commit 8188c1dd59)

Co-authored-by: Jack May <jack@solana.com>
2021-09-30 17:05:51 +00:00
734b380cdb Bump version to v1.7.15 (#20338) 2021-09-30 10:51:34 -06:00
9cc26b3b00 cli: Stop topping up buffer balance (#20181) (#20312)
(cherry picked from commit 53a810dbad)

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-30 12:31:12 -04:00
ef5a0e842c stake-accounts.md: fix grammar, link Solana Explorer (#20270) (#20274)
(cherry picked from commit f24fff8495)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-29 22:57:00 -06:00
5bdb824267 Remove original feature gating (#20334) 2021-09-29 22:36:51 -06:00
474f2bcdf4 Prune sigverify queue (#20315) 2021-09-30 05:40:48 +02:00
2302211963 Remove files (#20332) 2021-09-30 02:25:24 +00:00
8178db52a5 Add transaction mode to dos (#20191) (#20329)
(cherry picked from commit 94a1a57106)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-09-29 23:53:15 +00:00
5d8429d953 adds unprefixed_malloc_on_supported_platforms to jemalloc (#20317) (#20325)
Without this feature jemalloc is used only for Rust code but not for
bundled C/C++ libraries (like rocksdb).
https://github.com/solana-labs/solana/issues/14366#issuecomment-930404992

(cherry picked from commit 4bf6d0c4d7)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-29 22:49:47 +00:00
fec15f69f4 Increment 1.7 version (#20316) 2021-09-29 15:37:45 -04:00
257ddbeee1 Tpu vote 1.7 (#20187)
* Add separate vote processing tpu port

* Add feature to send to tpu vote port

* Add vote rejecting sigverify mode

* use packet.meta.is_simple_vote_tx in place of deserialization

* consolidate code that identifies vote tx atcommon path for cpu and gpu

* new key for feature set

* banking forward tpu vote

* add tpu vote port to dockerfile and other review changes

* Simplify thread id compare

* fix a test; updated cluster_info ABI change

Co-authored-by: Tao Zhu <tao@solana.com>
2021-09-29 18:12:58 +02:00
47c1730808 uses rayon thread-pool for retransmit-stage parallelization (#19486) (#20293)
(cherry picked from commit 01a7ec8198)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-29 14:11:46 +00:00
a005a6b816 Restore ability for programs to upgrade themselves (backport #20265) (#20295)
* Restore ability for programs to upgrade themselves (#20265)

* Make helper associated fn

* Add feature definition

* Add handling to preserve program-id write lock when upgradeable loader is present; restore bpf upgrade-self test

* Use single feature

(cherry picked from commit 2cd9dc99b6)

# Conflicts:
#	runtime/src/accounts.rs
#	sdk/program/src/message.rs
#	sdk/program/src/message/mapped.rs
#	sdk/program/src/message/sanitized.rs
#	sdk/src/feature_set.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-29 01:34:33 +00:00
2f2948f998 Extricate RpcCompletedSlotsService from RetransmitStage (backport #18017) (#20294)
* Extricate RpcCompletedSlotsService from RetransmitStage

(cherry picked from commit fa04531c7a)

# Conflicts:
#	core/src/replay_stage.rs
#	core/src/retransmit_stage.rs
#	core/src/tvu.rs
#	core/src/validator.rs

* removes backport merge conflicts

Co-authored-by: Michael Vines <mvines@gmail.com>
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-28 18:25:51 +00:00
55ccff7604 skips retransmit for shreds with unknown slot leader (backport #19472) (#20291)
* skips retransmit for shreds with unknown slot leader (#19472)

Shreds' signatures should be verified before they reach retransmit
stage, and if the leader is unknown they should fail signature check.
Therefore retransmit-stage can as well expect to know who the slot
leader is and otherwise just skip the shred.

Blockstore checking signature of recovered shreds before sending them to
retransmit stage:
https://github.com/solana-labs/solana/blob/4305d4b7b/ledger/src/blockstore.rs#L884-L930

Shred signature verifier:
https://github.com/solana-labs/solana/blob/4305d4b7b/core/src/sigverify_shreds.rs#L41-L57
https://github.com/solana-labs/solana/blob/4305d4b7b/ledger/src/sigverify_shreds.rs#L105

(cherry picked from commit 6d9818b8e4)

# Conflicts:
#	core/src/broadcast_stage/broadcast_duplicates_run.rs
#	ledger/src/shred.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-28 15:26:30 +00:00
1bf88556ee removes Slot from TransmitShreds (backport #19327) (#20260)
* removes Slot from TransmitShreds (#19327)

An earlier version of the code was funneling through stakes along with
shreds to broadcast:
https://github.com/solana-labs/solana/blob/b67ffab37/core/src/broadcast_stage.rs#L127

This was changed to only slots as stakes computation was pushed further
down the pipeline in:
https://github.com/solana-labs/solana/pull/18971

However shreds themselves embody which slot they belong to. So pairing
them with slot is redundant and adds rooms for bugs should they become
inconsistent.

(cherry picked from commit 1deb4add81)

# Conflicts:
#	core/benches/cluster_info.rs
#	core/src/broadcast_stage.rs
#	core/src/broadcast_stage/broadcast_duplicates_run.rs
#	core/src/broadcast_stage/fail_entry_verification_broadcast_run.rs
#	core/src/broadcast_stage/standard_broadcast_run.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-28 12:55:01 +00:00
4c4f183515 reverts #17542 (#20259) (#20273)
https://github.com/solana-labs/solana/pull/17542
excludes caller's crds values from pull responses.

Reverting that commit so that when a (staked) node restarts, it can
obtain its crds values before restart from other nodes.

(cherry picked from commit 43ed727ba7)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-28 12:54:31 +00:00
282322cbe8 Add more docs for RpcClient (backport #19771) (#20266)
* Add more docs for RpcClient (#19771)

* Add more docs for RpcClient

* Use custom mocks in rpc_client examples

* Move create_rpc_client_mocks into rpc_client module

Signed-off-by: Brian Anderson <andersrb@gmail.com>

* Update client/src/rpc_client.rs

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

* Update RpcClient docs per review feedback

* Consistently link 'commitment level' in RpcClient docs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
(cherry picked from commit 082d5dc5b2)

# Conflicts:
#	client/src/mock_sender.rs
#	client/src/rpc_client.rs

* Fix conflicts

Co-authored-by: Brian Anderson <andersrb@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-28 07:27:23 +00:00
2dc00d0e13 Paper wallet: fix URI scheme (#20233) (#20278)
(cherry picked from commit 38844a7010)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-28 01:29:42 +00:00
a90c338982 Rpc: use rust convenient methods
(cherry picked from commit ac79ae6848)
2021-09-27 13:46:27 -07:00
36c283026f fix Borsh typo
changes `BORSH_IO_ERROR` from `unkown` to `unknown` error

(cherry picked from commit e94b7984a1)
2021-09-27 12:30:41 -07:00
a1a0c63862 retransmits shreds recovered from erasure codes (backport #19233) (#20249)
* removes packet-count metrics from retransmit stage

Working towards sending shreds (instead of packets) to retransmit stage
so that shreds recovered from erasure codes are as well retransmitted.

Following commit will add these metrics back to window-service, earlier
in the pipeline.

(cherry picked from commit bf437b0336)

# Conflicts:
#	core/src/retransmit_stage.rs

* adds packet/shred count stats to window-service

Adding back these metrics from the earlier commit which removed them
from retransmit stage.

(cherry picked from commit 8198a7eae1)

* removes erroneous uses of Arc<...> from retransmit stage

(cherry picked from commit 6e413331b5)

# Conflicts:
#	core/src/retransmit_stage.rs
#	core/src/tvu.rs

* sends shreds (instead of packets) to retransmit stage

Working towards channelling through shreds recovered from erasure codes
to retransmit stage.

(cherry picked from commit 3efccbffab)

# Conflicts:
#	core/src/retransmit_stage.rs

* returns completed-data-set-info from insert_data_shred

instead of opaque (u32, u32) which are then converted to
CompletedDataSetInfo at the call-site.

(cherry picked from commit 3c71670bd9)

# Conflicts:
#	ledger/src/blockstore.rs

* retransmits shreds recovered from erasure codes

Shreds recovered from erasure codes have not been received from turbine
and have not been retransmitted to other nodes downstream. This results
in more repairs across the cluster which is slower.

This commit channels through recovered shreds to retransmit stage in
order to further broadcast the shreds to downstream nodes in the tree.

(cherry picked from commit 7a8807b8bb)

# Conflicts:
#	core/src/retransmit_stage.rs
#	core/src/window_service.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-27 18:11:37 +00:00
e20fdde0a4 Wallet guide: fix grammar (#20228) (#20254)
(cherry picked from commit f107aa296b)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-27 16:56:14 +00:00
5b52ac8990 Fix grammar in conventions.md (#20236) (#20252)
(cherry picked from commit af57bd3d48)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-27 16:39:39 +00:00
502ae8b319 removes repeated bank-forks locking in window-service (backport #19210) (#20239)
* removes repeated bank-forks locking in window-service

Window service is repeatedly locking bank-forks to look-up working-bank
for every single shred:
https://github.com/solana-labs/solana/blob/5fde4ee3a/core/src/window_service.rs#L597-L606

This commit updates shred_filter signature in recv_window so that where
we already obtain the lock on bank-forks, we can also look-up
working-bank once for all packets:
https://github.com/solana-labs/solana/blob/5fde4ee3a/core/src/window_service.rs#L256-L277

(cherry picked from commit d57398a959)

# Conflicts:
#	core/src/window_service.rs

* removes erroneous uses of &Arc<...> from window-service

(cherry picked from commit b64eeb7729)

# Conflicts:
#	core/src/window_service.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-27 13:48:58 +00:00
30f0b3cf53 removes raw indexing from streamer (backport #19183) (#20237)
* removes raw indexing from streamer (#19183)

Raw indexing is verbose and error-prone. This same code had an indexing
bug causing validator nodes panic just a few months ago:
https://github.com/solana-labs/solana/commit/482b8c6be

(cherry picked from commit 8229a4fbf6)

# Conflicts:
#	streamer/Cargo.toml

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-27 13:48:13 +00:00
2975dc5c1a removes use of public ip addresses from perf tests (backport #19184) (#20238)
* removes use of public ip addresses from system tests

Using global IPs causes outbound traffic which costs money:
https://github.com/solana-labs/solana/pull/18728#issuecomment-884290209

(cherry picked from commit bd8f793809)

* removes redundant allow-private-addr from system tests

Following https://github.com/solana-labs/solana/pull/19130
if gce.sh creat is invoked without -P then --allow-private-addr is
implied:
https://github.com/solana-labs/solana/blob/4cc1b1504/net/common.sh#L68-L73

Therefore tests only need to specify:
  USE_PUBLIC_IP_ADDRESSES: "false"

(cherry picked from commit 18463aa846)

# Conflicts:
#	system-test/partition-testcases/gce-5-node-3-partition.yml
#	system-test/partition-testcases/gce-partition-once-then-stabilize.yml
#	system-test/partition-testcases/gce-partition-with-offline.yml

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-27 01:23:02 +00:00
d68377e927 unifies cluster-nodes computation & caching across turbine stages (backport #18971) (#20231)
* sends slots (instead of stakes) through broadcast flow

Current broadcast code is computing stakes for each slot before sending
them down the channel:
https://github.com/solana-labs/solana/blob/049fb0417/core/src/broadcast_stage/standard_broadcast_run.rs#L208-L228
https://github.com/solana-labs/solana/blob/0cf52e206/core/src/broadcast_stage.rs#L342-L349

Since the stakes are a function of epoch the slot belongs to (and so
does not necessarily change from one slot to another), forwarding the
slot itself would allow better caching downstream.

In addition we need to invalidate the cache if the epoch changes (which
the current code does not do), and that requires to know which slot (and
so epoch) current broadcasted shreds belong to:
https://github.com/solana-labs/solana/blob/19bd30262/core/src/broadcast_stage/standard_broadcast_run.rs#L332-L344

(cherry picked from commit 44b11154ca)

# Conflicts:
#	core/src/broadcast_stage/broadcast_duplicates_run.rs
#	core/src/broadcast_stage/standard_broadcast_run.rs

* implements cluster-nodes cache

Cluster nodes are cached keyed by the respective epoch from which stakes
are obtained, and so if epoch changes cluster-nodes will be recomputed.

A time-to-live eviction policy is enforced to refresh entries in case
gossip contact-infos are updated.

(cherry picked from commit ecc1c7957f)

* uses cluster-nodes cache in retransmit stage

The new cluster-nodes cache will:
  * ensure cluster-nodes are recalculated if the epoch (and so the epoch
    staked nodes) changes.
  * encapsulate time-to-live eviction policy.

(cherry picked from commit 30bec3921e)

* uses cluster-nodes cache in broadcast-stage

* Current caching mechanism does not update cluster-nodes when the epoch
  (and so epoch staked nodes) changes:
  https://github.com/solana-labs/solana/blob/19bd30262/core/src/broadcast_stage/standard_broadcast_run.rs#L332-L344

* Additionally, the cache update has a concurrency bug in which the
  thread which does compare_and_swap may be blocked when it tries to
  obtain the write-lock on cache, while other threads will keep running
  ahead with the outdated cache (since the atomic timestamp is already
  updated).

In the new ClusterNodesCache, entries are keyed by epoch, and so if
epoch changes cluster-nodes will be recalculated. The time-to-live
eviction policy is also encapsulated and rigidly enforced.

(cherry picked from commit aa32738dd5)

# Conflicts:
#	core/src/broadcast_stage/broadcast_duplicates_run.rs
#	core/src/broadcast_stage/fail_entry_verification_broadcast_run.rs
#	core/src/broadcast_stage/standard_broadcast_run.rs

* unifies cluster-nodes computation & caching across turbine stages

Broadcast-stage is using epoch_staked_nodes based on the same slot that
shreds belong to:
https://github.com/solana-labs/solana/blob/049fb0417/core/src/broadcast_stage/standard_broadcast_run.rs#L208-L228
https://github.com/solana-labs/solana/blob/0cf52e206/core/src/broadcast_stage.rs#L342-L349

But retransmit-stage is using bank-epoch of the working-bank:
https://github.com/solana-labs/solana/blob/19bd30262/core/src/retransmit_stage.rs#L272-L289

So the two are not consistent at epoch boundaries where some nodes may
have a working bank (or similarly a root bank) lagging other nodes. As a
result the node which obtains a packet may construct turbine broadcast
tree inconsistently with its parent node in the tree and so some packets
may fail to reach all nodes in the tree.

(cherry picked from commit 50d0e830c9)

* adds fallback & metric for when epoch staked-nodes are none

(cherry picked from commit fb69f45f14)

* allows only one thread to update cluster-nodes cache entry for an epoch

If two threads simultaneously call into ClusterNodesCache::get for the
same epoch, and the cache entry is outdated, then both threads recompute
cluster-nodes for the epoch and redundantly overwrite each other.

This commit wraps ClusterNodesCache entries in Arc<Mutex<...>>, so that
when needed only one thread does the computations to update the entry.

(cherry picked from commit eaf927cf49)

* falls back on working-bank if root-bank::epoch-staked-nodes is none

bank.get_leader_schedule_epoch(shred_slot)
is one epoch after epoch_schedule.get_epoch(shred_slot).

At epoch boundaries, shred is already one epoch after the root-slot. So
we need epoch-stakes 2 epochs ahead of the root. But the root bank only
has epoch-stakes for one epoch ahead, and as a result looking up epoch
staked-nodes from the root-bank fails.

To be backward compatible with the current master code, this commit
implements a fallback on working-bank if epoch staked-nodes obtained
from the root-bank is none.

(cherry picked from commit e4be00fece)

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-26 23:45:42 +00:00
cc1a3d6645 recvmmsg IPv6 awareness (#18957) (#20232)
(cherry picked from commit 0b7ed18cfa)

Co-authored-by: Jeff Biseda <jbiseda@gmail.com>
2021-09-26 23:09:21 +00:00
e9a993fb59 allows sendmmsg api taking owned values (as well as references) (#18999) (#20226)
Current signature of api in sendmmsg requires a slice of inner
references:
https://github.com/solana-labs/solana/blob/fe1ee4980/streamer/src/sendmmsg.rs#L130-L152

That forces the call-site to convert owned values to references even
though doing so is redundant and adds an extra level of indirection:
https://github.com/solana-labs/solana/blob/fe1ee4980/core/src/repair_service.rs#L291

This commit expands the api using AsRef and Borrow traits to allow
calling the method with owned values (as well as references like
before).

(cherry picked from commit 049fb0417f)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-26 20:35:13 +00:00
88177d33fd Rpc: remove not required clone
(cherry picked from commit 9542bae56e)
2021-09-26 12:50:53 -07:00
0ec301f1c3 improves parallelism in window-service recv_window (backport #18446) (#20142)
* sends packets in batches from sigverify-stage (#18446)

sigverify-stage is breaking batches to single-item vectors before
sending them down the channel:
https://github.com/solana-labs/solana/blob/d451363dc/core/src/sigverify_stage.rs#L88-L92

Also simplifying window-service code, reducing number of nested branches.

(cherry picked from commit 7d56fa8363)

# Conflicts:
#	core/src/window_service.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-26 18:54:07 +00:00
34665571fa drop outstanding_requests lock before sending repair requests (backport #18893) (#20227)
* drop outstanding_requests lock before sending repair requests (#18893)

(cherry picked from commit 9255ae334d)

# Conflicts:
#	core/src/repair_service.rs

* removes backport merge conflicts

Co-authored-by: Jeff Biseda <jbiseda@gmail.com>
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-26 18:39:28 +00:00
5dd1c2191e shares cluster-nodes between retransmit threads (backport #18947) (#20221)
* shares cluster-nodes between retransmit threads (#18947)

cluster_nodes and last_peer_update are not shared between retransmit
threads, as each thread have its own value:
https://github.com/solana-labs/solana/blob/65ccfed86/core/src/retransmit_stage.rs#L476-L477

Additionally, with shared references, this code:
https://github.com/solana-labs/solana/blob/0167daa11/core/src/retransmit_stage.rs#L315-L328
has a concurrency bug where the thread which does compare_and_swap,
updates cluster_nodes much later after other threads have run with
outdated cluster_nodes for a while. In particular, the write-lock there
may block.

(cherry picked from commit d06dc6c8a6)

# Conflicts:
#	core/benches/retransmit_stage.rs
#	core/src/retransmit_stage.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-26 16:29:34 +00:00
aacb5e58ad sendmmsg cleanup #18589 (#20175)
Rationalize usage of sendmmsg(2). Skip packets which failed to send and track failures.

(cherry picked from commit ae5ad5cf9b)

Co-authored-by: Jeff Biseda <jbiseda@gmail.com>
2021-09-25 23:00:00 +00:00
8d2dce6f6b allows private addresses if not public network (#20178)
(cherry picked from commit c4f2e5f88c)

# Conflicts:
#	net/net.sh

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-25 21:34:24 +00:00
e50a26a493 passes through --allow-private-addr to validators in system perf tests (backport #18876) (#20180)
* passes through --allow-private-addr to validators in system perf tests (#18876)

(cherry picked from commit 81026f9ea5)

# Conflicts:
#	multinode-demo/bootstrap-validator.sh
#	multinode-demo/validator.sh
#	net/net.sh

* removes backport merge conflicts

* ignores RUSTSEC-2021-0115

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-25 20:08:32 +00:00
302887da67 Add new logos to README files and docs (#20049) (#20093)
* Add new logos to README files and docs

* Add explorer logos

(cherry picked from commit 8dbed193c2)

Co-authored-by: Ryan M. Shea <8948187+rmshea@users.noreply.github.com>
2021-09-25 15:15:29 -04:00
597c504c27 generate deterministic seeds for shreds (backport #17950) (#20172)
* generate deterministic seeds for shreds (#17950)

* generate shred seed from leader pubkey

* clippy

* clippy

* review

* review 2

* fmt

* review

* check

* review

* cleanup

* fmt

(cherry picked from commit a86ced0bac)

# Conflicts:
#	core/benches/cluster_info.rs
#	core/src/broadcast_stage.rs
#	core/src/broadcast_stage/fail_entry_verification_broadcast_run.rs
#	core/src/broadcast_stage/standard_broadcast_run.rs
#	ledger/src/shred.rs
#	sdk/src/feature_set.rs

* removes backport merge conflicts

Co-authored-by: jbiseda <jbiseda@gmail.com>
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-25 19:09:49 +00:00
b7af118091 Fix typo (#20218) (#20219)
(cherry picked from commit b95653331c)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-25 18:54:59 +00:00
9e392687eb chore: bump tiny-bip39 from 0.8.0 to 0.8.1 (backport #20136) (#20207)
* chore: bump tiny-bip39 from 0.8.0 to 0.8.1 (#20136)

* chore: bump tiny-bip39 from 0.8.0 to 0.8.1

Bumps [tiny-bip39](https://github.com/maciejhirsz/tiny-bip39) from 0.8.0 to 0.8.1.
- [Release notes](https://github.com/maciejhirsz/tiny-bip39/releases)
- [Changelog](https://github.com/maciejhirsz/tiny-bip39/blob/master/CHANGELOG.md)
- [Commits](https://github.com/maciejhirsz/tiny-bip39/compare/v0.8.0...v0.8.1)

---
updated-dependencies:
- dependency-name: tiny-bip39
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <anatoly+githubjenkins@solana.io>
(cherry picked from commit 038d77347a)

# Conflicts:
#	Cargo.lock
#	clap-utils/Cargo.toml
#	cli/Cargo.toml
#	keygen/Cargo.toml
#	sdk/Cargo.toml

* resolve conflicts

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Starry <justin@solana.com>
2021-09-25 16:48:42 +00:00
bee923ca6c gossip.md: simplify Markdown (#20201) (#20205)
No need for \-escaping

(cherry picked from commit e9c839a9e7)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-25 14:01:47 +00:00
879df38059 Terminology: link BPF (#20199) (#20204)
(cherry picked from commit cb4121da19)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-25 13:50:12 +00:00
3e776267b5 Resolve zeroize_derive audit warning by bumping version (#20182) (#20190)
* Revert "temporarily disable new audit"

This reverts commit 3dfbd95ddc.

* Bump version of zeroize_derive from v1.0.0 to v1.2.0

(cherry picked from commit 0c62a6fe3f)

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-25 09:48:07 -04:00
0bfb466184 Fix blatant md formatting at the very top (#20198) (#20203)
(cherry picked from commit c137c50d15)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-25 13:43:43 +00:00
71bb3bf6aa Improve grammar in terminology/ledger (#20197) (#20202)
(cherry picked from commit 20fbf09072)

Co-authored-by: Ted Robertson <10043369+tredondo@users.noreply.github.com>
2021-09-25 13:30:39 +00:00
99c74c8902 Limit transaction forwarding from banking_stage (#19940) (#20081)
(cherry picked from commit 013e1d9d49)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-09-24 18:04:22 +00:00
085f5f945d uses tikv_jemallocator::Jemalloc as the global allocator (backport #20149) (#20166)
* uses tikv_jemallocator::Jemalloc as the global allocator (#20149)

https://github.com/solana-labs/solana/pull/16346
switched default allocator from jemalloc to system allocator, but that
has shown regressions in form of higher ram usage causing nodes go OOM:
https://discord.com/channels/428295358100013066/439194979856809985/890413193858539580

This commit sets jemalloc as the default allocator.

(cherry picked from commit 2cf081d863)

# Conflicts:
#	Cargo.lock

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-09-24 17:37:57 +00:00
e757e51ddc Port sigverify to identify and mark simple vote transaction to v1.7 (#20147)
* sigverify to identify and mark simple vote transaction (#20021)

* check vote tx at get_packet_offsets to cover both cpu and gpu paths

* add pubkey_len to PacketOffsets to reduce the redundant bytes counting

* allow vote to have 1 or 2 sigs (#20082)
2021-09-24 11:35:50 -05:00
458ccecb5d Bump bpf-tools version to 1.12
(cherry picked from commit e98a7504f2)
2021-09-24 18:05:13 +02:00
7f21a55a32 Fix public key md links (#20162) (#20167)
(cherry picked from commit 9653f6b28d)

Co-authored-by: Israel Ferrer Camacho <rallat@gmail.com>
2021-09-24 15:28:46 +00:00
b112e4a8aa windows: Make solana-test-validator work (backport #20099) (#20123)
* windows: Make solana-test-validator work (#20099)

* windows: Make solana-test-validator work

The important changes to get this going on Windows:

* ledger lock needs to be done on a file instead of the directory
* IPC service needs to use the Windows pipe naming scheme
* always disable the JIT
* file logging not possible yet because we can't redirect stderr,
but this will change once env_logger fixes the pipe output target!

* Integrate review feedback

(cherry picked from commit 567f30aa1a)

# Conflicts:
#	validator/src/bin/solana-test-validator.rs
#	validator/src/lib.rs
#	validator/src/main.rs

* Fix merge conflicts

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-09-24 12:59:12 +00:00
63b24d9577 Update TransactionError link to docs.rs (#20145) (#20146)
(cherry picked from commit a70fd8e606)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-09-23 21:15:36 +00:00
49a6acffca Add metric for duplicate retransmit (#20129) 2021-09-22 22:51:44 -07:00
7b4638aa0b runtime: remove inactive delegation from stakes cache 2021-09-22 20:43:34 -06:00
f51ee23837 Fix typo in docs/cli/deploy-a-program (#20097) (#20098)
(cherry picked from commit 3d0db28d12)

Co-authored-by: Christoph Michel <MrToph@users.noreply.github.com>
2021-09-22 01:46:58 +00:00
55f27d5c26 Fix memo handling and "blocks" key formatting (#20044) (#20080)
* Fix memo handling and "blocks" key formatting

* Skip memo equality check

* Define slot_to_tx_by_addr_key

Co-authored-by: Justin Starry <justin@solana.com>
(cherry picked from commit 795dde109c)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-09-21 22:22:55 +00:00
f33c651114 Minor ProgramTest improvements (backport #20051) (#20054)
* Add stable_log output when a program is loaded as native code instead of BPF

(cherry picked from commit 34f5020457)

* Add ProgramTest::add_builtin_program()

This permits the unit testing of builtin programs in the ProgramTest environment

(cherry picked from commit 830ca369f1)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-09-21 17:04:16 +00:00
a71ebcc9f3 demote ./run.sh (backport #19679) (#20052)
* move `./run.sh` into `./scripts`

(cherry picked from commit 92e343da26)

* add some guidance in place of `./run.sh`

(cherry picked from commit 33de7b856f)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-09-21 15:59:48 +00:00
cd575945b6 Make bigtable delete-slots actually usable (#20037) (#20042)
(cherry picked from commit 22f45dca80)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-09-21 13:40:21 +00:00
6b24dd1c6a client: Add retry logic on Pubsub 429 error during connect (backport #19990) (#20002)
* client: Add retry logic on Pubsub 429s (#19990)

(cherry picked from commit e9b066d497)

* Use exponential backoff for older version of tungstenite

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-09-20 12:13:06 +00:00
03da3eaa81 Optimize RPC pubsub for multiple clients with the same subscription (backport #18943) (#19987)
* Optimize RPC pubsub for multiple clients with the same subscription (#18943)

* reimplement rpc pubsub with a broadcast queue

* update tests for new pubsub implementation

* fix: fix review suggestions

* chore(rpc): add additional pubsub metrics

* integrate max subscriptions check into SubscriptionTracker to reduce locking

* separate subscription control from tracker

* limit memory usage of items in pubsub broadcast queue, improve error handling

* add more pubsub metrics

* add final count metrics to pubsub

* add metric for total number of subscriptions

* fix small review suggestions

* remove by_params from SubscriptionTracker and add node_progress_watchers map instead

* add subscription tracker tests

* add metrics for number of pubsub notifications as a counter

* ignore clippy lint in TokenCounter

* fix underflow in token counter

* reduce queue capacity in pubsub tests

* fix(rpc): fix test timeouts

* fix race in account subscription test

* Add RpcSubscriptions::new_for_tests

Co-authored-by: Pavel Strakhov <p.strakhov@iconic.vc>
Co-authored-by: Nikita Podoliako <n.podoliako@zubr.io>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
(cherry picked from commit 65227f44dc)

# Conflicts:
#	Cargo.lock
#	core/Cargo.toml
#	core/src/replay_stage.rs
#	core/src/validator.rs
#	replica-node/src/replica_node.rs
#	rpc/Cargo.toml

* Fix conflicts (and standardize naming to make future subscription backports easier

Co-authored-by: Pavel Strakhov <ri@idzaaus.org>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-20 06:00:08 +00:00
07b71329a7 Update feature switch for reduced required deploy balance (backport #19999) (#20012)
* Update feature switch for reduced required deploy balance (#19999)

(cherry picked from commit ea34eb8a4b)

# Conflicts:
#	programs/bpf_loader/src/lib.rs

* fix conflict

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-19 23:17:59 +00:00
53b387f113 Report consumed_buffered_packets_count stat to metrics (backport #19900) (#19915)
* Report consumed_buffered_packets_count stat to metrics (#19900)

(cherry picked from commit 34c1a9ac85)

# Conflicts:
#	core/src/banking_stage.rs

* fix conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-18 20:57:28 +00:00
d0143dad8f Reduce payer balance needed to deploy programs (backport #19645) (#19998)
* Reduce payer balance needed to deploy programs (#19645)

* Reduce payer balance needed to deploy programs

* Fix test and unbalanced ix error

* fix test

* fix up tests

(cherry picked from commit efd024510a)

# Conflicts:
#	programs/bpf_loader/src/lib.rs

* fix conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-18 04:46:42 +00:00
3e870a40f2 Fix broken links in terminology.md (#19978) (#19992)
(cherry picked from commit 073c5359b0)

Co-authored-by: visortelle <visortelle@gmail.com>
2021-09-18 00:16:32 +00:00
707302d9f2 Add delete subcommand to ledger-tool bigtable (#19931) (#19963)
* Add `delete` subcommand to `ledger-tool bigtable` command

* feedback

(cherry picked from commit c71fab6cb3)

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-17 16:26:57 -05:00
b8ab6a46a8 Fix typos in terminology.md (#19977) (#19979)
(cherry picked from commit 1ec22572f2)

Co-authored-by: visortelle <visortelle@gmail.com>
2021-09-17 16:48:55 +00:00
9ad801a52c stake: Add BorshDeserialize trait to structs (#19958) (#19976)
(cherry picked from commit 9eb98adf97)

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-09-17 11:33:18 +00:00
c85816c44e rpc: performance fix for getProgramAccounts (#19941) (#19950)
* rpc: performance fix for getProgramAccounts

The accounts were gradually pushed into a vector, which produced
significant slowdowns for very large responses.

* rpc: rewrite loops using iterators

Co-authored-by: Christian Kamm <ckamm@delightful-solutions.de>
(cherry picked from commit f1bbf1d8b0)

Co-authored-by: Christian Kamm <mail@ckamm.de>
2021-09-16 23:26:21 +00:00
70d556782b Bump 1.7 version (#19943) 2021-09-16 13:16:09 -06:00
ca83167cfc Only allow votes when root distance gets too high (#19933) 2021-09-16 16:48:51 +02:00
54ad080bf2 Fix native invoke writable privileges (backport #19750) (#19860)
* Fix native invoke writable privileges (#19750)

* Fix native invoke writable privileges

* build downstream spl bpf programs for tests

(cherry picked from commit 00d7981f64)

# Conflicts:
#	program-runtime/src/instruction_processor.rs
#	runtime/src/message_processor.rs
#	sdk/src/feature_set.rs

* resolve conflictds

Co-authored-by: Jack May <jack@solana.com>
2021-09-16 01:42:26 +00:00
80e239550b Add banking metrics for buffered and dropped packets (#19902) (#19927)
(cherry picked from commit ca3f147670)

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-16 00:59:27 +00:00
992b313941 Cli: check current authorities before attempting to change them (backport #19853) (#19923)
* Cli: check current authorities before attempting to change them (#19853)

* Stake-authorize: check account current authority

* Stake-set-lockup: check account current custodian

* Make helper fn pub(crate)

* Vote-authorize: check account current authority

(cherry picked from commit 15144fc923)

# Conflicts:
#	cli/src/vote.rs

* Fix conflict

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-15 22:53:44 +00:00
97bd521725 Add logging after taking a bank snapshot (backport #19891) (#19920)
* Add logging after taking a bank snapshot (#19891)

(cherry picked from commit 8e3c420414)

* Fix conflict

Co-authored-by: Brooks Prumo <brooks@solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-15 14:29:33 -06:00
3ae2917603 build downstream spl bpf programs for tests (backport #19851) (#19887)
Co-authored-by: Justin Starry <justin@solana.com>
2021-09-15 12:20:00 -06:00
e51c2d1a84 Add an info log to indicate the node has reached supermajority and print the active stake percentage (#19893)
(cherry picked from commit 4ff50519ff)
2021-09-15 01:59:01 -07:00
a24b0dc81c Use f64 for stake math in get_stake_percent_in_gossip (#19895)
(cherry picked from commit c91519961c)
2021-09-15 01:58:52 -07:00
6e856cd468 Silence vercel github comments (#19827) (#19833)
(cherry picked from commit 8ac12c29ed)

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-13 17:30:05 +00:00
0dde54b95b Add --destake-vote-account <VOTE_ADDRESS>... argument to create-snapshot command (#19749) (#19796)
(cherry picked from commit 0f76077969)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-09-11 23:34:34 +00:00
1fa863e4b2 docs: be less specific about zen3 skus (#19791)
(cherry picked from commit 999ba9e026)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-09-11 05:30:30 +00:00
73e97aab5b Recover from interrupted bpf sdk installs (#19651) 2021-09-10 20:02:52 -07:00
8f082a239a Revert "fixup! test-validator: start logging asap (#19655)" (#19740) (#19745)
This reverts commit 64a2d7081b.

(cherry picked from commit 46fc92f392)

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-10 21:57:57 +00:00
7e5026bde2 removes backport merge conflicts 2021-09-09 23:33:29 -07:00
7ac0ea0885 filters for recent contact-infos when checking for live stake (#19204)
Contact-infos are saved to disk:
https://github.com/solana-labs/solana/blob/9dfeee299/gossip/src/cluster_info.rs#L1678-L1683

and restored on validator start-up:
https://github.com/solana-labs/solana/blob/9dfeee299/core/src/validator.rs#L450

Staked nodes entries will not expire until an epoch after. So when the
validator checks for online stake it is erroneously picking up
contact-infos restored from disk, which breaks the entire
wait-for-supermajority logic:
https://github.com/solana-labs/solana/blob/9dfeee299/core/src/validator.rs#L1515-L1561

This commit adds an extra check for the age of contact-info entries and
filters out old ones.

(cherry picked from commit 7a789e0763)

# Conflicts:
#	core/src/validator.rs
2021-09-09 23:33:29 -07:00
dc06d3dee5 Reduce wait for supermajority threshold back to 80%
(cherry picked from commit 4386e09710)
2021-09-09 21:45:00 -07:00
0b1aadf446 Add RpcClient::get_transport_stats()
(cherry picked from commit 21f4606212)
2021-09-09 21:17:56 -07:00
b9a0156a93 Return error if Transaction contains writable executable or ProgramData accounts (backport #19629) (#19730)
* Return error if Transaction contains writable executable or ProgramData accounts (#19629)

* Return error if Transaction locks an executable as writable

* Return error if a ProgramData account is writable but the upgradable loader isn't present

* Remove unreachable clause

* Fixup bpf tests

* Review comments

* Add new TransactionError

* Disallow writes to any upgradeable-loader account when loader not present; remove is_upgradeable_loader_present exception for all other executables

(cherry picked from commit 38bbb77989)

# Conflicts:
#	programs/bpf/tests/programs.rs
#	runtime/src/accounts.rs
#	runtime/src/bank.rs
#	sdk/src/transaction.rs
#	storage-proto/proto/transaction_by_addr.proto
#	storage-proto/src/convert.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-09 14:02:07 +00:00
f786d1d0f3 cargo-build-bpf: allow sdk path to be set by environment variables (#19509)
In many Linux distros such as NixOS, the directory in which packages are
installed is assumed to be read-only. To work around this, it is
expected that the filepaths which packaged CLI tools take in are able to
be freely configured through either 1) command-line flags, 2)
environment variables, or 3) a configuration file.

In this commit, environment variables 'BPF_SDK_PATH' and 'BPF_OUT_PATH',
which map respectively to command-line flags '--bpf-sdk-path' and
'--bpf-out-dir', are now handled in cargo-build-bpf.

Additionally, given that arbitrary filepaths may now be set in which the
BPF SDK is located, the requirement in which
'$BPF_SDK_PATH/dependencies/bpf-tools' must strictly be a symbolic link
to the directory '$HOME/.cache/solana/${bpf-tools.version}/bpf-tools has
been relaxed.

Ideally, the directory in which bpf-tools is expected to be downloaded
to and stored should be configurable. Though, this commit serves as a
temporary fix which enables NixOS users to now start being able to build
applications with the Solana SDK.

Co-authored-by: Kenta Iwasaki <kenta@lithdew.net>
2021-09-09 12:29:33 +00:00
b360c90d21 Add cargo-build-bpf integration tests (backport #18255) (#19720)
* Add cargo-build-bpf integration tests

(cherry picked from commit cf25729eaa)

* reduce version number

Co-authored-by: Dmitri Makarov <dmakarov@alumni.stanford.edu>
Co-authored-by: Justin Starry <justin@solana.com>
2021-09-08 23:31:13 +00:00
da801b753b Speed up program deploys by writing larger chunks (backport #19654) (#19680)
* Speed up program deploys by writing larger chunks (#19654)

(cherry picked from commit 24fd47a32d)

# Conflicts:
#	cli/src/program.rs

* resolve conflict

Co-authored-by: Justin Starry <justin@solana.com>
2021-09-08 21:45:30 +00:00
8f168a610e Updating Phantom description, removing invite code (#19004) (#19725)
* Updating Phantom description, removing invite code

* Updated copy

* Update web-wallets.md

(cherry picked from commit 9d2f0e237b)

Co-authored-by: Chris Kalani <chriskalani@gmail.com>
2021-09-08 21:23:37 +00:00
d7e6ab58c4 TpuClient now uses the processed slot to seed its leader schedule cache 2021-09-08 19:15:35 +00:00
a0e6a7c73b fixup! test-validator: start logging asap (backport #19655) (#19711)
* fixup! test-validator: start logging asap (#19655)

(cherry picked from commit 64a2d7081b)

# Conflicts:
#	validator/src/bin/solana-test-validator.rs

* Resolves conflicts

Co-authored-by: steviez <steven@solana.com>
2021-09-08 10:58:07 +00:00
ed4e7c0c87 Check seed length before trying to cal program address (backport #19699) (#19708)
* Check seed length before trying to cal program address (#19699)

(cherry picked from commit 778b2adbea)

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-09-08 08:26:07 +00:00
584f8deae3 cli: show upgradeable program accounts (backport #19431) (#19435)
* cli: show upgradeable program accounts (#19431)

(cherry picked from commit 57bbbb83a4)

* resolve conflicts

* nudge

Co-authored-by: Jack May <jack@solana.com>
2021-09-08 07:48:31 +00:00
e9c3f11d24 Remove native id check in pda creation (backport #19595) (#19689)
* Remove native id check in pda creation (#19595)

(cherry picked from commit 529fefc7cc)

# Conflicts:
#	programs/bpf/rust/invoke/src/lib.rs
#	programs/bpf_loader/src/syscalls.rs
#	sdk/src/feature_set.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-09-07 23:26:08 -07:00
57e87a09c0 Grammar nits (#19703) (#19706)
* Grammar nits

* add Phantom to staking docs

(cherry picked from commit 590e113f16)

Co-authored-by: Ryan M. Shea <8948187+rmshea@users.noreply.github.com>
2021-09-08 04:53:24 +00:00
a2b435916d Fix handling of stale links to bpf-tools in cargo-build-bpf (#17772) (#19667)
(cherry picked from commit 910ac94a8c)

Co-authored-by: Dmitri Makarov <dmakarov@users.noreply.github.com>
2021-09-06 22:23:40 +00:00
ad66189463 Update web-wallets.md (#19648) (#19650)
(cherry picked from commit f0be3e4ea9)

Co-authored-by: bitkeepwallet <85662627+bitkeepwallet@users.noreply.github.com>
2021-09-05 16:21:32 +00:00
9a280426da docs: fix typo (#19646) (#19647)
(cherry picked from commit f68ca3895b)

Co-authored-by: Zahin Mohammad <zahin.dev@gmail.com>
2021-09-04 18:48:36 +00:00
864006a78a docs: fix typo (#19641) (#19644)
(cherry picked from commit 497b6c152f)

Co-authored-by: Zahin Mohammad <zahin.dev@gmail.com>
2021-09-04 17:21:20 +00:00
e37e46cfc2 update Telegram link at docs (#19638) (#19639)
(cherry picked from commit 8352bc48db)

Co-authored-by: Pierre/Long <pierreneter@gmail.com>
2021-09-04 08:30:27 +00:00
376b21c6e7 Tiny dedupe 2021-09-04 01:43:23 -06:00
fcda5d4a7d Demote write locks on transaction program ids (backport #19593) (#19633)
* Demote write locks on transaction program ids (#19593)

* Add feature

* Demote write lock on program ids

* Fixup bpf tests

* Update MappedMessage::is_writable

* Comma nit

* Review comments

(cherry picked from commit decec3cd8b)

# Conflicts:
#	core/src/banking_stage.rs
#	core/src/cost_model.rs
#	core/src/cost_tracker.rs
#	ledger-tool/src/main.rs
#	program-runtime/src/instruction_processor.rs
#	programs/bpf/tests/programs.rs
#	programs/bpf_loader/src/syscalls.rs
#	rpc/src/transaction_status_service.rs
#	runtime/src/accounts.rs
#	runtime/src/bank.rs
#	runtime/src/message_processor.rs
#	sdk/benches/serialize_instructions.rs
#	sdk/program/src/message/mapped.rs
#	sdk/program/src/message/sanitized.rs
#	sdk/src/transaction/sanitized.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-04 06:46:09 +00:00
2e4a2c15be s/authorized_withdrawer_pubkey/authorized_withdrawer/
(cherry picked from commit f1ba759940)
2021-09-03 22:07:58 -07:00
a8ec380c56 Rework authorized_withdrawer usage
(cherry picked from commit fa61b90796)
2021-09-03 22:07:58 -07:00
afb87a386a Removed the --authorized-withdrawer argument from create-vote-account
The parameter is now a required third argument.  This is because authorized
withdrawer should never be the same as vote account keypair or validator
identity keypair for security reasons.

Added a --allow-unsafe-authorized-withdrawer to override this restriction if
necessary.

(cherry picked from commit e288459cf2)
2021-09-03 22:07:58 -07:00
2d060fd2d9 Add RpcClient::get_multiple_accounts_with_config()
(cherry picked from commit ae43ca3bfb)
2021-09-03 20:24:50 -07:00
c180f4c84e stake: Advance credits_observed on activation epoch (backport #19309) (#19626)
* stake: Advance `credits_observed` on activation epoch (#19309)

* stake: Advance `credits_observed` on activation epoch

* Add test for merging stakes just after activation

(cherry picked from commit 2c3bdedea3)

# Conflicts:
#	runtime/src/bank.rs

* Fix merge issues

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-09-04 01:29:00 +00:00
105a89175c Populate memo in blockstore signatures-for-address (backport #19515) (#19605)
* Populate memo in blockstore signatures-for-address (#19515)

* Add TransactionMemos column family

* Traitify extract_memos

* Write TransactionMemos in TransactionStatusService

* Populate memos from column

* Dedupe and add unit test

(cherry picked from commit 5fa3e5744c)

# Conflicts:
#	ledger/src/blockstore.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-09-03 08:51:02 +00:00
959334d2e3 docs: update spl token exchange integration (#19573) (#19578)
* docs: update spl token exchange integration

* Apply suggestions from code review

Co-authored-by: Michael Vines <mvines@gmail.com>

Co-authored-by: Michael Vines <mvines@gmail.com>
(cherry picked from commit f4f14c42bb)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-09-02 18:36:04 +00:00
aa2098d115 Write helper for multithread update (#18808) (#19282)
Co-authored-by: sakridge <sakridge@gmail.com>
2021-09-02 11:05:15 +00:00
37ee47c3e6 Add executor using the program's id during deploy (#19555) (#19572)
(cherry picked from commit 622a6fba7f)

Co-authored-by: Jack May <jack@solana.com>
2021-09-02 03:04:13 +00:00
4fb43bbd90 Fix tests that make assumptions about tx fee rate (#19538) 2021-08-31 22:02:20 -06:00
5fbcb10e6f adds logs when push-vote panics with invalid vote-index (#19485) (#19521)
In order to debug this panic on the clusters:

  panicked at 'assertion failed: (vote_index as usize) <
  MAX_LOCKOUT_HISTORY', core/src/cluster_info.rs:1012:9

(cherry picked from commit d7051b0d21)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-08-31 15:35:33 +00:00
6f86abf551 Populate memo in bigtable transaction structs (#19512) (#19514)
* Populate memo in bigtable transaction structs

* Preface memos with len

(cherry picked from commit f4ae450f34)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-08-31 05:14:25 +00:00
744a69f818 Fix shreds-to-hours/days estimations (#19477) (#19503)
(cherry picked from commit a3bef2e537)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-08-30 22:34:13 +00:00
1c6cac2054 fix typo in calling-between-programs developing documentation (#19502) (#19504)
(cherry picked from commit d11b0abf11)

Co-authored-by: Matthew Callens <callensmatt@gmail.com>
2021-08-30 20:04:39 +00:00
0c64bd0938 Improve terminology page (backport #18441) (#19165)
* Improve terminology page (#18441)

Co-authored-by: Gregg Dourgarian <greggd@aidacreative.com>
Co-authored-by: Haskell FTW <HaskellFTW@protonmail.com>
(cherry picked from commit e7190cc727)

# Conflicts:
#	docs/src/terminology.md

* Fix conflict

Co-authored-by: Haik Dulgarian <greggd@tempworks.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-30 16:48:22 +00:00
f73a61d2ec Bump version to 1.7.12 2021-08-27 16:24:24 +00:00
bdb77b0c98 Add missing owner check to bpf loader close ix (#19460) (#19470)
(cherry picked from commit 4305d4b7b1)

Co-authored-by: Justin Starry <justin@solana.com>
2021-08-27 10:19:14 -06:00
58bef3a94b Allow closing upgradeable program accounts (backport #19319) (#19411)
* Allow closing upgradeable program accounts (#19319)

(cherry picked from commit a89f180145)

# Conflicts:
#	programs/bpf_loader/src/lib.rs
#	programs/bpf_loader/src/syscalls.rs
#	sdk/src/feature_set.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
Co-authored-by: Justin Starry <justin@solana.com>
2021-08-27 08:56:51 +00:00
52dfb4a09c Bump jsonrpc crates and remove old tokio (backport #18779) (#19453)
* Bump jsonrpc crates and remove old tokio (#18779)

* Bump jsonrpc crates and replace old tokio

* Bump tokio

* getBlockTime

* getBlocks

* getBlocksWithLimit, getInflationReward

* getBlock

* getFirstAvailableBlock

* getTransaction

* getSignaturesForAddress

* getSignatureStatuses

* Remove superfluous runtime

(cherry picked from commit 8596db8f53)

# Conflicts:
#	Cargo.lock
#	client/Cargo.toml
#	core/Cargo.toml
#	programs/bpf/Cargo.lock
#	rpc/Cargo.toml
#	rpc/src/rpc.rs
#	validator/Cargo.toml

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-27 00:55:02 +00:00
c734db59cb hash calculation adds really old slots to dirty_stores (backport #19434) (#19451)
* hash calculation adds really old slots to dirty_stores (#19434)

(cherry picked from commit 98bc694606)

* fix test compile error

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
2021-08-26 22:44:25 +00:00
3b36e8e285 Add missing description for feature switch (#19428) 2021-08-25 18:24:28 +00:00
cdbc77bf97 Add parameter to allow setting max-retries for SendTransaction rpc (backport #19387) (#19416)
* Add parameter to allow setting max-retries for SendTransaction rpc (#19387)

* Add parameter to cap rpc send retries for a tx

* Add parameter to docs

(cherry picked from commit 7482861f4b)

# Conflicts:
#	banks-server/src/banks_server.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-25 07:23:03 +00:00
8ab358ce78 Preserve pre-existing vote/stake keypairs for bootstrap validator (#19405) (#19410)
(cherry picked from commit d559426373)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-08-24 23:44:06 +00:00
5193ba2062 Document more RpcClient methods (backport #19236) (#19390)
* Document more RpcClient methods (#19236)

* Document more RpcClient methods

* Update client/src/rpc_client.rs

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

* Update RpcClient docs per feedback

* Address review feedback

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
(cherry picked from commit 628ad58912)

# Conflicts:
#	client/src/mock_sender.rs

* Fix conflicts

* Restore previous methods for docs

Co-authored-by: Brian Anderson <andersrb@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-24 15:46:56 +00:00
7e5767f926 Bump crossbeam-epoch (backport #19378) (#19389)
* Bump to get off yanked crate (#19378)

(cherry picked from commit 82ea4891fd)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-24 03:10:55 +00:00
e5e6829d20 Update crossbeam-deque to 0.8.1 (#19361) (#19382)
(cherry picked from commit 2ccbe471ae)
2021-08-24 00:21:25 +00:00
3976816b79 Correct JSON-RPC docs for getSlot (#19355) (#19356)
* Correct JSON-RPC docs for getSlot

* Update docs/src/developing/clients/jsonrpc-api.md

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

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
(cherry picked from commit 9483866e0b)

Co-authored-by: Brian Anderson <andersrb@gmail.com>
2021-08-21 00:55:11 +00:00
9732157f0c Only encode data with <128 bytes in base58 (#19317) (#19351)
* Only encode data with <128 bytes in bs58

* Use same MAX_BS58_BYTES const in rpc

* Fix test

* Spell out base

Co-authored-by: Tyera Eulberg <tyera@solana.com>
(cherry picked from commit 967746abbf)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-08-21 00:32:30 +00:00
ed18d6d38d Remove tar-rs audit ignore (#19344) (#19352)
(cherry picked from commit 17978c2ff4)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-08-20 22:21:04 +00:00
ef336a44a1 change untar to use unpack instead of unpack_in (backport #19216) (#19340)
* change untar to use unpack instead of unpack_in (#19216)

* change untar to use unpack instead of unpack_in

* hacky, but maybe passes tests

* chore: bump tar from 0.4.35 to 0.4.37

Bumps [tar](https://github.com/alexcrichton/tar-rs) from 0.4.35 to 0.4.37.
- [Release notes](https://github.com/alexcrichton/tar-rs/releases)
- [Commits](https://github.com/alexcrichton/tar-rs/compare/0.4.35...0.4.37)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

* cleanup

* cleanup, add validate_inside_dst

* collapse use

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

* delete comment line

* add comments

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
(cherry picked from commit 89a31ff473)

# Conflicts:
#	Cargo.lock
#	download-utils/Cargo.toml
#	install/Cargo.toml
#	programs/bpf/Cargo.lock
#	runtime/Cargo.toml
#	sdk/cargo-build-bpf/Cargo.toml

* Fix conflicts

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-20 17:13:35 +00:00
de5f503a76 Add note about ASK keyword to paper wallet doc (#19330) (#19343)
* Add note about ASK keyword to paper wallet doc

Per https://github.com/solana-labs/solana/issues/17325#issuecomment-844434585, this change adds a note to the paper wallet docs mentioning the use of the `ASK` keyword.

Also specifes that the `solana-keygen pubkey prompt://` command returns a derived bip44 base address.

(I'm new to Solana development and this was a point of confusion for me, only resolved by finding this issue)

* Update docs/src/wallet-guide/paper-wallet.md

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
(cherry picked from commit 3be5715f45)

Co-authored-by: Brent Fitzgerald <burnto@gmail.com>
2021-08-20 15:20:09 +00:00
b5b1ed2a55 stake: Remove v2 program references (backport #19308) (#19336)
* stake: Remove v2 program references (#19308)

* stake: Remove v2 program references

* Remove stake v2 feature, along with stake rewrite

(cherry picked from commit 73aa004c59)

# Conflicts:
#	runtime/src/bank.rs

* Fix merge conflict

* Fix uses of old `stake` function

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-08-20 07:32:24 +00:00
caea9c99cd Minimize trust (backport #19279) (#19335)
* docs: Mainnet Beta inflation has been enabled for quite some time

(cherry picked from commit 169ded9a70)

* validator: Trusted validators are now called known validators

(cherry picked from commit e0bc5fa690)

* docs: trust minimize

(cherry picked from commit 40613161a0)

* docs: correct known validator operator

(cherry picked from commit eced50d103)

* docs: Remove decommissioned testnet archetype validator

(cherry picked from commit a587eec20b)

* docs: update devnet start args with new validators

(cherry picked from commit 2a877ae06e)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-08-20 06:24:43 +00:00
1495b94f7a discards epoch-slots epochs ahead of the current root (#19256) (#19328)
Cross cluster gossip contamination is causing cluster-slots hash map to
contain a lot of bogus values and consume too much memory:
https://github.com/solana-labs/solana/issues/17789

If a node is using the same identity key across clusters, then these
erroneous values might not be filtered out by shred-versions check,
because one of the variants of the contact-info will have matching
shred-version:
https://github.com/solana-labs/solana/issues/17789#issuecomment-896304969

The cluster-slots hash-map is bounded and trimmed at the lower end by
the current root. This commit also discards slots epochs ahead of the
root.

(cherry picked from commit 563aec0b4d)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-08-19 23:35:34 +00:00
f55bb78307 updates cluster-slots with root-bank instead of root-slot + bank-forks (backport #19058) (#19324)
* removes unused code from cluster-slots

(cherry picked from commit 2fc112edcf)

# Conflicts:
#	core/src/cluster_slots.rs

* updates cluster-slots with root-bank instead of root-slot + bank-forks

ClusterSlots::update is taking both root-slot and bank-forks only to
later lookup root-bank from bank-forks, which is redundant. Also
potentially by the time bank-forks is locked to obtain root-bank,
root-slot may have already changed and so be inconsistent with the
root-slot passed in as the argument.
https://github.com/solana-labs/solana/blob/6d95d679c/core/src/cluster_slots.rs#L32-L39
https://github.com/solana-labs/solana/blob/6d95d679c/core/src/cluster_slots.rs#L122

(cherry picked from commit 40914de811)

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-08-19 20:52:41 +00:00
fa5a71dbf0 ci: pin patched solana crates version for downstream project builds (#19322)
(cherry picked from commit b59b557163)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-08-19 15:58:24 +00:00
80a6479c47 Enable booting testnet validators without tower required (backport #19298) (#19306)
* Enable booting testnet validators without tower required (#19298)

(cherry picked from commit 7d135f185c)

# Conflicts:
#	net/net.sh

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-19 06:37:17 +00:00
a492de1bea Plumb accounts-db-skip-shrink through testnet scripts (backport #19290) (#19303)
* Plumb accounts-db-skip-shrink through testnet scripts (#19290)

(cherry picked from commit 1d375ff2da)

# Conflicts:
#	multinode-demo/bootstrap-validator.sh
#	multinode-demo/validator.sh
#	net/net.sh

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-19 01:14:06 +00:00
43b414b0df RPC: add option to exclude accounts from get_supply (backport #19270) (#19283)
* RPC: add option to exclude accounts from get_supply (#19270)

(cherry picked from commit c053df143f)

# Conflicts:
#	rpc/src/rpc.rs

* resolve conflicts

Co-authored-by: Justin Starry <justin@solana.com>
2021-08-18 20:22:06 +00:00
6f31882260 Fix memoverlap check (backport #19232) (#19259)
* Fix memoverlap check (#19232)

(cherry picked from commit 9be988db41)

# Conflicts:
#	programs/bpf_loader/src/syscalls.rs
#	sdk/src/feature_set.rs

* Resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-08-18 18:07:36 +00:00
5042808ecf Expose genesis block time via rpc (backport #19267) (#19277)
* Expose genesis block time via rpc (#19267)

* Expose genesis_creation_time from Bank

* Backfill genesis_creation_time for block/block-time requests of slot 0

(cherry picked from commit c167211611)

# Conflicts:
#	rpc/src/rpc.rs

* Fix conflict

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-18 00:19:59 +00:00
1c9d0521ca Revert TestValidatorGenesis::start() to v1.7.8 signature; add TestValidatorGenesis::start_with_socket_addr_space() (#19241)
(cherry picked from commit 3e5ba594e0)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-08-16 08:21:48 +00:00
ddda94e486 Add AsRef<AccountInfo> for AccountInfo (backport #19235) (#19238)
* Add AsRef<AccountInfo> for AccountInfo

(cherry picked from commit 930465e67c)

* add test for AsRef

(cherry picked from commit d10e37a829)

Co-authored-by: Kirill Fomichev <fanatid@ya.ru>
2021-08-15 16:21:04 +00:00
73ed9f56d7 Fixing missing pubsub notification for programSubscribe and logsSubscribe (backport #19092) (#19207)
* Fixing missing pubsub notification for programSubscribe and logsSubscribe (#19092)

#18587: programSubscribe is missing notifications randomly. The issue is because of two reasons

Not all rooted slots get OptimisticallyConfirmed notifications
The OptimisticallyConfirmed notifications can be out of order for slots: slot A and B with A < B can see notification for B first before A.
Summary of Changes

Changed OptimisticallyConfirmedBankTracker to send notifications for parent banks if they have not been notified yet. We use a new variable last_notified_slot to track that.

Tests:
With my validator running against testnet, before the fix, it was failing 75% of time, with the fix, it is passing consistently. Using the program mentioned in #18587.

(cherry picked from commit 1a372a792e)

* Use v1.7 api

Co-authored-by: Lijun Wang <83639177+lijunwangs@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-12 19:17:36 +00:00
ab5d032634 Bump version to v1.7.11 2021-08-12 06:55:18 +00:00
03b930515b Handle 0-lamport account in index generation (#19041) (#19160)
* Handle 0-lamport account in index generation

* rename duplicate to dirty keys

Co-authored-by: Carl Lin <carl@solana.com>
(cherry picked from commit 5a4979f25f)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-08-11 09:49:19 +00:00
c9f763ea6e Use last_valid_block_height in services and client apps (backport #19163) (#19171)
* Use last_valid_block_height in services and client apps (#19163)

* Add deprecated tag to Bank::get_blockhash_last_valid_slot

* Update SendTransactionService to use last_valid_block_height

* Update solana-tokens to use last_valid_block_height

* Remove dangling file

* Update solana program to use last_valid_block_height

* Update Banks crates to use last_valid_block_height

(cherry picked from commit 5970083b4d)

# Conflicts:
#	cli/src/program.rs

* Fix conflict

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-11 09:07:53 +00:00
422044f375 Updated transaction fee burn description. (#19161) (#19164)
(cherry picked from commit 83f0915e15)

Co-authored-by: bji <bryan@ischo.com>
2021-08-10 23:17:51 +00:00
7584262f47 add validator option --accounts-db-skip-shrink (backport #19028) (#19128)
* add validator option --accounts-db-skip-shrink (#19028)

* add validator option --accounts-db-skip-shrink

* typo

(cherry picked from commit 3280ae3e9f)

# Conflicts:
#	core/tests/snapshots.rs
#	ledger/src/bank_forks_utils.rs
#	ledger/src/blockstore_processor.rs
#	replica-node/src/replica_node.rs
#	runtime/src/snapshot_utils.rs

* Fix conflicts

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-10 10:07:27 -06:00
894f121d0e Fix deserialization of RPC errors in HttpSender (#19110) (#19127)
Fixes #15576

(cherry picked from commit e4b66a5913)

Co-authored-by: Brian Anderson <andersrb@gmail.com>
2021-08-09 22:36:16 -07:00
4b133509d9 v1.7: Handle new security advisories (#19131)
* Update hyper 0.14

* Add audit ignores

* Bump assert_cmd and remove audit ignore

* Remove pin-project-lite warning
2021-08-09 18:22:28 -06:00
e8040a828d Clean within shrink_all_slots (#19042) (#19109)
Co-authored-by: Carl Lin <carl@solana.com>
(cherry picked from commit 592013eaf4)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-08-07 06:16:43 +00:00
78086329be Add more API documentation for Rust RpcClient (#19021) (#19091)
* Add doc links to Transaction API docs

* Add more RpcClient API docs

* Reflow some rpc_client docs

* Update client/src/rpc_client.rs

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

* Update client/src/rpc_client.rs

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

* Update client/src/rpc_client.rs

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

* Update sdk/src/transaction.rs

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

* Update RpcClient docs per review

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
(cherry picked from commit b67ffab370)

Co-authored-by: Brian Anderson <andersrb@gmail.com>
2021-08-05 23:42:56 +00:00
6deeedd886 bump recommended maps/nofiles (#19059)
(cherry picked from commit d60ccf64e1)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-08-04 20:28:34 +00:00
1a0146f21d stake: Allow stakes with unmatched credits observed to merge (backport #18985) (#19055)
* stake: Allow stakes with unmatched credits observed to merge (#18985)

* stake: Allow stakes with unmatched credits observed to merge

* Address feedback

* Remove branch by doing a ceiling in one calc

(cherry picked from commit 2b33c0c165)

# Conflicts:
#	Cargo.lock
#	programs/stake/Cargo.toml
#	sdk/src/feature_set.rs

* Fix merge conflicts

* Fix clippy lint

* Add back whitespace

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-08-04 17:43:20 +00:00
7d0a9e0381 Add some docs for RpcClient and friends (backport #18748) (#19036)
* Add some docs for RpcClient and friends (#18748)

* Add some docs for RpcSender, HttpSender, MockSender

* Support SimulateTransaction in MockSender

* Add docs for RpcClient constructors

* Add some more RpcClient examples

* rustfmt

* Reflow docs in rpc_client and friends

(cherry picked from commit 5dcfd7ce74)

# Conflicts:
#	client/src/mock_sender.rs

* Fix conflicts

Co-authored-by: Brian Anderson <andersrb@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-08-03 22:18:48 +00:00
0f7b84197f Exit stable-bpf CI runs before localnet-sanity (#19016) (#19018)
(cherry picked from commit 95c2873b3c)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-08-02 19:28:55 +00:00
bb06502d24 v1.7: Fix broken test validator
Removes duplicated locking logic
2021-08-02 08:08:28 -06:00
b7f1f19d8e Bump version to v1.7.10 2021-07-31 01:19:33 -06:00
0707290bbf Fix serialization of parameters in RpcClient::get_block_production_with_config (backport #18998) (#19000)
* Fix serialization of parameters in RpcClient::get_block_production_with_config (#18998)

Params must be an array or null.

(cherry picked from commit 58f395257b)

# Conflicts:
#	client/src/mock_sender.rs

* Fix conflict

Co-authored-by: Brian Anderson <andersrb@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-07-31 02:00:32 +00:00
8934a3961f Add get_clock to BanksClient (#18591)
(cherry picked from commit d30a36641e)

Co-authored-by: Kirill Fomichev <fanatid@ya.ru>
2021-07-30 18:29:42 +00:00
b142ef5f8b Improve target CPU feature checks (backport #18940) (#18958)
* Improve check for Apple M1 silicon under Rosetta

(cherry picked from commit 59641623d1)

# Conflicts:
#	core/src/validator.rs

* test-validator: start logging asap

(cherry picked from commit ee65ffb3c8)

* test-validator: move feature check earlier in startup

(cherry picked from commit e641f257ef)

* validator: add avx2 runtime check

(cherry picked from commit c435f7b3e3)

* validator: start logging asap

(cherry picked from commit ed8285c096)

* validator: check target CPU features earlier

(cherry picked from commit 8ed0cd0fff)

* validator: remove disused cuda config argument

(cherry picked from commit 71f6d839f9)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-30 06:47:22 +00:00
f2dc9dd96e Fix unstable retransmit-num_nodes (#18970) (#18974)
(cherry picked from commit da480bdb5f)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-07-30 10:52:37 +09:00
20ad3005b5 allows private addresses by default in test-validator (backport #18976) (#18980)
* allows private addresses by default in test-validator (#18976)

(cherry picked from commit 1cef6fd4b4)

# Conflicts:
#	validator/src/bin/solana-test-validator.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-07-30 00:05:19 +00:00
eacc69efba adds validator flag to allow private ip addresses (backport #18850) (#18975)
* adds validator flag to allow private ip addresses (#18850)

(cherry picked from commit d2d5f36a3c)

# Conflicts:
#	accounts-cluster-bench/Cargo.toml
#	bench-tps/Cargo.toml
#	cli/Cargo.toml
#	core/benches/cluster_info.rs
#	core/src/banking_stage.rs
#	core/src/broadcast_stage.rs
#	core/src/broadcast_stage/broadcast_duplicates_run.rs
#	core/src/broadcast_stage/fail_entry_verification_broadcast_run.rs
#	core/src/broadcast_stage/standard_broadcast_run.rs
#	core/src/cluster_slots_service.rs
#	core/src/repair_service.rs
#	core/src/tvu.rs
#	core/src/validator.rs
#	dos/Cargo.toml
#	gossip/src/cluster_info.rs
#	gossip/src/crds_gossip_pull.rs
#	gossip/src/crds_gossip_push.rs
#	gossip/src/gossip_service.rs
#	local-cluster/Cargo.toml
#	local-cluster/src/cluster_tests.rs
#	local-cluster/tests/local_cluster.rs
#	rpc/Cargo.toml
#	rpc/src/rpc.rs
#	tokens/Cargo.toml
#	validator/Cargo.toml
#	validator/src/main.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-07-29 21:43:24 +00:00
3c200ae45a Tiny typo fix (#18978) (#18979)
(cherry picked from commit 46fdf8a4d2)

Co-authored-by: NearlyAlwaysThere <87867628+NearlyAlwaysThere@users.noreply.github.com>
2021-07-29 14:22:10 -06:00
74e7c7cbd0 Cli: app and wallet command reorg (backport #18955) (#18959)
* Cli: app and wallet command reorg (#18955)

* Clean up wallet commands

* Move global args

(cherry picked from commit 662ccfa558)

# Conflicts:
#	cli/src/cli.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-07-29 09:46:48 -06:00
6bd6d6212c Fix erroneous default start_slot (#18948) (#18952)
(cherry picked from commit 578f2aa22b)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-07-29 00:11:35 +00:00
4d2e66cf9c Added missing method to index and updated token account methods docs. (#18906) (#18954)
(cherry picked from commit 4d0cd9b283)

Co-authored-by: hugo <murlux@protonmail.com>
2021-07-28 22:35:55 +00:00
65fe00b7ad Auto-generate shell completions for solana-cli (issue #8879 and #14005) (#18931) (#18945)
* Auto-generate shell completions for solana-cli (issue #8879 and #14005)

Implement `completion` SubCommand for solana-cli, which outputs
completion script to stdout and exits the process. The script generation
handled completely by clap.

In order to implement the generation, one minor design change was
necessary regarding the creation of clap `App`.

Previously: One part of App initialization was in the `app` function,
and some other arguments and subcommands were added later directly in
the `main` function.

Now: The whole construction of App was moved to `get_clap_app` function.

P.S. I wasn't sure if constructing App separately had visual importance,
so both constructing parts are still separate in `base_clap_app` and
`final_clap_app` functions. But they sure could be in one single
function.

* Dereplicode match expr, fix clippy warning.

* Move clap App construction into separate module

Also join two parts of the construction into a single function

* Fix tests

* Apply rustfmt lints

(cherry picked from commit 9d0a937a05)

Co-authored-by: theonekeyg <34949189+theonekeyg@users.noreply.github.com>
2021-07-28 17:26:19 +00:00
02c509390a Add cli-output helpers (backport #18933) (#18935)
* Add cli-output helpers (#18933)

* Add OutputFormat helper to reduce copy-pasta

* Add CliSignOnlyData constructor

(cherry picked from commit 467c18e0d1)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-07-28 15:25:56 +00:00
49b0d1792b filters crds values in parallel when responding to gossip pull-requests (backport #18877) (#18901)
* filters crds values in parallel when responding to gossip pull-requests (#18877)

When responding to gossip pull-requests, filter_crds_values takes a lot of time
while holding onto read-lock:
https://github.com/solana-labs/solana/blob/f51d64868/gossip/src/crds_gossip_pull.rs#L509-L566

This commit will filter-crds-values in parallel using rayon thread-pools.

(cherry picked from commit f1198fc6d5)

# Conflicts:
#	gossip/src/cluster_info.rs
#	gossip/src/crds_gossip_pull.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-07-26 21:30:24 +00:00
9511031490 v1.7: backport new column families from master (#18897)
* backport new column families from master to 1.6 (#18743)

* backporting bank_hash and program_costs column families from master to 1.6 for rocksdb backward compatibility

* missed a line to allow dead code

* include code for purge

* Exclude stubbed ProgramCosts column from compaction (#18840)

Co-authored-by: Tao Zhu <82401714+taozhu-chicago@users.noreply.github.com>
2021-07-26 13:38:47 -06:00
04ee86e93c rebase 2021-07-24 19:48:12 -07:00
82f25f982e Put is_x86_feature_detected behind a target_arch check
This change adds a target arch check so that cargo build can be run from an
Apple M1 mac.

(cherry picked from commit 7ee5b02bc5)
2021-07-24 19:48:12 -07:00
1cc32c9cda Disable reed-solomon-erasure/simd-accel feature on aarch64 (Apple M1)
This feature requires clang to support -march=native on M1. Before this change,
cargo build would output a build error when building for aarch64.

(cherry picked from commit 8a9b7f5ef2)

# Conflicts:
#	ledger/Cargo.toml
2021-07-24 19:48:12 -07:00
aedcab846c RpcClient::send<T> now supports client-defined RPC methods via RpcRequest::Custom (#18882)
(cherry picked from commit f264511585)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-07-24 19:15:51 +00:00
548ddff7ed Bump version to v1.7.9 2021-07-24 11:23:44 -06:00
7aced9e772 Sigverify refactor (#18872) 2021-07-23 22:23:57 +02:00
1cc8de0fed Bump version to v1.7.8 (#18866) 2021-07-24 01:14:03 +09:00
f08c7b2294 Rpc: getProgramAccounts, restruct base58 account data size (#18852) (#18855)
* Refactor account encoding to povide helper w/out querying Bank

* Use new method in get_program_accounts to properly return length err

(cherry picked from commit 3eecb6f4ae)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-07-23 05:52:53 +00:00
cc58d36de6 Really start caching by fixing swapped CAS... (#18842) (#18853)
(cherry picked from commit 611af87fdb)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-07-23 03:51:12 +00:00
128393da54 Clarify entities in docs (#18821) (#18845)
* Update docs

* Change History

(cherry picked from commit e7a687d7ee)

Co-authored-by: Ryan M. Shea <8948187+rmshea@users.noreply.github.com>
2021-07-22 20:25:38 +00:00
e7964a0b89 token: Swap new token program id for consistency on all networks (#18823) (#18837)
(cherry picked from commit d6f5945653)

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-07-22 11:03:41 +00:00
77dc3746a3 docs: fix link to Native Programs page in transactions.md (#18830) (#18832)
(cherry picked from commit 71bd434297)

Co-authored-by: Stephen Peterkins <stephen@peterkins.ca>
2021-07-22 03:59:45 +00:00
e88f4d689c Fixed broken links and added more context to getTokenAccountBalance docs (#18811)
(cherry picked from commit d751d5b6e8)

Co-authored-by: murlux <murlux@protonmail.com>
2021-07-21 18:32:58 +00:00
f1858c74a4 Disambiguate archive_snapshot_package IO error sources (#18798)
(cherry picked from commit a4c3db51fc)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-21 17:17:57 +00:00
7427dafc36 feature: add new token program feature (backport #18780) (#18803)
* feature: add new token program feature (#18780)

* feature: add new token program feature

* Fixup test

* Update to spl-token v3.2.0

* Update Cargo.lock + fmt

* Update token program version in fetch-spl.sh

* Bump associated token program to 1.0.3

* Add aToken so

(cherry picked from commit 51f3b9aa7c)

# Conflicts:
#	Cargo.lock
#	account-decoder/Cargo.toml
#	accounts-cluster-bench/Cargo.toml
#	programs/bpf/Cargo.lock
#	rpc/Cargo.toml
#	sdk/src/feature_set.rs
#	tokens/Cargo.toml
#	transaction-status/Cargo.toml

* Fix merge issues

* Re-generate lock files

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-07-21 15:05:45 +00:00
1cdcabf7cf Bump BPF tools to v1.9 (#18766)
(cherry picked from commit 47861fc373)

Co-authored-by: Dmitri Makarov <dmakarov@alumni.stanford.edu>
2021-07-19 20:46:59 +00:00
ea192b3c83 prevent excess allocation with AccountsIndexIterator (#18605) (#18642)
(cherry picked from commit 0bd8710d34)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-07-19 20:15:40 +00:00
927057df26 correct typo (backport #18750) (#18751)
* correct typo

(cherry picked from commit 1507477306)

* fix another typo

(cherry picked from commit 269028360c)

Co-authored-by: Yang Li <yangli1990@live.com.au>
2021-07-18 13:52:57 +00:00
19049ca91b Bump version to v1.7.7 2021-07-17 08:42:22 +00:00
3542348c1e CI Tweaks (backport #18738) (#18742)
* ci: fix typo

(cherry picked from commit 96a7cedaca)

* ci: suppress cargo tree output

(cherry picked from commit 59cd0556ef)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-17 06:07:45 +00:00
df9061b933 excludes private ip addresses (#18740)
(cherry picked from commit e316586516)

# Conflicts:
#	core/src/broadcast_stage.rs
#	gossip/src/cluster_info.rs

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-07-17 04:10:43 +00:00
98658ebed5 Use rustup default profile (#18727) (#18731)
(cherry picked from commit 2ec81f627d)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-07-16 15:21:34 -06:00
2a93147b1b Add voting service (#18552) (#18722)
Co-authored-by: sakridge <sakridge@gmail.com>
2021-07-16 22:12:04 +02:00
4145c629c0 removes id from push_lowest_slot args (backport #18645) (#18649)
* removes id from push_lowest_slot args (#18645)

push_lowest_slot cannot sign the new crds-value unless the id (pubkey)
argument passed-in is the same pubkey as in ClusterInfo::keypair(), in
which case the id argument is redundant:
https://github.com/solana-labs/solana/blob/bb41cf346/gossip/src/cluster_info.rs#L824-L845

Additionally, the lookup is done with self.id(), but insert is done with
the id argument, which is logically a bug.

(cherry picked from commit c90af3cd63)

# Conflicts:
#	gossip/src/cluster_info.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-07-16 18:31:54 +00:00
551dc0a74c Bump 1.7 version (#18723) 2021-07-16 09:43:18 -06:00
85bbcdad9a Cli: Support checked stake and vote operations (#18449) (#18705)
* Refactor VoteAuthorize to use SignerIndex and support vote-authorize-*-checked

* Add checked bool const and use in command parsing

* Add create-stake-account-checked handling

* Add stake-set-lockup-checked handling

* Remove unnecessary mut

* Add stake-authorized-checked handling

(cherry picked from commit aeb30fa873)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-07-16 09:42:29 -06:00
336c1c1d37 nonce: Unify NonceError with SystemError 2021-07-16 04:41:51 -06:00
1570afe493 Cli configurable validators (backport #18630) (#18666)
* rpc: more params for `GetVoteAccountsConfig`

(cherry picked from commit bf90ea282a)

* cli: allow returning more `solana validators`

(cherry picked from commit a4a24b6531)

# Conflicts:
#	Cargo.lock

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-16 09:49:13 +00:00
c7c650fccc Gate libsecp256k1 update (backport #18656) (#18701)
* hijack secp256k1 enablement feature plumbing for libsecp256k1 upgrade

* bump libsecp256k1 to v0.5.0

* gate libsecp256k1 upgrade to v0.5.0

* ci: allow clippy::inconsistent_struct_constructor

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-16 07:38:45 +00:00
9b7fba69f4 Remove tour-de-sol.md link 2021-07-15 21:55:04 -07:00
0bd355c166 Remove zh tds pages 2021-07-15 21:08:35 -07:00
0d8c8d013d Remove Tour de SOL more
(cherry picked from commit c03490b24a)
2021-07-15 21:07:11 -07:00
7a57f7b8cc Remove tour-de-sol/
(cherry picked from commit 5fe0350c2e)
2021-07-15 20:17:54 -07:00
940c4731c4 Align vote-account output with stake-account output 2021-07-15 08:16:17 -07:00
4332f0ca05 Replace get_clock by get_sysvar in BanksClient 2021-07-14 18:06:27 -07:00
e0e6e20e02 Add method id to SysbarId trait (#18604)
(cherry picked from commit 5cea25ac3e)
2021-07-14 17:51:54 -07:00
0fdaa1438e Drop default_on_eof attribute from Reward struct
(cherry picked from commit 33718e5fb4)
2021-07-14 12:37:38 -07:00
8a111229f7 Cleanup secp256k1 deps (backport #18618) (#18625)
* Cleanup secp256k1 deps (#18618)

(cherry picked from commit 0d3e8ada94)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock
#	programs/secp256k1/Cargo.toml
#	runtime/Cargo.toml

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-07-13 08:35:50 +00:00
e3eb9c195a Cli: expose last valid block height (#18620) (#18627)
* Add Fees struct to client

* Add complete RpcClient::get_fees methods

* Switch cli to last_valid_block_height

(cherry picked from commit 8ad4ffdee5)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-07-13 06:34:31 +00:00
8dd5ec6fbd refactor(rpc_client): const number of retries for send and confirm transaction (#18390) (#18427)
* refactor(rpc_client): simplfy send and confirm transaction flow

* chore: configurable num of retries for send and confirm

(cherry picked from commit 70234dfdf4)

Co-authored-by: hrls <viktor.kharitonovich@gmail.com>
2021-07-13 06:28:11 +00:00
e5d60bc56d Record vote account commission with voting/staking rewards and surface in RPC
(cherry picked from commit 4098af3b5b)
2021-07-12 17:07:07 -07:00
cba97d576a serial insertion of bins into accounts index (#18469) (#18617)
(cherry picked from commit f5ff4b2058)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-07-12 22:26:29 +00:00
0670213365 Unignore spl downstream build (#18218) (#18611)
(cherry picked from commit 072a7761e1)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-07-12 20:12:39 +00:00
ed5c11b3aa Update neon program id (backport #18607) (#18608)
* Update neon program id (#18607)

(cherry picked from commit 00f7e514b8)

* fix test

Co-authored-by: Jack May <jack@solana.com>
2021-07-12 11:18:29 -07:00
4b8c4704b0 Fix typo (#18595) (#18596)
(cherry picked from commit ab45532b52)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-07-12 08:02:06 +00:00
c5374095e6 storage-proto: Rework source generation (#18584)
(cherry picked from commit 899b09872b)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-11 03:33:56 +00:00
6abd5fbc3e removes redundant (mutable) self receivers (backport #18574) (#18580)
* removes redundant (mutable) self receivers (#18574)

(cherry picked from commit 918b5c28b2)

# Conflicts:
#	gossip/src/cluster_info.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-07-11 01:02:20 +00:00
a6a302f41f chore: bump ouroboros from 0.5.1 to 0.9.3 (#18189) (#18573)
* chore: bump ouroboros from 0.5.1 to 0.9.3

Bumps [ouroboros](https://github.com/joshua-maros/ouroboros) from 0.5.1 to 0.9.3.
- [Release notes](https://github.com/joshua-maros/ouroboros/releases)
- [Commits](https://github.com/joshua-maros/ouroboros/commits)

---
updated-dependencies:
- dependency-name: ouroboros
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* [auto-commit] Update all Cargo lock files

* Api changes

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-07-10 20:44:54 +00:00
4c764829da CI: Make BPF test suite a first-class citizen (backport #18535) (#18571)
* CI: Extricate BPF tests from stable-perf

(cherry picked from commit 1eab0773af)

* CI: Dump BPF assembly listings and upload as artifact

(cherry picked from commit f1996ca0f3)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-10 19:24:23 +00:00
9900c1ad8a adds a generic implementation of Gossip{Read,Write}Lock (#18559) (#18569)
(cherry picked from commit fd9c10c2e2)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-07-10 15:51:29 +00:00
3fabbab417 Add storage-proto build.rs and readme (backport #18353) (#18562)
* Add storage-proto build.rs and readme (#18353)

* Use build.rs for storage-proto generation

* Add readme

* Single use statements

(cherry picked from commit c2e7d39154)

# Conflicts:
#	Cargo.lock
#	storage-proto/build-proto/Cargo.lock
#	storage-proto/build-proto/Cargo.toml

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-07-09 22:21:08 +00:00
6c99c1ae13 Bump prost, prost-types, and tonic (backport #18537) (#18558)
* Bump prost, prost-types, and tonic (#18537)

* Bump prost+tonic and accommodate generated service changes

* Unignore advisory

* Fixup .proto error list

(cherry picked from commit 761de8b1a3)

# Conflicts:
#	Cargo.lock
#	storage-bigtable/Cargo.toml
#	storage-proto/Cargo.toml

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-07-09 19:54:29 +00:00
c2320fceab Remove sysvar special cases for rent and assign 2021-07-10 01:24:44 +09:00
8b87d86358 Bump compute budget for neon evm (#17700) (#18522)
(cherry picked from commit 2867584985)

Co-authored-by: Jack May <jack@solana.com>
2021-07-09 09:12:31 -07:00
5d0e1d62d5 removes id and shred_version from CrdsGossip (backport #18505) (#18554)
* removes id and shred_version from CrdsGossip (#18505)

ClusterInfo is the gateway to CrdsGossip function calls, and it already
has node's pubkey and shred version (full ContactInfo and Keypair in
fact).
Duplicating these data in CrdsGossip adds redundancy and possibility for
bugs should they not be consistent with ClusterInfo.

(cherry picked from commit 4e1333fbe6)

# Conflicts:
#	gossip/src/cluster_info.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-07-09 15:37:05 +00:00
7e613c7a78 skips process_push_message for local messages (backport #18493) (#18532)
* skips process_push_message for local messages (#18493)

received_cache is not relevant for local messages, and does not need to
be updated:
https://github.com/solana-labs/solana/blob/92c5cdab6/gossip/src/crds_gossip_push.rs#L166-L189

(cherry picked from commit 27cc7577a1)

# Conflicts:
#	gossip/src/cluster_info.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-07-09 13:33:40 +00:00
2a30436e45 Show grcov version as well (#18549) (#18551)
(cherry picked from commit a5b91ef4c3)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-07-09 12:41:44 +00:00
5315a89e7d Remove dead solana airdrop parameters (#18520) (#18524)
(cherry picked from commit f39ffa69f6)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-07-08 21:56:25 +00:00
8c328316ae Add ecrecover syscall (backport #17720) (#18500)
* Add ecrecover syscall (#17720)

Co-authored-by: Anton Lisanin <lisanin.anton@gmail.com>
(cherry picked from commit 1f288ce527)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock
#	programs/bpf/tests/programs.rs
#	programs/bpf_loader/Cargo.toml
#	programs/bpf_loader/src/syscalls.rs
#	sdk/program/Cargo.toml

* resolve conflicts

Co-authored-by: s-medvedev <40623263+s-medvedev@users.noreply.github.com>
Co-authored-by: Jack May <jack@solana.com>
2021-07-08 21:56:19 +00:00
030a97d098 Temporarily ignore prost-types advisory (backport #18525) (#18527)
* Temporarily ignore prost-types audit (#18525)

(cherry picked from commit 6188283ba6)

* Bump tokio

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-07-08 13:49:33 -06:00
c40e71dc03 featurize_policy_update (#18492) (#18502)
(cherry picked from commit ccdf93e2b8)

Co-authored-by: Jack May <jack@solana.com>
2021-07-07 22:31:05 +00:00
2f633cdfb7 Refactor verify_and_update write privileges check (#18468) (#18484)
Co-authored-by: Justin Starry <justin@solana.com>
2021-07-07 21:46:07 +00:00
edd6ae588a Update verify policy (backport #18459) (#18491)
* Update verify policy (#18459)

(cherry picked from commit 44289e6728)

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-07-07 19:02:52 +00:00
2a73ba2fbb Fix cargo check (#18497) 2021-07-07 14:01:19 -05:00
5eadb86500 Fix example in docs for getInflationReward (#18494) (#18496)
(cherry picked from commit ebc7df62f3)

Co-authored-by: Max Ogden <maxogden@users.noreply.github.com>
2021-07-07 18:43:24 +00:00
c98ab6c6dc Record parent slot to reconstruct fork tree from influxdb (#18482) (#18488)
(cherry picked from commit d69f469b83)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-07-07 17:42:03 +00:00
5321463892 Refactoring: Unify account_deps and accounts (backport #17898) (#18486)
* Refactoring: Unify account_deps and accounts (#17898)

* Changes ThisInvokeContext::get_account() to use accounts instead of pre_accounts.

* Adds explicit keys to accounts to make them symmetric to account_deps.

* Appends account_deps to accounts in transaction loading and removes account_deps everywhere else.

(cherry picked from commit 7462c27d07)

# Conflicts:
#	program-test/src/lib.rs
#	runtime/src/bank.rs
#	runtime/src/message_processor.rs

* fix conflicts

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
Co-authored-by: Justin Starry <justin@solana.com>
2021-07-07 17:14:39 +00:00
d668a7694f implements an unbiased weighted shuffle using binary indexed tree (#18343) (#18485)
Current implementation of weighted_shuffle:
https://github.com/solana-labs/solana/blob/b08f8bd1b/gossip/src/weighted_shuffle.rs#L11-L37
uses a heuristic which results in biased samples.

For example, if the weights are [1, 10, 100], then the 3rd index should
come first 100 times more often than the 1st index. However,
weighted_shuffle is picking the 3rd index 200+ times more often than the
1st index, showing a disproportional bias in favor of higher weights.

This commit implements weighted shuffle using binary indexed tree to
maintain cumulative sum of weights while sampling. The resulting samples
are demonstrably unbiased and precisely proportional to the weights.

Additionally the iterator interface allows to skip computations when
not all indices are processed.

Of the use cases of weighted_shuffle, changing turbine code requires
feature-gating to keep the cluster in sync. That is not updated in
this commit, but can be done together with future updates to turbine.

(cherry picked from commit dba42c57b4)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-07-07 16:07:41 +00:00
9bb482e46f persists repair-peers cache across repair service loops (#18400) (#18483)
The repair-peers cache is reset each time repair service loop runs,
and so computed repeatedly for the same slots:
https://github.com/solana-labs/solana/blob/d2b07dca9/core/src/repair_service.rs#L275

This commit uses an LRU cache to persists repair-peers for each slot.
In addition to LRU eviction rules, in order to avoid re-using outdated
data, each entry also has 10 seconds TTL.

(cherry picked from commit a0551b4054)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-07-07 15:43:15 +00:00
c534c928a7 encapsulates turbine peers computations of broadcast & retransmit stages (#18238) (#18464)
Broadcast stage and retransmit stage should arrange nodes on turbine
broadcast tree in exactly same order. Additionally any changes to this
ordering (e.g. updating how unstaked nodes are handled) requires feature
gating to keep the cluster in sync.

Current implementation is scattered out over several public methods and
exposes too much of implementation details (e.g. usize indices into
peers vector) which makes code changes and checking for feature
activations more difficult.

This commit encapsulates turbine peer computations into a new struct,
and only exposes two public methods, get_broadcast_peer and
get_retransmit_peers, for call-sites.

(cherry picked from commit 04787be8b1)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-07-07 14:30:55 +00:00
0d0478c4a4 Add vote/stake checked instructions (backport #18345) (#18457)
* Add vote/stake checked instructions

(cherry picked from commit ee219ffa47)

* Fix set-lockup custodian index

(cherry picked from commit 544f62c92f)

* Add parsing for new stake instructions; clean up confusing test args

(cherry picked from commit 9b302ac0b5)

* Add parsing for new vote instructions

(cherry picked from commit 39bac256ab)

* Add VoteInstruction::AuthorizeChecked test

(cherry picked from commit b8ca2250fd)

* Add Stake checked tests

(cherry picked from commit 74e89a3e3e)

Co-authored-by: Michael Vines <mvines@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-07-07 03:17:21 +00:00
cda681a2f0 Remove obsolete stake-monitor command (backport #18020) (#18462)
* Remove obsolete stake-monitor command

(cherry picked from commit f859a39b86)

# Conflicts:
#	Cargo.lock
#	stake-monitor/Cargo.toml

* Fix conflict

Co-authored-by: Michael Vines <mvines@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-07-07 00:55:13 +00:00
72ed4f28b1 Remove feature switch for demoting sysvar write locks (#18373) (#18454)
Co-authored-by: Justin Starry <justin@solana.com>
2021-07-06 23:25:28 +00:00
6afeaac7a5 Fix transaction logs and inner ixs for leader nodes (backport #18395) (#18448)
* Fix transaction logs and inner ixs for leader nodes (#18395)

* Fix transaction logs and inner ixs for leader nodes

* Fix cpi log storage flag

(cherry picked from commit 5dd399dafa)

# Conflicts:
#	runtime/src/bank.rs

* resolve conflict

Co-authored-by: Justin Starry <justin@solana.com>
2021-07-06 23:04:19 +00:00
75a2b66206 docs: Correct integration validator cli reference (#18458)
(cherry picked from commit 77f61a5e2e)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-06 22:26:38 +00:00
5966053a6d Improve account unlock performance (#18442) (#18447)
* Improve account unlock performance

* fix clippy

(cherry picked from commit 6319e8811a)

Co-authored-by: Justin Starry <justin@solana.com>
2021-07-06 21:40:04 +00:00
e500b79858 Update terminology.md (#18430) (#18431)
* Update terminology.md

Fix duplicate "holders"

* Update docs/src/inflation/terminology.md

Co-authored-by: Michael Vines <mvines@gmail.com>
(cherry picked from commit b887e89972)

Co-authored-by: Sean Michael <seankmichael@gmail.com>
2021-07-06 03:13:50 +00:00
428c20c79f borsh: add bool type (#18429)
(cherry picked from commit e7b36c8484)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-07-05 21:48:10 +00:00
bf84bc17ea Cli: expose --with-memo to nonce and stake commands (#18404) (#18410)
* Fmt memo_arg

* Add --with-memo to nonce and stake cli commands

(cherry picked from commit 1dd730d685)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-07-05 01:19:17 +00:00
30fa9cbee7 sdk: add is_interactive() method Signer trait (#18407)
(cherry picked from commit 2af5ec4f57)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-03 09:09:39 +00:00
eefca613ad Rename Tower::lockouts to Tower::vote_state
(cherry picked from commit d5c2c72360)
2021-07-02 20:35:02 -07:00
f6d943aec7 SDK: Add test for illegal Pubkey::create_with_seed owners (#18402)
(cherry picked from commit 216983c50e)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-03 01:27:53 +00:00
88462e67b5 Allow a solana-validator to join a cluster established by solana-test-validator (backport #18394) (#18399)
* Report 404 instead of 502 when a snapshot file is not found

This provides the client with more useful information about why their
request failed

(cherry picked from commit 40d696fcbc)

* As a last resort try to download an uncompressed snapshot

`solana-test-validator` creates uncompressed snapshots and it can be
useful to attach another validator to a `solana-test-validator` cluster
from time to time

(cherry picked from commit e36247d187)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-07-03 00:27:42 +00:00
eb683dd402 Document order of recent blockhashes sysvar (#18379)
I wanted to use this sysvar to get a recent block hash, but I didn't
know whether the first or the last entry contains the most recent block
hash.

By calling it for mainnet, printing the results, and comparing that to
the recent blocks on solanabeach.io/blocks, I discovered that the
entries are ordered from most recent to least recent. Document this to
save future readers the trouble.

(cherry picked from commit 94ab0eb49f)

Co-authored-by: Ruud van Asseldonk <ruud@chorus.one>
2021-07-02 07:03:04 +00:00
c7d0aea5f4 Make set roots an iterator (#18357) (#18377)
(cherry picked from commit 0eca92de18)

Co-authored-by: carllin <carl@solana.com>
2021-07-02 04:44:38 +00:00
8f08953100 Added formats to notifications in WebSocket RPC client. (#18231)
(cherry picked from commit 8e7d393b70)
2021-07-01 21:14:49 -07:00
09b009abd9 Removed unused purged_slots in purge_older_root_entries (#18102)
Removed unused purged_slots in purge_older_root_entries

(cherry picked from commit ccf6b21bf8)
2021-07-01 21:13:02 -07:00
c37e481a43 test (#18159) (#18289)
(cherry picked from commit 47cafb70da)

Co-authored-by: carllin <carl@solana.com>
2021-07-02 04:12:53 +00:00
72cf55b8c3 More detailed voting timings in replay stage (#18229)
(cherry picked from commit 5d08bf9aa3)
2021-07-01 21:12:11 -07:00
6cb24ae7b6 Docs expose Transaction v2 proposal (backport #18283) (#18286)
* docs: expose TX v2 proposal

(cherry picked from commit 0972d12c1c)

* docs: A-Z sort accepted proposals

(cherry picked from commit 70d75ce4e8)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-07-02 03:07:26 +00:00
eeaf0234f0 Add proposal for transactions v2 and address map program (#17103) (#18376)
* Add proposal for supporting big transactions

* account index program

* fix formatting

* review feedback

* Add cost changes section

* Add cost section and more attack details

* fix lint

* document metadata changes

* nit

* rpc details

* add index meta struct

* add additional proposal and chagne title

* rename proposal file

* rename to address map and rewrite tx format

* no more appends, limit mapping size to 256

* update dos section

* add note about readonly

* restructure message to use enum

* cleanup

(cherry picked from commit 191519188d)

Co-authored-by: Justin Starry <justin@solana.com>
2021-07-02 02:39:44 +00:00
0200740d70 Add sdk and program READMEs (#18154)
(cherry picked from commit 94905dae52)
2021-07-01 18:25:04 -07:00
1268eef3b2 Revert "Clean up build warning"
This reverts commit 17a173ebb5.

(cherry picked from commit d269975784)
2021-07-01 18:23:23 -07:00
b433048003 report on min/max bin stats for accounts index (#18338) (#18347)
(cherry picked from commit 531f1bce78)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-07-01 23:55:43 +00:00
daf2c3c155 Consider all peers as potential candidates during pull-request in case of offline nodes (#18333) (#18372)
* Try all peers during pull-request in case of offline nodes

* fix clippy err

(cherry picked from commit f4fb5de545)

Co-authored-by: Ashwin Sekar <ashwin@solana.com>
2021-07-01 22:56:20 +00:00
03d213d764 Reject transactions with extra signatures (#18306) (#18370)
* Reject transactions with extra signatures

* fix tests

* fix check

* fix check

* tx method

* fix checks

(cherry picked from commit d5961e9d9f)

Co-authored-by: Justin Starry <justin@solana.com>
2021-07-01 20:07:43 +00:00
99f9481b5d Remove hackathon banner 2021-07-01 13:01:48 -07:00
10bd14bca6 Remove feature switch for using message hash for already processed check (#18340) (#18367)
(cherry picked from commit 5ca975383c)

Co-authored-by: Justin Starry <justin@solana.com>
2021-07-01 17:39:22 +00:00
d26533e370 Cleanup ReplayStage tests (#18241) (#18292)
(cherry picked from commit 68c87469c3)

Co-authored-by: carllin <carl@solana.com>
2021-07-01 07:47:02 +00:00
820abacf49 Update notification format info to be consistent (#18354) (#18356)
(cherry picked from commit cc80197349)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-07-01 06:14:03 +00:00
4466aa39c4 Bump version to v1.7.5 2021-06-30 22:55:01 -06:00
f4e43731ef solana validators output now includes average skip rate
(cherry picked from commit 52290dbd35)
2021-06-30 17:47:49 -07:00
884ef211f7 Document slotsUpdates (#18335) (#18339)
* Add slotsUpdates to jsonrpc docs

* Re-add unstable section

(cherry picked from commit dfb6296499)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-07-01 00:25:24 +00:00
896ef5a15f Fixed an issue doing the set_roots repeatedly for the same set. Instead doing the per chunks. (#18314) (#18337)
(cherry picked from commit a67d26a1e8)

Co-authored-by: Lijun Wang <83639177+lijunwangs@users.noreply.github.com>
2021-07-01 00:12:33 +00:00
4ff482cd47 Fail simulation if transaction contains duplicate accounts (#18304) (#18334)
(cherry picked from commit b08f8bd1b0)

Co-authored-by: Justin Starry <justin@solana.com>
2021-06-30 21:35:56 +00:00
6e27360fbc Add repair number per slot (#18082) (#18329)
(cherry picked from commit 8d9a6deda4)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-06-30 20:39:05 +00:00
a10a0824eb refactor untar_snapshot_in to push parallelism deeper for further refactoring (#18310) (#18312)
(cherry picked from commit ce53b84cdc)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-30 17:59:57 +00:00
2fdda2ec1b test-validator: hold rent constant with --slots-per-epoch (#18318)
(cherry picked from commit 02b14caa5f)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-06-30 08:37:54 +00:00
57f76a2111 Use timeout to allow RpcClient to retry initial transaction confirmation (#18311) (#18316)
* Tidying: relocate function

* Use proper helper method for RpcClient commitment

* Add RpcClientConfig

* Add configurable confirm_transaction_initial_timeout

* Use default 5s timeout for initial tx confirmation

(cherry picked from commit 9d4428d3d8)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-06-30 03:09:47 +00:00
287daa9248 debug logs when crds table trim failed (#18307) (#18309)
reports of this error being possibly spammy:
https://discord.com/channels/428295358100013066/689412830075551748/859441080054710293

The commit changes the log level to debug.
Additionally adding a new metric to understand the frequency of this error.

(cherry picked from commit 9d983a34a0)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-06-29 22:43:33 +00:00
7e40a051a4 bin accounts index (#18111) (#18280)
Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-29 09:14:10 -05:00
bd0a7730b6 tx-status: Don't assume a memo instruction succeeded (#18288)
(cherry picked from commit 7babf28ef7)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-06-29 03:37:44 +00:00
0d1c87e650 Cli epoch-info: generate epoch-completed time from block times (#18258) (#18285)
* Generate epoch-completed time from block times

* Add annotation when block times not available

(cherry picked from commit f2b0d562b0)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-06-28 17:54:20 -06:00
56cd963fd7 Ignore flaky tests (#18278) (#18282)
(cherry picked from commit 639a61d639)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-06-28 23:13:25 +00:00
d1b26cb267 reduce pubkey copies on insert path (#18240) (#18276)
(cherry picked from commit 1f1e54b9d8)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-28 16:31:48 -05:00
6a0a03415c Don't update if already an executable
(cherry picked from commit 2fbedd834f)
2021-06-27 12:24:00 -06:00
41d50adbf3 Only print Foundation inflation rate if it is greater than 0
(cherry picked from commit b44af11511)
2021-06-26 14:57:03 -07:00
328b52c4d6 Zelcore wallet support for SOL/SPLs info added (#17580) (#18249)
* Zelcore wallet support for SOL/SPLs info added

I have added a quick infodump about Zelcore wallet supporting various features of the Solana ecosystem. I looked at previous commits and it seemed adding to the top of the file was the norm, but please feel free to move around if needed.

* Zelcore wallet info moved to bottom of file.

(cherry picked from commit 8fc4c2f375)

Co-authored-by: trial123Zel <38964930+trial123Zel@users.noreply.github.com>
2021-06-26 17:22:55 +00:00
b7d04cf7b9 replace account index bulk insert with iterator (#18198) (#18235)
(cherry picked from commit e06376664b)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-25 17:55:42 -05:00
7ed2cf30a5 Bump borsh from 0.8.1 to 0.9.0 (#18230) 2021-06-25 14:43:04 -06:00
78fe5576a9 Added notes to running validator documentation to ensure that 'exec' is used from scripts when starting the validator to prevent logrotate signals from killing the validator. (#18234) (#18236)
(cherry picked from commit c045f1dfb5)

Co-authored-by: bji <bryan@ischo.com>
2021-06-25 20:36:41 +00:00
41179b1282 metric for accounts index insertion time (#18202) (#18226)
(cherry picked from commit f2a2581259)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-25 13:36:29 -05:00
f82d99b4c2 ci: add wrapper script for running ci locally
Linux only for now

(cherry picked from commit 0bc38153ca)
2021-06-25 10:17:17 -06:00
967f0d07f2 ci: add downstream build wrapper
(cherry picked from commit 761e324982)
2021-06-25 10:17:17 -06:00
940dbe99e9 ci: give localnet nodes a more time to startup
(cherry picked from commit 278a241db3)
2021-06-25 10:17:17 -06:00
98e1c68a70 sdk: ensure ld can find criterion when running BPF tests
(cherry picked from commit 7ee39fcb0f)
2021-06-25 10:17:17 -06:00
d8e250e9b0 ci: nvidia persistence mode isn't a hard requirement
(cherry picked from commit f213e48067)
2021-06-25 10:17:17 -06:00
c8be8510ba ci: use versioned cargo wrapper for crate ordering
(cherry picked from commit 554002b73c)
2021-06-25 10:17:17 -06:00
c99460ba15 remove unnecessary copies from accounts index code paths (#18196) (#18212)
(cherry picked from commit f9fccdee85)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-25 02:23:23 +00:00
769fcb7f50 untar in parallel (#18184) (#18210)
* untar in parallel

* make enum for 'ignore' return value

(cherry picked from commit 31ec986ea1)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-24 19:35:21 -05:00
60812790e1 rework dirty_pubkeys from insert_new_if_missing_into_primary_index (#18200) (#18208)
(cherry picked from commit 4b314be5bd)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-24 17:55:45 -05:00
a01e44f3b9 Update README.md (#18191) (#18195)
(cherry picked from commit 3362ac06b5)

Co-authored-by: Hao-Cher Hong <rax333j@gmail.com>
2021-06-24 15:47:12 +00:00
0917370bd5 Update leader-rotation.md (#18192) (#18193)
Confusing wording regarding epoch length

(cherry picked from commit 6b62ba045d)

Co-authored-by: Marcel Jackisch <jackisch@protonmail.com>
2021-06-24 14:49:22 +00:00
09b612b130 add min/max bin size metrics to hash calculation (#18155) (#18181)
(cherry picked from commit 77c3ffe4cf)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-23 20:04:15 +00:00
26fdf3fb07 Add batch stats (#18096) (#18142)
(cherry picked from commit e808f34b0b)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-06-23 12:43:37 -05:00
f41f3f6b51 apply 'debug_do_not_add_builtins' to feature activations (#18110) (#18150)
(cherry picked from commit fbc94d84c8)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-23 17:34:19 +00:00
677664e71d filters crds values obtained through gossip by their shred version (backport #18072) (#18175)
* filters crds values obtained through gossip by their shred version (#18072)

filter_by_shred_version does not check the shred-version of the owner of
the crds-value. It only checks the shred-version of the node which is
relaying the value:
https://github.com/solana-labs/solana/blob/5cc073420/gossip/src/cluster_info.rs#L2274-L2289

So crds-values with different shred versions can still pass through this
function as long as they are relayed by a node with matching shred
version; and so, a single node can bridge different shred values
through-out the cluster.

(cherry picked from commit 69a5f0e6cd)

# Conflicts:
#	gossip/src/cluster_info.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-06-23 17:16:33 +00:00
a8071f1039 chore(pubkey): remove dead code (#18162)
(cherry picked from commit 755b7c7aee)

Co-authored-by: hrls <viktor.kharitonovich@gmail.com>
2021-06-23 17:07:21 +00:00
bc08351a0a capture sort time in hash calculation (#18118) (#18153)
(cherry picked from commit d3ee73e151)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-23 15:49:28 +00:00
088b3893c3 Keep track of dirty stores on remove accounts to clean (#17601) (#18173)
* Keep track of dirty stores on remove accounts to clean

and not zero_lamport key set

* Only dirty when count==0?

* Add another clean

(cherry picked from commit 3b1738c000)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-06-23 10:23:44 +00:00
d9d6dd9ba6 Add metrics for rpc send-tx failures (#18156) (#18164)
(cherry picked from commit 64cff8c5a1)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-06-22 22:28:22 -06:00
aca66674d3 correctly calculate hash_total for hash/lamport calculation (#18144) (#18146)
(cherry picked from commit d5f9f3b7ce)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-22 21:21:10 +00:00
597429ab3e Bump version to v1.7.4 2021-06-22 19:57:34 +00:00
715360c1e7 ci: fix release build agent targeting 2021-06-22 13:36:34 -06:00
fcabaa7eff sdk: refactor pda generation 2021-06-22 11:36:05 -06:00
b14af989b8 Update sysvar docs (#18125) (#18147)
(cherry picked from commit 8a136736ad)

Co-authored-by: Jack May <jack@solana.com>
2021-06-22 17:28:15 +00:00
1a919e0c3e ci: isolate release builds (#18133)
(cherry picked from commit d43c6eafaf)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-06-22 06:14:59 +00:00
9c1a6bed7b Fix flaky optimistic violation detection cluster test (#18027) (#18126)
* Fix flaky optimistic violation detection cluster test

* Add small sleep to avoid tight loop

(cherry picked from commit 423e0d90ee)

Co-authored-by: Ashwin Sekar <ashwin@solana.com>
2021-06-22 05:07:33 +00:00
c48ec02f42 Docs val net reqs (backport #18122) (#18130)
* docs: don't suggest cloud instances for validators

(cherry picked from commit cf187dcb0b)

* docs: flesh out validator network requirements

(cherry picked from commit 93dd965947)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-06-22 02:12:49 +00:00
6f376489a5 Handle removing slots during account scans (#17471) (#17953)
(cherry picked from commit ccc013e134)

Co-authored-by: carllin <carl@solana.com>
2021-06-22 00:59:12 +00:00
0cbf7bef1e Move stake_weighted_timestamp module (#18114) (#18120)
* Move timestamp module into runtime

* Less public

* Remove unused enum

(cherry picked from commit 19fe1dd463)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-06-22 00:11:12 +00:00
0f87e598f6 refactor generate_index_for_slot (#17984) (#18116)
(cherry picked from commit 2087f5da94)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-21 18:25:56 -05:00
363b75619f adds shred-version to ip-echo-server response (backport #18066) (#18113)
* adds shred-version to ip-echo-server response

When starting a validator, the node initially joins gossip with
shred_verison = 0, until it adopts the entrypoint's shred-version:
https://github.com/solana-labs/solana/blob/9b182f408/validator/src/main.rs#L417

Depending on the load on the entrypoint, this adopting entrypoint
shred-version through gossip sometimes becomes very slow, and causes
several problems in gossip because we have to partially support
shred_version == 0 which is a source of leaking crds values from one
cluster to another. e.g. see
https://github.com/solana-labs/solana/pull/17899
and the other linked issues there.

In order to remove shred_version == 0 from gossip, this commit adds
shred-version to ip-echo-server response. Once the entrypoints are
updated, on validator start-up, if --expected_shred_version is not
specified we will obtain shred-version from the entrypoint using
ip-echo-server.

(cherry picked from commit 598093b5db)

# Conflicts:
#	Cargo.lock
#	net-utils/Cargo.toml
#	programs/bpf/Cargo.lock

* removes backport merge conflicts

* obtains shred-version from entrypoint's ip-echo-server in validator-main

(cherry picked from commit 58e115275a)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-06-21 23:04:08 +00:00
090c801cc6 eliminate flatten and sort in hash calculation (#17802) (#18115)
* eliminate flatten and sort in hash calculation

* reduce critical section time

* remove now no-longer necessary test code

* conflict with reset bins to 0 pr

(cherry picked from commit bf97627021)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-21 17:47:47 -05:00
b711778d4a More nightly clippy fixes (#18081)
(cherry picked from commit 1b7f6d2bc0)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-06-21 21:55:42 +00:00
d52569d66f user process.accounts_db_test_hash_calculation for debug_verify hash (#18053) (#18109)
(cherry picked from commit ec2f930475)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-21 16:15:13 -05:00
c676b7a473 refactor reconstruct_accountsdb_from_fields (#17987) (#18100)
(cherry picked from commit ae82e4e25b)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-21 15:14:45 -05:00
71c49bc8cd Add logging when RpcHealthStatus::Unknown (#18098) (#18107)
(cherry picked from commit faecc41603)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-06-21 13:53:25 -06:00
97a7f747fb remove unused code (#17981) (#18048)
(cherry picked from commit 20e714b3d0)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-21 10:12:50 -05:00
cef9e0de0c generate_index timings (#17983) (#18049)
(cherry picked from commit 1feaaf009d)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-21 10:12:27 -05:00
5637acb799 Add additional subscription metrics (#18071) (#18076)
(cherry picked from commit 83a6c669a5)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-06-19 04:51:40 +00:00
3d3bdcb966 Drop Error suffix from enum values to avoid the enum_variant_names clippy lint
(cherry picked from commit 4a12c715a3)
2021-06-18 19:59:20 -07:00
c9f02ae020 fix loader instruction checker (#18047) (#18074)
(cherry picked from commit d18e02ef44)

Co-authored-by: Jack May <jack@solana.com>
2021-06-18 21:28:29 +00:00
0e7512a225 Fix Nightly Clippy Warnings (backport #18065) (#18070)
* chore: cargo +nightly clippy --fix -Z unstable-options

(cherry picked from commit 6514096a67)

# Conflicts:
#	core/src/banking_stage.rs
#	core/src/cost_model.rs
#	core/src/cost_tracker.rs
#	core/src/execute_cost_table.rs
#	core/src/replay_stage.rs
#	core/src/tvu.rs
#	ledger-tool/src/main.rs
#	programs/bpf_loader/build.rs
#	rbpf-cli/src/main.rs
#	sdk/cargo-build-bpf/src/main.rs
#	sdk/cargo-test-bpf/src/main.rs
#	sdk/src/secp256k1_instruction.rs

* chore: cargo fmt

(cherry picked from commit 789f33e8db)

* Updates BPF program assert_instruction_count tests.

(cherry picked from commit c1e03f3410)

# Conflicts:
#	programs/bpf/tests/programs.rs

* Resolve conflicts

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
Co-authored-by: Michael Vines <mvines@gmail.com>
2021-06-18 20:02:48 +00:00
c330016109 adds mapping from nodes pubkeys to their shred-version (#17940) (#18067)
Crds values of nodes with different shred versions are creeping into
gossip table resulting in runtime issues as the one addressed in:
https://github.com/solana-labs/solana/pull/17899

This commit works towards enforcing more checks and filtering based on
shred version by adding necessary mapping and api to gossip table.
Once populated, pubkey->shred-version mapping persists as long as there
are any values associated with the pubkey.

(cherry picked from commit 5a99fa3790)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-06-18 18:02:23 +00:00
cb13cdec85 Fix build issues downstream due to stake state shuffle
(cherry picked from commit 810fce1f3d)
2021-06-18 07:13:40 -07:00
c65c580b20 introduce LockMapType for accounts_index (#18021) (#18051)
(cherry picked from commit 0a81c37fce)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-18 01:39:27 +00:00
d159ae9342 Bump version to v1.7.3 2021-06-17 15:34:50 -06:00
a540af1ca7 refactor rebuild_bank_from_snapshots (backport #17988) (#18006)
* refactor rebuild_bank_from_snapshots (#17988)

(cherry picked from commit bb7413c9f9)

# Conflicts:
#	runtime/src/snapshot_utils.rs

* merge errors

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
2021-06-17 19:26:10 +00:00
e9c234d89f Make account shrink configurable #17544 (backport #17778) (#18013)
* Make account shrink configurable #17544 (#17778)

1. Added both options for measuring space usage using total accounts usage and for individual store shrink ratio using an enum. Validator CLI options: --accounts-shrink-optimize-total-space and --accounts-shrink-ratio
2. Added code for selecting candidates based on total usage in a separate function select_candidates_by_total_usage
3. Added unit tests for the new functions added
4. The default implementations is kept at 0.8 shrink ratio with --accounts-shrink-optimize-total-space set to true

Fixes #17544

(cherry picked from commit 269d995832)

# Conflicts:
#	core/tests/snapshots.rs
#	ledger/src/bank_forks_utils.rs
#	runtime/src/accounts_db.rs
#	runtime/src/snapshot_utils.rs

* fix some merge errors

Co-authored-by: Lijun Wang <83639177+lijunwangs@users.noreply.github.com>
Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
2021-06-17 17:32:03 +00:00
b472dac6b3 validator: expose max active pubsub subscriptions to CLI (#18036)
(cherry picked from commit 5efc48fc69)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-06-17 08:02:20 +00:00
523dac1be3 metrics: Don't unwrap client instantiation errors (#18019)
(cherry picked from commit 5cc073420a)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-06-17 07:08:36 +00:00
962a2126b5 Log more info on runtime account verification errors (#17861) (#17879)
(cherry picked from commit a1fab0c5ca)

Co-authored-by: Jack May <jack@solana.com>
2021-06-17 01:55:37 +00:00
5c495ad1b0 ledger tool limit_load_slot_count_from_snapshot avoids assert failures (backport #17974) (#18008)
* ledger tool limit_load_slot_count_from_snapshot avoids assert failures (#17974)

(cherry picked from commit dbd4dc04b0)

# Conflicts:
#	core/tests/snapshots.rs
#	ledger/src/blockstore_processor.rs
#	runtime/benches/accounts.rs
#	runtime/src/bank.rs

* fix merge errors

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
2021-06-17 01:32:50 +00:00
f633f34e43 Clean up remove_all_authorized_voters() (#18029)
(cherry picked from commit f1ebbbab8f)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-06-17 00:28:41 +00:00
bacf1b9acc accounts-cluster-bench, close all accounts in a sliding window (#17993) (#18026)
(cherry picked from commit ed18add7d3)

Co-authored-by: carllin <carl@solana.com>
2021-06-16 23:53:31 +00:00
4df9da5c48 validator: run poh speed test earlier in start up (#18024)
(cherry picked from commit 5bc6c89adc)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-06-16 23:28:15 +00:00
30bbc1350d Startup optimization in shrink - don't shrink non-shrinkable slots (backport #17405) (#17792)
* Skip shrink when it doesn't save anything (#17405)

(cherry picked from commit 14c52ab018)

# Conflicts:
#	runtime/src/accounts_db.rs

* fix merge error

Co-authored-by: sakridge <sakridge@gmail.com>
Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
2021-06-16 23:28:03 +00:00
2f0f1fd5f5 break out generate index reporting (#17980) (#18015)
(cherry picked from commit 71796f4951)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-16 22:02:19 +00:00
c28e6ebc4c do not use index for verify_bank_hash_and_lamports (#17812) (#18010)
(cherry picked from commit adc683956f)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-16 21:33:30 +00:00
6479c11e9a Don't store votes unless we are leader soon (#17803) (#17894)
(cherry picked from commit 0feac57cb0)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-06-16 21:28:06 +00:00
4ed0fcdde6 avoid unnecessary empty arrays when binning (#17944) (#18011)
(cherry picked from commit eee5414c64)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-16 20:48:18 +00:00
296a8ade63 set hash bins to 65k (#17912) (#18009)
(cherry picked from commit 55ee3b5f2f)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-16 20:31:26 +00:00
a84953ccfd Improve program deployment error message (#17717) (#17725)
(cherry picked from commit 39654d3fa5)

Co-authored-by: Jack May <jack@solana.com>
2021-06-16 20:16:00 +00:00
8492031fd0 refactor generate_index process_storage_slot (#17982) (#18007)
(cherry picked from commit 7ca04d6a86)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-16 20:14:49 +00:00
bff7259111 parallel storage -> accounts folder (#17955) (#18004)
(cherry picked from commit 7de79425ce)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-16 15:51:00 +00:00
67e1814581 nit: rename measure (#17946) (#17995)
(cherry picked from commit 5ecb30ff58)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-16 14:51:38 +00:00
12e92dd59d verify bank hash on startup with ledger tool option (backport #17939) (#17996)
* verify bank hash on startup with ledger tool option (#17939)

(cherry picked from commit f558b9b6bf)

# Conflicts:
#	core/tests/snapshots.rs
#	ledger/src/bank_forks_utils.rs
#	runtime/src/snapshot_utils.rs

* fix merge errors

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
2021-06-16 14:46:34 +00:00
4ee366edfa Properly handle block_height in Bigtable bincode deserialization (#17990) (#17994)
* Default block_height on eof

* Add comment to prevent future errors

(cherry picked from commit c57d1b44ef)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-06-16 05:41:38 +00:00
61573756f8 add metrics for startup (#17913) (#17975)
* add metrics for startup

    * roll timings up higher

    * fix test

    * fix duplicate

    (cherry picked from commit 471b34132e)

    # Conflicts:
    #       ledger/src/bank_forks_utils.rs
    #       runtime/src/snapshot_utils.rs
conflicts because #17778 is not present.

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-16 01:40:56 +00:00
fe5fed1182 Refactor bank_forks_utils::load() and some snapshot logic (#17492) (#17979)
Refactor a few functions that are on the load-from-snapshot path, to facilitate
adding in incremental snapshots more easily.

Additionally, add some tests and doc comments.

(cherry picked from commit 1953543274)

Co-authored-by: Brooks Prumo <brooks@solana.com>
2021-06-15 22:03:49 +00:00
0c90307677 v1.7: Stake refactor (Manual backport of #17906) (#17978)
* Refactor stake program into solana_program (#17906)

* Move stake state / instructions into solana_program

* Update account-decoder

* Update cli and runtime

* Update all other parts

* Commit Cargo.lock changes in programs/bpf

* Update cli stake instruction import

* Allow integer arithmetic

* Update ABI digest

* Bump rust mem instruction count

* Remove useless structs

* Move stake::id() -> stake::program::id()

* Re-export from solana_sdk and mark deprecated

* Address feedback

* Run cargo fmt

* Run cargo fmt post cherry-pick
2021-06-15 23:43:22 +02:00
cdd2a51f1f remove unused parameters from CalculateHashIntermediate (#17949) (#17976)
(cherry picked from commit 4d8ffdcc11)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-15 19:15:07 +00:00
0dbe3434f0 refactor so hash verify can be done by more callers (#17941) (#17947)
Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-15 16:49:32 +00:00
ef205593c5 removes port-based forwarding logic from turbine retransmit (#17716) (#17973)
Turbine retransmit logic is based on which socket it received the packet
from (i.e `packet.meta.forward`):
https://github.com/solana-labs/solana/blob/708bbcb00/core/src/retransmit_stage.rs#L467-L470

This can leave the cluster vulnerable to spoofing and selective
propagation of packets; see
https://github.com/solana-labs/solana/issues/6672
https://github.com/solana-labs/solana/pull/7774

This commit identifies if the node is on the "critical path" based on
its index in the shuffled cluster. If so, it forwards the packet to both
neighbors and children; otherwise, the packet is only forwarded to the
children.

The metrics added in
https://github.com/solana-labs/solana/pull/17351
shows that the number of times the index does not match the port is very
rare, and therefore this change should be safe.

(cherry picked from commit 161838655c)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-06-15 15:16:20 +00:00
8b5ba771ad name arguments to help with confusion (#17942) (#17948)
(cherry picked from commit 7fde9b6ff0)

    # Conflicts:
    #       runtime/src/accounts_db.rs

Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
2021-06-15 14:46:07 +00:00
991f99b239 Bump spl-token to v3.1.1 (backport #17951) (#17958)
* Bump spl-token to v3.1.1 (#17951)

(cherry picked from commit b7de369992)

# Conflicts:
#	Cargo.lock
#	account-decoder/Cargo.toml
#	accounts-cluster-bench/Cargo.toml
#	programs/bpf/Cargo.lock
#	rpc/Cargo.toml
#	tokens/Cargo.toml

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-15 08:29:54 +00:00
d6f17517cb calculate_capitalization uses hash calculation (#17443) (#17932)
* calculate_capitalization uses hash calculation

* feedback

* remove debugging code, clean up slot math

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-15 05:03:06 +00:00
15b2f280e3 use trait to simplify and consolidate cumulative code (#17852) (#17931)
(cherry picked from commit 2dc6969858)

    # Conflicts:
    #       runtime/src/accounts_hash.rs

Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
2021-06-15 04:29:13 +00:00
60b43a1ddf Pass iterator for SortedStorages::new_with_slots (#17811) (#17847)
Co-authored-by: Carl Lin <carl@solana.com>
(cherry picked from commit 2a9b127029)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-15 00:01:53 +00:00
d6b83e3b0a add metrics to handle_snapshot_requests (#17937) (#17945)
(cherry picked from commit e6bbd4b3f0)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-14 22:56:14 +00:00
0446f89d22 binary search in slices for hashing (#17755) (#17804)
(cherry picked from commit 817d48be21)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-14 17:32:05 -05:00
54bc3e606e Fix typo in docs (#17920) (#17938)
(cherry picked from commit 3657469826)

Co-authored-by: Sarat Limawongpranee <innneang@users.noreply.github.com>
2021-06-14 12:04:02 -06:00
fed90cfbe8 Fix accounts index panic in purge_exact (#17757) (#17935)
(cherry picked from commit c2191d885d)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-06-14 17:41:59 +00:00
e2e41a29eb Don't use pinned memory when unnecessary (#17832) (#17934)
Reports of excessive GPU memory usage and errors
from cudaHostRegister. There are some cases where pinning is
not required.

(cherry picked from commit eeee75c5be)

Co-authored-by: sakridge <sakridge@gmail.com>
2021-06-14 16:30:51 +00:00
3b813db42f minor fixes to punctuation and typos (#17881) (#17923)
* fix minor typos and punctuation

* fix minor typos and punctuation

* rewording for clarity and typo corrections

* rewording for clarity and typo corrections

* rewording for clarity and typo corrections

Co-authored-by: Gregg Dourgarian <greggd@aidacreative.com>
(cherry picked from commit 54155f875a)

Co-authored-by: Haik Dulgarian <greggd@tempworks.com>
2021-06-14 06:56:39 +00:00
16b1a4d003 short cuts expiration check if origin's contact-info is still valid (#17918) (#17921)
Crds::find_old_labels can skip checking values timestamps if the
origin's contact info hasn't expired yet:
https://github.com/solana-labs/solana/blob/985280ec0/gossip/src/crds.rs#L394-L408

(cherry picked from commit cca46308bc)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-06-13 21:12:24 +00:00
b51ea3ca0c excludes epoch-slots from nodes with unknown or different shred version (#17899) (#17916)
Inspecting TDS gossip table shows that crds values of nodes with
different shred-versions are creeping in. Their epoch-slots are
accumulated in ClusterSlots causing bogus slots very far from current
root which are not purged and so cause ClusterSlots keep consuming more
memory:
https://github.com/solana-labs/solana/issues/17789
https://github.com/solana-labs/solana/issues/14366#issuecomment-769896036
https://github.com/solana-labs/solana/issues/14366#issuecomment-832754654

This commit updates ClusterInfo::get_epoch_slots, and discards entries
from nodes with unknown or different shred-version.

Follow up commits will patch gossip not to waste bandwidth and memory
over crds values of nodes with different shred-version.

(cherry picked from commit 985280ec0b)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-06-13 15:56:05 +00:00
dc76675644 Don't require non-existent param for keygen new (#17896) (#17897)
(cherry picked from commit 22c356d24c)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-06-11 22:08:46 +00:00
274a238a00 Port unconfirmed duplicate tracking logic from ProgressMap to ForkChoice (#17779) (#17889)
(cherry picked from commit c8535be0e1)

Co-authored-by: carllin <carl@solana.com>
2021-06-11 11:41:59 +00:00
10507f0ade Account for duplicate before a bank is frozen or replayed (#17866) (#17883)
(cherry picked from commit afafa624a3)

Co-authored-by: carllin <carl@solana.com>
2021-06-11 07:06:42 +00:00
af2a6106da Check for undefined symbols in .so and warn about run-time errors (#17850) (#17880)
(cherry picked from commit c684e2bdc0)

Co-authored-by: Dmitri Makarov <dmakarov@users.noreply.github.com>
2021-06-11 00:03:17 +00:00
120a7e433f Warn about InstructionError meta (#17864) (#17878)
(cherry picked from commit fa6bdd2d12)

Co-authored-by: Jack May <jack@solana.com>
2021-06-10 23:49:03 +00:00
98e34f07df programs/config: Disallow duplicate signers 2021-06-10 06:54:18 +00:00
738df79394 Add local cluster tests that broadcast duplicate slots (#13995) (#17863)
* Add duplicate node local cluster test

* fix clippy

* remove dupe test

(cherry picked from commit 050bb5446d)

Co-authored-by: Justin Starry <justin@solana.com>
2021-06-10 03:17:44 +00:00
98e9b6e70b refactor: create type (#17818) (#17848)
(cherry picked from commit 576e3d95f7)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-09 08:38:04 +00:00
c9318f8dc2 Wrap long lines (#17842)
(cherry picked from commit e5e7390d44)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-06-09 08:10:34 +00:00
78f3606e30 test: simple CalculateHashIntermediate refactoring (#17813) (#17846)
(cherry picked from commit 01ef2a5c4a)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-08 21:47:40 +00:00
97f4d098e1 Add more info about how to safely change the identity of a staked validator (#17843)
(cherry picked from commit 193813d49a)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-06-08 19:25:41 +00:00
144a13b096 Update a dangling devnet endpoint doc (#17836) (#17839)
(cherry picked from commit 2dfb5b7579)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-06-08 16:20:43 +00:00
af0869c66c add min to roots_tracker (#17806) (#17835)
(cherry picked from commit 58fe1d0764)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-08 16:14:59 +00:00
48e565038a Bump version to v1.7.2 (#17831) 2021-06-08 10:29:39 +00:00
cd6e1d921c update dependence version for gag to latest support windows (#17801) (#17825)
* update dependence version for gag to leatest support windows

* fix compile on windows

* add Cargo.lock

(cherry picked from commit e0ab5ee4f8)

Co-authored-by: Govlzkoy <gotope@users.noreply.github.com>
2021-06-08 07:48:39 +00:00
fb767f4612 Remove budget program (backport #17816) (#17822)
* Remove budget program (#17816)

(cherry picked from commit a66566e75b)

# Conflicts:
#	Cargo.lock
#	genesis/Cargo.toml
#	ledger/Cargo.toml
#	perf/Cargo.toml
#	programs/budget/Cargo.toml

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-08 03:07:26 +00:00
9f35db28e5 Switch EpochSlots to be frozen slots, not completed slots (#17168) (#17776)
(cherry picked from commit 96ba2edfeb)

Co-authored-by: carllin <carl@solana.com>
2021-06-07 22:51:30 +00:00
ab19543dff break out hash time in metric (#17721) (#17753)
(cherry picked from commit 00ee84af37)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-07 22:19:52 +00:00
3d5f333a3b parallelizes gossip packets receiver with processing of requests (#17647) (#17807)
Gossip packet processing is composed of two stages:
  * The first is consuming packets from the socket, deserializing,
    sanitizing and verifying them:
    https://github.com/solana-labs/solana/blob/7f0349b29/gossip/src/cluster_info.rs#L2510-L2521
  * The second is actually processing the requests/messages:
    https://github.com/solana-labs/solana/blob/7f0349b29/gossip/src/cluster_info.rs#L2585-L2605

The former does not acquire any locks and so can be parallelized with
the later, allowing better pipelineing properties and smaller latency in
responding to gossip requests or propagating messages.

(cherry picked from commit cab30e2356)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-06-07 20:30:31 +00:00
d06ca605cf Bump jsonrpc crates (backport #17797) (#17805)
* Bump jsonrpc crates (#17797)

* Bump jsonrpc crates

* Update error text

* gitignore for rpc

(cherry picked from commit 2e998ed11d)

# Conflicts:
#	Cargo.lock
#	validator/Cargo.toml

* Fix conflicts

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-07 20:15:23 +00:00
334e11e4b9 rework hash calculation to not keep slot and write version (#17685) (#17794)
* rework hash calculation to not keep slot and write version

* refactor functions and add tests

* always use multiple slot code path

(cherry picked from commit b5bb91b50f)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-07 15:31:18 +00:00
fd68b4e7a8 Support out of band dumping of unrooted slots in AccountsDb (#17269) (#17777)
* Accounts dumping logic

* Add test for interaction between cache flush and remove_unrooted_slot()

* Update comments

* Rename

* renaming

* Add more comments

* Renaming

* Fixup test and bad check

(cherry picked from commit bbcdf073ba)

Co-authored-by: carllin <carl@solana.com>
2021-06-07 09:37:55 +00:00
e5ea16fad8 system-program: Remove zero lamport check on transfers (#17726) (#17764)
* system-program: Move lamports == 0 check on transfers

* Address feedback

* Update stake split to explicitly allocate + assign

* Update stake tests referring to split instruction

* Revert whitespace

* Update split instruction index in test

* Remove unnecessary `assign_with_seed` from `split_with_seed`

* Fix stake instruction parser

* Update test to allow splitting into account with lamports

(cherry picked from commit 8f5e773caf)

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-06-06 18:27:29 +00:00
6d5a4b5cce Document ProgramTest::new and fix ProgramTest::add_program (#17754) (#17768)
* document ProgramTest::new

* simplify ProgramTest::new doc-string

* make ProgramTest::add_program noisier

`add_program` (and `new`, implicitly) now prints a warning when the user
supplies a bogus program name to a ProgramTest and invokes `test-bpf`.

Additionally, it is now impossible to ask for a regular `test` and for
the generated ProgramTest to load BPF code instead of native code.
Previously, this was caused by a precedence issue: BPF code would always
be preferred over native if the program name was valid, regardless of
user choice.

(cherry picked from commit 2aaf55795f)

Co-authored-by: xuoe <alex@psi.io>
2021-06-06 07:03:13 +00:00
ffb6b5a23b add data point for cap mismatch (#17746) (#17751)
(cherry picked from commit f6fb8906c7)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-04 20:39:46 +00:00
e247625025 Create solana-poh and move remaining rpc modules to solana-rpc (backport #17698) (#17745)
* Create solana-poh and move remaining rpc modules to solana-rpc (#17698)

* Create solana-poh crate

* Move BigTableUploadService to solana-ledger

* Add solana-rpc to workspace

* Move dependencies to solana-rpc

* Move remaining rpc modules to solana-rpc

* Single use statement solana-poh

* Single use statement solana-rpc

(cherry picked from commit 544b3c0d17)

# Conflicts:
#	Cargo.lock
#	banking-bench/Cargo.toml
#	core/Cargo.toml
#	core/benches/banking_stage.rs
#	local-cluster/Cargo.toml
#	rpc/Cargo.toml
#	stake-monitor/Cargo.toml
#	validator/Cargo.toml

* Fix conflicts & versions

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-04 18:19:08 +00:00
67c07aa5d3 increase bin count for hash scan (#17562) (#17747)
(cherry picked from commit 5197454fea)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-04 18:12:48 +00:00
0de1ce0c2c adds fallback logic if retransmit multicast fails (#17714) (#17742)
In retransmit-stage, based on the packet.meta.seed and resulting
children/neighbors, each packet is sent to a different set of peers:
https://github.com/solana-labs/solana/blob/708bbcb00/core/src/retransmit_stage.rs#L421-L457

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

This can exacerbate packets loss in turbine.

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

Recent discord chat:
https://discord.com/channels/428295358100013066/689412830075551748/849530845052403733

(cherry picked from commit be957f25c9)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-06-04 16:20:44 +00:00
59f4fba05c simplify test construction (#17686) (#17693)
(cherry picked from commit 83ceedc091)

# Conflicts:
#	runtime/src/accounts_db.rs

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-04 15:57:11 +00:00
c0c764377c excludes caller's crds values from pull responses (#17542) (#17744)
If the crds entry belongs to the caller itself, then the caller will
always have the more recent version of it, regardless of it being
filtered out by the bloom filter or not.

The exception is node-instance types which are meant to detect duplicate
running instances, and those are exempted.

(cherry picked from commit 7cf6e66ddd)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-06-04 15:54:00 +00:00
c9bc059637 writes epoch-slots to crds table synchronously (#17719) (#17743)
epoch-slots may be overwritten before they are written to crds table:
https://github.com/solana-labs/solana/issues/17711

This commit writes new epoch-slots to crds table synchronously with
push_epoch_slots. The functions is still not thread-safe as commented in
the code, however currently only one threads is invoking this code.

(cherry picked from commit 60b0a13444)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-06-04 15:34:39 +00:00
78147d48e4 use slots returned from get_snapshot_storages to sort (#17638) (#17695)
* use slots returned from get_snapshot_storages to sort

    * add tests

    (cherry picked from commit 9388aaca15)

    # Conflicts:
    #       runtime/src/accounts_db.rs
    #       runtime/src/sorted_storages.rs

Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
2021-06-04 10:14:37 -05:00
5e7db52087 Avoid full-range compactions with periodic filtered b.g. ones (backport #16697) (#17741)
* Avoid full-range compactions with periodic filtered b.g. ones (#16697)

* Update rocksdb to v0.16.0

* Promote the infrequent and important log to info!

* Force background compaction by ttl without manual compaction

* Fix test

* Support no compaction mode in test_ledger_cleanup_compaction

* Fix comment

* Make compaction_interval customizable

* Avoid major compaction with periodic filtering...

* Adress lazy_static, special cfs and range check

* Clean up a bit and add comment

* Add comment

* More comments...

* Config code cleanup

* Add comment

* Use .conflicts_with()

* Nullify unneeded delete_range ops for special CFs

* Some clean ups

* Clarify the locking intention

* Ensure special CFs' consistency with PurgeType::CompactionFilter

* Fix comment

* Fix bad copy paste

* Fix various types...

* Don't use tuples

* Add a unit test for compaction_filter

* Fix typo...

* Remove flag and just use new behavior always

* Fix wrong condition negation...

* Doc. about no set_last_purged_slot in purge_slots

* Write a test and fix off-by-one bug....

* Apply suggestions from code review

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

* Follow up to github review suggestions

* Fix line-wrapping

* Fix conflict

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
(cherry picked from commit 1f97b2365f)

# Conflicts:
#	ledger/src/blockstore_db.rs

* Fix conflict

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-06-04 14:38:02 +00:00
ae42413d57 support bin divisions up to 65536 (#17563) (#17692)
* support bin divisions up to 65536

* add tests

(cherry picked from commit db8811eacd)

# Conflicts:
#	runtime/src/accounts_db.rs

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-04 06:33:00 +00:00
d433bd3d84 remove slot lookup (#17691) (#17694)
(cherry picked from commit 4bd32d891f)

    # Conflicts:
    #       runtime/src/accounts_db.rs

Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
2021-06-04 06:09:46 +00:00
58dd6dc227 add info for vm.max_map_count incorrectly set. (#17727) (#17730)
(cherry picked from commit 81bafd9daf)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-04 05:02:13 +00:00
893df9b277 Rename ValidatorExit and move to sdk (#17728) (#17729)
(cherry picked from commit 3a647c4bea)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-06-04 04:38:49 +00:00
17dc13760b sort storages by slot before scan (#17411) (#17724)
* sort storages by slot before scan

* fix return value

(cherry picked from commit ef5169ff24)

# Conflicts:
#	runtime/src/accounts_db.rs

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-04 03:21:20 +00:00
498bf911eb Add missing ProgramError to InstructionError mappings (#16231) (#17723)
* Add missing ProgramError to InstructionError mappings

* add note

* Clarify process of adding new program error

(cherry picked from commit 83b9a046d1)

Co-authored-by: Jack May <jack@solana.com>
2021-06-04 00:25:25 +00:00
96de58b3a4 reduce copy (#17672) (#17688)
(cherry picked from commit d802eb303c)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-03 22:26:31 +00:00
9b61fa24c7 rework test for flexibility (#17592) (#17681)
* rework test for flexibility

* respond to pr feedback

(cherry picked from commit 886898eabf)

# Conflicts:
#	runtime/src/accounts_db.rs

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-03 21:25:58 +00:00
e9be3cf6bc implement ancestors as rolling bit field (#17482) (#17673)
(cherry picked from commit eec996ba41)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-03 18:47:37 +00:00
ea44a71914 parallel get_snapshot_storages (#17589) (#17679)
(cherry picked from commit 738cc9549f)

# Conflicts:
#	runtime/src/accounts_db.rs
#	runtime/src/bank.rs
#	runtime/src/serde_snapshot/tests.rs

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-03 18:32:04 +00:00
a00fbbf5ca add metric for collecting storages (#17527) (#17675)
(cherry picked from commit 72bb271a94)

# Conflicts:
#	runtime/src/accounts_db.rs
#	runtime/src/snapshot_utils.rs

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-03 05:34:32 +00:00
eb1a04af65 refactor SnapshotStorage helpers to prepare for later changes (#17560) (#17678)
(cherry picked from commit 654918ab27)

# Conflicts:
#	runtime/src/accounts_db.rs

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-03 05:24:11 +00:00
d1fbf77f3f RollingBitField: bug fixes and add tests (#17525) (#17674)
* RollingBitField: bug fixes and add tests

* respond to feedback

(cherry picked from commit 8924fbf6a0)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-03 05:07:02 +00:00
04fbf73a29 remove antiquated assert (#17643) (#17689)
(cherry picked from commit 07bac27ac7)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-02 21:53:33 +00:00
db70eb3160 minor test code cleanup (#17645) (#17680)
(cherry picked from commit 107af52deb)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-02 20:14:23 +00:00
cd974c26b6 add check_hash to non-index hash calculation (#17558) (#17676)
(cherry picked from commit 55c22d3b76)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-02 20:00:50 +00:00
53e0f5d61c remove unnecessary clone (#17559) (#17677)
(cherry picked from commit 1d02dba06f)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-06-02 19:59:55 +00:00
e864bf4898 Fix CPI recursion depth (#17659) (#17670)
* Fix CPI recursion depth

(cherry picked from commit 80e5b24b38)

Co-authored-by: Jack May <jack@solana.com>
2021-06-02 11:06:50 +00:00
81d12b7644 Fix test instruction count (#17655) (#17660)
(cherry picked from commit 4e0db50e4e)

Co-authored-by: Jack May <jack@solana.com>
2021-06-02 09:20:11 +00:00
309fcd6270 Fix test instruction count (#17655) (#17660)
(cherry picked from commit 4e0db50e4e)

Co-authored-by: Jack May <jack@solana.com>
2021-06-02 08:51:45 +00:00
938112e449 fix getBlock API reference (#17661) (#17662)
(cherry picked from commit 10c6e771b5)

Co-authored-by: oncecsc <74547046+oncecsc@users.noreply.github.com>
2021-06-02 07:32:15 +00:00
3e012ea69e Cli: Decode known program custom errors returned from simulation (#17652) (#17658)
(cherry picked from commit b7f98ea18a)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-06-02 07:03:46 +00:00
975c942ea7 Bump version to v1.7.1 2021-06-02 05:21:14 +00:00
2798271da0 Add memory operation syscalls (backport #16447) (#17648)
* Add memory operation syscalls (#16447)

(cherry picked from commit 2b50529265)

# Conflicts:
#	programs/bpf/Cargo.lock

* Resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-06-01 18:43:50 -07:00
dc258cebab Add create-stake command to solana-tokens CLI (#17550) (#17649)
* Add create-stake command to solana-tokens CLI

* Add --unlocked-sol arg

Thanks @CriesofCarrots!

(cherry picked from commit 1b7f8777d6)

Co-authored-by: Greg Fitzgerald <greg@solana.com>
2021-06-02 01:16:48 +00:00
4b8c5194c7 Purge expired BlockHeight data from blockstore (backport #17634) (#17641)
* Purge expired BlockHeight data from blockstore (#17634)

* Purge expired BlockHeight data from blockstore

* Also call compact_storage and add comment....

(cherry picked from commit 96cdbfdcc0)

# Conflicts:
#	ledger/src/blockstore_db.rs

* Fix conflict

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-02 01:04:11 +00:00
3c7c6dacfb Add BPF rustc option to reduce the optimizations to safer level (#17590) (#17594)
(cherry picked from commit 831e87c65d)

Co-authored-by: Dmitri Makarov <dmakarov@users.noreply.github.com>
2021-05-31 19:15:56 +00:00
e36337a764 Make the sys-tuner oneliner actually copy-pastable (#17615) (#17619)
* Make the sys-tuner oneliner actually copy-pastable

* Use `command -v`

(cherry picked from commit 41975016b9)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-05-31 18:13:47 +00:00
a49856b898 Rework #17486 (backport #17566) (#17597)
* Revert "Improve missing default signer error messaging (#17486)"

This reverts commit 6d40d0d141.

(cherry picked from commit ca8c1c6c42)

* Improve missing default filepath signer error messaging

(cherry picked from commit 06a926f2f4)

* CI: temporarily skip spl downstream build

(cherry picked from commit d01b4f80f9)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-05-31 17:28:06 +00:00
8ca2f52041 Make initialize public (#17605) (#17607)
(cherry picked from commit 2896fc3987)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-31 08:51:05 +00:00
2f7f243022 Always bail if program modifies a ro account (backport #17569) (#17584)
* Always bail if program modifies a ro account (#17569)

(cherry picked from commit a3240aebde)

* resolve conflicts

* nudge

Co-authored-by: Jack May <jack@solana.com>
2021-05-28 20:34:10 +00:00
7e443770d7 test-validator: add an arg to control faucet genesis balance (#17582)
(cherry picked from commit 974a96738a)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-05-28 17:50:44 +00:00
8ec09884b8 Revert bpf-tools to version 1.8 because of a codegen bug suspicion (#17568) (#17577)
(cherry picked from commit 2316ddb90a)

Co-authored-by: Dmitri Makarov <dmakarov@users.noreply.github.com>
2021-05-28 11:10:14 +00:00
88c7e636d6 Bump console from 0.11.3 to 0.14.1 (#16301) (#17552)
* Bump console from 0.11.3 to 0.14.1

Bumps [console](https://github.com/mitsuhiko/console) from 0.11.3 to 0.14.1.
- [Release notes](https://github.com/mitsuhiko/console/releases)
- [Changelog](https://github.com/mitsuhiko/console/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/console/compare/0.11.3...0.14.1)

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

* Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
(cherry picked from commit ec1a307a7c)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-27 21:30:17 +00:00
add3fd479d chore: bump chrono-humanize from 0.1.1 to 0.2.1 (#16895) (#17549)
* chore: bump chrono-humanize from 0.1.1 to 0.2.1

Bumps [chrono-humanize](https://gitlab.com/imp/chrono-humanize-rs) from 0.1.1 to 0.2.1.
- [Release notes](https://gitlab.com/imp/chrono-humanize-rs/tags)
- [Commits](https://gitlab.com/imp/chrono-humanize-rs/compare/0.1.1...0.2.1)

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <anatoly+githubjenkins@solana.io>
(cherry picked from commit 4f74c77146)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-27 20:37:42 +00:00
70410536b9 Bump serde_bytes from 0.11.4 to 0.11.5 (#16299) (#17546)
* Bump serde_bytes from 0.11.4 to 0.11.5

Bumps [serde_bytes](https://github.com/serde-rs/bytes) from 0.11.4 to 0.11.5.
- [Release notes](https://github.com/serde-rs/bytes/releases)
- [Commits](https://github.com/serde-rs/bytes/compare/0.11.4...0.11.5)

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
(cherry picked from commit 6e2ae68643)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-27 20:04:59 +00:00
6f3f9b485c Allow configuring testnet slots-per-epoch (#17545) (#17551)
(cherry picked from commit cb1fb28247)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-27 19:46:49 +00:00
bd9ce3590d Remove redundant copy from RocksDB get_cf() wrapper (#17529) (#17543)
(cherry picked from commit 983828a2a9)

Co-authored-by: steviez <steven@solana.com>
2021-05-27 18:58:47 +00:00
49402b7d82 Only add keys with multiple index entries to the clean set (#17473) 2021-05-27 16:31:24 +02:00
3973bf08f1 move local out of call (#17519) 2021-05-27 08:53:11 -05:00
dd3cf27ab0 chore:(deps): bump @project-serum/serum in /explorer (#17539)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.37 to 0.13.38.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-27 09:03:41 +00:00
02a433307c chore:(deps): bump typescript from 4.2.4 to 4.3.2 in /explorer (#17538)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.4 to 4.3.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.2.4...v4.3.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-27 08:55:42 +00:00
44f7fd5eef chore: bump sinon from 11.1.0 to 11.1.1 in /web3.js (#17537)
Bumps [sinon](https://github.com/sinonjs/sinon) from 11.1.0 to 11.1.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v11.1.0...v11.1.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-27 08:47:14 +00:00
a47d55c75c chore: bump eslint-plugin-mocha from 8.2.0 to 9.0.0 in /web3.js (#17535)
Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 8.2.0 to 9.0.0.
- [Release notes](https://github.com/lo1tuma/eslint-plugin-mocha/releases)
- [Changelog](https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/lo1tuma/eslint-plugin-mocha/compare/8.2.0...9.0.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-27 08:20:57 +00:00
c4c2beca19 chore: bump rollup from 2.49.0 to 2.50.1 in /web3.js (#17511)
Bumps [rollup](https://github.com/rollup/rollup) from 2.49.0 to 2.50.1.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.49.0...v2.50.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-26 22:52:45 -07:00
ab581dafc2 Add block height to ConfirmedBlock structs (#17523)
* Add BlockHeight CF to blockstore

* Rename CacheBlockTimeService to be more general

* Cache block-height using service

* Fixup previous proto mishandling

* Add block_height to block structs

* Add block-height to solana block

* Fallback to BankForks if block time or block height are not yet written to Blockstore

* Add docs

* Review comments
2021-05-26 22:16:16 -06:00
9541411c15 Plumb transaction-level rewards (aka "rent debits") into the getTransaction RPC method 2021-05-27 03:05:05 +00:00
7dfc1d9790 Fix typo in docs 2021-05-26 19:49:23 -07:00
52dccc656a Purge slots greater than new last index (#16071) 2021-05-26 16:12:57 -07:00
cbce440af4 simulateTransaction can now return accounts modified by the simulation 2021-05-26 14:20:23 -07:00
54f0fc9f0f Use type alias for DownloadProgress callback (#17518)
Convert to use type alias for the callback and cascade the changes to callers. Thanks @jeffwashington for the help making it possible.
Changed the closure for the progress update in the validator main to FnMut and modify the abort count in the closure which is more reliable.
2021-05-26 13:26:07 -07:00
6abe089740 Add custom error for tx-history queries when node does not support (#17494) 2021-05-26 13:27:41 -06:00
3f9e3c7375 Remove copied shrink code (#17385) 2021-05-26 19:27:18 +02:00
6b9d8d41a3 add --limit_load_slot_count_from_snapshot to ledger-tool (#17417) 2021-05-26 10:36:12 -05:00
bb72ab7f1b docs: Add find_program_address and example (#17515) 2021-05-26 15:25:05 +00:00
179856c13a explorer: Display correct list of block programs (#17489) 2021-05-26 08:21:07 -07:00
9a5330b7eb Move gossip modules into solana-gossip crate (#17352)
* Move gossip modules to solana-gossip

* Update Protocol abi digest due to move

* Move gossip benches and hook up CI

* Remove unneeded Result entries

* Single use statements
2021-05-26 09:15:46 -06:00
752cd7d15e feat: use specialized explorer endpoints (#17516) 2021-05-26 07:09:35 -07:00
302b83a198 chore: bump @types/sinon from 10.0.0 to 10.0.1 in /web3.js (#17514)
Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 10.0.0 to 10.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-26 09:40:02 +00:00
0bb8c4f3ea chore: bump sinon from 11.0.0 to 11.1.0 in /web3.js (#17512)
Bumps [sinon](https://github.com/sinonjs/sinon) from 11.0.0 to 11.1.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-26 08:40:40 +00:00
37c2a2810f chore:(deps): bump @types/react from 17.0.6 to 17.0.8 in /explorer (#17510)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 17.0.6 to 17.0.8.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-26 08:22:39 +00:00
aed8e4c242 chore: bump eslint-plugin-mocha from 8.1.0 to 8.2.0 in /web3.js (#17509)
Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 8.1.0 to 8.2.0.
- [Release notes](https://github.com/lo1tuma/eslint-plugin-mocha/releases)
- [Changelog](https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/lo1tuma/eslint-plugin-mocha/compare/8.1.0...8.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-26 08:19:36 +00:00
2a6c5ed0ac add tests from RentDebits 2021-05-26 08:19:10 +00:00
97eab7edf9 runtime: add rent debit charges to block metadata 2021-05-26 08:19:10 +00:00
e9bc1c6b07 Add last valid block height to rpc Fees (#17506)
* Add last_valid_block_height to fees rpc

* Add getBlockHeight rpc

* Update docs
2021-05-26 07:26:19 +00:00
7ce910f459 Add a hacky shell for fun code reading (#17503) 2021-05-26 14:39:57 +09:00
3d40ec3c88 Add missing fields from getClusterNodes documentation 2021-05-26 02:00:30 +00:00
6d40d0d141 Improve missing default signer error messaging (#17486) 2021-05-25 18:31:27 -07:00
660d37aadf sigVerify conflicts with replace, add tests 2021-05-25 17:32:00 -07:00
e14f3eb529 rename flag 2021-05-25 17:32:00 -07:00
96cef5260c Add a flag to simulateTransaction to use most recent blockhash 2021-05-25 17:32:00 -07:00
4eb6deee2d Update sysvar docs (#17493) 2021-05-25 16:57:53 -07:00
64bfc14a75 docs: Add RPC node HW recommendations 2021-05-25 15:12:51 -06:00
3dfe87973b Propagate dead slots up to replay (#17227) 2021-05-25 13:43:47 -07:00
7a1446a3ed explorer: Update web3 to 1.14.0 (#17487) 2021-05-25 20:30:36 +00:00
7e433ddf83 chore: fix formatting (#17483) 2021-05-25 19:39:11 +00:00
a5c2067273 fixup! Ancestors to HashSet: From(Vec) (#17447) (#17481) 2021-05-25 12:24:34 -05:00
0dbe926efe feat: add getBlock and getTransaction apis (#17449) 2021-05-25 10:12:47 -07:00
3ae4806dae Fix missing builtins in C programs linking with compiler_builtins (#17475) 2021-05-25 17:11:02 +00:00
a03230338a docs: Add inner instruction and cross-program invocation (#17476) 2021-05-25 18:42:54 +02:00
4c17243157 snapshot download enhancement (#17415)
1. Allow the validator bootstrap code to specify the minimal snapshot download speed. If the snapshot download speed is detected below that, a different RPC can be retried. The default is 10MB/sec.

2. To prevent spinning on a number of sub-optimal choices and not making progress, the abort/retry logic is implemented with the following safe guards:
2.1 at maximum we do this retry for 5 times -- this number is configurable with default 5.
2.2 if the download in one notification round (5 second) is more than 2%, do not do retry -- it is not as bad anyway.
2.3 if the remaining estimate time is less than 1 minutes, do not abort retry as it will be done quickly anyway.
2.4 We do this abort/retry logic only at the first notification to avoid wasting download efforts -- the reasoning is being opportunistic and too greedy may not achieve overall shorter download time.

3. The download_snapshot and download_file is modified with the option allowing caller to notified of download progress via a callback. This allows the business logic of retrying to the place it belongs.
2021-05-25 09:32:12 -07:00
98f1b11edd Ancestors to HashSet: From(Vec) (#17447)
* ancestors.large_range_slots becomes HashSet

* Ancestors to HashSet: From(Vec)
2021-05-25 11:01:11 -05:00
d39a327138 ancestors.large_range_slots becomes HashSet (#17446) 2021-05-25 11:00:50 -05:00
2019558f03 docs: budget program is gone, link to SPL Token multisig 2021-05-25 15:40:31 +00:00
40bb6577fc initialize purge stats (#17345) 2021-05-25 09:24:38 -05:00
e39cb49f13 chore:(deps): bump @solana/web3.js from 1.12.0 to 1.13.0 in /explorer (#17474)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.12.0...v1.13.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 08:21:43 +00:00
85b647d80f Bump solana_rbpf to version 0.2.11 (#17404) 2021-05-25 08:05:35 +00:00
1108cb32b5 chore:(deps): bump @testing-library/react in /explorer (#17470)
Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 11.2.6 to 11.2.7.
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v11.2.6...v11.2.7)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 04:50:22 +00:00
a7ba6c84d0 chore:(deps): bump @types/node from 15.3.0 to 15.6.1 in /explorer (#17469)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.3.0 to 15.6.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 04:41:52 +00:00
ddff4fdbf3 chore:(deps): bump @bonfida/bot from 0.5.0 to 0.5.3 in /explorer (#17468)
Bumps [@bonfida/bot](https://github.com/bonfida/bonfida-bot) from 0.5.0 to 0.5.3.
- [Release notes](https://github.com/bonfida/bonfida-bot/releases)
- [Commits](https://github.com/bonfida/bonfida-bot/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 04:35:19 +00:00
1f204660be chore:(deps): bump @solana/spl-token-registry in /explorer (#17467)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.71 to 0.2.114.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.71...v0.2.114)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 21:24:25 -07:00
744f4dd834 chore:(deps): bump prettier from 2.2.1 to 2.3.0 in /explorer (#17454)
* chore:(deps): bump prettier from 2.2.1 to 2.3.0 in /explorer

Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.2.1...2.3.0)

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

* format

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Starry <justin@solana.com>
2021-05-24 21:24:11 -07:00
dbd7be5ff1 feat: generate random keypair with constructor (#17448) 2021-05-24 21:04:05 -07:00
fda8cb176a chore: bump prettier from 2.2.1 to 2.3.0 in /web3.js (#17143)
* chore: bump prettier from 2.2.1 to 2.3.0 in /web3.js

Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.2.1...2.3.0)

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

* chore: bump

* chore: format

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Starry <justin@solana.com>
2021-05-25 03:53:16 +00:00
fd43446bfa chore:(deps): bump @solana/web3.js from 1.11.0 to 1.12.0 in /explorer (#17464)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.11.0...v1.12.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 20:44:08 -07:00
eeaa032791 chore: bump sinon from 10.0.1 to 11.0.0 in /web3.js (#17465)
Bumps [sinon](https://github.com/sinonjs/sinon) from 10.0.1 to 11.0.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 02:04:08 +00:00
26fe60a0cd chore:(deps): bump @project-serum/serum in /explorer (#17463)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.34 to 0.13.37.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 01:47:54 +00:00
bc03102efd chore: bump start-server-and-test from 1.12.2 to 1.12.3 in /web3.js (#17462)
Bumps [start-server-and-test](https://github.com/bahmutov/start-server-and-test) from 1.12.2 to 1.12.3.
- [Release notes](https://github.com/bahmutov/start-server-and-test/releases)
- [Commits](https://github.com/bahmutov/start-server-and-test/compare/v1.12.2...v1.12.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 01:44:19 +00:00
f193ea96f7 chore: bump jayson from 3.6.2 to 3.6.3 in /web3.js (#17461)
Bumps [jayson](https://github.com/tedeh/jayson) from 3.6.2 to 3.6.3.
- [Release notes](https://github.com/tedeh/jayson/releases)
- [Commits](https://github.com/tedeh/jayson/compare/v3.6.2...v3.6.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 01:39:38 +00:00
70d9347514 chore:(deps): bump @types/react from 17.0.5 to 17.0.6 in /explorer (#17460)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 17.0.5 to 17.0.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 01:31:09 +00:00
f4bdb11949 chore:(deps): bump @sentry/react from 6.3.6 to 6.4.1 in /explorer (#17459)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 6.3.6 to 6.4.1.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/6.3.6...6.4.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 01:27:57 +00:00
3a0c6950cb chore: bump @typescript-eslint/parser from 4.23.0 to 4.25.0 in /web3.js (#17458)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.23.0 to 4.25.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.25.0/packages/parser)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 01:25:47 +00:00
d53dba546a chore: bump rollup-plugin-dts from 3.0.1 to 3.0.2 in /web3.js (#17457)
Bumps [rollup-plugin-dts](https://github.com/Swatinem/rollup-plugin-dts) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/Swatinem/rollup-plugin-dts/releases)
- [Changelog](https://github.com/Swatinem/rollup-plugin-dts/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Swatinem/rollup-plugin-dts/compare/v3.0.1...v3.0.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 01:15:08 +00:00
4541c6e596 chore:(deps): bump @types/socket.io-client in /explorer (#17456)
Bumps [@types/socket.io-client](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/socket.io-client) from 1.4.36 to 3.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/socket.io-client)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 01:05:44 +00:00
91416b2075 chore:(deps): bump react-select from 4.3.0 to 4.3.1 in /explorer (#17455)
Bumps [react-select](https://github.com/JedWatson/react-select) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/JedWatson/react-select/releases)
- [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/JedWatson/react-select/compare/react-select@4.3.0...react-select@4.3.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 01:02:09 +00:00
5e04d6438f chore: bump @types/node from 15.6.0 to 15.6.1 in /web3.js (#17453)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.6.0 to 15.6.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 00:58:21 +00:00
27b84dda4e chore: bump rollup from 2.47.0 to 2.49.0 in /web3.js (#17452)
Bumps [rollup](https://github.com/rollup/rollup) from 2.47.0 to 2.49.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.47.0...v2.49.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 00:47:39 +00:00
06a0788385 chore: bump @typescript-eslint/eslint-plugin in /web3.js (#17450)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.24.0 to 4.25.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.25.0/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-25 00:24:23 +00:00
a0c57de387 chore:(deps): bump @testing-library/user-event in /explorer (#17260)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.1.8 to 13.1.9.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v13.1.8...v13.1.9)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 17:13:03 -07:00
efd85b8e28 chore:(deps): bump @types/react-dom from 17.0.3 to 17.0.5 in /explorer (#17258)
Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 17.0.3 to 17.0.5.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 17:12:58 -07:00
7157233275 chore:(deps): bump @types/chai from 4.2.17 to 4.2.18 in /explorer (#17118)
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.17 to 4.2.18.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 17:12:52 -07:00
6b13373e4b chore: bump eslint from 7.26.0 to 7.27.0 in /web3.js (#17433)
Bumps [eslint](https://github.com/eslint/eslint) from 7.26.0 to 7.27.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.26.0...v7.27.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 17:12:27 -07:00
2aac716626 chore: bump @babel/preset-env from 7.14.1 to 7.14.2 in /web3.js (#17207)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.14.1 to 7.14.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.2/packages/babel-preset-env)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 17:01:41 -07:00
99313a4ba2 add ledger-tool verify option to verify hash calculation (#17412) 2021-05-24 18:15:57 -05:00
d4fc9e7ed4 ad metric for collect (#17418) 2021-05-24 18:14:52 -05:00
dd22ae047b ancestors is set instead of map (#17363) 2021-05-24 17:01:02 -05:00
d8bc56fa51 Refactor purge_slots_from_cache_and_store() and handle_reclaims() (#17319) 2021-05-24 13:51:17 -07:00
41ec1c8d50 Add blockstore-root-scan for api nodes on boot (#17402)
* Add blockstore-root-scan for api nodes on boot

* Ensure cluster-confirmed root and parents are set as root in blockstore in load_frozen_forks()

* Plumb rpc-scan-and-fix-roots validator flag
2021-05-24 13:24:47 -06:00
30b60a976b Avoid ip_echo_server unwrap 2021-05-24 12:10:50 -07:00
ad1f24d487 runtime: Executor usage counts retain only single-epoch memory (#17162) 2021-05-24 12:01:56 -07:00
e867d7f3b8 removes Crds::lookup and lookup_versioned (#17438) 2021-05-24 18:21:54 +00:00
a8dca3976b Refactor genesis download/load/check functions (#17276)
* Refactor genesis ingest functions

* Consolidate genesis.bin/genesis.tar.bz2 references
2021-05-24 16:45:36 +02:00
9d112cf41f encapsulates purged values bookkeeping into crds module (#17265)
For all code paths (gossip push, pull, purge, etc) that remove or
override a crds value, it is necessary to record hash of values purged
from crds table, in order to exclude them from subsequent pull-requests;
otherwise the next pull request will likely return outdated values,
wasting bandwidth:
https://github.com/solana-labs/solana/blob/ed51cde37/core/src/crds_gossip_pull.rs#L486-L491

Currently this is done all over the place in multiple modules, and this
has caused bugs in the past where purged values were not recorded.

This commit encapsulated this bookkeeping into crds module, so that any
code path which removes or overrides a crds value, also records the hash
of purged value in-place.
2021-05-24 13:47:21 +00:00
060332c704 indexes crds votes by insert order (#17340)
Crds::get_votes is scanning over all votes in the crds table only to
return those inserted since the given cursor:
https://github.com/solana-labs/solana/blob/2ae57c172/core/src/crds.rs#L250-L266

Having votes indexed by insert order avoids the table scan and will be
more efficient.
2021-05-24 13:35:01 +00:00
8aec50a275 chore: bump ts-node from 9.1.1 to 10.0.0 in /web3.js (#17432)
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 9.1.1 to 10.0.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v9.1.1...v10.0.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 12:10:12 +00:00
b58ebb7bcd chore: bump @babel/core from 7.14.2 to 7.14.3 in /web3.js (#17431)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.14.2 to 7.14.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.3/packages/babel-core)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 11:50:41 +00:00
702d0a4d10 chore: bump start-server-and-test from 1.12.1 to 1.12.2 in /web3.js (#17430)
Bumps [start-server-and-test](https://github.com/bahmutov/start-server-and-test) from 1.12.1 to 1.12.2.
- [Release notes](https://github.com/bahmutov/start-server-and-test/releases)
- [Commits](https://github.com/bahmutov/start-server-and-test/compare/v1.12.1...v1.12.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 11:32:38 +00:00
65f6949376 chore: bump rpc-websockets from 7.4.11 to 7.4.12 in /web3.js (#17429)
Bumps [rpc-websockets](https://github.com/elpheria/rpc-websockets) from 7.4.11 to 7.4.12.
- [Release notes](https://github.com/elpheria/rpc-websockets/releases)
- [Commits](https://github.com/elpheria/rpc-websockets/compare/v7.4.11...v7.4.12)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 11:09:39 +00:00
e13cd33290 chore: bump @babel/plugin-transform-runtime in /web3.js (#17428)
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.14.2 to 7.14.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.3/packages/babel-plugin-transform-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 09:58:13 +00:00
c8169a2f1b chore: bump @typescript-eslint/eslint-plugin in /web3.js (#17427)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.23.0 to 4.24.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.24.0/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 09:30:56 +00:00
2d63e15023 chore: bump @types/node from 15.0.3 to 15.6.0 in /web3.js (#17426)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.0.3 to 15.6.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 09:01:23 +00:00
db38ba81ee chore: bump eslint-plugin-import from 2.22.1 to 2.23.3 in /web3.js (#17425)
Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.22.1 to 2.23.3.
- [Release notes](https://github.com/benmosher/eslint-plugin-import/releases)
- [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md)
- [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.22.1...v2.23.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 08:40:34 +00:00
5567305a5f rolls back min number of bloom items for debug builds (#17420)
coverage ci builds are have become flaky presumably because of the
overhead added in https://github.com/solana-labs/solana/pull/17236
for very small test clusters.

This commit uses a smaller min number of bloom items condition on that
if debug assertions are enabled or not.

Previous attempt at fixing the flakiness:
https://github.com/solana-labs/solana/pull/17408
2021-05-23 16:50:19 +00:00
8664b2cc39 Fix bad assertion (#17401) 2021-05-22 20:18:13 -07:00
cf1acfb021 uses Duration type for gossip discover timeout 2021-05-22 19:17:36 +00:00
d6496376ce increases timeout duration for gossip discover 2021-05-22 19:17:36 +00:00
a7870cda8d records hash of timed-out pull responses
Gossip should record hash of pull responses which are timed out and
fail to insert:
https://github.com/solana-labs/solana/blob/ed51cde37/core/src/crds_gossip_pull.rs#L397-L400

so that they are excluded from the next pull request:
https://github.com/solana-labs/solana/blob/ed51cde37/core/src/crds_gossip_pull.rs#L486-L491

otherwise the next pull request will likely include the same timed out
values and waste bandwidth.
2021-05-22 17:02:24 +00:00
d41266e4e9 rpc: add context toggle to getProgramAccounts (#17399)
* fix(rpc): return context in get_program_accounts

* doc(rpc): document withContext flag

* fix(rpc): fix comment

Co-authored-by: Michael Vines <mvines@gmail.com>

* fix(rpc): fix doc

Co-authored-by: Michael Vines <mvines@gmail.com>

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-22 07:12:21 +00:00
51178ccb33 account-decoder: don't use strings to convert between Pubkey types (#17391)
* account-decoder: don't use strings to convert between Pubkey types

* transaction-status: don't use strings to convert between Pubkey types
2021-05-21 22:53:53 +00:00
855ae79598 Fix InvokeContext::push() account_deps (#17350)
* Reverts aliasing of account_deps with the previous invocation stack frame in InvokeContext::push().
* Adds explicit assert of programdata account content in test_program_bpf_upgrade_via_cpi.
2021-05-21 22:34:07 +02:00
9471ba61c5 removes redundant slots sort in push_epoch_slots 2021-05-21 19:17:15 +00:00
9339a6f8f3 locks gossip only once in push_epoch_slots
push_epoch_slots is unlocking and locking again gossip when iterating
over epoch slot indices which is wasteful:
https://github.com/solana-labs/solana/blob/0486df02b/core/src/cluster_info.rs#L915-L929
2021-05-21 19:17:15 +00:00
8758e9ed82 Remove const qualifier from syscall out-parameters (#17382) 2021-05-21 12:09:22 -07:00
3f3324231d Hold read lock during startup shrink (#17309)
* hold read lock during account scan of shrink

* rename and improve rusty
2021-05-21 13:59:32 -05:00
96cde36784 SetLockup now requires the authorized withdrawer when the lockup is not in force 2021-05-21 11:49:01 -07:00
ff0e623d30 removes the nested for loop from retransmit-stage
The code can be simplified by just flattening the vector of packets.
2021-05-21 17:10:56 +00:00
71de021177 adds metric for turbine retransmit tree mismatch
In order to remove port-based forwarding logic in turbine, we need to
first track how often the turbine retransmit/broadcast trees mismatch
across nodes.
One consistency condition is that if the node is on the critical path
(i.e. the first node in each neighborhood), then we expect that the
packet arrives at tvu socket as opposed to tvu-forwards.

This commit adds a metric to track how often above condition is not met.
2021-05-21 17:10:56 +00:00
019bccab51 stake: merge accounts with mismatched, but expired lockups 2021-05-21 10:50:27 -06:00
74ac6ab80f stake: plumb can_merge_expired_lockups feature flag 2021-05-21 10:50:27 -06:00
8c073b2c94 Update getrandom bpf dependency 2021-05-21 08:55:47 -07:00
2adce67260 extends crds values timeouts if stakes are unknown (#17261)
If stakes are unknown, then timeouts will be short, resulting in values
being purged from the crds table, and consequently higher pull-response
load when they are obtained again from gossip. In particular, this slows
down validator start where almost all values obtained from entrypoint
are immediately discarded.
2021-05-21 15:55:22 +00:00
44831c18d2 reuse work in is_non_loader_key (#16521) 2021-05-21 10:07:04 -05:00
8143ee5502 add AccountsIndex AccountMapsReadLock type (#17365) 2021-05-21 10:02:14 -05:00
2f55547d37 remove flatten in storage scan (#17354)
* remove flatten in storage scan

* fix tests
2021-05-21 09:26:46 -05:00
5e6b00fe98 prioritizes more recent values in pull responses (#17238)
On the receiving end, the outdated values are discarded, and they will
only waste bandwidth:
https://github.com/solana-labs/solana/blob/3f0480d06/core/src/crds_gossip_pull.rs#L385-L400

This is also exacerbating validator start, since the entrypoint is
returning old values in pull responses, and the validator immediately
discards those; resulting in huge delay until the validator obtains
contact-info of the entrypoint and is able to adopt shred-version and
fully start.
2021-05-21 14:07:46 +00:00
e8b35a4f7b bumps up min number of bloom items in gossip pull requests (#17236)
When a validator starts, it has an (almost) empty crds table and it only
sends one pull-request to the entrypoint. The bloom filter in the
pull-request targets 10% false rate given the number of items. So, if
the `num_items` is very wrong, it makes a very small bloom filter with a
very high false rate:
https://github.com/solana-labs/solana/blob/2ae57c172/runtime/src/bloom.rs#L70-L80
https://github.com/solana-labs/solana/blob/2ae57c172/core/src/crds_gossip_pull.rs#L48

As a result, it is very unlikely that the validator obtains entrypoint's
contact-info in response. This exacerbates how long the validator will
loop on:
    > Waiting to adopt entrypoint shred version
https://github.com/solana-labs/solana/blob/ed51cde37/validator/src/main.rs#L390-L412

This commit increases the min number of bloom items when making gossip
pull requests. Effectively this will break the entrypoint crds table
into 64 shards, one pull-request for each, a larger bloom filter for
each shard, and increases the chances that the response will include
entrypoint's contact-info, which is needed for adopting shred version
and validator start.
2021-05-21 13:59:26 +00:00
662c2aaeec programs/stake: cancel deactivate (#17344)
fix: remove stray println

add error for inconsistent input.

fix: lamports don't need to match when redelegating to same vote account

Improve comments

bump

Apply suggestions from code review


Add assert in test

Use stake_program_v4

Co-Authored-By: Trent Nelson <trent.a.b.nelson@gmail.com>

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2021-05-21 05:31:55 +00:00
e320af99a0 clap-utils: Fix signer resolution on Windows 2021-05-21 02:12:57 +00:00
91f2b6185e Prevent withrawing Initialized stake account to zero stake (#17366) 2021-05-21 02:01:08 +00:00
2c99b23ad7 Add get_sysvar() helper to sdk 2021-05-21 01:30:12 +00:00
45552d271a take mutex once in process_dead_slots (#17357) 2021-05-20 19:50:58 -05:00
a1a0d6f84b Add stake_program_v4 feature 2021-05-20 21:15:18 +00:00
741f99ebb6 Explorer: introduce rewards tab for stake/vote accounts (#16851)
* feat: introduce staking rewards tab

* feat: take into consideration stake activation

* fix: report fetch errors

* fix: find rewards all the way to epoch 0

* fix: find rewards all the way to epoch 0

* fix: autocomplete error

* fix: load one page at a time
2021-05-20 14:00:48 -07:00
0486df02ba don't limit to thread pool when cleaning on startup (#17317) 2021-05-20 14:36:35 -05:00
dd13a31a5a restore Serum in CI downstream job (#17346) 2021-05-20 15:33:19 +00:00
33ab9c4e8d batch insert account_index items in generate_index (#17290) 2021-05-20 10:29:13 -05:00
9b74988fc6 calculate_accounts_hash does not throttle threads on startup (#17338) 2021-05-20 10:25:54 -05:00
a9aa533684 replace Ancestors HashMap for performance (#16477)
* replace Ancestors HashMap for performance

* add ancestors module
2021-05-20 10:11:56 -05:00
ddfc15b9f2 docs: Update transaction expiration time (#17347) 2021-05-20 14:55:34 +00:00
2ae57c172a Bump bpf-tools version to 1.9
- upgrade rustc to 1.52.1 and clang to 12.0
2021-05-20 11:35:37 +02:00
a544010b03 don't log shrink metrics on first call (#17328)
* don't log shrink metrics on first call

* simplify logic
2021-05-20 00:15:35 +00:00
32ec8341f9 generate_index inserts ideal initial data (#17247)
* improve insert into map initially

* rework towards single code path

* rename

* update test
2021-05-19 16:21:24 -05:00
13b032b2d4 removes manual trait impl for contact-info (#17332)
The current implementations use only the id and disregard other fields,
in particular wallclock. This can lead to bugs where an outdated
contact-info shadows or overrides a current one because they compare
equal.
2021-05-19 20:56:10 +00:00
477898f682 Optimize aligned memory used by the runtime (#17324) 2021-05-19 13:43:59 -07:00
e7073ecab1 adds gossip metrics for number of staked nodes (#17330) 2021-05-19 19:25:21 +00:00
b5302e7619 add calc_stored_meta_us metric (#17318) 2021-05-19 12:29:41 -05:00
f1b4a0a2e0 Fix typo (#17326) 2021-05-19 11:24:08 -06:00
c20b27bc8f shink all in parallel on startup (#17308) 2021-05-19 12:15:24 -05:00
ed9cbd50f0 move Ancestors to its own module (#17316) 2021-05-19 11:50:34 -05:00
0781fe1b4f Upgrade Rust to 1.52.0 (#17096)
* Upgrade Rust to 1.52.0
update nightly_version to newly pushed docker image
fix clippy lint errors
1.52 comes with grcov 0.8.0, include this version to script

* upgrade to Rust 1.52.1

* disabling Serum from downstream projects until it is upgraded to Rust 1.52.1
2021-05-19 09:31:47 -05:00
4788976517 rework slot list update (#17232) 2021-05-19 08:48:46 -05:00
7fe24c455c simplify generate_index (#17292) 2021-05-19 08:11:41 -05:00
305d9dd3f4 Validator progress bars are now rendered when stdout is not a terminal 2021-05-19 07:32:39 +00:00
827355a6b1 Create solana-rpc crate and move subscriptions (#17320)
* Move non_circulating_supply to runtime

* Add solana-rpc crate and move max_slots

* Move subscriptions to solana-rpc

* Single use statements
2021-05-19 00:54:28 -06:00
a3c0833a1c tests: cleanup test (#17305)
* tests: cleanup test

* 2 more replacements
2021-05-18 18:08:37 -05:00
63b97729e6 get_program_accounts_with_config() now correctly defaults to RpcClient's commitment level 2021-05-18 19:57:40 +00:00
cfcae50022 fix test (#17310) 2021-05-18 11:46:42 -07:00
00e198d169 feat: add borsh utilities and public key support (#17239)
* feat: add borsh utilities and public key support

* fix: make bn internal for flow

* fix: add Buffer import in borsh file
2021-05-18 19:33:06 +02:00
75335b4f58 datapoint for verify_snapshot_bank (#17306) 2021-05-18 12:14:43 -05:00
6cba53421e Disallow bad combination of arguments in keygen grind (#17251)
* Use constant for outfile sentinel value

* Require --use-mnemonic flag when --no-outfile flag passed to keygen grind
2021-05-18 10:35:07 -05:00
f7b0184f81 patches flaky test_new_mark_creation_time (#17288) 2021-05-18 13:39:35 +00:00
2175fc0625 calculate account infos before lock (#17245) 2021-05-18 08:06:19 -05:00
ab871ed4b7 Bump bpf-tools version to 1.8 2021-05-18 08:10:57 +02:00
c65c4475f6 Add Contextual Search (#17299)
* this should prevent other language results appearing in the search area
2021-05-18 05:47:19 +00:00
3a56a56d69 StoredMetaWriteVersion (#17293) 2021-05-17 23:58:36 +00:00
f15dd1b4ef Add C Serialization Tests for #17217 (#17294) 2021-05-17 16:33:58 -07:00
7ea1131090 Clear release cache for stable-perf (#17287) 2021-05-17 17:28:52 -06:00
bcbe155575 Minor test cleanup and comments (#17283) 2021-05-18 07:22:43 +09:00
d461aba6a4 don't try to build secondary indexes if we don't need them (#17246) 2021-05-17 17:21:15 -05:00
8a574baae2 Explorer: add token market prices from Coingecko (#17289)
* feat: add coingecko prices to tokens with associated coingeckoId

* feat: useCoingecko util
2021-05-17 12:43:18 -07:00
9d6837c904 fix comment (#17286) 2021-05-17 14:06:25 -05:00
d1db5448b9 hold lock to speed up insert (#17194)
* hold lock to speed up insert

* add tests
2021-05-17 11:58:33 -05:00
3805874c86 Add --no-wait option to CLI's stake-authorize command (#17244) 2021-05-17 16:54:33 +00:00
de76adbdf3 Update docs/src/running-validator/validator-start.md 2021-05-17 10:22:10 -06:00
02157f4753 Update keypair configuration output
While going through the tutorial to start a validator I noticed that the output I received from running...

```
solana config set --keypair ~/validator-keypair.json
```

...different from the output I was seeing. Wondering whether the docs are out of date I thought I'd propose an update to the docs just in case.
2021-05-17 10:22:10 -06:00
1f322b8a9c Add two more testnet entrypoints 2021-05-17 08:07:38 -07:00
611628a402 fixed getProgramAccounts fields list (#17278) 2021-05-17 14:23:30 +00:00
d6ab4196ea Remove duplicate std::net reference (#17254) 2021-05-16 18:51:41 -06:00
ed51cde37b chore:(deps): bump @sentry/react from 6.3.5 to 6.3.6 in /explorer (#17259)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 6.3.5 to 6.3.6.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/6.3.5...6.3.6)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-15 17:44:37 +00:00
2fe864aa48 chore:(deps): bump @types/node from 15.0.2 to 15.3.0 in /explorer (#17257)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.0.2 to 15.3.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-15 17:30:45 +00:00
031a6373ae feat: bump web3.js to 1.11.0 (#17256) 2021-05-15 17:19:24 +00:00
e02b4e1192 Fix a bug in input deserialization in the C SDK (#17217)
When the input contains more accounts than the user has requested to be deserialized, and one of the excess ones is a dup, the input pointer is not adjusted correctly.

Compare the lines added by this commit to line 401: "input += 7; // padding". Since the input data layout does not depend on the number of accounts the user wants to deserialize, this adjustment by 7 bytes must happen in both branches.
2021-05-14 16:41:55 -06:00
7be3171f4a fix: update devnet and testnet urls 2021-05-14 16:20:39 -06:00
ec621e71dc docs: update old devnet and testnet url references 2021-05-14 16:20:39 -06:00
ae5a10dffd fix: cluster test 2021-05-14 16:20:39 -06:00
0f3045fb68 feat: update api urls 2021-05-14 16:20:39 -06:00
515f8a21d5 Add NEW labels for RPC methods introduced in v1.7 2021-05-14 21:22:52 +00:00
0c07f1ffe4 add data point for ledger processing (#17210) 2021-05-14 15:58:31 -05:00
3745e0babc minor refactoring of AccountsIndex in preparation of bigger things (#17237) 2021-05-14 15:27:10 -05:00
fd88db7339 ancestors::new -> default (#17195) 2021-05-14 15:20:59 -05:00
3f0480d060 Fix deprecated trait object without an explicit dyn warning (#17231) 2021-05-14 17:33:07 +00:00
2c8dde7224 test-validator: Hint at airdrop when wallet is unavailable 2021-05-14 11:14:27 -06:00
5e642a174c docs: remove missig link (#17212) 2021-05-14 09:27:58 -06:00
c6f7867aa1 log mismatch (#17209) 2021-05-14 09:50:11 -05:00
76dfacca61 Add documentation for BankForks::prune_non_rooted() (#17213) 2021-05-14 07:47:48 -05:00
754c708473 test-validator: Display more cluster info in dash 2021-05-14 08:36:08 +00:00
67e6a3106f rpc: plumb shred_version through RpcContactInfo 2021-05-14 08:36:08 +00:00
26afc7620b Update clusters.md (#17220) 2021-05-14 04:13:28 +00:00
b074e86ad2 Fix clippy (#17214)
Newer clippy from +nightly have new errors about where annotations can and
cannot go.  This commit fixes two of them.
2021-05-13 17:51:36 -05:00
27004f1b76 Return error for excluded secondary-index keys (#17193)
* Add runtime helpers to check secondary indexes for key

* Add custom rpc error

* Check secondary-index key inclusion in rpc

* Clone complete AccountSecondaryIndexes into rpc to avoid bank query
2021-05-13 21:04:21 +00:00
3dbc7744ab metrics for generating index time (#17192)
* metrics for generating index time

* update metrics to include scan time
2021-05-13 14:32:19 -05:00
3e0c0abb53 Update docs/src/developing/test-validator.md 2021-05-13 17:28:31 +00:00
7868df3211 Update docs/src/developing/test-validator.md 2021-05-13 17:28:31 +00:00
3214105a21 Update docs/src/developing/test-validator.md
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-13 17:28:31 +00:00
e08687acfd Update docs/src/developing/test-validator.md
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-13 17:28:31 +00:00
38d7e9a4c4 Update docs/src/developing/test-validator.md
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-13 17:28:31 +00:00
5b13d4057b Update docs/src/developing/test-validator.md
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-13 17:28:31 +00:00
056c1a7b50 Update docs/src/developing/test-validator.md
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-13 17:28:31 +00:00
768a2ebe9d docs: Add docs for solana-test-validator 2021-05-13 17:28:31 +00:00
0e646d10bb prunes received-cache only once per unique owner's key (#17039) 2021-05-13 13:50:16 +00:00
0aa7824884 retains one node-instance per pubkey (#17187)
crds table retains up to 32 node-instance values per each pubkey. This
is so because if there are multiple running instances of the same node,
then we want gossip to propagate node-instance values associated with
both instances, therefore the corresponding label/key includes the
randomly generated token in addition to the pubkey:
https://github.com/solana-labs/solana/blob/9c42a89a4/core/src/crds_value.rs#L448
https://github.com/solana-labs/solana/pull/14037

As a result, the number of such values per pubkey are effectively
unbounded, requiring custom mitigations implemented in:
https://github.com/solana-labs/solana/pull/14467
but still taking redundant extra memory and bandwidth.

This commit instead retains only one node-instance per pubkey by
extending crds values override logic. If a crds value is of type
node-instance, it will always override an existing one with the same key
if it has more recent starting timestamp (not wallclock). As a result,
gossip will always propagate the node-instance with more recent
timestamp. Since the check_duplicate logic will stop the node with older
timestamp, this change should preserve existing functionality.
2021-05-13 13:35:46 +00:00
8b9c9aa790 chore: bump @babel/plugin-transform-runtime in /web3.js (#17206)
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.13.15 to 7.14.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.2/packages/babel-plugin-transform-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-13 10:09:25 +00:00
e8090f45f2 chore: bump @babel/core from 7.14.0 to 7.14.2 in /web3.js (#17205)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.14.0 to 7.14.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.2/packages/babel-core)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-13 09:55:46 +00:00
8e9c730f40 chore: bump @types/node from 15.0.2 to 15.0.3 in /web3.js (#17203)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.0.2 to 15.0.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-13 09:37:28 +00:00
0a4cdc8a85 chore: bump semantic-release from 17.4.2 to 17.4.3 in /web3.js (#17202)
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 17.4.2 to 17.4.3.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v17.4.2...v17.4.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-13 09:27:36 +00:00
6bc27e8864 chore: bump @commitlint/config-conventional in /web3.js (#17201)
Bumps [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint) from 12.1.3 to 12.1.4.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/compare/v12.1.3...v12.1.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-13 08:27:01 +00:00
d9f96f71d4 chore: bump @commitlint/travis-cli from 12.1.3 to 12.1.4 in /web3.js (#17200)
Bumps [@commitlint/travis-cli](https://github.com/conventional-changelog/commitlint) from 12.1.3 to 12.1.4.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/compare/v12.1.3...v12.1.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-13 08:19:12 +00:00
248f2309ef docs: fix fixed banner layout 2021-05-13 04:27:17 +00:00
a821c4d57f docs: lock update missed in 545e037e38 2021-05-13 04:27:17 +00:00
239ab8799c Remove bloat from secondary indexes (#17048) 2021-05-12 15:29:30 -07:00
597373f5fa Update devnet and testnet endpoints (#17188) 2021-05-12 19:39:15 +00:00
b437b0a49d Add bip32 support to solana-keygen recover (#17180)
* Fix spelling

* Add validator for  SignerSources

* Add helper to generate Keypair from supporting SignerSources

* Add bip32 support to solana-keygen recover

* Make SignerSourceKind const strs, use for Debug impl and URI schemes
2021-05-12 19:33:11 +00:00
9c42a89a43 Issue #17008 -- make snapshot archives to hold on to configurable. (#17158)
* purge_old_snapshot_archives is changed to take an extra argument 'maximum_snapshots_to_retain' to control the max number of latest snapshot archives to retain. Note the oldest snapshot is always retained as before and is not subjected to this new options.
* The validator and ledger-tool executables are modified with a CLI argument --maximum-snapshots-to-retain. And the options are propagated down the call chains. Their corresponding shell scripts were changed accordingly.
* SnapshotConfig is modified to have an extra field for the maximum_snapshots_to_retain
* Unit tests are developed to cover purge_old_snapshot_archives
2021-05-12 10:32:27 -07:00
e3d722bb42 chore: bump @commitlint/travis-cli from 12.1.1 to 12.1.3 in /web3.js (#17184)
Bumps [@commitlint/travis-cli](https://github.com/conventional-changelog/commitlint) from 12.1.1 to 12.1.3.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/compare/v12.1.1...v12.1.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-12 08:18:18 +00:00
64a200b1c1 chore: bump @commitlint/config-conventional in /web3.js (#17183)
Bumps [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint) from 12.1.1 to 12.1.3.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/compare/v12.1.1...v12.1.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-12 08:12:16 +00:00
7d96f78821 include/exclude keys on account secondary index (#17110)
* AccountSecondaryIndexes.include/exclude

* use normal scan if key is not indexed

* add a test to ask for a scan for an excluded secondary index

* fix up cli args
2021-05-11 22:06:22 +00:00
4ed828e4ee Enable RBPF trace output for BPF tests that are not using bpf_loader 2021-05-11 23:50:42 +02:00
88626b2945 Bump bpf-tools version to 1.7 (#17176) 2021-05-11 19:51:20 +00:00
dbac38702a sdk: keypair - drop superfluous iter() 2021-05-11 13:07:58 -06:00
967840aed6 sdk: Move signers module into signer module 2021-05-11 13:07:58 -06:00
b71e4bdc61 sdk: Move NullSigner to signer module 2021-05-11 13:07:58 -06:00
12bf6c06c3 sdk: Move Presigner to signer module 2021-05-11 13:07:58 -06:00
0eba6eb401 sdk: Move Keypair to signer module 2021-05-11 13:07:58 -06:00
af6f3d776e sdk: Move Signer trait to own module 2021-05-11 13:07:58 -06:00
d4ffd909a4 chore: bump @typescript-eslint/parser from 4.22.0 to 4.23.0 in /web3.js (#17167)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.22.0 to 4.23.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.23.0/packages/parser)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 09:25:03 +00:00
77272a17b3 Fix dump postprocessing in cargo-build-bpf (#17165) 2021-05-11 09:24:12 +00:00
e21ad02288 chore: bump @typescript-eslint/eslint-plugin in /web3.js (#17166)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.22.1 to 4.23.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.23.0/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 09:07:33 +00:00
4625231e30 Update web-wallet.md to add phantom with fixed link (#17161)
* Update web-wallet.md to add phantom with fixed link

Update web-wallet.md to add phantom with fixed link

* Update web-wallets.md for phantom

removing trailing whitespaces

* Update docs/src/wallet-guide/web-wallets.md

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-11 04:23:13 +00:00
a5ec3a0547 SignerSource: rename input scheme to prompt, default to bip44 solana base key (#17154)
* Rename ask to prompt

* Default to Solana bip44 base if no derivation-path

* Add SignerSource legacy field, support legacy ASK

* Update docs

* Fix docs: validator current doesn't support uri SignerSources
2021-05-10 19:28:47 -06:00
8eb05d6ed4 Add Keccak256 syscall and sdk support (#16498) 2021-05-10 16:16:58 -07:00
e511c442e6 fix: improve findProgramAddress error when MAX_SEED_LENGTH is exceeded (#17151) 2021-05-10 15:55:51 -07:00
82fb6712e7 fix c program deploy help (#17152) 2021-05-10 15:38:01 -07:00
4b60b2863e sdk: Add get_instance_packed_len for variable-size types (#17092)
* sdk: Add get_instance_packed_len for variable-size types

* Add comment for get_packed_len

* Add more tests
2021-05-10 23:31:02 +02:00
6e9deaf1bd Move block-time caching earlier (#17109)
* Require that blockstore block-time only be recognized slot, instead of root

* Move cache_block_time to after Bank freeze

* Single use statement

* Pass transaction_status_sender by reference

* Remove unnecessary slot-existence check before caching block time altogether

* Move block-time existence check into Blockstore::cache_block_time, Blockstore no longer needed in blockstore_processor helper
2021-05-10 13:14:56 -06:00
f39dda00e0 type AccountSecondaryIndexes = HashSet (#17108) 2021-05-10 14:22:48 +00:00
a6a1355b80 fix secondary index test (#17111) 2021-05-10 08:54:30 -05:00
c616c34825 Add comment for another unspoken eager collection subtlety (#17137) 2021-05-10 22:44:46 +09:00
81ad795d46 removes position field in coding-shred-header
CodingShredHeader.position is equal to
  ShredCommonHeader.index - ShredCommonHeader.fec_set_index
and is so redundant. The extra position field can add bugs if not
consistent with index and fec_set_index.
2021-05-10 13:20:56 +00:00
ad92414be3 chore: bump @solana/spl-token from 0.1.3 to 0.1.4 in /web3.js (#17142)
Bumps [@solana/spl-token](https://github.com/solana-labs/solana-program-library) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/solana-labs/solana-program-library/releases)
- [Commits](https://github.com/solana-labs/solana-program-library/compare/@solana/spl-token@v0.1.3...@solana/spl-token@v0.1.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 12:27:18 +00:00
a74cbb2f93 chore: bump @rollup/plugin-commonjs from 18.1.0 to 19.0.0 in /web3.js (#17141)
Bumps [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/HEAD/packages/commonjs) from 18.1.0 to 19.0.0.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/commonjs/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/commonjs-v19.0.0/packages/commonjs)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 12:22:05 +00:00
442ce816ac chore: bump @types/chai-as-promised from 7.1.3 to 7.1.4 in /web3.js (#17140)
Bumps [@types/chai-as-promised](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai-as-promised) from 7.1.3 to 7.1.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai-as-promised)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 11:39:51 +00:00
6ee90759c8 chore: bump @types/chai from 4.2.17 to 4.2.18 in /web3.js (#17139)
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.17 to 4.2.18.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 11:31:48 +00:00
9983d6af77 chore: bump eslint from 7.25.0 to 7.26.0 in /web3.js (#17138)
Bumps [eslint](https://github.com/eslint/eslint) from 7.25.0 to 7.26.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.25.0...v7.26.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 11:27:04 +00:00
22c02b917e reads gossip push messages off crds ordinal index
Having an ordinal index on crds values based on insert order allows to
efficiently filter values using a cursor. In particular
CrdsGossipPush::push_messages hash-map can be replaced with a cursor,
saving on the bookkeepings, purging, etc
2021-05-09 22:40:41 +00:00
dfa3e7a61c indexes crds values by their insert order 2021-05-09 22:40:41 +00:00
ff95e2aaa6 Add a make target to run the readelf utility on a compiled program
The readelf utility (already shipped with the solana tools) shows meta-information about ELF files, such as symbol tables. It is useful for investigating "unresolved symbol" errors that crop up at runtime.

This commit also fixes the objdump flags (two dashes are required and there is no "color" option) as well as a few typos.
2021-05-08 18:49:14 -07:00
a1df57a4ea Add chinese translations to docs (#17125)
* import zh translations

* Fix broken links

* fix whitespace
2021-05-09 00:46:24 +08:00
6927d0c77e Fix syscalls in the C SDK failing at runtime when compiled as C++ (#17124)
Some syscalls are wrongly declared "static" in solana_sdk.h, which makes clang++ assume they are local to the compilation unit. It therefore ignores the extern "C" {} block and mangles their names. While that doesn't break C++ compilation, the syscall fails at runtime with something along the lines of "ELF error: Unresolved symbol (_ZL26sol_create_program_addressPK13SolSignerSeediPK9SolPubkeyS4_)".
2021-05-08 16:31:50 +00:00
0a6fa1999a explorer: Fix bonfida dependency (#17120)
* explorer: Fix bonfida dependency

* fix import
2021-05-08 15:09:14 +08:00
35f20b8b6a chore:(deps): bump @solana/web3.js from 1.9.0 to 1.9.1 in /explorer (#17079)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.9.0...v1.9.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-08 14:00:24 +08:00
d6c076f1b6 getBlockProduction now correctly reports block production 2021-05-07 19:04:51 -07:00
ec2b06d81d solana-validator exit now uses process::exit() to ensure prompt termination 2021-05-07 10:33:51 -07:00
640883a9a9 chore: bump mocha from 8.3.2 to 8.4.0 in /web3.js (#17101)
Bumps [mocha](https://github.com/mochajs/mocha) from 8.3.2 to 8.4.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v8.3.2...v8.4.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 09:22:07 +00:00
97429744af chore: bump codecov from 3.8.1 to 3.8.2 in /web3.js (#17100)
Bumps [codecov](https://github.com/codecov/codecov-node) from 3.8.1 to 3.8.2.
- [Release notes](https://github.com/codecov/codecov-node/releases)
- [Changelog](https://github.com/codecov/codecov-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-node/compare/v3.8.1...v3.8.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 09:18:10 +00:00
f43f0afa55 feat: add Keypair class and deprecate Account (#17098)
* feat: add Keypair class and deprecate Account

* chore: fix lint issues

* chore: rename TransactionSigner to Signer
2021-05-07 08:59:51 +00:00
0b5167bf51 Add pubkey for stevecz (#17094) 2021-05-06 21:52:39 -05:00
225ec00ec4 add comment (#17059) 2021-05-06 15:17:41 -05:00
ddfbae260f Add ledger-tool for restoring roots to the Roots CF (#17045)
* Add ledger-tool for restoring roots to the Roots CF

* Print successful repair data, and repair in chunks

* Add parameter to limit num slots checked for root repair
2021-05-06 14:12:01 -06:00
dc0429f5e6 add metric for assumption (#17061) 2021-05-06 15:04:13 -05:00
edc2ab3e48 Test account index and store alignment (#17038)
* Use ReclaimResult::Default() instead of building subtypes

* Add test to ensure account_db store and index are aligned
2021-05-06 14:13:44 -05:00
fa86a335b0 implements cursor for gossip crds table queries (#16952)
VersionedCrdsValue.insert_timestamp is used for fetching crds values
inserted since last query:
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L1197-L1215
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L1274-L1298

So it is crucial that insert_timestamp does not go backward in time when
new values are inserted into the table. However std::time::SystemTime is
not monotonic, or due to workload, lock contention, thread scheduling,
etc, ... new values may be inserted with a stalled timestamp way in the
past. Additionally, reading system time for the above purpose is
inefficient/unnecessary.

This commit adds an ordinal index to crds values indicating their insert
order. Additionally, it implements a new Cursor type for fetching values
inserted since last query.
2021-05-06 14:04:17 +00:00
d19526e6c2 Dump rent_collector/inflation with ledger-tool cap (#17069) 2021-05-06 19:29:46 +09:00
2541809c45 chore: bump @babel/preset-env from 7.14.0 to 7.14.1 in /web3.js (#17078)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.14.0 to 7.14.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.1/packages/babel-preset-env)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-06 09:46:48 +00:00
9cd55e0d98 chore: bump @rollup/plugin-commonjs from 18.0.0 to 18.1.0 in /web3.js (#17077)
Bumps [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/HEAD/packages/commonjs) from 18.0.0 to 18.1.0.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/commonjs/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/commonjs-v18.1.0/packages/commonjs)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-06 09:36:35 +00:00
b8fc69a45b chore: bump @typescript-eslint/eslint-plugin in /web3.js (#17076)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.22.0 to 4.22.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.22.1/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-06 09:34:14 +00:00
5103bc11b4 chore:(deps): bump @solana/spl-token-registry in /explorer (#17075)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.68 to 0.2.71.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.68...v0.2.71)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-06 09:18:09 +00:00
66d0348c72 chore:(deps): bump superstruct from 0.15.1 to 0.15.2 in /explorer (#17073)
Bumps [superstruct](https://github.com/ianstormtaylor/superstruct) from 0.15.1 to 0.15.2.
- [Release notes](https://github.com/ianstormtaylor/superstruct/releases)
- [Changelog](https://github.com/ianstormtaylor/superstruct/blob/main/Changelog.md)
- [Commits](https://github.com/ianstormtaylor/superstruct/compare/v0.15.1...v0.15.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-06 09:00:57 +00:00
cb5e000615 CLI: Print gossip nodes with cli-output crate 2021-05-06 07:49:47 +00:00
d4aa7d512c chore: bump rollup from 2.46.0 to 2.47.0 in /web3.js (#17030)
Bumps [rollup](https://github.com/rollup/rollup) from 2.46.0 to 2.47.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.46.0...v2.47.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-06 11:41:43 +08:00
5d655eb516 chore:(deps): bump @types/react from 17.0.4 to 17.0.5 in /explorer (#17053)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 17.0.4 to 17.0.5.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-06 11:41:29 +08:00
9c92531ea0 explorer: update package-lock.json to v2 (#17067) 2021-05-06 02:34:14 +00:00
12c2cd4e86 Fix net shaper script to properly query interfaces (#17065)
Previously was using ifconfig which is not available on gce
2021-05-05 19:02:38 -07:00
7d1637d89a RpcClient now respects the retry-after server response header when getting rate limited 2021-05-05 18:11:57 -07:00
9bca18603b Add Brooks's pubkey to authorized keys (#17063) 2021-05-05 23:11:20 +00:00
ffbe8906ed get root lock once (#16829) 2021-05-05 15:17:45 -05:00
e6f49a3e79 Clean unrooted unfrozen banks (#16580) (#17003)
Cleanup pubkeys when an unrooted, unfrozen bank is dropped.  This is a
continuation of PR #16911.
2021-05-05 15:02:02 -05:00
9ba2c53b85 Add --tower argument to specify where tower files are persisted 2021-05-05 12:20:39 -07:00
769136f586 feat: associated token program card (#17043) 2021-05-05 11:49:05 -07:00
ab7c96aa81 insert accounts in parallel when building initial index (#17040)
* insert accounts in parallel when building initial index

* rename nits from pr review

* rename nits from pr review

* rename nits from pr review

* rename nits from pr review
2021-05-05 17:08:45 +00:00
3e0fed48e7 Don't recognize temp snapshots as possible snapshots to open 2021-05-05 08:45:03 -07:00
5786be13a4 flatten_hash_intermediate sets capacity first (#17013)
* flatten_hash_intermediate sets capacity first

* use iterator instead of for
2021-05-05 09:07:05 -05:00
a125388f6e chore: bump @types/node from 15.0.1 to 15.0.2 in /web3.js (#17056)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.0.1 to 15.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-05 10:28:50 +00:00
33443170de chore: bump @typescript-eslint/parser from 4.22.0 to 4.22.1 in /web3.js (#17055)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.22.0 to 4.22.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.22.1/packages/parser)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-05 10:04:58 +00:00
4b7083c38a chore: bump @rollup/plugin-node-resolve in /web3.js (#17054)
Bumps [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/HEAD/packages/node-resolve) from 11.2.1 to 13.0.0.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/node-resolve/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/commonjs-v13.0.0/packages/node-resolve)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-05 09:54:27 +00:00
a8f84a5622 fix: fix flow type declaration (#17049)
* fix: fix flow type declaration

* chore: fix prettier
2021-05-05 17:50:55 +08:00
34599ad57d chore: bump @rollup/plugin-commonjs from 18.0.0 to 18.1.0 in /web3.js (#17052)
Bumps [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/HEAD/packages/commonjs) from 18.0.0 to 18.1.0.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/commonjs/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/commonjs-v18.1.0/packages/commonjs)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-05 09:25:25 +00:00
e619b101c9 chore: bump @typescript-eslint/eslint-plugin in /web3.js (#17051)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.22.0 to 4.22.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.22.1/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-05 09:16:49 +00:00
7e774ee90f chore:(deps): bump @types/node from 15.0.1 to 15.0.2 in /explorer (#17050)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.0.1 to 15.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-05 09:07:23 +00:00
8f0b410714 chore: bump @babel/preset-env from 7.14.0 to 7.14.1 in /web3.js (#17031)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.14.0 to 7.14.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.1/packages/babel-preset-env)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-05 14:31:19 +08:00
6d11d5dd9f chore: conflate use statement 2021-05-04 08:34:35 -07:00
4ede5117f9 fix: add bpf_loader_upgradeable to ProgramTest default builtins 2021-05-04 08:34:35 -07:00
9abfa65920 Document that Transaction::sign might panic (#17026) 2021-05-04 08:32:21 -07:00
46d2755205 Correct days/year (#17024) 2021-05-04 10:00:30 +00:00
f5862c03ec chore: bump codecov from 3.8.1 to 3.8.2 in /web3.js (#17029)
Bumps [codecov](https://github.com/codecov/codecov-node) from 3.8.1 to 3.8.2.
- [Release notes](https://github.com/codecov/codecov-node/releases)
- [Changelog](https://github.com/codecov/codecov-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-node/compare/v3.8.1...v3.8.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-04 09:15:55 +00:00
efbb4a5a00 chore:(deps): bump @solana/spl-token-registry in /explorer (#17028)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.67 to 0.2.68.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.67...v0.2.68)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-04 09:07:16 +00:00
f17b80236f test-validator: Plumb --limit-ledger-size 2021-05-04 08:45:24 +00:00
bc7e741514 Integrate gossip votes into switching threshold (#16973) 2021-05-04 00:51:42 -07:00
9ff17a1c18 Update web3.js import sample 2021-05-03 23:32:45 -07:00
0ebfa08860 Remove ramp-tps 2021-05-04 02:06:50 +00:00
694c674aa6 Implement Bip32 for seed-phrase/passphrase signing (#16942)
* Add Keypair helpers for bip32 derivation

* Plumb bip32 for SignerSourceKind::Ask

* Support full-path querystring

* Use as_ref

* Add public wrappers for from_uri cases

* Support master root derivations (and fix too-deep print

* Add ask:// HD documentation

* Update ASK elsewhere in docs
2021-05-03 19:58:56 -06:00
6318705607 Add keys 2021-05-03 17:18:54 -07:00
b948a18841 Key rotation 2021-05-03 17:18:54 -07:00
b2778f34f5 Rotate keys 2021-05-03 17:18:54 -07:00
7cea2c4466 validates gossip addresses before sending pull-requests
IP addresses need to be validated before sending packets to them.
This commit, sends a ping packet to nodes before any pull requests.
Pull requests are then only sent to the nodes which have responded with
the correct hash of their respective ping packet.
2021-05-03 18:21:06 +00:00
2231017b35 uses Mutex instead of RwLock for ping_cache 2021-05-03 18:21:06 +00:00
d94e4ef7c9 More docs for bank.rs (#17006) 2021-05-03 17:37:18 +00:00
92b8b20ca5 AccountSharedData.lamports private (#16985) 2021-05-03 17:25:31 +00:00
a698e34744 patches local pending push messages processing (#16833)
process_push_messages writes local pending push messages to the crds
table, but it discards the return value:
https://github.com/solana-labs/solana/blob/cf779c63c/core/src/crds_gossip.rs#L96-L102

In order to exclude outdated values from the next pull-request, we need
to record the hash of values purged/overridden by the local push
messages, otherwise pull-responses will return outdated values back to
the node:
https://github.com/solana-labs/solana/blob/c1829dd00/core/src/crds_gossip_pull.rs#L447-L452

Additionally, gossip packets arrive and are processed out of order. So,
local pending push messages should be flushed *before* generating bloom
filters for pull-requests, preventing pull-responses returning the same
values back to the node itself. This requires flipping order of
generating pull and push messages:
https://github.com/solana-labs/solana/blob/cf779c63c/core/src/cluster_info.rs#L1757-L1762

Both above bugs cause redundant traffic and bandwidth waste in gossip
pull-responses.
2021-05-03 16:00:17 +00:00
541aa5ad85 tests: lamports -> lamports() (#16982) 2021-05-03 10:45:54 -05:00
744ac1535f tests: lamports -> ReadableAccount (#16983) 2021-05-03 10:45:15 -05:00
40c31f87e0 Fixing a broken link in the docs (#16975) 2021-05-03 10:04:55 -05:00
8fe2668e99 chore:(deps): bump @sentry/react from 6.3.4 to 6.3.5 in /explorer (#17002)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 6.3.4 to 6.3.5.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/6.3.4...6.3.5)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-03 10:42:39 +00:00
f9af7cde7e chore:(deps): bump @solana/web3.js from 1.7.1 to 1.9.0 in /explorer (#17001)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.7.1 to 1.9.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.7.1...v1.9.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-03 10:38:44 +00:00
43ccaf14b0 Update sysvars.md (#16998)
a typo
2021-05-03 03:36:26 -06:00
d7166c5778 Remove errant backslash (#16994) 2021-05-02 19:53:03 +00:00
c003f8e93c Corrected typo in calling between programs document (#16991)
* Corrected typo in calling between programs document

* corrected another typo

Co-authored-by: Srinivas Valekar <srinivasvalekar@Srinivass-MacBook-Pro.local>
2021-05-02 12:03:51 -06:00
da81ad0c41 feat: add support for slot update pubsub subscriptions (#16990) 2021-05-02 20:14:30 +08:00
8e561354d5 Improve readability of vote lockout processing (#16987)
* Improve readability of vote lockout processing

* clippy

* simplify comment

* feedback
2021-05-02 08:36:06 +00:00
643133b2c1 feat: add getSlotLeaders method (#16989) 2021-05-02 03:54:27 +00:00
18a04b0825 Docs/staking with exodus wallet (#16938)
* add Exodus as wallet that supports staking

* remove extra verbiage

* add binance & ftx. add note for these additions that you cannot select a validator with them

* Formatting

Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
2021-05-01 17:03:00 +00:00
555ed44e13 chore:(deps): bump @solana/spl-token-registry in /explorer (#16969)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.64 to 0.2.67.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.64...v0.2.67)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-01 14:41:46 +08:00
1fe131a5bb Readable account trait for stored account meta (#16690)
* ReadableAccount for StoredAccountMeta

* add test
2021-04-30 16:25:02 -05:00
1a9954f85b bank deposit checked_add error (#16917)
* bank deposit checked_add error

* add id

* rename variables

* rename error and metric
2021-04-30 16:22:17 -05:00
01308cd890 distribute_rent_to_validators checked_add_lamports unwrap (#16847)
* distribute_rent_to_validators checked_add_lamports unwrap

* make rent disappear on add failure

* add pubkey to message

* update message text

* don't store account that we failed to transfer to

* format
2021-04-30 16:19:20 -05:00
763c04adf3 lamports = -> .set_lamports() (#16980) 2021-04-30 21:17:05 +00:00
5e74cede4e lamports -> lamports() (#16979) 2021-04-30 21:03:08 +00:00
17e6bd579f Clean unrooted dropped banks (#16580) (#16911)
In a scenario where a bank is unrooted and dropped, any keys that exist
_only_ in that bank are now cleaned up.

This work was originally based on PR #15106.
2021-04-30 15:34:38 -05:00
1594a7f11a fix: change unlisted to unknown for unknown token accounts (#16981) 2021-04-30 15:21:47 -05:00
6f88aeac56 tests: .lamports= -> .set_lamports() (#16977)
* .lamports= -> .set_lamports()

* another

* fix

* another
2021-04-30 18:44:15 +00:00
0af84bb91e lamports= -> .set_lamports() (#16978) 2021-04-30 18:20:54 +00:00
ac87bc40ca tests: .lamports -> .lamports() (#16976) 2021-04-30 18:16:58 +00:00
3f982fcf65 account.rent_epoch private (#16974) 2021-04-30 12:16:44 -05:00
475b00c42f Add test to ensure data shreds with empty data would be inserted (#16955)
* Add test to ensure data shreds with empty data would be inserted

* Add error log statements for malformed shreds
2021-04-30 10:38:15 -05:00
c4943f3cb0 checked_sub_lamports (#16932) 2021-04-30 09:56:34 -05:00
e0ffcfd53c chore: bump jayson from 3.6.1 to 3.6.2 in /web3.js (#16972)
Bumps [jayson](https://github.com/tedeh/jayson) from 3.6.1 to 3.6.2.
- [Release notes](https://github.com/tedeh/jayson/releases)
- [Commits](https://github.com/tedeh/jayson/compare/v3.6.1...v3.6.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-30 10:07:36 +00:00
42202b6aef chore: bump buffer-layout from 1.2.0 to 1.2.1 in /web3.js (#16971)
Bumps [buffer-layout](https://github.com/pabigot/buffer-layout) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/pabigot/buffer-layout/releases)
- [Changelog](https://github.com/pabigot/buffer-layout/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pabigot/buffer-layout/commits/v1.2.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-30 09:59:57 +00:00
38302432e5 chore:(deps): bump @solana/web3.js from 1.7.0 to 1.7.1 in /explorer (#16968)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.7.0...v1.7.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-30 09:28:11 +00:00
c1c115e5ad chore: bump @babel/preset-env from 7.13.15 to 7.14.0 in /web3.js (#16967)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.13.15 to 7.14.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.0/packages/babel-preset-env)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-30 09:24:10 +00:00
9ca19a2928 chore: bump @babel/runtime from 7.13.17 to 7.14.0 in /web3.js (#16966)
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.13.17 to 7.14.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.0/packages/babel-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-30 09:15:48 +00:00
cf3b479bce chore: bump @babel/core from 7.13.16 to 7.14.0 in /web3.js (#16965)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.13.16 to 7.14.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.0/packages/babel-core)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-30 09:11:21 +00:00
dfb3db23f0 chore: bump @types/node from 15.0.0 to 15.0.1 in /web3.js (#16902)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.0.0 to 15.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-30 16:23:02 +08:00
545e037e38 Docs cleanup (#16964)
* Run lint:fix on docs

* Update dependencies

* Run prettier

* Run lint
2021-04-30 16:20:56 +08:00
3d98321b38 docs: fix copy-pasta breaking typo in getRecentBlockhash example 2021-04-30 04:03:15 +00:00
7e5964e339 Add Measure::this() (#16953)
Use `Measure::this()` when you have a function that you want to measure.
`this()` will start a new `Measure`, call your function, stop the
measure, then return the `Measure` object along with your function's
return value.
2021-04-29 17:48:33 -05:00
0ef5a9b1d7 explorer: add Bonfida Bots instructions (#16872)
* explorer: add Bonfida Bots instructions

* Update explorer/src/components/instruction/BonfidaBotDetails.tsx

Co-authored-by: Josh <josh.hundley@gmail.com>

* explorer: Bonfida Bot instructions fixes

Co-authored-by: Josh <josh.hundley@gmail.com>
2021-04-29 15:47:10 -07:00
5981399612 Distinguish max replayed and max observed vote (#16936) 2021-04-29 14:43:28 -07:00
94edd6140c checked_sub_lamports (#16918) 2021-04-29 21:34:44 +00:00
63c56b57a9 checked_sub_lamports with unwrap (#16922)
* checked_sub_lamports with unwrap

* avoid unwrap
2021-04-29 15:04:28 -05:00
8c651d2530 Change positioning (#16951)
* oops!
2021-04-29 12:54:18 -06:00
c9c94a7ef2 checked_sub_lamports (#16923) 2021-04-29 12:38:21 -05:00
ca7b36ad8f lamports -> lamports() (#16920) 2021-04-29 10:44:46 -05:00
59e19828ea set_lamports() (#16914) 2021-04-29 10:43:26 -05:00
23d67e4ac7 stretchy roots tracker (#16830)
* stretchy roots tracker

* rename hash to hash_set in tests

* update comment

* try 2 widths in test

* bool iter

* add assert

* helper function for bitfield insert/remove

* introduce RollingBitFieldTester

* another bool iter replacement

* map cleanup

* map to cloned
2021-04-29 09:11:28 -05:00
a2fbb9cfef fix: optional stake lockup field parameters (#16943)
* fix: optional stake lockup field parameters

* chore: update web3.js/src/stake-program.ts

Co-authored-by: Justin Starry <justin.m.starry@gmail.com>

* chore: prettier

Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
Co-authored-by: Justin Starry <justin@solana.com>
2021-04-29 22:04:33 +08:00
90641ad28b chore:(deps): bump @types/chai from 4.2.16 to 4.2.17 in /explorer (#16867)
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.16 to 4.2.17.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 21:01:08 +08:00
e03baeed2b chore: bump @types/chai from 4.2.16 to 4.2.17 in /web3.js (#16865)
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.16 to 4.2.17.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 21:00:58 +08:00
17f45fb75c chore:(deps): bump @types/jest from 26.0.22 to 26.0.23 in /explorer (#16869)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.22 to 26.0.23.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 21:00:52 +08:00
87c153bd37 chore:(deps): bump @testing-library/user-event in /explorer (#16950)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.1.6 to 13.1.8.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v13.1.6...v13.1.8)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 11:33:32 +00:00
07a4e8494f chore:(deps): bump @sentry/react from 6.3.1 to 6.3.4 in /explorer (#16949)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 6.3.1 to 6.3.4.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/6.3.1...6.3.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 11:23:18 +00:00
9c71a6c0c8 chore:(deps): bump react-chartjs-2 from 2.11.1 to 2.11.2 in /explorer (#16948)
Bumps [react-chartjs-2](https://github.com/reactchartjs/react-chartjs-2) from 2.11.1 to 2.11.2.
- [Release notes](https://github.com/reactchartjs/react-chartjs-2/releases)
- [Commits](https://github.com/reactchartjs/react-chartjs-2/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 11:08:45 +00:00
da020552fd chore:(deps): bump @types/node from 14.14.41 to 15.0.1 in /explorer (#16947)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.41 to 15.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 10:34:29 +00:00
31abedcbf7 chore:(deps): bump @testing-library/user-event in /explorer (#16946)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.1.5 to 13.1.6.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v13.1.5...v13.1.6)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 10:15:51 +00:00
2625dd733d chore:(deps): bump @solana/spl-token-registry in /explorer (#16945)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.62 to 0.2.64.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.62...v0.2.64)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 09:52:07 +00:00
97183774e8 chore: bump rollup from 2.45.2 to 2.46.0 in /web3.js (#16944)
Bumps [rollup](https://github.com/rollup/rollup) from 2.45.2 to 2.46.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.45.2...v2.46.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-29 09:48:57 +00:00
d6f30b7537 Refactor SignerSource to expose DerivationPath to other kinds of signers (#16933)
* One use statement

* Add stdin uri scheme

* Convert parse_signer_source to return Result

* A-Z deps

* Convert Usb data to Locator

* Pull DerivationPath out of Locator

* Wrap SignerSource to share derivation_path

* Review comments

* Check Filepath existence, readability in parse_signer_source
2021-04-29 01:42:21 -06:00
d640ac143b Add skip rate to solana validators 2021-04-28 22:43:06 -07:00
542d88929f Add getBlockProduction RPC method 2021-04-28 20:02:54 -07:00
cfc1cb1aee SDK: Factor out pubkey on-curve test to a helper 2021-04-28 20:10:19 -06:00
a7070a5ca7 set_lamports() (#16921) 2021-04-28 21:30:06 +00:00
8dc15f727c account.lamports -= (#16913) 2021-04-28 15:47:59 -05:00
21c75d9d29 lamports = -> set_lamports (#16919) 2021-04-28 15:39:54 -05:00
f533d3be77 Write account path impl ReadableAccount (#16779) 2021-04-28 15:29:22 -05:00
783bd79e9d Fixup rpc-endpoints (#16924) 2021-04-28 20:13:58 +00:00
82e11588a5 lamports -> lamports() (#16915) 2021-04-28 14:55:55 -05:00
b5d30846d6 Retry latest vote if expired (#16735) 2021-04-28 11:46:16 -07:00
9070191b8b stats on clean for removing roots (#16849)
* stats on clean for removing roots

* rename

* accumulate and swap metrics
2021-04-28 13:24:01 -05:00
9218b51de7 accountshareddata.executable is private (#16882) 2021-04-28 12:01:31 -05:00
77f1ffd84b Collect uncleaned pubkeys from all slots (#16786)
While working on another issue (#16580), the list of uncleaned pubkeys
returned from `remove_uncleaned_slots_and_collect_pubkeys_up_to_slot()`
did not include unrooted slots.  This meant that during cleaning,
unrooted slots would not have their pubkeys cleaned up properly.

Now, return all uncleaned pubkeys, regardless if the slot is rooted or
not.  Additionally, update the tests to have unrooted slots to ensure
this behavior.

This is part two of PR #16879, and originally based on PR #15106.
2021-04-28 10:57:42 -05:00
0aecc6033a Update rpc-endpoints.md (#16910) 2021-04-28 21:01:54 +05:30
f35453f838 AccountSharedData.set_executable() (#16876) 2021-04-28 15:25:58 +00:00
7f1c1fe6a4 Add banner to page (#16908) 2021-04-28 08:14:25 -06:00
a7a671b3aa AccountSharedData.set_executable() (#16881) 2021-04-28 14:07:43 +00:00
2021255f91 executable() (#16880) 2021-04-28 08:53:54 -05:00
30e83a4a3c private AccountSharedData.rent_epoch (#16878) 2021-04-28 08:53:21 -05:00
da3342759b private AccountSharedData.rent_epoch (#16877) 2021-04-28 08:52:20 -05:00
6381ee38eb reclaims unref accounts from index (#16838) 2021-04-28 08:50:38 -05:00
1864bc2080 write Option<AccountSharedData> (#16874)
* write Option<&AccountSharedData>

* add comment
2021-04-28 08:47:26 -05:00
25054bfd35 retains peer's contact-info when making pull requests (#16715)
ClusterInfo::new_pull_requests has to lookup contact-infos:
https://github.com/solana-labs/solana/blob/a1ef2bd74/core/src/cluster_info.rs#L1663-L1673

when it was already available when making pull requests:
https://github.com/solana-labs/solana/blob/a1ef2bd74/core/src/crds_gossip_pull.rs#L232
2021-04-28 13:19:12 +00:00
1eaff394da Refactor collect_uncleaned_pubkeys_to_slot() (#16879)
* Refactor `collect_uncleaned_pubkeys_to_slot()`

While working on another issue (#16580), I came across
`collect_unclean_pubkeys_to_slot()` and had difficulty understanding it.
Since the function does a few logically separate things, I split the
function up.  I also added documentation, removed an unused return value,
and renamed the functions to be more specific.

This commit is to split up an existing PR (#16786), where I had both this
aesthetic change _and_ a behavioral change.
2021-04-28 08:16:12 -05:00
1ac2a8cfa5 removes delayed crds inserts when upserting gossip table (#16806)
It is crucial that VersionedCrdsValue::insert_timestamp does not go
backward in time:
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/crds.rs#L67-L79

Otherwise methods such as get_votes and get_epoch_slots_since will
break, which will break their downstream flow, including vote-listener
and optimistic confirmation:
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L1197-L1215
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L1274-L1298

For that, Crds::new_versioned is intended to be called "atomically" with
Crds::insert_verioned (as the comment already says so):
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/crds.rs#L126-L129

However, currently this is violated in the code. For example,
filter_pull_responses creates VersionedCrdsValues (with the current
timestamp), then acquires an exclusive lock on gossip, then
process_pull_responses writes those values to the crds table:
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L2375-L2392

Depending on the workload and lock contention, the insert_timestamps may
well be in the past when these values finally are inserted into gossip.

To avoid such scenarios, this commit:
  * removes Crds::new_versioned and Crd::insert_versioned.
  * makes VersionedCrdsValue constructor private, only invoked in
    Crds::insert, so that insert_timestamp is populated right before
    insert.

This will improve insert_timestamp monotonicity as long as Crds::insert
is not called with a stalled timestamp. Following commits may further
improve this by calling timestamp() inside Crds::insert, and/or
switching to std::time::Instant which guarantees monotonicity.
2021-04-28 11:56:13 +00:00
1c95e2bbee chore: bump jayson from 3.5.2 to 3.6.1 in /web3.js (#16901)
Bumps [jayson](https://github.com/tedeh/jayson) from 3.5.2 to 3.6.1.
- [Release notes](https://github.com/tedeh/jayson/releases)
- [Commits](https://github.com/tedeh/jayson/compare/v3.5.2...v3.6.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-28 08:55:36 +00:00
aee30e304d chore: export is_on_curve() 2021-04-28 06:37:25 +00:00
b17d5eeaee moves cluster-info metrics to a separate module (#16883) 2021-04-28 02:04:49 +00:00
36574c30ef Add allowed-ip list to faucet (#16891) 2021-04-28 01:31:32 +00:00
b468ead1b1 uses current timestamp when flushing local pending push queue (#16808)
local_message_pending_push_queue is recording timestamps at the time the
value is created, and uses that when the pending values are flushed:
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L321
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/crds_gossip.rs#L96-L102

which is then used as the insert_timestamp when inserting values in the
crds table:
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/crds_gossip_push.rs#L183

The flushing may happen 100ms after the values are created (or even
later if there is a lock contention). This will cause non-monotone
insert_timestamps in the crds table (where time goes backward),
hindering the usability of insert_timestamps for other computations.

For example both ClusterInfo::get_votes and get_epoch_slots_since rely
on monotone insert_timestamps when values are inserted into the table:
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L1197-L1215
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L1274-L1298

This commit removes timestamps from local_message_pending_push_queue and
uses current timestamp when flushing the queue.
2021-04-28 00:15:11 +00:00
cac666d035 remote-wallet: Move Locator to its own module 2021-04-27 17:54:02 -06:00
4ce4f04c58 remote-wallet: derivation-path crate doesn't like empty trailing child indexes 2021-04-27 17:54:02 -06:00
3d12be29ec remote-wallet: Plumb Locator into RemoteWalletInfo 2021-04-27 17:54:02 -06:00
64fcb792c2 remote-wallet: Add helpers for locating remote wallets 2021-04-27 17:54:02 -06:00
722de942ca SDK: More conversion for DerivationPath 2021-04-27 17:54:02 -06:00
9b7120bf73 SDK: More conversions for Pubkey 2021-04-27 17:54:02 -06:00
bc31378797 Trim extra shred bytes in blockstore (#16602)
Strip the zero-padding off of data shreds before insertion into blockstore

Co-authored-by: Stephen Akridge <sakridge@gmail.com>
Co-authored-by: Nathan Hawkins <utsl@utsl.org>
2021-04-27 17:40:41 -05:00
283f587afe Enable multiple payers in accounts-cluster-bench (#16889)
* Enable multiple payer keypairs

* Suppress tx creation if batch size == 0

* Suppress logs when waiting to create txs

* Double airdrop threshold to prevent stall when closing accounts
2021-04-27 21:26:16 +00:00
9b3a59f030 Retain alloc'd and updated data in cpi (#16850) 2021-04-27 13:36:42 -07:00
1bd623cd15 private AccountSharedData.rent_epoch (#16844) 2021-04-27 13:51:13 -05:00
2f5102587c owner() lifetime issue (#16875) 2021-04-27 12:57:47 -05:00
8f56c116d7 tests: lamports += to checked_add (#16842) 2021-04-27 10:23:07 -05:00
d533f77301 bank.withdraw uses checked_sub_lamports (#16848)
* bank.withdraw uses checked_sub_lamports

* retain previous codepath for error

* map_err from clippy
2021-04-27 09:58:41 -05:00
69bfbf9e98 AccountSharedData.set_executable (#16836) 2021-04-27 09:56:50 -05:00
3887169db0 lamports += to checked_add (#16841) 2021-04-27 09:56:18 -05:00
47ca7063f2 rootstracker.remove returns previous state (#16831) 2021-04-27 09:15:44 -05:00
3fdbaefaa6 tests: lamports -= to checked_sub (#16843) 2021-04-27 09:12:48 -05:00
998cba74b5 AccountSharedData.executable() (#16835) 2021-04-27 09:12:17 -05:00
4e7e675c07 lamports += -> checked_add_lamports (#16791) 2021-04-27 09:11:35 -05:00
81402ee7f5 pass &Pubkey through account storage, slot clean code to reduce copies (#16778)
* &Pubkey

* use trait to pass &Hash or Hash

* use impl Borrow<Hash> instead of trait

* remove old code line commented out
2021-04-27 09:10:06 -05:00
3b8d6b59fb records hash of values purged by expired pull-responses (#16800)
process_pull_responses should record hash of values purged by expired
responses (as well as unexpired ones):
https://github.com/solana-labs/solana/blob/c1829dd00/core/src/crds_gossip_pull.rs#L385-L387

otherwise, these values are not excluded from following pull-requests
(from likely different nodes):
https://github.com/solana-labs/solana/blob/c1829dd00/core/src/crds_gossip_pull.rs#L447-L452

and would waste bandwidth should they be included in subsequent
pull-responses.
2021-04-27 12:06:49 +00:00
0f3ac51cf1 limits to data_header.size when combining shreds' payloads (#16708)
Shredder::deshred is ignoring data_header.size when combining shreds' payloads:
https://github.com/solana-labs/solana/blob/37b8587d4/ledger/src/shred.rs#L940-L961

Also adding more sanity checks on the alignment of data shreds indices.
2021-04-27 12:04:44 +00:00
68d5aec55b chore:(deps): bump @types/react from 17.0.3 to 17.0.4 in /explorer (#16868)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 17.0.3 to 17.0.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-27 09:22:57 +00:00
9606126543 chore:(deps): bump @solana/web3.js from 1.5.0 to 1.7.0 in /explorer (#16866)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.5.0 to 1.7.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.5.0...v1.7.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-27 09:15:29 +00:00
e5d1037fda chore: bump flowgen from 1.14.0 to 1.14.1 in /web3.js (#16864)
Bumps flowgen from 1.14.0 to 1.14.1.

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-27 09:10:05 +00:00
ef9a931567 chore: bump @types/node from 14.14.41 to 15.0.0 in /web3.js (#16863)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.41 to 15.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-27 09:05:59 +00:00
374fee2953 chore:(deps): bump @solana/spl-token-registry in /explorer (#16822)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.60 to 0.2.62.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.60...v0.2.62)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-27 15:01:43 +08:00
f93565da6f Compress account data by default 2021-04-27 04:56:56 +00:00
59fc33635a Add getVoteAccounts RPC method parameter to restrict results to a single vote account 2021-04-27 04:27:15 +00:00
b66a68975b block-production subcommand now uses SlotHistory sysvar when possible 2021-04-26 21:00:16 -07:00
3af8cb0150 Fix limit-ledger-size syntax (#16856) 2021-04-27 03:35:35 +00:00
c2becbc0a8 solana leader-schedule -um works again 2021-04-26 16:29:35 -07:00
5eb5d9b2f5 Update bpf loader info on native-programs docs (#16840)
* Update bpf loader info on native-programs docs

* Link to program deployment docs
2021-04-26 20:09:44 +00:00
603872685d private AccountSharedData.owner (#16760)
* private AccountSharedData.owner

* fix perf test
2021-04-26 14:59:17 -05:00
c54daa8009 feat: introduce getInflationReward to connection (#16807)
* feat: introduce getInflationReward to connection

* fix: only run getInflationReward test in mock mode
2021-04-26 11:09:40 -07:00
cf779c63c5 Add ALL support to withdraw-stake subcommand 2021-04-26 11:03:37 -07:00
9706512115 removes old runtime feature gates in gossip and turbine (#16633) 2021-04-26 17:12:02 +00:00
f2ab0384e4 owner -> owner() (#16783) 2021-04-26 17:06:40 +00:00
aeff911c93 owner -> owner() (#16784) 2021-04-26 10:40:11 -05:00
c44812fa71 feat: introduce support for custom HTTP headers (#16599)
* feat: introduce support for custom http headers

* feat: add fetch middleware
2021-04-26 08:35:07 -07:00
6d160768d7 delete vest program (#16795) 2021-04-26 08:50:46 -05:00
97812570e7 chore:(deps): bump @sentry/react from 6.3.0 to 6.3.1 in /explorer (#16821)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/6.3.0...6.3.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-26 10:59:55 +00:00
4733baf511 chore: bump jayson from 3.4.4 to 3.5.2 in /web3.js (#16820)
Bumps [jayson](https://github.com/tedeh/jayson) from 3.4.4 to 3.5.2.
- [Release notes](https://github.com/tedeh/jayson/releases)
- [Commits](https://github.com/tedeh/jayson/compare/v3.4.4...v3.5.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-26 10:55:25 +00:00
aac37e5eee chore: bump eslint-config-prettier from 8.2.0 to 8.3.0 in /web3.js (#16819)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.2.0 to 8.3.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.2.0...v8.3.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-26 10:52:03 +00:00
e842a63dc5 chore:(deps): bump @project-serum/serum in /explorer (#16818)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.33 to 0.13.34.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-26 10:42:28 +00:00
c608efc823 chore: bump eslint from 7.24.0 to 7.25.0 in /web3.js (#16817)
Bumps [eslint](https://github.com/eslint/eslint) from 7.24.0 to 7.25.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.24.0...v7.25.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-26 10:35:37 +00:00
559d3d8f49 Add new logo to Explorer repo (#16813) 2021-04-25 14:26:48 -06:00
8ce4a8d6ab Annotate clock constants with computed values for quick refeerence (#16812) 2021-04-25 22:05:00 +08:00
ec37a843a4 docs: getInflationReward rpc output fields should be in lower camel case (#16802) 2021-04-24 19:13:02 +00:00
c1829dd00b Show last vote/root behind distance in solana validators output 2021-04-24 02:57:57 +00:00
2420b280a9 Update deprecated commitments (#16794) 2021-04-23 18:32:28 -06:00
d9dcd28d82 Ignore racy test_load_account_and_purge_race_without_retry 2021-04-23 23:17:56 +00:00
ca14c18998 owner -> owner() (#16782) 2021-04-23 22:49:47 +00:00
1a4a7059af owner -> owner() (#16785) 2021-04-23 15:59:13 -05:00
1500011fc6 get_packed_len() now correctly handles u32/i32 types 2021-04-23 13:39:42 -07:00
48c07d32f0 WritableAccount.add/subtract_lamports (#16750)
* add/sub lamports

* make add/sub return Result

* sample replacements

* cleanup

* fix up a few tests as examples

* move enum, cleanup, impl from

* fmt

* cleanup

* add lamports.rs
2021-04-23 20:20:48 +00:00
be29568318 runtime: checked math for Bank::withdraw 2021-04-23 20:13:35 +00:00
dcf2d84b24 refactor complicated 'len' (#16777) 2021-04-23 18:36:49 +00:00
04e6aebf35 .owner = X -> .set_owner(X) (#16759) 2021-04-23 18:26:33 +00:00
fb0b76c1f3 account.owner = X -> account.set_owner(X) (#16754) 2021-04-23 12:34:22 -05:00
63436cc2bf Disable flaky test_poh_service (#16772) 2021-04-23 12:14:11 -05:00
da58f20a99 Restore text wrapping (#16776) 2021-04-23 17:03:21 +00:00
7602911f9a read_only_cache remove updates cache size (#16742) 2021-04-23 12:00:17 -05:00
1cc9a1c0eb log roots range metric (#16636)
* log roots range metric

* rename
2021-04-23 16:09:39 +00:00
2c82f2154d retains crds values if the origin is still active (#16576)
Local timestamps are updated for records associated with a pubkey if the
origin is still active:
https://github.com/solana-labs/solana/blob/c8ed14c64/core/src/crds.rs#L301-L311

However this is done inconsistently on some gossip paths (pull requests
and pull responses) but not all (e.g. push messages). Additionally
update_record_timestamp is inefficient since there can be ~800 values
associated with each pubkey.

This commit updates records timestamps only on contact-infos; and,
instead utilizes origin's timestamp when purging old values.
2021-04-23 15:14:49 +00:00
4beb2f8ddb chore:(deps): bump @testing-library/jest-dom in /explorer (#16766)
Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.11.10 to 5.12.0.
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v5.11.10...v5.12.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-23 22:51:10 +08:00
96d21335e1 .owner -> .owner() (#16758) 2021-04-23 09:35:55 -05:00
5591cd6ef3 .owner -> .owner() (#16757)
* .owner -> .get_owner()

* use
2021-04-23 09:35:09 -05:00
6c5b7ecf90 account.owner = X -> account.set_owner(X) (#16756) 2021-04-23 09:34:28 -05:00
87e2e07d34 AccountSharedData.copy_into_owner_from_slice (#16755) 2021-04-23 09:34:08 -05:00
91be2903da Reduce account index lookups during clean (#16689)
* reduce account index lookups in clean

* rename

* rename enum

* hold locks during removal from zero pubkey list

* merge with zero lamport fix

* tests
2021-04-23 09:33:14 -05:00
03194145c0 removes first_coding_index from erasure recovery code (#16646)
first_coding_index is the same as the set_index and is so redundant:
https://github.com/solana-labs/solana/blob/37b8587d4/ledger/src/blockstore_meta.rs#L49-L60
2021-04-23 12:00:37 +00:00
f59fe41abf chore:(deps): bump @solana/spl-token-registry in /explorer (#16765)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.59 to 0.2.60.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.59...v0.2.60)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-23 09:01:41 +00:00
e7fcb77b49 chore: bump typedoc from 0.20.35 to 0.20.36 in /web3.js (#16764)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.20.35 to 0.20.36.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.20.35...v0.20.36)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-23 08:59:51 +00:00
e9a616cfc2 fix reference to Rust Restrictions section (#16763) 2021-04-23 14:40:03 +08:00
084997c4f0 hotfix: avoid passing along additionalSignatures as an option to getConfirmedSignaturesForAddress2 (#16734) 2021-04-22 20:27:17 -07:00
c217ee3a00 docs: fix formatting issue (#16761) 2021-04-23 09:41:20 +08:00
75b8434b76 Add TPU client for sending txs to the current leader tpu port (#16736)
* Add TPU client for sending txs to the current leader tpu port

* Update tpu_client.rs
2021-04-23 09:35:12 +08:00
fc12841d95 Readonlyaccounts (#16743)
* lamports -> lamports()

* format
2021-04-22 20:04:55 +00:00
636b5987af Update getLeaderSchedule options (#16749) 2021-04-22 19:27:30 +00:00
556997666c chore:(deps): bump @sentry/react from 6.2.5 to 6.3.0 in /explorer (#16702)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 6.2.5 to 6.3.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/6.2.5...6.3.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-22 12:10:37 -07:00
739f0698ab clean read_only_cache in the bg (#16722)
* clean read_only_cache in the bg

* reset lru_index

* cleanup

* cleanup

* drop for read only cache

* join bg thread

* reuse existing lru vec

* simplify reserve logic
2021-04-22 13:59:58 -05:00
333998d008 .lamports = <number> -> .set_lamports(<number>) (#16746) 2021-04-22 18:56:47 +00:00
8a6b80095e Set lamports (#16747)
* lamports = -> set_lamports()

* .lamports = X -> .set_lamports(X)
2021-04-22 13:53:06 -05:00
8d9d6b62d9 use cheaper account get (#16682) 2021-04-22 12:54:08 -05:00
be4df39a4c Remove unactivated ristretto syscall (#16727) 2021-04-22 09:29:42 -07:00
639650ed2c chore:(deps): bump @types/classnames from 2.2.11 to 2.3.1 in /explorer (#16704)
Bumps [@types/classnames](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/classnames) from 2.2.11 to 2.3.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/classnames)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-22 23:07:09 +08:00
13dfc15e84 chore:(deps): bump @solana/spl-token-registry in /explorer (#16738)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.58 to 0.2.59.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.58...v0.2.59)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-22 23:06:51 +08:00
f4214637a9 program-test: Add large bootstrap stake for realistic warmups (#16739) 2021-04-22 16:44:54 +02:00
517a30e83d explorer: downgrade nodejs version in travis (#16740) 2021-04-22 22:27:50 +08:00
26fa71a7c1 chore: bump flowgen from 1.13.0 to 1.14.0 in /web3.js (#16737)
Bumps flowgen from 1.13.0 to 1.14.0.

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-22 08:59:59 +00:00
b22c13dcd7 Update secp instruction link in docs (#16729) 2021-04-21 21:33:05 -07:00
b8b54567b1 Clean up "APR" language around inflation rewards 2021-04-21 19:02:03 -07:00
123e0bdba7 don't iterate slot_list if zero-lamport (#16678) 2021-04-21 20:38:48 -05:00
6004c0abf5 getLeaderSchedule now supports filtered results based on validator identity 2021-04-21 17:59:26 -07:00
3f92abedd5 Make metrics tests independent of RUST_LOG env var (#16710)
Previously, running the tests with RUST_LOG=none would fail, because the
env logger would set its filter level to reject all log messages, and
incrementing a counter only happens if the global logger has at least
the specified log level. Having the tests behave differently when
RUST_LOG is set is surprising, they should be self-contained.

Nix' buildRustPackage sets RUST_LOG="" to make the build logs less
verbose. I have trouble packaging Solana for Nix because of this, and I
believe making the tests independent of the environment is a good
solution for this.
2021-04-21 18:14:49 -06:00
1a658c7f31 Allow SetUpgradeAuthority instruction in CPI calls (#16676)
* feat: allow SetAuthority in CLI calls

* chore: clippy match_like_matches_macro

* chore: clippy match_like_matches_macro

* chore: rename CLI to CPI

* chore: move check for cpi authorised instruction to syscalls

* chore: add set_upgrade_authority cpi test

* chore: assert upgrade authority was changed

* feat: gate set_upgrade_authority via cpi with a feature

* chore: move feature to the end of the list

* chore: remove white spaces

* chore: remove white spaces

* chore: update comment to rerun build
2021-04-22 00:06:59 +01:00
91b6888e15 verify_pubkey() now takes a ref 2021-04-21 14:43:49 -07:00
4c94f8933f Ingest votes from gossip into fork choice (#16560) 2021-04-21 14:40:35 -07:00
63957f0677 CLI: Make pay subcommand a proper alias of transfer 2021-04-21 21:21:06 +00:00
ba9a502e7e Add --seed support to delegate-stake and withdraw-stake commands 2021-04-21 20:25:01 +00:00
a1ef2bd74d Ignore flaky test_pull_request_time_pruning 2021-04-21 12:07:36 -07:00
69cbad0869 some ReadableAccount changes (#16688)
* some ReadableAccount changes

* deref
2021-04-21 12:20:37 -05:00
189d2121e6 simplify do_shrink_slot_stores, delay/reduce account clone (#16691) 2021-04-21 11:17:38 -05:00
37b8587d4e expands number of erasure coding shreds in the last batch in slots (#16484)
Number of parity coding shreds is always less than the number of data
shreds in FEC blocks:
https://github.com/solana-labs/solana/blob/6907a2366/ledger/src/shred.rs#L719

Data shreds are batched in chunks of 32 shreds each:
https://github.com/solana-labs/solana/blob/6907a2366/ledger/src/shred.rs#L714

However the very last batch of data shreds in a slot can be small, in
which case the loss rate can be exacerbated.

This commit expands the number of coding shreds in the last FEC block in
slots to: 64 - number of data shreds; so that FEC blocks are always 64
data and parity coding shreds each.

As a consequence of this, the last FEC block has more parity coding
shreds than data shreds. So for some shred indices we will have a coding
shred but no data shreds. This should not cause any kind of overlapping
FEC blocks as in:
https://github.com/solana-labs/solana/pull/10095
since this is done only for the very last batch in a slot, and the next
slot will reset the shred index.
2021-04-21 12:47:50 +00:00
ba2be0ca34 chore: bump @babel/register from 7.13.14 to 7.13.16 in /web3.js (#16705)
Bumps [@babel/register](https://github.com/babel/babel/tree/HEAD/packages/babel-register) from 7.13.14 to 7.13.16.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.16/packages/babel-register)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-21 09:30:27 +00:00
1e6fc5b3d1 chore: bump @babel/runtime from 7.13.10 to 7.13.17 in /web3.js (#16703)
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.13.10 to 7.13.17.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.17/packages/babel-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-21 09:18:20 +00:00
29852de4f7 chore: bump @babel/core from 7.13.15 to 7.13.16 in /web3.js (#16701)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.13.15 to 7.13.16.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.16/packages/babel-core)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-21 09:05:19 +00:00
053120e04c Initialize non-bootstrap ndoes with faucet address 2021-04-21 01:48:41 -06:00
51b748408c Pass limit-ledger-size value 2021-04-21 01:48:41 -06:00
0924c2d070 Add port and gossip options to solana-test-validator (#16696) 2021-04-21 02:40:52 +00:00
9852572eb9 increase rolling slot width to 4M (#16583) 2021-04-20 21:18:15 -05:00
bb2b4c7e0b Update float docs (#16695) 2021-04-20 17:28:30 -07:00
05fa7250b0 Selectable jit in program-test (#16685) 2021-04-20 15:02:54 -07:00
34addee882 getVoteAccounts: Limit the length of the epoch_credits array 2021-04-20 14:42:28 -07:00
03f7b251b8 ReadableAccount.data returns slice (#16686)
* ReadAbleAccount.data returns slice

* more slice fixup

* more slice

* slice
2021-04-20 16:41:16 -05:00
08d5253651 Enforce host aligned memory for program regions (#16590) 2021-04-20 11:07:30 -07:00
8e69dd42c1 Add non-default repair nonce values (#16512)
* Track outstanding nonces in repair

* Rework outstanding requests to use lru cache and randomize nonces

Co-authored-by: Carl <carl@solana.com>
2021-04-20 09:37:33 -07:00
36e11998c7 read only accounts cache uses accurate size representation (#16610)
* read ony accounts cache uses accurate size representation

* add comment and test
2021-04-20 09:58:01 -05:00
bc90e04e64 uses current local timestamp when recording purged values
CrdsGossipPull.purged_values is meant to record recently purged values
so that they are excluded from imminent pull requests, until the entire
cluster have synced to the updated value:
https://github.com/solana-labs/solana/blob/c826cddbb/core/src/crds_gossip_pull.rs#L449-L454

However, VersionedCrdsValue.local_timestamp represents the local time
when the value was last updated, and given that crds values may have
different timeouts based on stake, it does not necessarily represent how
recently the value was purged:
https://github.com/solana-labs/solana/blob/c826cddbb/core/src/crds.rs#L75-L76

As such, recording current local timestamp when purging values is more
appropriate. Additionally, purge_purged assumes that the purge_values is
sorted in timestamps when draining the old ones; which is not true if
those timestamps are VersionedCrdsValue.local_timestamp:
https://github.com/solana-labs/solana/blob/c826cddbb/core/src/crds_gossip_pull.rs#L563-L571
2021-04-20 11:21:00 +00:00
f91de6a84d CLI: Limit stake-history output by default 2021-04-20 10:15:25 +00:00
97f6b090b9 chore:(deps): bump @solana/web3.js from 1.4.0 to 1.5.0 in /explorer (#16669)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.4.0...v1.5.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-20 18:07:38 +08:00
2c2e7e4cf9 chore:(deps): bump @testing-library/user-event in /explorer (#16668)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.1.4 to 13.1.5.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v13.1.4...v13.1.5)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-20 09:16:06 +00:00
b32ad29071 chore:(deps): bump @solana/spl-token-registry in /explorer (#16667)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.57 to 0.2.58.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.57...v0.2.58)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-20 09:03:29 +00:00
12678a819d docs: Expand native program descriptions 2021-04-20 08:50:54 +00:00
d575450ef0 docs: Flesh out address verification in integraion guide 2021-04-20 08:50:54 +00:00
a7e65c0034 RPC: use finalized as default pubsub commitment level (#16659)
* RPC: use finalized as default pubsub commitment level

* update docs

* Fix tests
2021-04-20 08:19:54 +00:00
c8b474cd0b Send votes to next leader's TPU instead of our TPU 2021-04-20 00:38:21 -07:00
a19c3ba5b0 chore: bump @types/node from 14.14.37 to 14.14.41 in /web3.js (#16614)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.37 to 14.14.41.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-20 13:37:49 +08:00
b20314738f chore:(deps): bump @solana/web3.js from 1.2.7 to 1.4.0 in /explorer (#16632)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.2.7 to 1.4.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.2.7...v1.4.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-20 13:37:38 +08:00
01786f684e Remove unwrap (#16652) 2021-04-19 20:17:56 -07:00
30c95d38a5 feat: support commitment in getConfirmed methods 2021-04-19 20:49:20 -06:00
a99ee15a85 fix: add Finality type for confirmed+ 2021-04-19 20:49:20 -06:00
568438aa6f Prefix current validators with nbsp for easier sed-ing 2021-04-19 16:31:23 -07:00
f14cf3ed1a Add --number argument 2021-04-19 16:31:23 -07:00
1824b5a2ce Print the header as a footer when there's a large number of validators to show 2021-04-19 16:31:23 -07:00
818c3198c1 Add line numbers to solana validators output 2021-04-19 16:31:23 -07:00
b66faf7e80 Add --sort argument to solana validators 2021-04-19 16:31:23 -07:00
185bbf2db5 Wrap derivation_path::DerivationPath (#16609)
* Replace custom DerivationPath impl

* Add method to parse full-path from str with hardening

* Convert Bip44 to trait

* Hoist more work on derivation-path

* Privatize Bip44 trait
2021-04-19 20:57:43 +00:00
2409bb18f3 Remove unwrap from bpf_loader serialization (#16645) 2021-04-19 13:30:31 -07:00
1b63bdaf44 solana validators: Restore the meaning of "credits" in the JSON output 2021-04-19 13:01:40 -07:00
0b84440e0f cargo-install-all.sh: on Mac OS X, use greadlink instead of readlink (#16642)
* on Mac OS X, use greadlink when building from source

* this is a cleaner way to do it

* we want to keep the cargo install comment at the top of the script
2021-04-19 19:05:46 +00:00
f5f06904c3 solana validators now shows current epoch credits instead of lifetime credits 2021-04-19 10:19:30 -07:00
4aa753ff01 rename threads: 15 char limit (#16625) 2021-04-19 12:16:58 -05:00
9dfcb921cf Refactoring: Move KeyedAccounts to InvokeContext (#15410)
Collects all parametric occurrences and the construction of keyed_accounts and puts them into InvokeContext.
2021-04-19 18:48:48 +02:00
015bc034a5 improve failing assert (#16581) 2021-04-19 08:55:01 -05:00
1e638c1371 chore:(deps): bump @solana/spl-token-registry in /explorer (#16631)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.56 to 0.2.57.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.56...v0.2.57)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-19 10:25:25 +00:00
376d0bf063 chore:(deps): bump @testing-library/user-event in /explorer (#16630)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.1.3 to 13.1.4.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v13.1.3...v13.1.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-19 10:25:19 +00:00
b06e93fe5b Increase test timeout 2021-04-18 20:55:02 -07:00
a911ae00ba clippy 2021-04-18 20:55:02 -07:00
3b79b21e9d Upgrade to Rust 1.51.0 2021-04-18 20:55:02 -07:00
cfe7a4340b adds a shrink policy to the recycler without an allocation limit
https://github.com/solana-labs/solana/pull/15320
added an allocation limit to the recycler, which has been the source of a
number of bugs. For example the code bellow panics by simply cloning packets:

    const RECYCLER_LIMIT: usize = 8;
    let recycler = PacketsRecycler::new_with_limit("", RECYCLER_LIMIT as u32);
    let packets = Packets::new_with_recycler(recycler.clone(), 1).unwrap();
    for _ in 0..RECYCLER_LIMIT {
        let _ = packets.clone();
    }
    Packets::new_with_recycler(recycler.clone(), 1);

The implementation also fails to account for instances where objects are
consumed. Having the allocation limit in the recycler also seems out of place,
as higher level code has better context to impose allocation limits (e.g. by
using bounded channels to rate-limit), whereas the recycler would be simpler
and more efficient if it just do the recycling.

This commit:
* Reverts https://github.com/solana-labs/solana/pull/15320
* Adds a shrink policy to the recycler without an allocation limit.
2021-04-18 19:29:24 +00:00
e405747409 Revert "Add limit and shrink policy for recycler (#15320)"
This reverts commit c2e8814dce.
2021-04-18 19:29:24 +00:00
6907a2366e Remove unnecessary clone 2021-04-17 10:23:13 -07:00
5399faaf53 Documentation typo for langauge 2021-04-17 07:53:21 -07:00
7e01adc050 chore: bump eslint-plugin-prettier from 3.3.0 to 3.4.0 in /web3.js (#16619)
Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-17 14:46:35 +00:00
4eac6cf366 chore: bump @typescript-eslint/parser from 4.21.0 to 4.22.0 in /web3.js (#16618)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.21.0 to 4.22.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.22.0/packages/parser)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-17 14:32:04 +00:00
7426861817 chore: bump mockttp from 1.2.0 to 1.2.2 in /web3.js (#16617)
Bumps [mockttp](https://github.com/httptoolkit/mockttp) from 1.2.0 to 1.2.2.
- [Release notes](https://github.com/httptoolkit/mockttp/releases)
- [Commits](https://github.com/httptoolkit/mockttp/compare/v1.2.0...v1.2.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-17 14:18:35 +00:00
aa64f13172 chore: bump @types/sinon from 9.0.11 to 10.0.0 in /web3.js (#16615)
Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 9.0.11 to 10.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-17 14:05:15 +00:00
a6b197adfe chore: bump eslint-config-prettier from 8.0.0 to 8.2.0 in /web3.js (#16613)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.0.0 to 8.2.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.0.0...v8.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-17 13:44:35 +00:00
87715b59a1 chore: bump @types/secp256k1 from 4.0.1 to 4.0.2 in /web3.js (#16612)
Bumps [@types/secp256k1](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/secp256k1) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/secp256k1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-17 13:38:29 +00:00
48d836b8e2 chore: bump @typescript-eslint/eslint-plugin in /web3.js (#16531)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.21.0 to 4.22.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.22.0/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-17 21:25:17 +08:00
cd5398a889 chore: bump rollup from 2.44.0 to 2.45.2 in /web3.js (#16532)
Bumps [rollup](https://github.com/rollup/rollup) from 2.44.0 to 2.45.2.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.44.0...v2.45.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-17 21:25:09 +08:00
c94a5a170b chore: bump eslint from 7.23.0 to 7.24.0 in /web3.js (#16533)
Bumps [eslint](https://github.com/eslint/eslint) from 7.23.0 to 7.24.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.23.0...v7.24.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-17 21:25:01 +08:00
52f4b96a80 Move derivation path into sdk (#16603)
* Move DerivationPath to sdk

* Remove eprintln
2021-04-16 22:03:24 +00:00
6444f0e57b clap-utils: Add explicit schemes for ask and file SignerSources 2021-04-16 13:56:12 -06:00
5d1ef5d01d clap-utils: Use uriparse crate to parse SignerSource 2021-04-16 13:56:12 -06:00
c5ab3ba6f1 clap-utils: Reduce SignerSource's visibility 2021-04-16 13:56:12 -06:00
09dcc9ea04 clap-utils: Rename KeypairUrl to SignerSource 2021-04-16 13:56:12 -06:00
bb24318ef0 Document shreds (#16514)
No functionality changes from this commit
2021-04-16 14:04:46 -05:00
285f3c9d56 Feature-gate hash-based duplicate transaction check 2021-04-16 18:51:18 +00:00
7e3db1dedb feat: add filters to getProgramAccounts and getParsedProgramAccounts (#16448)
* feat: add filters to getProgramAccounts and getParsedProgramAccounts

* fix: documentation edits

* fix: make connection interface match existing interface
2021-04-16 10:18:19 -07:00
c63a208488 hotfix: don't report to sentry for custom clusters on token account section (#16597) 2021-04-16 10:09:05 -07:00
a4474f1d94 fix: deprecate getTotalSupply 2021-04-16 10:33:42 -06:00
fe4c39a26a fix: deprecate getConfirmedSignaturesForAddress 2021-04-16 10:33:42 -06:00
f37c05adeb feat: add method to return a confirmed block with signatures only 2021-04-16 10:33:42 -06:00
4ac17b1ee3 Revert "web3.js: deprecate getTotalSupply and getConfirmedSignaturesForAddress (#16534)" (#16594)
This reverts commit 59268b8629.
2021-04-16 10:11:34 -06:00
d747614b27 Account for possibility of cache flush in load() (#15454)
* Account for possibility of cache flush in load()

* More cleaning

* More cleaning

* Remove unused method and some comment cleaning

* Fix typo

* Make the detected impossible purge race panic()!

* Finally revert to original .expect()

* Fix typos...

* Add assertion for max_root for easier reasoning

* Reframe races with LoadHint as possible opt.

* Fix test

* Make race bug tests run longer for less flaky

* Delay the clone-in-lock slow path even for RPC

* Make get_account panic-free & add its onchain ver.

* Fix rebase conflicts...

* Clean up

* Clean up comment

* Revert fn name change

* Fix flaky test...

* fmt...

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-04-17 00:23:32 +09:00
6dab20812e chore:(deps): bump @types/node from 14.14.39 to 14.14.41 in /explorer (#16593)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.39 to 14.14.41.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-16 09:07:02 +00:00
013875e787 Fix instruction validation for parsed memo instructions (#16591) 2021-04-16 05:04:06 +00:00
59268b8629 web3.js: deprecate getTotalSupply and getConfirmedSignaturesForAddress (#16534)
* feat: add method to return a confirmed block with signatures only

* fix: deprecate getConfirmedSignaturesForAddress

* fix: deprecate getTotalSupply
2021-04-16 03:52:08 +00:00
974e6dd2c1 Deprecate "confirmed" RpcClient methods (#16520)
* Remove obsolete client methods

* Deprecate GetConfirmed client methods

* Rename Confirmed config structs, with appropriate deprecation

* Fixup client apps

* Map RpcRequest to deprecated when targeting older nodes
2021-04-15 17:00:14 -06:00
ba77e48c12 Don't parse uninitialized system/nonce accounts (#16584) 2021-04-15 16:32:29 -06:00
a535c0e129 Rotate CODECOV_TOKEN 2021-04-15 16:07:04 +00:00
c8ed14c647 docs: Fix typo in program deploy instructions (#16572) 2021-04-15 13:56:19 +00:00
c826cddbb5 chore:(deps): bump @testing-library/user-event in /explorer (#16568)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.1.2 to 13.1.3.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v13.1.2...v13.1.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-15 09:15:57 +00:00
bcb1b67500 chore:(deps): bump @types/node from 14.14.37 to 14.14.39 in /explorer (#16567)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.37 to 14.14.39.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-15 08:59:07 +00:00
492b3a91bd chore:(deps): bump @solana/spl-token-registry in /explorer (#16566)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.55 to 0.2.56.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.55...v0.2.56)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-15 08:54:19 +00:00
9dfe545820 Remove colo nodes (#16546) 2021-04-15 00:13:07 -07:00
7dfb51c0b4 Cli: move airdrop to rpc requests (#16557)
* Add recent_blockhash to requestAirdrop

* Move tx confirmation to separate method

* Add RpcClient airdrop methods

* Request cli airdrop via RpcClient

* Pass optional faucet_addr into TestValidator and fix tests

* Update client/src/rpc_client.rs

Co-authored-by: Michael Vines <mvines@gmail.com>

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-04-15 06:25:23 +00:00
76ce28c723 docs: freshen and clarify rent-exempt dev description 2021-04-15 04:13:57 +00:00
1f29031b9d fix transaction spelling (#16558) 2021-04-14 20:02:55 -06:00
4905bb552b Add new logo (#16556) 2021-04-14 19:02:42 -06:00
e61b4b7d70 dl-utils: use wide_msg everywhere for truncation on narrow terminals 2021-04-14 23:50:42 +00:00
143496ccba Explorer: hide irrelevant delegation information displayed for inactive stake (#16467)
* fix: hide irrelevant delegation information displayed for inactive stake

* fix: when inactive_stake equals delegated_stake, display as initialized

* refactor: clean up logic

* fix: reverse logic on showDelegation

* fix: change copy to not delegated
2021-04-14 16:26:31 -07:00
39eddfd161 explorer: Token mint histories (token balance and token instructions tabs) (#15861)
* feat: refactor and introduce balances and instructions tabs for mints

* fix: refactor instruction utilities into common file

* refactor: move transaction history components into one spot

* chore: minor cleanup

* fix: show only token instructions

* fix: use better naming for slugs and paths

* feat: refactor and work on transaction status

* feat: show token transfer details

* fix: format code and remove some extra spaces

* fix: exclude non-mint transfers

* feat: introduce react-moment and reorganize history tables

* feat: reintroduce status columns and reorganize columns

* fix: remove ts-ignore

* feat: refactor history card components

* fix: remove detailed history provider

* fix: filter instructions and inner instructions based on mint

* fix: use better key and report parse error

* fix: remove double spacing

* feat: batch transaction map batches

* fix: remove debug code

* fix: pass proper signatureInfo and reduce batch size to 10
2021-04-14 16:22:40 -07:00
d92721aab9 uses timeouts based on stake for filtering pull responses (#16549)
filter_pull_responses is using default timeout when discarding pull
responses (except for ContactInfo):
https://github.com/solana-labs/solana/blob/f804ce63c/core/src/crds_gossip_pull.rs#L349-L350

But purging code uses timeouts based on stake:
https://github.com/solana-labs/solana/blob/f804ce63c/core/src/cluster_info.rs#L1867-L1870

So the crds value will not be purged from the sender's table and will be
sent again over the next pull request.
2021-04-14 20:18:00 +00:00
f35a6a8be0 prioritizes contact-infos in pull responses (#16541)
Expired crds values where the contact-info does not exist are wasted:
https://github.com/solana-labs/solana/blob/f804ce63c/core/src/crds_gossip_pull.rs#L353-L378
and then are sent again over the next pull-request.

Also, the stake of the first response (which can be anything) is used to
weight all pull-responses to a node, while the rest of responses can
have different stake.
https://github.com/solana-labs/solana/blob/f804ce63c/core/src/cluster_info.rs#L2231
2021-04-14 18:45:20 +00:00
ad71e27a0d Add tao pubkey for testnet (#16548)
Co-authored-by: Tao Zhu <taozhu@Taos-MacBook-Pro.local>
2021-04-14 12:44:55 -05:00
328e7690f3 Fix sanity test flakiness by prebuilding binaries (#16530)
* Fix sanity test flakiness by prebuilding binaries

* ignore shellcheck

* bump

* nudge

* simplify
2021-04-15 01:15:06 +08:00
f0c150cfb9 Fix channel panic in tests (#16503)
* Fix channel panic

* Add exit signal to PohRecorder because Crossbeam doesnt drop objects inside dropped channel
2021-04-14 12:07:21 -05:00
eddfe06a00 Other hostname changes 2021-04-14 09:46:56 -07:00
d684ec00aa Correct gossip hostname 2021-04-14 09:46:56 -07:00
f804ce63c2 Add --faucet-port option 2021-04-14 08:57:49 -07:00
bd968f7229 chore: bump @babel/preset-env from 7.13.12 to 7.13.15 in /web3.js (#16450)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.13.12 to 7.13.15.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.15/packages/babel-preset-env)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-14 12:47:39 +08:00
6382323159 chore: bump @babel/core from 7.13.14 to 7.13.15 in /web3.js (#16451)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.13.14 to 7.13.15.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.15/packages/babel-core)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-14 12:47:32 +08:00
a593999f1e chore: bump @babel/plugin-transform-runtime in /web3.js (#16452)
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.13.10 to 7.13.15.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.15/packages/babel-plugin-transform-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-14 12:47:26 +08:00
3bfae8e829 Bump scripts to current commitment variants (#16526) 2021-04-14 00:50:59 +00:00
74f58376f8 Expand and update instruction count tests (#16522) 2021-04-13 16:23:42 -07:00
f7eadd9d70 bump solana_rbpf from 0.2.5 to 0.2.7 (#16515) 2021-04-13 14:49:09 -07:00
ccb11a939f Deprecate RpcClient methods, RpcRequest variants (#16516)
* Deprecate RpcClient methods, RpcRequest variants

* Update cli to getSupply
2021-04-13 14:05:42 -06:00
17aa45fad1 Remove old way of account hashing
Account data hashing used to use different ways of hashing on different
clusters.  That is no longer the case, but the old code still existed.
This commit removes that old, now used code.

**NOTE** The golden hash values in bank.rs needed to be updated.  Since
the original code that selected the hash algorithm used `if >` instead
of `if >=`, this meant that the genesis block's hash _always_ used the
old hashing method, which is no longer valid.

Validated by running `cargo test` successfully.
2021-04-13 14:42:21 -05:00
5c6b38a83c Derive PartialEq for RpcStakeActivation 2021-04-13 12:34:22 -07:00
f641429056 Remove blake3 from bpf program dependencies (#16506) 2021-04-13 10:06:05 +00:00
37afa00ffb Rpc: deprecate getConfirmed endpoints (#16502)
* Deprecate getConfirmed methods in rpc

* Add new methods to docs

* Move deprecated rpc methods to separate docs section

* Add note to docs about removal timing
2021-04-13 01:50:15 -06:00
db3bca7edd Add llvm feature option to compile for Solana BPF target (#16495) 2021-04-13 07:20:18 +00:00
85eb37fab0 Merge pull request from GHSA-8v47-8c53-wwrc
* Track transaction check time separately from account loads

* banking packet process metrics

* Remove signature clone in status cache lookup

* Reduce allocations when converting packets to transactions

* Add blake3 hash of transaction messages in status cache

* Bug fixes

* fix tests and run fmt

* Address feedback

* fix simd tx entry verification

* Fix rebase

* Feedback

* clean up

* Add tests

* Remove feature switch and fall back to signature check

* Bump programs/bpf Cargo.lock

* clippy

* nudge benches

* Bump `BankSlotDelta` frozen ABI hash`

* Add blake3 to sdk/programs/Cargo.lock

* nudge bpf tests

* short circuit status cache checks

Co-authored-by: Trent Nelson <trent@solana.com>
2021-04-13 00:28:08 -06:00
70f3f7e679 Move obsolete rpc endpoints to separate api for removal (#16500)
* Move obsolete rpc methods to separate api for removal

* Remove obsolete method from docs

* Fix test using obs method
2021-04-12 20:33:40 -06:00
05ad979a2d canonicalize authorized voter filepath 2021-04-12 17:52:55 -07:00
fa83f3bd73 Return sysvars via syscalls (#16422) 2021-04-12 16:04:57 -07:00
2229b70c4e Add authorized-voter add/remove-all commands 2021-04-12 15:55:28 -07:00
17a173ebb5 Clean up build warning 2021-04-12 15:55:28 -07:00
54ef065cc8 Use slot 1 for tests' sample store and accounts
Anticipating the removal of the old account hashing way, the Account DB
tests use slot 0 for the sample storages and accounts data.  Slot 0 is a
special case, and so to make future changes not break any tests, update
just the tests here now to use any other slot.

The golden hash values were obtained by running `cargo test` and copying
in the "actual" values from the test output into the `raw_expected`
vector of the test code.

Validated by running `cargo test` successfully.
2021-04-12 17:09:07 -05:00
8c498dbf75 Clarify bug bounty payment policy (#16488)
* Clarify bug bounty payment policy

* Fixup language

* Apply suggestions from code review

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

* Update SECURITY.md

Co-authored-by: publish-docs.sh <maintainers@solana.com>
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-04-12 14:53:15 -06:00
fffff2cd75 Add address_cache and exclude loopback from ip limit (#16487) 2021-04-12 19:59:38 +00:00
09752a6827 chore:(deps): bump @solana/spl-token-registry in /explorer (#16490)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.51 to 0.2.55.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.51...v0.2.55)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-12 19:19:42 +00:00
a7f8239b46 Explorer: use identicon and token layout for unlisted tokens (#16347)
* feat: use identicon and token layout for unlisted tokens

* feat: add identicon to smaller icons and change dependency to current package

* fix: add proper library
2021-04-12 11:25:51 -07:00
105a6bfb46 Replace RootsTracker HashSet (#16310)
* Replace RootsTracker HashSet

* use bitvec

* cleanup, add brenchmark test

* test cleanup

* add lots of tests

* get rid of demo

* change warp test constant

* get rid of unused function

* pr feedback

* reorder use

* rework get_all to remove range checks

* add tests, fix bugs
2021-04-12 12:11:33 -05:00
78d1d59889 Augment BPF binary dumps to resolve call instruction targets 2021-04-12 18:36:41 +02:00
7ba3e710d3 latest_slot uses > current_max (#16374) 2021-04-12 10:52:24 -05:00
6930a77a0f prepare replace Ancestors HashMap for performance (#16476) 2021-04-12 10:51:57 -05:00
2bc19eb51e chore:(deps): bump @testing-library/user-event in /explorer (#16483)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.1.1 to 13.1.2.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v13.1.1...v13.1.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-12 11:10:47 +00:00
a7c7287cc3 chore:(deps): bump @solana/web3.js from 1.2.6 to 1.2.7 in /explorer (#16481)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.2.6 to 1.2.7.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.2.6...v1.2.7)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-12 10:34:46 +00:00
dc7030ffaa Allow fork choice to support multiple versions of a slot (#16266) 2021-04-12 01:00:59 -07:00
ef30943c5c Fix up App formatting 2021-04-11 22:32:56 -07:00
448d5be79f docker: Expose all ports in Dockerfile, add back localnet.sh (#16401)
* docker: Expose all ports in Dockerfile, add back localnet.sh

* Add documentation for where to find containers

* Obliterate script
2021-04-11 21:13:57 +02:00
1d2cae433c fix: add until param to getConfirmedSignaturesForAddress2 (#16459) 2021-04-11 12:20:22 -06:00
278c125d99 Fix account copy step in program test message processor (#16469) 2021-04-11 07:59:43 +00:00
99b3aab703 Track gossip vote updates per hash for replay stage (#16421)
* Track gossip vote updates per hash for replay stage
2021-04-10 17:34:45 -07:00
91d5f6ab30 fix: token holdings summary table sums tokens correctly (#16464) 2021-04-10 12:24:56 -07:00
c4646b2bc3 fix: active stake is an epoch off, use getVoteAccounts to sum active stake (#16465) 2021-04-10 12:23:56 -07:00
ac5462e7a2 Merge pull request from GHSA-fmvj-vqp5-qqh9
* Sanitize permissions

* Forbid creating directories under ledger/rocksdb/

* hardened_unpack: Disallow dirs under rocksdb/ in genesis

* hardened_unpack: expand valid genesis entry test coverage

* hardened_unpack: rework old-style bsd directory entry rejection

Co-authored-by: Ivan Mironov <mironov.ivan@gmail.com>
2021-04-10 00:57:32 -06:00
54a04bac3d Apple M1 compatibility (#16346)
Co-authored-by: Christian Drappi <christiandrappi@Christians-MacBook-Pro.local>
2021-04-09 17:21:01 -07:00
8bc0bdd40b Fill in not-yet-finalized block-time if possible (#16460) 2021-04-09 20:25:47 +00:00
22a18a68e3 stops consuming pinned vectors with a recycler (#16441)
If the vector is pinned and has a recycler, From<PinnedVec>
implementation of Vec should clone (instead of consuming) the underlying
vector so that the next allocation of a PinnedVec will recycle an
already pinned one.
2021-04-09 16:55:24 +00:00
8ec7e2e14f chore: bump @typescript-eslint/eslint-plugin in /web3.js (#16416)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.20.0 to 4.21.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.21.0/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-09 11:35:26 +08:00
8862dcb4a0 chore:(deps): bump @types/chart.js from 2.9.31 to 2.9.32 in /explorer (#16435)
Bumps [@types/chart.js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chart.js) from 2.9.31 to 2.9.32.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chart.js)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-09 11:35:16 +08:00
4704b813ff chore:(deps): bump typescript from 4.2.3 to 4.2.4 in /explorer (#16436)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.3 to 4.2.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-09 11:35:08 +08:00
b08cff9e77 Simplify some pattern-matches (#16402)
When those match an exact combinator on Option / Result.

Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust).
2021-04-08 12:40:37 -06:00
bb9d2fd07a Cli: use get_inflation_rewards and limit epochs queried (#16408)
* Fix block-with-limit when not finalized blocks found

* Enable confirmed commitment in getInflationReward

* Use get_inflation_rewards in cli

* Line up rewards output

* Add range validator

* Change cli epoch arg -> num epochs

* Add solana inflation rewards subcommand

* Consolidate epoch rewards meta
2021-04-08 10:57:33 -06:00
0e262aab3d simplifies PinnedVec implementation (#16382) 2021-04-08 10:40:30 +00:00
3645092a52 chore: bump sinon from 10.0.0 to 10.0.1 in /web3.js (#16439)
Bumps [sinon](https://github.com/sinonjs/sinon) from 10.0.0 to 10.0.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v10.0.0...v10.0.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-08 09:21:17 +00:00
ce56f1f6f4 chore: bump typescript from 4.2.3 to 4.2.4 in /web3.js (#16438)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.3 to 4.2.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-08 09:06:08 +00:00
8a6a380fe1 chore: bump @types/node-fetch from 2.5.8 to 2.5.10 in /web3.js (#16437)
Bumps [@types/node-fetch](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node-fetch) from 2.5.8 to 2.5.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node-fetch)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-08 08:55:43 +00:00
e69f37a464 Remove old function: account_balance_for_capitalization (#16383)
This function currently returns one of its' parameters and is thus useless.
2021-04-07 23:57:40 -05:00
878e52f0b9 Fix cargo-build/test-bpf --workspace (#16431) 2021-04-07 17:22:55 -07:00
388ce12207 CI: Let cargo-install-all.sh resolve stable 2021-04-07 20:24:19 +00:00
42ce2ba069 Use local cargo-test-bpf (#16427) 2021-04-07 18:08:55 +00:00
c5c3ae0203 CLI: Fix rent panic (#16417)
* CLI: Fix `rent` panic on non-numeric input (+monikers)

* Update cli/src/cluster_query.rs

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

* Update cli/src/cluster_query.rs

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

* Update cli/src/cluster_query.rs

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

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-04-07 09:57:12 -06:00
117860218f docs: Validator SOL reqs followup 2021-04-07 09:49:52 -06:00
476fd40948 Add program-test tests to bpf programs (#16407) 2021-04-07 01:47:15 -07:00
6cd4bc5e60 Speed up net.sh builds (#16360)
* Speed up net.sh builds

* feedback

* Update net/net.sh

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

* feedback

* fix

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-04-07 14:45:03 +08:00
02197b1215 chore: bump typedoc from 0.20.34 to 0.20.35 in /web3.js (#16415)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.20.34 to 0.20.35.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.20.34...v0.20.35)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-07 04:38:39 +00:00
eb2b68b7f2 chore: bump tslib from 2.1.0 to 2.2.0 in /web3.js (#16413)
Bumps [tslib](https://github.com/Microsoft/tslib) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/Microsoft/tslib/releases)
- [Commits](https://github.com/Microsoft/tslib/compare/2.1.0...2.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-07 04:05:22 +00:00
81323cbccf chore: bump @typescript-eslint/parser from 4.20.0 to 4.21.0 in /web3.js (#16412)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.20.0 to 4.21.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.21.0/packages/parser)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-07 04:00:53 +00:00
0e42a35e4f docs: Add validator SOL reqs 2021-04-07 03:52:52 +00:00
d5b3bcc0b2 chore: bump @types/chai from 4.2.15 to 4.2.16 in /web3.js (#16366)
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.15 to 4.2.16.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-07 11:19:10 +08:00
e19b728fa5 chore: bump rpc-websockets from 7.4.10 to 7.4.11 in /web3.js (#16367)
Bumps [rpc-websockets](https://github.com/elpheria/rpc-websockets) from 7.4.10 to 7.4.11.
- [Release notes](https://github.com/elpheria/rpc-websockets/releases)
- [Commits](https://github.com/elpheria/rpc-websockets/compare/v7.4.10...v7.4.11)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-07 11:19:04 +08:00
5b89055e00 chore:(deps): bump @types/chai from 4.2.15 to 4.2.16 in /explorer (#16370)
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.15 to 4.2.16.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-07 11:18:58 +08:00
d26707dd28 chore:(deps): bump classnames from 2.3.0 to 2.3.1 in /explorer (#16371)
Bumps [classnames](https://github.com/JedWatson/classnames) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/JedWatson/classnames/releases)
- [Changelog](https://github.com/JedWatson/classnames/blob/master/HISTORY.md)
- [Commits](https://github.com/JedWatson/classnames/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-07 11:18:52 +08:00
e501fa5f0b Rpc: introduce get_inflation_reward rpc call (#16278)
* feat: introduce get_inflation_reward rpc call

* fix: style suggestions

* fix: more style changes and match how other rpc functions are defined

* feat: get reward for a single epoch

* feat: default to the most recent epoch

* fix: don't factor out get_confirmed_block

* style: introduce from impl for RpcEncodingConfigWrapper

* style: bring commitment into variable

* feat: support multiple pubkeys for get_inflation_reward

* feat: add get_inflation_reward to rpc client

* feat: return rewards in order

* fix: rename pubkeys to addresses

* docs: introduce jsonrpc docs for get_inflation_reward

* style: early return in map (not sure which is more idiomatic)

* fix: call the rpc client function args addresses as well

* fix: style

* fix: filter out only addresses we care about

* style: make this more idiomatic

* fix: change rpc client epoch to optional and include some docs edits

* feat: filter out rent rewards in get_inflation_reward

* feat: add option epoch config param to get_inflation_reward

* feat: rpc client get_inflation_reward takes epoch instead of config and some filter staking and voting rewards
2021-04-06 18:10:53 -07:00
92f4018b07 Cleanup unsupported sysvars (#16390)
* Cleanup unsupported sysvars

* fix ser description
2021-04-06 00:08:03 -07:00
03d3ae1cb9 Faucet: repurpose cap and slice args to apply to single IPs (#16381)
* Single use stmt

* Log request IP

* Switch cap and slice to apply per IP

* Use SOL in logs, error msgs

* Use thiserror instead of overloading io::Error

* Return memo transaction for requests that exceed per-request-cap

* Handle faucet memos in cli

* Add some docs, esp about memo transaction

* Use SOL symbol & standardize memo

Co-authored-by: Michael Vines <mvines@gmail.com>

* Differentiate faucet tx-length errors

* Populate signature in cli airdrop memo case

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-04-06 07:01:05 +00:00
1219842a96 No wallclock throttle tests (#16396) 2021-04-05 19:40:16 -07:00
ae7bc8299d Use spl-memo v3.0.1 (#16384)
* Use memo v3.0.1, which simplifies id imports

* tree
2021-04-06 02:06:44 +00:00
9360e57816 Fix build 2021-04-05 17:12:31 -07:00
b71875df61 cluster-info: Get rid of some integer math while we're here 2021-04-06 00:09:37 +00:00
b6b08706b9 cluster-info: Don't subtract non-shred spies from node count 2021-04-06 00:09:37 +00:00
a4f0d8636a RpcClient no longer panics in a tokio multi-threaded runtime 2021-04-05 16:50:03 -07:00
7a2a39093d validator: Use a const for wait for supermajority threshold 2021-04-05 17:29:37 -06:00
bji
364af3a3e0 issue #10831: added --with-memo option to all cli commands that submit (#16291)
* issue #10831: added --with-memo option to all cli commands that submit
transactions.  Also, improve the block command to show UTF-8 string instead
of integer values for memo program data.

* Fixed tests and changed some syntax according to feedback.

* Use spl_memo id (all versions where applicable) instead of hardcoding id.

* Update Cargo.toml in programs/bpf.

* Update formatting via cargo fmt.

* Update to use spl_memo version 3.0.1, which simplifies package imports
2021-04-05 20:53:50 +00:00
43feef7362 Adjust tokio version to just "1" 2021-04-05 17:13:20 +00:00
95dc7b5449 reduce lock contention on latest_root (#16306) 2021-04-05 11:35:14 -05:00
7a997759fa reduce locking on get_rooted_entries (#16304) 2021-04-05 11:26:53 -05:00
b242f82696 Reduce test-validator ledger size 2021-04-05 08:37:29 -07:00
701fc93343 patches bug in banking stage where buffered packets are never retained (#16276)
banking_stage::handle_forwarding is retaining buffered packets with
empty index, so nothing is held:
https://github.com/solana-labs/solana/blob/6f3926b64/core/src/banking_stage.rs#L520
2021-04-05 12:46:21 +00:00
b521f50278 chore:(deps): bump @solana/web3.js from 1.2.5 to 1.2.6 in /explorer (#16372)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.2.5...v1.2.6)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-05 10:37:46 +00:00
d9d6d65959 chore:(deps): bump cross-fetch from 3.1.2 to 3.1.4 in /explorer (#16369)
Bumps [cross-fetch](https://github.com/lquixada/cross-fetch) from 3.1.2 to 3.1.4.
- [Release notes](https://github.com/lquixada/cross-fetch/releases)
- [Commits](https://github.com/lquixada/cross-fetch/compare/v3.1.2...v3.1.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-05 10:21:55 +00:00
8169c8d320 chore:(deps): bump @solana/spl-token-registry in /explorer (#16363)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.48 to 0.2.51.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.48...v0.2.51)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-05 13:53:10 +08:00
b8b6777262 Only get Blockstore::last_root once (#16362) 2021-04-05 04:14:02 +00:00
a98467b563 chore:(deps): bump @project-serum/serum in /explorer (#16325)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.32 to 0.13.33.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-05 11:05:28 +08:00
a6f4a333e9 chore:(deps): bump @sentry/react from 6.2.4 to 6.2.5 in /explorer (#16324)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 6.2.4 to 6.2.5.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/6.2.4...6.2.5)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-05 11:05:17 +08:00
1a13d22984 Fixup iterator method (#16357) 2021-04-04 23:32:51 +00:00
a679aebc82 wait-for-restart-window works again for unstaked nodes 2021-04-04 16:52:39 +00:00
0596cf5405 Remove unprocessed transactions from log notifications (#16349) 2021-04-04 23:44:59 +08:00
1359bceb5d Bump bpf-tools to version v1.5 (#16331)
The new version of bpf-tools eliminates the separate
rust-bpf-sysroot. The Rust standard libraries for the BPF target are
built in tree when the compiler is built.  The standard libraries code
is slightly more optimized and some reduction of compute budget can be
expected with this version of bpf-tools.
2021-04-04 13:04:22 +00:00
4b7b402e74 fix: allow strings in transaction error validation (#16348)
* fix: allow strings in transaction error validation

* chore: make log tests more robust
2021-04-04 18:02:36 +08:00
3429785d9b Wait for 90 percent of stake before starting (#16340) 2021-04-03 14:21:20 -07:00
a44c32694f merkle-tree: Use matches crate when targeting eBPF 2021-04-03 12:09:36 -06:00
ddc0a16cec merkle-tree: Get Hash et. al from program instead of sdk 2021-04-03 12:09:36 -06:00
a1d9b53cd7 merkle-tree: Add Xargo.toml 2021-04-03 12:09:36 -06:00
c8c89dd5f7 wait-for-restart-window now indicates how far away the next restart window is 2021-04-02 22:45:32 -07:00
4e5ef6bce2 Add cluster state verifier logging (#16330)
* Add cluster state verifier logging

* Add duplicate-slots iterator to ledger tool
2021-04-02 21:48:44 -07:00
e4889220c4 Remove UNSTABLE warning from logsSubscribe 2021-04-02 12:53:42 -07:00
dee655df35 Cleanup use (#16327) 2021-04-02 08:54:09 -07:00
9784bbb802 chore: bump @commitlint/config-conventional in /web3.js (#16323)
Bumps [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint) from 12.0.1 to 12.1.1.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/compare/v12.0.1...v12.1.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-02 08:51:30 +00:00
a86d74f214 chore: bump @commitlint/travis-cli from 12.0.1 to 12.1.1 in /web3.js (#16322)
Bumps [@commitlint/travis-cli](https://github.com/conventional-changelog/commitlint) from 12.0.1 to 12.1.1.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/compare/v12.0.1...v12.1.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-02 08:42:50 +00:00
a902505810 Parse SPL associated-token-account instructions (#16318) 2021-04-01 22:48:05 +00:00
482b8c6be9 Merge pull request from GHSA-qgrq-w56v-hr62 2021-04-01 09:54:45 -07:00
3996b699dc read only account cache for executable accounts - improve replay (#16150)
* read only account cache

* tests

* clippy

* cleanup

* new file, add tests

* remove copy/paste code from test

* remove dead code

* all loads use cache

* remove stale comments

* add metrics logging for read only cache size

* report read only cache hits and misses

* consistency

* formatting

* rename, add comment

* u64

* better interaction with existing cache

* lru list saved between cleans
2021-04-01 07:16:34 -05:00
badf224460 Bump goauth from 0.9.0 to 0.10.0 (#15738)
Bumps [goauth](https://github.com/durch/rust-goauth) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/durch/rust-goauth/releases)
- [Commits](https://github.com/durch/rust-goauth/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-01 19:22:17 +08:00
a8a4027ab8 chore:(deps): bump react and react-dom in /explorer (#16273)
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) and [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom). These dependencies needed to be updated together.

Updates `react` from 17.0.1 to 17.0.2
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v17.0.2/packages/react)

Updates `react-dom` from 17.0.1 to 17.0.2
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v17.0.2/packages/react-dom)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-01 18:38:00 +08:00
4db301f749 chore:(deps): bump classnames from 2.2.6 to 2.3.0 in /explorer (#16298)
Bumps [classnames](https://github.com/JedWatson/classnames) from 2.2.6 to 2.3.0.
- [Release notes](https://github.com/JedWatson/classnames/releases)
- [Changelog](https://github.com/JedWatson/classnames/blob/master/HISTORY.md)
- [Commits](https://github.com/JedWatson/classnames/compare/v2.2.6...v2.3.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-01 09:02:58 +00:00
8dac9c3634 chore: bump rpc-websockets from 7.4.9 to 7.4.10 in /web3.js (#16297)
Bumps [rpc-websockets](https://github.com/elpheria/rpc-websockets) from 7.4.9 to 7.4.10.
- [Release notes](https://github.com/elpheria/rpc-websockets/releases)
- [Commits](https://github.com/elpheria/rpc-websockets/compare/v7.4.9...v7.4.10)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-01 08:58:52 +00:00
aa45e81b3e nit: fix variable names (#16283) 2021-03-31 23:18:29 -07:00
da27acabcc Rpc: enable getConfirmedSignaturesForAddress2 to return confirmed (not yet finalized) data (#16281)
* Update blockstore method to allow return of unfinalized signature

* Support confirmed sigs in getConfirmedSignaturesForAddress2

* Add deprecated comments

* Update docs

* Enable confirmed transaction-history in cli

* Return real confirmation_status; fill in not-yet-finalized block time if possible
2021-04-01 04:35:57 +00:00
18bd47dbe1 Rpc: fix getConfirmedTransaction slot (#16288)
* Fix transaction blockstore apis

* Update blockstore apis in rpc
2021-03-31 21:04:00 -06:00
3f63ed9a72 removes OrderedIterator and transaction batch iteration order (#16153)
In TransactionBatch,
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/transaction_batch.rs#L4-L11
lock_results[i] is aligned with transactions[iteration_order[i]]:
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/bank.rs#L2414-L2424
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/accounts.rs#L788-L817

However load_and_execute_transactions is iterating over
  lock_results[iteration_order[i]]
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/bank.rs#L2878-L2889
and then returning i as for the index of the retryable transaction.

If iteratorion_order is [1, 2, 0], and i is 0, then:
  lock_results[iteration_order[i]] = lock_results[1]
which corresponds to
  transactions[iteration_order[1]] = transactions[2]
so neither i = 0, nor iteration_order[i] = 1 gives the correct index for the
corresponding transaction (which is 2).

This commit removes OrderedIterator and transaction batch iteration order
entirely. There is only one place in blockstore processor which the
iteration order is not ordinal:
https://github.com/solana-labs/solana/blob/e50f59844/ledger/src/blockstore_processor.rs#L269-L271
It seems like, instead of using an iteration order, that can shuffle entry
transactions in-place.
2021-03-31 23:59:19 +00:00
ad7f8e7f23 Use more performant copy (#16282) 2021-03-31 16:52:58 -07:00
416312b30b update timings only on outer call (#16275)
* update timings only on outer call

* test & format
2021-03-31 18:02:59 -05:00
c723251575 Update overview.md
fix link which was broken/wrong
2021-03-31 14:39:52 -07:00
f374b35944 Hash stored accounts in bg (#16157)
* lazy calculate account hash

* push to bg thread

* remove deadlock

* logs

* format

* some cleanup on aisle 9

* format, fix up some metrics

* fix test, remove legacy function only there for tests

* cleanup

* remove unused store_hasher

* Switch to crossbeam

* clippy

* format

* use iter()

* rework from feedback

* hash_slot -> slot

* hash(cluster_type)

Co-authored-by: Carl Lin <carl@solana.com>
2021-03-31 15:39:34 -05:00
6f3926b643 chore:(deps): bump @solana/web3.js from 1.2.3 to 1.2.5 in /explorer (#16274)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.2.3 to 1.2.5.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.2.3...v1.2.5)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-31 22:16:46 +08:00
d0793aa1f0 chore:(deps): bump @project-serum/serum in /explorer (#16271)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.31 to 0.13.32.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-31 14:12:35 +00:00
a5dcee254d get rid of unnecessary data copy (#16214)
* get rid of unnecessary data copy

* preserve rent_epoch
2021-03-31 09:11:39 -05:00
e57975de26 chore:(deps): bump superstruct from 0.14.2 to 0.15.1 in /explorer (#16269)
Bumps [superstruct](https://github.com/ianstormtaylor/superstruct) from 0.14.2 to 0.15.1.
- [Release notes](https://github.com/ianstormtaylor/superstruct/releases)
- [Changelog](https://github.com/ianstormtaylor/superstruct/blob/main/Changelog.md)
- [Commits](https://github.com/ianstormtaylor/superstruct/compare/v0.14.2...v0.15.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-31 13:58:19 +00:00
c6a97e8eff chore:(deps): bump @types/react-dom from 17.0.2 to 17.0.3 in /explorer (#16265)
Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 17.0.2 to 17.0.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-31 21:48:25 +08:00
e8620dea54 chore:(deps): bump @sentry/react from 6.2.2 to 6.2.4 in /explorer (#16264)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 6.2.2 to 6.2.4.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/6.2.2...6.2.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-31 21:48:19 +08:00
e27cfa0781 chore:(deps): bump react-select from 4.2.1 to 4.3.0 in /explorer (#16268)
Bumps [react-select](https://github.com/JedWatson/react-select) from 4.2.1 to 4.3.0.
- [Release notes](https://github.com/JedWatson/react-select/releases)
- [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/JedWatson/react-select/compare/react-select@4.2.1...react-select@4.3.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-31 11:01:56 +00:00
b0f4e2b738 chore: update doc comments (#16267) 2021-03-31 10:48:41 +00:00
d0e3aae39f chore:(deps): bump @testing-library/jest-dom in /explorer (#16263)
Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.11.9 to 5.11.10.
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v5.11.9...v5.11.10)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-31 17:58:13 +08:00
19f21b595a fix: fix Buffer shim compatibility in browser (#16262) 2021-03-31 17:51:27 +08:00
3e22f61ecf chore:(deps): bump @types/node from 14.14.35 to 14.14.37 in /explorer (#16260)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.35 to 14.14.37.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-31 09:13:30 +00:00
663abbdd16 chore:(deps): bump @solana/spl-token-registry in /explorer (#16259)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.47 to 0.2.48.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.47...v0.2.48)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-31 09:08:07 +00:00
d474eadf7b chore:(deps): bump @testing-library/react in /explorer (#16258)
Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 11.2.5 to 11.2.6.
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v11.2.5...v11.2.6)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-31 09:03:42 +00:00
493d461c89 chore: bump @solana/spl-token from 0.1.2 to 0.1.3 in /web3.js (#16257)
Bumps [@solana/spl-token](https://github.com/solana-labs/solana-program-library) from 0.1.2 to 0.1.3.
- [Release notes](https://github.com/solana-labs/solana-program-library/releases)
- [Commits](https://github.com/solana-labs/solana-program-library/compare/@solana/spl-token@v0.1.2...@solana/spl-token@v0.1.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-31 08:57:47 +00:00
bcd89dd34c Fix BPF ELF layout (#16256)
* Fix BPF ELF layout

* whitespace
2021-03-31 08:51:19 +00:00
2c94c6f8e8 fix: handle empty rpc batch requests properly (#16254) 2021-03-31 15:15:04 +08:00
c344702fa0 fix: revert usage of toBytes to fix compatibility (#16253) 2021-03-31 14:51:41 +08:00
67b747938f Helpful const and Arg doc (#16248) 2021-03-31 05:11:38 +00:00
700ebde474 Update SECURITY.md
Co-authored-by: Michael Vines <mvines@gmail.com>
2021-03-30 22:41:56 -06:00
e9e46ff521 security policy: Add out-of-scope section 2021-03-30 22:41:56 -06:00
1ecde67078 docs: explain reasons of non-obvious disableCache (#16246) 2021-03-31 13:10:14 +09:00
aac18d7564 Validator monitor now displays the max retransmit slot 2021-03-30 18:58:32 -07:00
2a1639836a Add get_max_retransmit_slot/get_max_shred_insert_slot to RpcClient 2021-03-30 23:52:47 +00:00
c70674a616 debug run-sanity.sh (#16163) 2021-03-30 15:51:14 -07:00
7db3af647b Update retransmit docs to move deshredder and rename (#16229)
deshredder into something else
2021-03-30 15:37:33 -07:00
2bcfbad653 docs: Reduce airdrop examples to 1 SOL 2021-03-30 21:28:42 +00:00
ce7f7c2b6c Align ProcessInstruction error handling (#16232) 2021-03-30 13:41:04 -07:00
f84e88f0a2 Cleanup nits (#16211) 2021-03-30 12:16:21 -07:00
54c68ea83f Drop write lock on sysvars (#15497)
* Drop write lock on sysvars

* adds env var for demoting sysvar write lock demotion

* moves demote logic to is_writable

* feature gates sysvar write lock demotion

* adds builtins to write lock demotion

* adds system program id to builtins

* adds Feature111...

* adds an abi-freeze test

* mvines set of builtin program keys

Co-authored-by: Michael Vines <mvines@gmail.com>

* update tests

* adds bpf loader keys

* Add test sysvar

* Plumb demote_sysvar to is_writable

* more plumbing of demote_sysvar_write_locks to is_writable

* patches test_program_bpf_instruction_introspection

* hard codes demote_sysvar_write_locks to false for serialization/encoding methods

* Revert "hard codes demote_sysvar_write_locks to false for serialization/encoding methods"

This reverts commit ae3e2d2e777437bddd753933097a210dcbc1b1fc.

* change the hardcoded ones to demote_sysvar_write_locks=true

* Use data_as_mut_slice

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
Co-authored-by: Michael Vines <mvines@gmail.com>
2021-03-30 10:05:09 -07:00
527adbed34 Add channel version check 2021-03-30 08:46:32 -07:00
414c7070cb poll checking for new record in poh service after every batch of hashes instead of busy waiting (#16167)
* poll waiting in poh service after every batch of hashes

* clippy
2021-03-30 10:34:21 -05:00
f4f2e781ff get rid of data copy (#16210)
* get rid of data copy

* format
2021-03-30 10:33:46 -05:00
28a6424f38 chore:(deps): bump @solana/spl-token-registry in /explorer (#16226)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.38 to 0.2.47.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.38...v0.2.47)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 22:00:01 +08:00
031bacbc48 chore:(deps): bump @project-serum/serum in /explorer (#16069)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.27 to 0.13.31.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 21:43:30 +08:00
f2133af9ac chore:(deps): bump cross-fetch from 3.1.1 to 3.1.2 in /explorer (#16054)
Bumps [cross-fetch](https://github.com/lquixada/cross-fetch) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/lquixada/cross-fetch/releases)
- [Commits](https://github.com/lquixada/cross-fetch/compare/v3.1.1...v3.1.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 21:42:51 +08:00
e5300c1c05 chore:(deps): bump @types/jest from 26.0.21 to 26.0.22 in /explorer (#16225)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.21 to 26.0.22.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 13:33:50 +00:00
8d8ed5e9fe chore:(deps): bump @testing-library/user-event in /explorer (#16224)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.0.2 to 13.1.1.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v13.0.2...v13.1.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 13:19:38 +00:00
fc4ca34238 chore: bump rollup from 2.43.1 to 2.44.0 in /web3.js (#16216)
Bumps [rollup](https://github.com/rollup/rollup) from 2.43.1 to 2.44.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.43.1...v2.44.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 20:58:06 +08:00
a8a817c713 chore: bump @babel/register from 7.13.8 to 7.13.14 in /web3.js (#16222)
Bumps [@babel/register](https://github.com/babel/babel/tree/HEAD/packages/babel-register) from 7.13.8 to 7.13.14.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.14/packages/babel-register)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 20:57:50 +08:00
03498f2288 explorer: Bump web3 to v1.2.3 (#16223) 2021-03-30 20:57:33 +08:00
c959c5daf7 fix: add explicit module declaration to type definitions (#16219) 2021-03-30 20:16:31 +08:00
54cb16d99b chore: bump @babel/core from 7.13.13 to 7.13.14 in /web3.js (#16221)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.13.13 to 7.13.14.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.14/packages/babel-core)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 12:04:22 +00:00
ba377b7364 chore: bump @typescript-eslint/eslint-plugin in /web3.js (#16220)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.19.0 to 4.20.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.20.0/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 11:42:48 +00:00
ca222167ef chore: bump @typescript-eslint/parser from 4.19.0 to 4.20.0 in /web3.js (#16215)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.19.0 to 4.20.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.20.0/packages/parser)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 11:31:51 +00:00
cd6df35e1a chore: bump @solana/spl-token from 0.0.13 to 0.1.2 in /web3.js (#16217)
Bumps [@solana/spl-token](https://github.com/solana-labs/solana-program-library) from 0.0.13 to 0.1.2.
- [Release notes](https://github.com/solana-labs/solana-program-library/releases)
- [Commits](https://github.com/solana-labs/solana-program-library/commits/@solana/spl-token@v0.1.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 19:18:30 +08:00
5eff23db0c TransactionRecorder uses unique channel so we can use Recv instead of RecvTimeout (#16195)
* time

* new channel each call

* new channel every time
2021-03-30 00:51:35 -05:00
9ba9d2a8ae Allow incomplete features in frozen-abi 2021-03-30 02:32:53 +00:00
1d145e1fc2 Add handling to close accounts to many-accounts bench (#16199)
* gitignore farf

* Improve cli args

* Use derived addresses for accounts

* Add parameter to close every nth account created
2021-03-29 15:30:00 -06:00
3977ed5c82 Future-aware enum name 2021-03-29 14:58:05 -06:00
60ed8e2892 Rpc: enable getConfirmedBlocks and getConfirmedBlocksWithLimit to return confirmed (not yet finalized) data (#16161)
* Add commitment config capabilities

* Use rpc limit if no end_slot provided

* Limit to actually finalized blocks

* Support confirmed blocks in getConfirmedBlocks and getConfirmedBlocksWithLimit

* Update docs

* Add client plumbing

* Rename config enum
2021-03-29 12:41:31 -06:00
4e7bd45d4c Derive PartialEq for StakeActivationState 2021-03-29 17:03:27 +00:00
a6b7dcb3c6 fix: fix static properties in flow type declaration 2021-03-29 23:12:19 +08:00
5f46ef7adc chore: bump @rollup/plugin-replace from 2.4.1 to 2.4.2 in /web3.js (#16192)
Bumps [@rollup/plugin-replace](https://github.com/rollup/plugins) from 2.4.1 to 2.4.2.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Commits](https://github.com/rollup/plugins/compare/replace-v2.4.1...replace-v2.4.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-29 12:18:07 +00:00
de9ba0f306 chore: bump @types/node from 14.14.36 to 14.14.37 in /web3.js (#16191)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.36 to 14.14.37.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-29 12:04:22 +00:00
02c0664487 fix: post process generated flow definition 2021-03-29 20:00:00 +08:00
dfbca76a76 chore: bump rollup from 2.42.4 to 2.43.1 in /web3.js (#16189)
Bumps [rollup](https://github.com/rollup/rollup) from 2.42.4 to 2.43.1.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.42.4...v2.43.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-29 11:39:35 +00:00
a04c09c030 chore: bump @babel/core from 7.13.10 to 7.13.13 in /web3.js (#16188)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.13.10 to 7.13.13.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.13/packages/babel-core)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-29 11:15:41 +00:00
44e3445a4d fix: strip internal types from external declaration 2021-03-29 19:05:53 +08:00
69a4059da0 chore: bump @rollup/plugin-node-resolve in /web3.js (#16187)
Bumps [@rollup/plugin-node-resolve](https://github.com/rollup/plugins) from 11.2.0 to 11.2.1.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Commits](https://github.com/rollup/plugins/compare/node-resolve-v11.2.0...node-resolve-v11.2.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-29 11:01:26 +00:00
d78f2e55d7 chore: bump eslint from 7.22.0 to 7.23.0 in /web3.js (#16186)
Bumps [eslint](https://github.com/eslint/eslint) from 7.22.0 to 7.23.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.22.0...v7.23.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-29 10:28:29 +00:00
5834346aa2 chore: bump @rollup/plugin-commonjs from 17.1.0 to 18.0.0 in /web3.js (#16185)
Bumps [@rollup/plugin-commonjs](https://github.com/rollup/plugins) from 17.1.0 to 18.0.0.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Commits](https://github.com/rollup/plugins/compare/commonjs-v17.1.0...commonjs-v18.0.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-29 10:21:41 +00:00
a622198235 feat: add PublicKey.toBytes and fix buffer incompatibility 2021-03-29 14:32:35 +08:00
abada56ba1 Print the rust version when building bpf programs (#16181) 2021-03-29 14:17:08 +08:00
5e5b63712b Status cache improvements (#16174) 2021-03-28 19:10:14 -07:00
27ab415ecc Fix handling of invoked ix accounts in program-test (#16170) 2021-03-29 08:42:11 +08:00
bji
e50f598449 Implement mnemonic support for solana-keygen grind (solana-labs#9325) (#16108)
* Implement mnemonic support for solana-keygen grind (solana-labs#9325)

* Updated to include feedback from review.

* Renaming as per review feedback

* Fixed an incorrectly transcribed underscore

* Properly re-use string constants.
2021-03-27 23:47:50 -06:00
aabe186e3f sdk: Use u32::MAX from std to unbreak BPF builds (#16171) 2021-03-27 15:53:25 +00:00
16e4ccca13 Switch to a single use 2021-03-26 22:33:12 -07:00
5791b95b17 Add RpcClient::get_stake_activation() 2021-03-26 20:18:16 -07:00
60b4771fc6 Only print skipped leader slot message when the node is actually leader (#16156)
Also, check vote signature after the vote is signed
2021-03-26 17:45:53 -07:00
433f1ead1c Rpc: enable getConfirmedBlock and getConfirmedTransaction to return confirmed (not yet finalized) data (#16142)
* Add Blockstore block and tx apis that allow unrooted responses

* Add TransactionStatusMessage, and send on bank freeze; also refactor TransactionStatusSender

* Track highest slot with tx-status writes complete

* Rename and unpub fn

* Add commitment to GetConfirmed input configs

* Support confirmed blocks in getConfirmedBlock

* Support confirmed txs in getConfirmedTransaction

* Update sigs-for-addr2 comment

* Enable confirmed block in cli

* Enable confirmed transaction in cli

* Review comments

* Rename blockstore method
2021-03-26 16:47:35 -06:00
cffa851e0f sdk: Add try_from_slice_unchecked for Borsh (#16098)
* sdk: Add try_from_slice_unchecked for Borsh

* Add tests

* Rename + clarify comment

* Rename back to unchecked
2021-03-26 23:37:35 +01:00
658ddd1c9c Bump bpf-tools to version v1.4 (#16152) 2021-03-26 19:21:41 +00:00
4f4cffbd03 Throttle PoH ticks by cumulative slot time (#16139)
* Throttle PoH ticks by cumulative slot time

* respond to pr feedback

* saturating sub

* updated comment
2021-03-26 18:54:16 +00:00
a1f1f573d5 hotfix: account for custom endpoint possible conditions in stakehistory (#16151) 2021-03-26 17:54:53 +00:00
d2e4503be2 chore: bump @types/node from 14.14.35 to 14.14.36 in /web3.js (#16148)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.35 to 14.14.36.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-26 08:31:58 +00:00
06ac0fe9a3 increase timeout in TransactionRecorder.record (#16133) 2021-03-25 21:31:07 -05:00
b99ae8f334 Skip leader slots until a vote lands (#15607) 2021-03-25 18:54:51 -07:00
b041b55028 makes test_pull_request_time_pruning smaller (#16128) 2021-03-25 22:44:43 +00:00
2a1ac97391 fix: test heroku slugignore for explorer (#16141) 2021-03-25 15:22:00 -07:00
bf6b098c75 Explorer: add color to price change and updated at time (#16140)
* feat: add color to price change and updated at

* feat: add market cap rank

* fix: rename slug ignore
2021-03-25 21:50:47 +00:00
9b94741290 Fix test_replay_commitment_cache (#16131) 2021-03-25 21:16:39 +00:00
d3d6d8fb78 fix: reduce heroku slug size (#16138) 2021-03-25 13:05:55 -07:00
e817a6db00 Add timeout for local cluster partition tests (#16123)
* Add timeout for local cluster partition tests

* fix optimistic conf test logs

* Bump instruction count assertions
2021-03-25 13:27:07 -06:00
07273bfa9e Show bpf-tools download progress 2021-03-25 12:23:51 -07:00
a15790c9aa fix: make new stats card look okay on mobile (#16132) 2021-03-25 18:52:28 +00:00
2aea35281e Explorer: introduce circulating supply, active stake, and price on cluster stats page (#16095)
* feat: add styles form staking component

* feat: introduce circulating supply, active stake, and price on cluster stats page

* feat: add an error state for coingecko
2021-03-25 09:59:50 -07:00
66c42f62d8 make AccountSharedData.data private to abstract storage (#16091)
* format

* 2 more tests

* use
2021-03-25 11:04:20 -05:00
43a116a84e chore: stop building on npm prepare (#16126) 2021-03-25 19:06:29 +08:00
ed828dae88 fix: update transitive elliptic dependency (#16125) 2021-03-25 19:06:20 +08:00
a7b024639e chore: bump @babel/preset-env from 7.13.10 to 7.13.12 in /web3.js (#16082)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.13.10 to 7.13.12.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.12/packages/babel-preset-env)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-25 19:05:51 +08:00
602d0ca52d chore: modify https test and add run-all dep (#16124) 2021-03-25 17:18:00 +08:00
cc980cb638 chore: bump typedoc from 0.20.33 to 0.20.34 in /web3.js (#16122)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.20.33 to 0.20.34.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.20.33...v0.20.34)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-25 08:59:42 +00:00
06886f4e4c chore: bump rollup from 2.42.3 to 2.42.4 in /web3.js (#16120)
Bumps [rollup](https://github.com/rollup/rollup) from 2.42.3 to 2.42.4.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.42.3...v2.42.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-25 08:38:33 +00:00
52703badfa Setup ReplayStage confirmation scaffolding for duplicate slots (#9698) 2021-03-24 23:41:52 -07:00
6d5c6c17c5 Simplify account.rent_epoch handling for sysvar rent (#16049)
* Add some code for special local testing

* Add comment to store_account_and_update_capitalization

* Simplify account.rent_epoch handling for sysvar rent

* Introduce *_for_test functions

* Add deprecation messages to existing api
2021-03-25 15:23:20 +09:00
7f0ac6a67c clap-utils: Allow NullSigners outside sign-only mode 2021-03-25 05:45:21 +00:00
8b3de72e2a program: Correct clamp in Message::signer_keys() 2021-03-24 23:27:24 -06:00
6bc858a888 Refactored ShortU16Visitor::visit_seq() to reject overflows, extra leading zeros and ensure one-to-one encoding. 2021-03-24 21:53:35 -06:00
9153cb9237 sdk: ShortU16 - rename variables for clarity
ShortU16's implementation embeds its usage as the length of a
ShortVec, confusingly referring to both a 'len' and a 'size'
at the same time.
2021-03-24 21:53:35 -06:00
cc6dcb48d4 sdk: Add ShortU16 deser test 2021-03-24 21:53:35 -06:00
b7aa366758 Remove stake-o-matic 2021-03-24 20:09:04 -07:00
a8ef29df27 Support getBlockTime for unfinalized blocks (#16103) 2021-03-24 20:52:08 -06:00
26af2d4c26 Up store limit for test_account_grow (#16099)
There can be more than 5 stores
2021-03-24 15:24:17 -07:00
ad47c63f27 Add Exodus as Solana Mobile app option (#16100)
* Add Exodus as Solana Mobile app option

* Update docs/src/wallet-guide/apps.md

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-03-24 21:09:20 +00:00
96ccc40f0a Set ticks_per_slot higher for banking stage tests (#16094)
Tests are timing out because the bank hit the MaxTickHeight and
will not process the transactions.
2021-03-24 14:05:43 -07:00
db3eecf1e9 set target hash/sec to half of capability for auto (#16096) 2021-03-24 14:48:38 -05:00
f68860a643 poh record metrics (#16092) 2021-03-24 14:48:32 -05:00
a6c23648cb limits CrdsGossipPull::pull_request_time size (#15793)
There is no pruning logic on CrdsGossipPull::pull_request_time
https://github.com/solana-labs/solana/blob/79ac1997d/core/src/crds_gossip_pull.rs#L172-L174
potentially allowing this to take too much memory.

Additionally, CrdsGossipPush::last_pushed_to is pruning recent push
timestamps:
https://github.com/solana-labs/solana/blob/79ac1997d/core/src/crds_gossip_push.rs#L275-L279
instead of the older ones.

Co-authored-by: Nathan Hawkins <utsl@utsl.org>
2021-03-24 18:33:56 +00:00
7aa65831bc fix: token registry avoids custom slug (#16093) 2021-03-24 16:08:47 +00:00
570fd3f810 makes turbine peer computation consistent between broadcast and retransmit (#14910)
get_broadcast_peers is using tvu_peers:
https://github.com/solana-labs/solana/blob/84e52b606/core/src/broadcast_stage.rs#L362-L370
which is potentially inconsistent with retransmit_peers:
https://github.com/solana-labs/solana/blob/84e52b606/core/src/cluster_info.rs#L1332-L1345

Also, the leader does not include its own contact-info when broadcasting
shreds:
https://github.com/solana-labs/solana/blob/84e52b606/core/src/cluster_info.rs#L1324
but on the retransmit side, slot leader is removed only _after_ neighbors and
children are computed:
https://github.com/solana-labs/solana/blob/84e52b606/core/src/retransmit_stage.rs#L383-L384
So the turbine broadcast tree is different between the two stages.

This commit:
* Removes retransmit_peers. Broadcast and retransmit stages will use tvu_peers
  consistently.
* Retransmit stage removes slot leader _before_ computing children and
  neighbors.
2021-03-24 13:34:48 +00:00
664ed76523 Bump bpf-tools to version v1.3 (#16068)
* Bump bpf-tools to version v1.3

This brings in the fix for increased compute budget that wasn't caught
when bpf-tools v1.2 were released.

* Adjust BPF test programs instruction counts
2021-03-24 07:16:38 +00:00
17dca6da6a chore: bump rollup-plugin-flat-dts from 1.1.0 to 1.2.0 in /web3.js (#16087)
Bumps [rollup-plugin-flat-dts](https://github.com/run-z/rollup-plugin-flat-dts) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/run-z/rollup-plugin-flat-dts/releases)
- [Commits](https://github.com/run-z/rollup-plugin-flat-dts/compare/v1.1.0...v1.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-24 05:13:09 +00:00
560baa3296 chore: bump @typescript-eslint/parser from 4.18.0 to 4.19.0 in /web3.js (#16086)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.18.0 to 4.19.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.19.0/packages/parser)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-24 04:57:22 +00:00
665af3d26b chore: bump rollup from 2.42.0 to 2.42.3 in /web3.js (#16085)
Bumps [rollup](https://github.com/rollup/rollup) from 2.42.0 to 2.42.3.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.42.0...v2.42.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-24 04:43:16 +00:00
6f831edfb4 chore: bump @typescript-eslint/eslint-plugin in /web3.js (#16084)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.18.0 to 4.19.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.19.0/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-24 04:11:00 +00:00
812a86f217 chore: bump sinon from 9.2.4 to 10.0.0 in /web3.js (#16083)
Bumps [sinon](https://github.com/sinonjs/sinon) from 9.2.4 to 10.0.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v9.2.4...v10.0.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-24 03:48:32 +00:00
8c732268f5 chore: bump typedoc from 0.20.32 to 0.20.33 in /web3.js (#16053)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.20.32 to 0.20.33.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.20.32...v0.20.33)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-24 11:07:24 +08:00
c38936011e chore: bump @types/mocha from 8.2.1 to 8.2.2 in /web3.js (#16052)
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.2.1 to 8.2.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-24 11:07:09 +08:00
d6ef694139 feat: add logs subscription (#16045)
* feat: logs subscription

* fix: address review comments

* fix: use processed commitment

* fix: sleep before triggering log transaction
2021-03-24 11:05:17 +08:00
afbd09062d use certbot from apt not snap (#16081) 2021-03-23 22:22:47 +00:00
2d24d13046 AccountsSharedData: data copy on write (#15800)
* Arc<AccountData>

* try custom serializer

* adapt test from Behzad's change

* clippy

* simplify serialization

* remove abi example derive

* refactor 'take'

* remove serialization

* remove serialize calls

* remove account_data

* remove intos

* remove left over file
2021-03-23 15:19:31 -05:00
6f5d8d18e9 remove new alloc on deserialization (#15636) 2021-03-23 14:52:59 -05:00
e7fd7d46cf rpc: add getSlotLeaders method (#16057) 2021-03-23 17:48:54 +00:00
4f82b897bc buffers data shreds to make larger erasure coded sets (#15849)
Broadcast stage batches up to 8 entries:
https://github.com/solana-labs/solana/blob/79280b304/core/src/broadcast_stage/broadcast_utils.rs#L26-L29
which will be serialized into some number of shreds and chunked into FEC
sets of at most 32 shreds each:
https://github.com/solana-labs/solana/blob/79280b304/ledger/src/shred.rs#L576-L597
So depending on the size of entries, FEC sets can be small, which may
aggravate loss rate.
For example 16 FEC sets of 2:2 data/code shreds each have higher loss
rate than one 32:32 set.

This commit broadcasts data shreds immediately, but also buffers them
until it has a batch of 32 data shreds, at which point 32 coding shreds
are generated and broadcasted.
2021-03-23 14:52:38 +00:00
57ba86c821 eliminate lock on record (#15929)
* eliminate lock on record

* use same error as MaxHeightReached

* clippy

* review feedback

* refactor should_tick code

* pr feedback
2021-03-23 09:10:04 -05:00
6271665ba6 Avoid RPC in --sign-only mode
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2021-03-23 02:31:39 +00:00
3dff5c9dee transfer now requires --allow-unfunded-recipient if the recipient doesn't exist 2021-03-23 02:31:39 +00:00
d76ad33597 Handle blockstore insert dup checks (#16051) 2021-03-22 16:18:22 -07:00
fde43a906d revert test to use Account for serialization (#16063) 2021-03-22 22:48:09 +00:00
2fc609a294 add metric for ticks from poh_recorder.record (#16047) 2021-03-22 15:35:06 -05:00
ff2242d0e3 Update dashboard with new poh metrics (#15991) 2021-03-22 11:38:57 -07:00
482c027d3b sq: optimize 2021-03-22 12:01:57 -06:00
834fae684b perf: use saturating/checked integer arithmetic 2021-03-22 12:01:57 -06:00
63d0c78b20 web3.js: add support for batch getParsedConfirmedTransactions (#16001)
* feat: add support for batch requests

* feat: get confirmed transactions batch

* feat: test get parsed confirmed transactions

* fix: run prettier

* fix: test uses one signature

* fix: fix docs and return type on ParsedConfirmedTransactions

* fix: null values in test
2021-03-22 10:22:59 -07:00
a2dae8e8d4 chore: bump @types/node from 14.14.31 to 14.14.35 in /web3.js (#16011)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.31 to 14.14.35.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-22 17:35:04 +08:00
2c4ff000b9 explorer: minor cleanup and fixes (#15855)
* chore: bump web3 to v1.0.0

* explorer: minor cleanup and fixes
2021-03-20 16:22:22 +08:00
2ec24d438f Make getStakeActivation response consistent for undelegated accounts (#16038) 2021-03-19 14:54:56 -06:00
64429104b1 account data.fill replacement (#16037) 2021-03-19 15:13:20 -05:00
038f80d7fd fix: confirmed block timestamp tooltip was incorrect (#16036) 2021-03-19 11:52:43 -07:00
939c654752 Fix version more 2021-03-19 09:14:31 -07:00
ac75e386dd Fix version 2021-03-19 09:05:59 -07:00
B
b503215122 fix: logo rendering (#16005)
fix: logo rendering
2021-03-19 09:56:28 -05:00
ddc758439e metrics for poh_recorder.record (#15998) 2021-03-19 09:48:55 -05:00
3da9ab5d83 chore: bump eslint-plugin-mocha from 8.0.0 to 8.1.0 in /web3.js (#16033)
Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 8.0.0 to 8.1.0.
- [Release notes](https://github.com/lo1tuma/eslint-plugin-mocha/releases)
- [Changelog](https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/lo1tuma/eslint-plugin-mocha/compare/8.0.0...8.1.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 14:21:45 +00:00
a8b6dd7d91 chore: bump mocha from 8.3.0 to 8.3.2 in /web3.js (#16032)
Bumps [mocha](https://github.com/mochajs/mocha) from 8.3.0 to 8.3.2.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v8.3.0...v8.3.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 14:06:15 +00:00
89ccf2b65f chore: bump eslint from 7.21.0 to 7.22.0 in /web3.js (#16030)
Bumps [eslint](https://github.com/eslint/eslint) from 7.21.0 to 7.22.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.21.0...v7.22.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 13:48:41 +00:00
6cc22e62d4 program-test: Fix warp and staking issue (#16002)
Since program-test creates a test genesis and then adds fees and rent,
some of the genesis accounts get rent-collected after warping.  Most
notably, `StakeConfig` gets rent-collected, causing any stake operations
to fail after warp.  This fix creates genesis with the `Rent` and
`FeeRateGovernor` actually used by the bank.
2021-03-19 14:37:13 +01:00
2cd875f8e0 chore: bump chai from 4.3.1 to 4.3.4 in /web3.js (#16029)
Bumps [chai](https://github.com/chaijs/chai) from 4.3.1 to 4.3.4.
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/main/History.md)
- [Commits](https://github.com/chaijs/chai/compare/4.3.1...v4.3.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 13:26:14 +00:00
b996252b88 chore: bump @babel/plugin-transform-runtime in /web3.js (#16028)
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.12.17 to 7.13.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.10/packages/babel-plugin-transform-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 13:05:19 +00:00
413a2b71b5 chore: bump rollup-plugin-ts from 1.3.7 to 1.3.10 in /web3.js (#16027)
Bumps [rollup-plugin-ts](https://github.com/wessberg/rollup-plugin-ts) from 1.3.7 to 1.3.10.
- [Release notes](https://github.com/wessberg/rollup-plugin-ts/releases)
- [Changelog](https://github.com/wessberg/rollup-plugin-ts/blob/master/CHANGELOG.md)
- [Commits](https://github.com/wessberg/rollup-plugin-ts/compare/v1.3.7...v1.3.10)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 12:49:33 +00:00
75cf1cdd56 chore: bump typescript from 4.2.2 to 4.2.3 in /web3.js (#16026)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.2.2...v4.2.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 12:29:15 +00:00
33a49b487c chore: bump semantic-release from 17.4.0 to 17.4.2 in /web3.js (#16025)
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 17.4.0 to 17.4.2.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v17.4.0...v17.4.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 12:11:10 +00:00
869c5ba7e6 chore: bump @babel/preset-typescript from 7.12.16 to 7.13.0 in /web3.js (#16024)
Bumps [@babel/preset-typescript](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-typescript) from 7.12.16 to 7.13.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.0/packages/babel-preset-typescript)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 11:52:57 +00:00
4e10bcc306 chore: bump @typescript-eslint/eslint-plugin in /web3.js (#16023)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.16.1 to 4.18.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.18.0/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 11:38:58 +00:00
7ef0ef5d05 chore: bump start-server-and-test from 1.12.0 to 1.12.1 in /web3.js (#16022)
Bumps [start-server-and-test](https://github.com/bahmutov/start-server-and-test) from 1.12.0 to 1.12.1.
- [Release notes](https://github.com/bahmutov/start-server-and-test/releases)
- [Commits](https://github.com/bahmutov/start-server-and-test/compare/v1.12.0...v1.12.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 11:19:42 +00:00
14e45155e4 Bump bpf-tools to v1.2 and get rid of xargo 2021-03-19 12:09:15 +01:00
3d8c4f8389 chore: bump @typescript-eslint/parser from 4.16.1 to 4.18.0 in /web3.js (#16020)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.16.1 to 4.18.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.18.0/packages/parser)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 10:59:10 +00:00
54f1b2ea0e chore: bump typedoc from 0.20.31 to 0.20.32 in /web3.js (#16019)
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.20.31 to 0.20.32.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.20.31...v0.20.32)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 10:32:07 +00:00
aef3215722 Remove unneeded bpf sdk publishing automation (#15947) 2021-03-19 18:11:53 +08:00
5b08621c3f chore: bump rollup-plugin-flat-dts from 1.0.3 to 1.1.0 in /web3.js (#16018)
Bumps [rollup-plugin-flat-dts](https://github.com/run-z/rollup-plugin-flat-dts) from 1.0.3 to 1.1.0.
- [Release notes](https://github.com/run-z/rollup-plugin-flat-dts/releases)
- [Commits](https://github.com/run-z/rollup-plugin-flat-dts/compare/v1.0.3...v1.1.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 10:08:41 +00:00
0a726f1706 chore:(deps): bump @project-serum/serum in /explorer (#16017)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.26 to 0.13.27.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 09:57:58 +00:00
38ff6a4747 chore:(deps): bump @testing-library/user-event in /explorer (#16016)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.0.1 to 13.0.2.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v13.0.1...v13.0.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 09:50:00 +00:00
e9b08b5e7f fix: remove deprecated bpf-sdk, localnet, and examples
BREAKING CHANGE: Removed binaries solana-localnet and solana-bpf-sdk-install.
Please install the Solana CLI tools to download the BPF SDK and to
install the solana-test-validator binary intead.
2021-03-19 17:45:08 +08:00
f46f346710 chore: bump @babel/preset-env from 7.12.17 to 7.13.10 in /web3.js (#16015)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.12.17 to 7.13.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.10/packages/babel-preset-env)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 09:38:19 +00:00
06b97554e1 chore:(deps): bump @solana/spl-token-registry in /explorer (#16014)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.34 to 0.2.38.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.34...v0.2.38)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 09:18:20 +00:00
55c6fef962 chore:(deps): bump cross-fetch from 3.1.0 to 3.1.1 in /explorer (#16013)
Bumps [cross-fetch](https://github.com/lquixada/cross-fetch) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/lquixada/cross-fetch/releases)
- [Commits](https://github.com/lquixada/cross-fetch/compare/v3.1.0...v3.1.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 09:12:41 +00:00
2d3464a548 chore: bump rollup from 2.40.0 to 2.42.0 in /web3.js (#16010)
Bumps [rollup](https://github.com/rollup/rollup) from 2.40.0 to 2.42.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.40.0...v2.42.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 08:44:23 +00:00
07dc522981 docs: SIGUSR1 killing wrapper shell scripts 2021-03-19 07:22:11 +00:00
ac95fa058c chore: bump @babel/core from 7.12.17 to 7.13.10 in /web3.js (#15823)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.12.17 to 7.13.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.10/packages/babel-core)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 13:27:36 +08:00
a0f24f23b5 chore:(deps): bump cross-fetch from 3.0.6 to 3.1.0 in /explorer (#15869)
Bumps [cross-fetch](https://github.com/lquixada/cross-fetch) from 3.0.6 to 3.1.0.
- [Release notes](https://github.com/lquixada/cross-fetch/releases)
- [Commits](https://github.com/lquixada/cross-fetch/compare/v3.0.6...v3.1.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 13:27:19 +08:00
4a0d956a6a chore: bump @babel/runtime from 7.13.8 to 7.13.10 in /web3.js (#15935)
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.13.8 to 7.13.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.10/packages/babel-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 13:27:03 +08:00
4c5660ba7a Santize instruction index when loading instruction from sysvar (#15942) 2021-03-19 09:32:41 +08:00
f4db9e4275 feat: add support for signature received notifications (#15946)
* feat: add support for signature received notifications

* chore: update type comments
2021-03-19 01:30:36 +00:00
02b81dd05d Update to reqwest 0.11.2 2021-03-18 11:59:41 -07:00
067b390194 cli cleanup (#15990) 2021-03-18 18:29:42 +00:00
aa54c468ea rpc: Add config options limiting getConfirmedBlock response data (#15970)
* Add new confirmed block struct

* Add RpcConfirmedBlockConfig options

* Configure block response based on new options

* Add client api, use in cli fetch_epoch_rewards

* Update docs

* Apply review suggestions
2021-03-18 17:58:20 +00:00
9760fded2d remove old code (#15988) 2021-03-18 17:51:49 +00:00
4beb39f7a1 multi-pass bin scanning (#15377)
* multi-pass bin scanning

* pr feedback

* format

* fix typo

* adjust metrics for code changes

* merge errors
2021-03-18 10:32:07 -05:00
0988c2f1d6 feat: add support for blockTime on confirmed block (#15968) 2021-03-18 07:10:48 -07:00
689e03d341 chore:(deps): bump @testing-library/user-event in /explorer (#15985)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.0.0 to 13.0.1.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v13.0.0...v13.0.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-18 09:54:22 +00:00
561d55feef chore:(deps): bump @project-serum/serum in /explorer (#15984)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.25 to 0.13.26.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-18 09:29:54 +00:00
8670bd4589 chore:(deps): bump @solana/spl-token-registry in /explorer (#15983)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.33 to 0.2.34.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.33...v0.2.34)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-18 09:07:20 +00:00
7deddaa42d chore:(deps): bump @types/jest from 26.0.20 to 26.0.21 in /explorer (#15982)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.20 to 26.0.21.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-18 08:49:23 +00:00
ba33c9e18e Avoid panic when validator doesn't have performance samples (#15976) 2021-03-18 02:00:02 -06:00
2dabcac0da remote-wallet: Expose Ledger app settings 2021-03-18 07:29:16 +00:00
4ab98fff02 Avoid a panic when --slots-per-epoch is less than MINIMUM_SLOTS_PER_EPOCH 2021-03-18 05:45:21 +00:00
7f500d610c Add Close instrruction and tooling to upgradeable loader (#15887) 2021-03-17 21:39:29 -07:00
12399157f5 SDK: Allow integer math in bump allocator 2021-03-17 22:23:18 -06:00
854e6766ce SDK: Ovf in epoch_schedule 2021-03-17 22:23:18 -06:00
98d7673a03 sdk/program: switch allow to mod-level for integer_arithmetic lint 2021-03-17 22:23:18 -06:00
5b2b824a53 Sdk: remove integer arithmetic (#15962)
* Fix timing

* Fix secp256k1_instruction

* Fix secp256k1 tests
2021-03-18 01:33:50 +00:00
04c99cf7ea Add --slots-per-epoch argument 2021-03-17 22:56:41 +00:00
c06ff47a90 Add --slots-per-epoch validator 2021-03-17 22:56:41 +00:00
f548a04fae Allow unbounded wallclock processing time in tests (#15961) 2021-03-17 15:48:50 -07:00
03180b502d Avoid changing signature of ProgramTest::add_account 2021-03-17 13:21:43 -07:00
82269f1351 Build full SPL in CI 2021-03-17 13:21:43 -07:00
d30c9ef351 refactor test truncate data (#15851)
* refactor test truncate data

* retain existing behavior
2021-03-17 15:09:26 -05:00
59c19d9fbf Notice the user when the --mint, --bpf-program, or --clone arguments are ignored 2021-03-17 20:04:53 +00:00
8a9b51952e Ignore flaky test_banking_stage_entries_only and test_banking_stage_entryfication 2021-03-17 11:28:56 -07:00
a5d144b00f Revert to removing only tmp- 2021-03-17 10:31:01 -07:00
20b53eb4b4 Revert to snapshots 2 2021-03-17 10:31:01 -07:00
0b42379ed7 Revert to snapshots
Co-authored-by: Michael Vines <mvines@gmail.com>
2021-03-17 10:31:01 -07:00
a43b3674c7 add missed suggestion 2021-03-17 10:31:01 -07:00
cfb01e26dd Apply suggestions from code review
Co-authored-by: Michael Vines <mvines@gmail.com>
2021-03-17 10:31:01 -07:00
0209d334bd Add option for separate snapshot location
(cherry picked from commit 6126878f509c69e23480a5ec22b3271e2b16e072)
2021-03-17 10:31:01 -07:00
58b980f9cd Download snapshot files with a tmp- prefix so they'll automatically be cleaned up if interrupted 2021-03-17 09:10:10 -07:00
3160549e85 Replace solana-program-test when building example-helloworld 2021-03-17 09:07:52 -07:00
B
9b26c45be6 explorer/wormhole (#15948)
* feat: add lending instruction names

* chore: capitalize words

* feat: add wormhole card

* feat: add asset contract

* chore: format
2021-03-17 10:53:50 -05:00
40997d0aef add metrics for tick producer and poh_recorder (#15931) 2021-03-17 10:38:26 -05:00
5460fb10a2 drop poh lock after record (#15930) 2021-03-17 10:37:20 -05:00
d370b5a4d2 chore:(deps): bump @testing-library/user-event in /explorer (#15943)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 12.8.3 to 13.0.0.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v12.8.3...v13.0.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-17 09:31:42 +00:00
f1c4c3b719 chore:(deps): bump @solana/spl-token-registry in /explorer (#15941)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.30 to 0.2.33.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/v0.2.30...v0.2.33)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-17 08:46:18 +00:00
4e99f1e634 clap-utils: Add helper to CliSignerInfo for getting signers for a message 2021-03-16 22:09:46 -06:00
bf33ce8906 sdk: Add accessor for signer pubkeys of a tx message 2021-03-16 22:09:46 -06:00
d9176c1903 solana-install init can now select a pre-release from Github 2021-03-17 02:54:26 +00:00
51bc18f8c4 chore: fix coverage command 2021-03-17 10:26:00 +08:00
48b3b27985 chore: linter fixes 2021-03-17 10:26:00 +08:00
8ada44456d chore: migrate tests to typescript 2021-03-17 10:26:00 +08:00
f912c63b22 chore: migrate to typescript 2021-03-17 10:26:00 +08:00
3eb9f7b3eb chore: project config changes for typescript migration 2021-03-17 10:26:00 +08:00
3ea23fe736 fix: fix buffer types 2021-03-17 10:26:00 +08:00
a5c840e672 feat: update confirmation status typing and validations 2021-03-17 10:26:00 +08:00
d40dc06d6a fix: clean up unnecessary nullable validations 2021-03-17 10:26:00 +08:00
672e9c640f CLI: Support dumping the TX message in sign-only mode 2021-03-16 19:20:54 -06:00
98ea058ebe feat: require programId and keys for TransactionInstruction 2021-03-17 09:10:17 +08:00
806bfdd67b set_data_from_slice (#15854)
* data_ensure_equal_to_slice

* rename and change to copy
2021-03-16 16:56:26 -05:00
654449ce91 Bump tokio to 1.1 (#15926) 2021-03-16 21:32:50 +00:00
0c4c89ff4a explorer: display wormhole bridge details (#15833)
* feat: display wormhole bridge details

* fix: add rel noopener noreferrer

* fix: extract eth address properly

* feat: copyable bridge contract address
2021-03-16 18:47:43 +00:00
61112d4826 fix: compute pre/post token balances on all accounts if token program present (#15900)
* fix: compute pre/post token balances on all accounts if token program present

* fix: skip token program in balance query

* fix: prevent program ids from being collected
2021-03-16 16:49:22 +00:00
1c261d293f Encourage use of the default --ledger location 2021-03-16 16:36:59 +00:00
3b85cbc504 renames is_last_in_fec_set back to is_last_data (#15848)
https://github.com/solana-labs/solana/pull/10095
renamed is_last_data to is_last_in_fec_set. However, the code shows that
this is actually meant to indicate where the serialized data is
complete:
https://github.com/solana-labs/solana/blob/420174d3d/ledger/src/shred.rs#L599-L600
https://github.com/solana-labs/solana/blob/420174d3d/ledger/src/shred.rs#L229-L231

There are multiple FEC sets for each `&[Entry]` serialized and this flag
does not represent shreds last in FEC sets (only the very last one by
overlap). So the name is wrong and confusing
2021-03-16 10:09:16 +00:00
97e5591a63 chore:(deps): bump @solana/spl-token-registry in /explorer (#15915)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.2 to 0.2.30.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Changelog](https://github.com/solana-labs/token-list/blob/main/CHANGELOG.md)
- [Commits](https://github.com/solana-labs/token-list/compare/0.2.2...v0.2.30)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-16 08:49:52 +00:00
a8a3f4d362 chore:(deps): bump @types/node from 14.14.33 to 14.14.35 in /explorer (#15914)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.33 to 14.14.35.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-16 08:44:42 +00:00
3726358f51 Cli: better estimate of epoch time elapsed/remaining (#15893)
* Add rpc_client api for getRecentPerformanceSamples

* Prep fn for variable avg slot time

* Use recent-perf-samples to more-accurately estimate epoch completed times

* Spell out average
2021-03-16 08:35:27 +00:00
eb19e11688 Add cargo-bpf-test --no-run flag, matching cargo-test 2021-03-16 08:23:03 +00:00
4be9d7fd29 Pin solana crate versions to prevent downstream users from accidentally mixing crate versions 2021-03-16 07:51:07 +00:00
a2eb655322 =1.7.0 2021-03-16 07:51:07 +00:00
5760cf0f41 nit: fix spelling (#15908) 2021-03-15 23:47:57 -07:00
74aa32175b Show flags for accounts in tx by solana confirm (#15804)
* Show flags for accounts in tx by solana confirm

* Address review comments

* Improve comment a bit

* Apply suggestions from code review

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

* Further apply review suggestions

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-03-16 14:44:48 +09:00
ad9901d7c6 Charge compute budget for bytes passed via cpi (#15874) 2021-03-15 22:41:44 -07:00
8567b41d5f Improve Instruction::new deprecation warning 2021-03-15 20:04:20 -07:00
430ed6d774 Export tokio for program-test clients 2021-03-15 20:03:55 -07:00
efee8b62d7 a few missed set_data calls (#15846)
* a few missed set_data calls

* another set data call
2021-03-15 21:57:23 -05:00
e50f284658 use Account for test since it borrows mut ref to data (#15852) 2021-03-15 21:56:48 -05:00
e35d738906 rework BankClient.get_account_data (#15853) 2021-03-15 19:27:53 -05:00
c09ea2c314 More AccountSharedData construction (#15844)
* one more AccountSharedData construction

* one more construct
2021-03-15 19:27:17 -05:00
2bf46b789f Also ignore */node_modules/* paths when bumping version 2021-03-16 00:27:11 +00:00
510760d81b Ignore not_paths for *.md files when bumping version 2021-03-16 00:27:11 +00:00
853e735edf Disallow version bump with dirty working tree 2021-03-16 00:27:11 +00:00
c1ba265dd9 Wallclock BankingStage Throttle (#15731) 2021-03-15 17:11:15 -07:00
60e5fd11c9 Display actual account length (#15875) 2021-03-15 14:17:56 -07:00
699888dfb3 Update cargo lock files on version bump 2021-03-15 20:03:01 +00:00
c40bd5f394 Fix real_number_string_trimmed zero-decimal behavior (#15873)
* Add failing test

* Don't strip zeroes from zero-decimal amounts

* Add zero-case test
2021-03-15 18:32:40 +00:00
85b4578b14 chore:(deps): bump chai from 4.3.3 to 4.3.4 in /explorer (#15867)
Bumps [chai](https://github.com/chaijs/chai) from 4.3.3 to 4.3.4.
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/main/History.md)
- [Commits](https://github.com/chaijs/chai/compare/4.3.3...v4.3.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-15 09:47:39 +00:00
cb9fded508 chore:(deps): bump @solana/spl-token-registry in /explorer (#15866)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.1 to 0.2.2.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Commits](https://github.com/solana-labs/token-list/compare/0.2.1...0.2.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-15 09:43:21 +00:00
134eccc273 chore:(deps): bump @types/socket.io-client in /explorer (#15865)
Bumps [@types/socket.io-client](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/socket.io-client) from 1.4.35 to 1.4.36.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/socket.io-client)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-15 09:38:49 +00:00
821be88d13 chore: bump rpc-websockets from 7.4.8 to 7.4.9 in /web3.js (#15822)
Bumps [rpc-websockets](https://github.com/elpheria/rpc-websockets) from 7.4.8 to 7.4.9.
- [Release notes](https://github.com/elpheria/rpc-websockets/releases)
- [Commits](https://github.com/elpheria/rpc-websockets/compare/v7.4.8...v7.4.9)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-15 15:53:40 +08:00
a36d2f2d3e fix: use uiAmountString in token balances component (#15860) 2021-03-15 04:25:09 +00:00
420174d3dd explorer: Fix midnight timestamps (#15843) 2021-03-14 11:26:14 +08:00
485a943958 explorer: Add label for serum dex v1 (#15842) 2021-03-14 10:20:31 +08:00
3722f46089 explorer: Add token symbol to token label (#15841) 2021-03-14 10:16:32 +08:00
eab182188a Fix delinquent stake display 2021-03-13 18:58:04 +00:00
c4f98f9c73 explorer: Add details pages for upgradeable loader accounts (#15836) 2021-03-14 01:11:59 +08:00
0c9ca5522c Bump version to v1.7.0 2021-03-13 09:01:21 +00:00
186b342453 explorer: Update superstruct (#15835) 2021-03-13 13:31:52 +08:00
5b2da19c93 Rpc: support extended config for getConfirmedBlock (#15827)
* Add rpc confirmed-block config wrapper to support struct of extended config

* Update docs

* Make config wrapper generic and use in getConfirmedTransaction as well

* Update/clean confirmed-tx docs
2021-03-12 22:19:45 +00:00
79280b304b solana-install update now updates a named release to the latest patch version 2021-03-12 12:30:51 -08:00
66b4124a68 cli-config: Ovf in ws port calculation 2021-03-12 10:26:15 -07:00
193e370186 frozen-abi: Ovf in digester child depth calculation 2021-03-12 09:41:33 -07:00
14985420fd frozen-abi: Ovf in enum variant count 2021-03-12 09:41:33 -07:00
567e54aaa3 frozen-abi: disallow integer arithmetic lint 2021-03-12 09:41:33 -07:00
f2865dfd63 requires stakes for propagating crds values through gossip (#15561) 2021-03-12 15:50:14 +00:00
be99cef593 explorer: Filter program search results by cluster (#15820) 2021-03-12 22:10:38 +08:00
822cb93495 chore: bump @commitlint/travis-cli from 11.0.0 to 12.0.1 in /web3.js (#15672)
Bumps [@commitlint/travis-cli](https://github.com/conventional-changelog/commitlint) from 11.0.0 to 12.0.1.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/compare/v11.0.0...v12.0.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-12 21:45:25 +08:00
c496177a86 chore: bump bn.js from 5.1.3 to 5.2.0 in /web3.js (#15673)
Bumps [bn.js](https://github.com/indutny/bn.js) from 5.1.3 to 5.2.0.
- [Release notes](https://github.com/indutny/bn.js/releases)
- [Changelog](https://github.com/indutny/bn.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/indutny/bn.js/compare/v5.1.3...v5.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-12 21:45:18 +08:00
004f98fba9 chore:(deps): bump @solana/spl-token-registry in /explorer (#15819)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.2.0 to 0.2.1.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Commits](https://github.com/solana-labs/token-list/compare/0.2.0...0.2.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-12 21:44:52 +08:00
918d04e3f0 Add more slot update notifications (#15734)
* Add more slot update notifications

* fix merge

* Address feedback and add integration test

* switch to datapoint

* remove unused shred method

* fix clippy

* new thread for rpc completed slots

* remove extra constant

* fixes

* rely on channel closing

* fix check
2021-03-12 21:44:06 +08:00
28c27893b9 chore:(deps): bump @sentry/react from 6.2.0 to 6.2.2 in /explorer (#15818)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 6.2.0 to 6.2.2.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/6.2.0...6.2.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-12 09:17:37 +00:00
e5b644e830 Add trait for saturating arithmetic (#15812)
* Add SaturatingArithmetic trait

* Use Duration saturating arithmetic

* Use new macro to fix poh_config
2021-03-12 06:22:40 +00:00
cc38ae72e7 Skip deserialization of readonly accounts (#15813) 2021-03-11 19:28:21 -08:00
4bbeb9c033 Remove old feature: simple_capitalization (#15763)
* Remove old feature: simple_capitalization

* Fix another failing test in core

* Finish up test cleanup

* Further clean up a bit
2021-03-12 11:12:40 +09:00
209dbb6f7c sec: Create private repo as part of new advisory step 2021-03-12 01:40:21 +00:00
952c3bcbb7 AccountSharedData construction (#15790) 2021-03-11 18:09:04 -06:00
3419a5446e AccountSharedData.set_data (#15781)
* account.set_data and resize_data

* remove data_resize
2021-03-11 16:40:45 -06:00
e1ceb430e3 cli: improve deploy error reporting (#15806) 2021-03-11 13:44:21 -08:00
aa2b2d6b75 Default --ledger arg to "ledger" for solana-validator and solana-ledger-tool 2021-03-11 13:09:30 -08:00
1061d021c9 Unpack snapshot AppendVecs directly into account paths 2021-03-11 08:25:24 -08:00
c078e01fa9 add catchup average speed and remaining time (#15608)
* add catchup average speed and remaining time

* code style and improve average time remaining calculation

* code style

* remove instant time remaining

* negative speed perceives better

* Some little improves and comments of catchup avg and eta

* format code of catchup avg and eta

* fix copy-paste error
2021-03-11 23:59:33 +09:00
79ac1997de sdk: add macro for unchecked div with const denominator 2021-03-11 08:44:36 +00:00
c4ee1ab710 docs: deprecate lastvalidslot field of jsonrpc getfees 2021-03-11 08:38:18 +00:00
45190f6281 docs: stabilize spl token jsonrpc methods 2021-03-11 08:38:18 +00:00
9c8be34906 docs: 'builtins' -> 'runtime facilities' 2021-03-11 08:38:18 +00:00
0e452c8d91 docs: rename 'deployed programs' section to 'on-chain programs' 2021-03-11 08:38:18 +00:00
3e6c7c4a3e docs: add rust client api entry 2021-03-11 08:38:18 +00:00
24d18b3cf2 docs: add docs links for crates published to crates.io 2021-03-11 08:38:18 +00:00
478518308d Share RO and Executable accounts within invocations (#15799) 2021-03-10 23:04:00 -08:00
ac8ccee6b8 Add --force and --monitor options to exit subcommand 2021-03-11 05:17:31 +00:00
65dd177601 AppendVec cleanup: remove dead code, rename non-idiomatic "new" function 2021-03-10 14:50:59 -08:00
1135ffd595 mut data refs as slice (#15782) 2021-03-10 15:28:03 -06:00
56923c91bf limits number of unique pubkeys in the crds table (#15539) 2021-03-10 20:46:05 +00:00
9c1198c0c7 Improve load_largest_accounts more (#15785)
* Add load_largest_accounts bench

* Check lamports before address filter

* Use BinaryHeap, add Accounts test

* Use pubkey reference in the min-heap

Also, flatten code with early returns

Co-authored-by: Greg Fitzgerald <greg@solana.com>
2021-03-10 11:22:02 -07:00
369e13b111 cleanup old runtime features (#15787) 2021-03-10 09:48:41 -08:00
c5a5d7457e Bump bpf-tools to v1.1 (#15776) 2021-03-10 18:13:38 +01:00
c836cd85c3 Default to the BPF JIT. Use the solana-validator --no-bpf-jit flag to disable 2021-03-10 08:37:35 -08:00
ab21171e2a chore:(deps): bump @testing-library/user-event in /explorer (#15789)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 12.8.0 to 12.8.3.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v12.8.0...v12.8.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-10 09:28:27 +00:00
61011f626f chore:(deps): bump @types/node from 14.14.32 to 14.14.33 in /explorer (#15788)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.32 to 14.14.33.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-10 09:16:34 +00:00
3355efbb5a Fix test to use AccountSharedData 2021-03-09 20:47:54 -07:00
12937eb604 chore:(deps): bump @types/react from 17.0.2 to 17.0.3 in /explorer (#15773)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 17.0.2 to 17.0.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-10 10:56:49 +08:00
5991cef5f5 Improve load_largest_accounts and add Bank test (#15775) 2021-03-10 00:23:41 +00:00
52e54e1100 account.data -> data() (#15778) 2021-03-09 22:31:33 +00:00
8a3135d17b Account->AccountSharedData (#15691) 2021-03-09 15:06:07 -06:00
61c7ce857e fix: vote timestamp is nullable (#15774) 2021-03-09 15:50:37 +00:00
a23e653fa1 chore:(deps): bump @types/react-dom from 17.0.1 to 17.0.2 in /explorer (#15772)
Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 17.0.1 to 17.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-09 09:17:16 +00:00
2bee9435f3 Add tracer key for tracing transaction path through the network (#15732) 2021-03-08 19:31:00 -08:00
331c45decf Report datapoint on number of retransmit shreds (#15694) 2021-03-08 17:54:53 -08:00
e3e8179f2d Sdk: start to appease clippy's integer arithmetic check (#15736)
* Move to module-level clippy allowance

* Fix stake_weighted_timestamp math

* Fix genesis_config

* Fix shred_version

* Fix hard_forks

* Fix process_instruction

* Add ArithmeticOverflow ix error

* Fix nonce_keyed_account

* Update BankSlotDelta frozen abi due to new ix error
2021-03-08 18:37:57 -07:00
cae8f61952 Fix typo 2021-03-09 00:00:35 +01:00
5bde399499 Explorer: update to new spl-token-registry standard (#15765)
* feat: update tokenlist

* feat: bump spl-token-registry version to 0.2.0
2021-03-08 14:23:07 -08:00
2204898ded Update validator_list.rs 2021-03-08 15:09:29 -07:00
a7d5645f72 Clean up security group exclusion in validator list 2021-03-08 11:50:57 -07:00
a2db697ca3 chore:(deps): bump react-select from 4.2.0 to 4.2.1 in /explorer (#15762)
Bumps [react-select](https://github.com/JedWatson/react-select) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/JedWatson/react-select/releases)
- [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/JedWatson/react-select/compare/react-select@4.2.0...react-select@4.2.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-08 09:54:53 +00:00
003677fb8b chore:(deps): bump @types/node from 14.14.31 to 14.14.32 in /explorer (#15761)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.31 to 14.14.32.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-08 09:33:05 +00:00
beac2d6d3f Remove stale comment 2021-03-08 10:18:32 +09:00
8b0c6db871 Remove old feature: cumulative_rent_related_fixes (#15754) 2021-03-08 09:58:50 +09:00
3a1d51c657 Avoid destaking all nodes when there are no quality block producers 2021-03-06 20:56:08 -08:00
76ddc93358 The --identity argument is now required 2021-03-06 19:08:37 -08:00
04d11ca6c6 Slow down solana-validator monitor refresh interval when talking to a real node 2021-03-07 00:51:02 +00:00
b2b7617ec3 Show cluster average rate (#15752) 2021-03-06 21:30:21 +00:00
efcb58092e Add more duplicate account tests (#15746) 2021-03-05 20:36:27 -08:00
d09112fa6d PoH batch size calibration (#15717) 2021-03-05 16:01:21 -08:00
c5371fdc85 More debug on shrink and flush (#15518) 2021-03-05 14:10:34 -08:00
437d9311fb fix: structs need to use pick instead of object, and add uiAmountString (#15745) 2021-03-05 14:08:40 -08:00
a43a783aa4 Explorer: update TokenLargestAccounts to use uiAmountString. (#15743)
* feat: bump web3 to 0.94.2

* fix: update token largest accounts component to support uiAmountString

* fix: format code
2021-03-05 20:20:30 +00:00
11c154dfb9 Explorer: support uiAmountString api updates (#15742)
* fix: support uiAmountString api updates

* fix: remove this uiAmount

* fix: change owned account section and token account section to support BigNumber uiAmountString

* fix: update web3 to latest
2021-03-05 19:34:26 +00:00
4a3ab77baf Remove unused id field 2021-03-05 19:07:59 +00:00
f2ce5f6c82 fix: add TokenAccountBalancePair.uiAmountString (#15741) 2021-03-05 18:53:45 +00:00
d61b74919b fix: add TokenAmount.uiAmountString (#15739) 2021-03-05 11:01:37 -07:00
66b781eec3 Add 'unknown' health check state 2021-03-05 17:46:50 +00:00
ee621878b0 [auto-commit] Update all Cargo lock files 2021-03-05 09:06:36 -08:00
4eab51fe06 chore: bump env_logger from 0.8.2 to 0.8.3
Bumps [env_logger](https://github.com/env-logger-rs/env_logger) from 0.8.2 to 0.8.3.
- [Release notes](https://github.com/env-logger-rs/env_logger/releases)
- [Changelog](https://github.com/env-logger-rs/env_logger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/env-logger-rs/env_logger/compare/v0.8.2...v0.8.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-05 09:06:36 -08:00
13b9bb6790 refactor function to store into account after data is finished (#15710) 2021-03-05 11:02:35 -06:00
9448540ea6 log timing after ledger process (#15716) 2021-03-05 11:01:52 -06:00
7e65289729 Convert blockstore TransactionStatus column family to protobufs (#15733)
* Prevent panic if TransactionStatus can't be deserialized

* Convert Blockstore TransactionStatus column to protobuf

* Add compatability test
2021-03-05 09:05:35 -07:00
bd13262b42 Add validator startup process reporting before RPC is available 2021-03-05 08:03:36 -08:00
2cc695bb5d Update validator_list.rs 2021-03-05 08:27:34 -07:00
718b105ec4 Update validator_list.rs 2021-03-05 08:23:55 -07:00
1fc8836631 Add timeout to prevent infinite loop (#15715) 2021-03-05 21:37:46 +09:00
65eb9ae754 chore:(deps): bump typescript from 4.2.2 to 4.2.3 in /explorer (#15730)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-05 09:40:55 +00:00
4eaa3d5faf chore:(deps): bump react-select from 4.1.0 to 4.2.0 in /explorer (#15729)
Bumps [react-select](https://github.com/JedWatson/react-select) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/JedWatson/react-select/releases)
- [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/JedWatson/react-select/compare/react-select@4.1.0...react-select@4.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-05 09:16:32 +00:00
9c8e7564ed Update deploy-a-program.md (#15727) 2021-03-05 01:41:33 -07:00
edd159e7d7 Fix typos (#15721) 2021-03-05 07:16:53 +00:00
f035b9c7cd chore: bump hidapi from 1.2.3 to 1.2.5
Bumps [hidapi](https://github.com/ruabmbua/hidapi-rs) from 1.2.3 to 1.2.5.
- [Release notes](https://github.com/ruabmbua/hidapi-rs/releases)
- [Commits](https://github.com/ruabmbua/hidapi-rs/commits/v1.2.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-04 18:09:28 -08:00
e7a4349b0e chore: bump fd-lock from 1.1.1 to 2.0.0
Bumps [fd-lock](https://github.com/yoshuawuyts/fd-lock) from 1.1.1 to 2.0.0.
- [Release notes](https://github.com/yoshuawuyts/fd-lock/releases)
- [Commits](https://github.com/yoshuawuyts/fd-lock/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-04 18:08:53 -08:00
24ab84936e Break up RPC API into three categories: minimal, full and admin 2021-03-04 16:39:44 -08:00
81253c9956 chore: remove undocumented validatorExit method 2021-03-04 16:39:44 -08:00
872f7117c3 Use OrderedIterator to produce TransactionLogInfo (#15712)
* Add failing test

* Fix iteration_order issue with stored logs
2021-03-04 15:26:19 -07:00
f2f6dd4def Update validator_list.rs 2021-03-04 14:56:18 -07:00
1e2f5a5f55 Permit the snapshots/status_cache file to be sparse 2021-03-04 12:36:34 -08:00
fb3837260c Add BPf loader finalize test via inner instruction (#15708) 2021-03-04 20:34:36 +00:00
99f0d29dd1 Update validator_list.rs 2021-03-04 13:11:01 -07:00
2177e0aff8 cli: add program show for non-upgradeable programs (#15707) 2021-03-04 19:42:15 +00:00
34bebb7d09 report execution details in replay time (#15693) 2021-03-04 11:38:12 -06:00
f72640c9b2 explorer: Display transaction success stats (#15704) 2021-03-04 23:58:22 +08:00
efa3cd711c explorer: Add tabs for block program and account stats (#15702) 2021-03-04 21:12:41 +08:00
7bf430b360 Add serum program to search results (#15703) 2021-03-04 20:48:54 +08:00
1b76c019cb chore:(deps): bump chai from 4.3.0 to 4.3.3 in /explorer (#15700)
Bumps [chai](https://github.com/chaijs/chai) from 4.3.0 to 4.3.3.
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/main/History.md)
- [Commits](https://github.com/chaijs/chai/compare/4.3.0...4.3.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-04 09:15:47 +00:00
b53cb8eb2d Deprecate Instruction::new (#15695) 2021-03-04 05:46:48 +00:00
d6ea2f392b docs: address post-merge review of #15649 2021-03-04 05:19:48 +00:00
4a05210d8e Clarify Instruction::new (#15686)
Not related to local-cluster, merging
2021-03-03 17:39:04 -08:00
bbf7ded997 SoM: Gate cluster average skip rate behind a flag 2021-03-03 16:24:04 -08:00
e5ebe61687 SoM: Plumb Config through classify_producers() 2021-03-03 16:24:04 -08:00
22d2bb9a9c invert default behavior of index hashing (#15689) 2021-03-03 18:12:18 -06:00
be35c1c1b7 add execute detail timings (#15638) 2021-03-03 17:07:45 -06:00
9bbe015a05 Document and clean up AppendVec (#15640)
* Document AppendVec

* Remove the almost-duplicate state in AppendVec

AppendVec was maintaining two offsets, `current_len` and
`append_offset`. Despite the different looking names, the two
values have the same meaning, but were updated at slightly different
times. When appending a batch of accounts, `current_len` updates would
be immediately available to other threads after each append, whereas
`append_offset` would only be updated after its mutex was unlocked.
`append_offset` is redundant. By removing it, we eliminate potential
bugs and no longer need to suppress clippy warnings.

* Remove get_mut() from AppendVec design

Only the offset into the AppendVec memory is thread-safe. The memory
itself is only threadsafe because it is append-only and is otherwise
unprotected. Adding get_mut() would only be safe if the memory was
protected by a ReadWrite lock.
2021-03-03 12:51:48 -08:00
5cd6a0c2f1 Docs: Update validator hardware recommendations 2021-03-03 20:39:37 +00:00
658951e680 sends only the latest vote of each validator to the banking stage (#15629) 2021-03-03 19:07:16 +00:00
aacb28c453 Only report metrics every second (#15652) 2021-03-03 10:58:47 -08:00
830be855dc Forward and hold packets (#15634) 2021-03-03 10:23:05 -08:00
6acb06f8d8 refactor: Use UINT64_MAX to replace hardcoded number (#15676) 2021-03-03 17:16:18 +00:00
0970653b6a feat: add two additional Serum markets to Explorer (#15680) 2021-03-03 08:49:40 -08:00
8d0d6ded01 feat: introduce three new Serum instructions and program ID, rename bpf-upgradeable-loader card (#15679) 2021-03-03 16:43:06 +00:00
9a43679fe1 feat: new rounded tether icon for Explorer (#15677) 2021-03-03 07:53:45 -08:00
77019caf08 chore: bump @typescript-eslint/eslint-plugin in /web3.js (#15671)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.15.1 to 4.16.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.16.1/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 11:42:19 +00:00
381e103bff chore: bump @commitlint/config-conventional in /web3.js (#15670)
Bumps [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint) from 11.0.0 to 12.0.1.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/compare/v11.0.0...v12.0.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 11:22:16 +00:00
9b98a6749a chore: bump @types/node from 14.14.30 to 14.14.31 in /web3.js (#15669)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.30 to 14.14.31.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 11:17:41 +00:00
b6f94cacdf chore: bump @typescript-eslint/parser from 4.15.2 to 4.16.1 in /web3.js (#15668)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.15.2 to 4.16.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.16.1/packages/parser)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 11:01:22 +00:00
e909f05556 chore: bump semantic-release from 17.3.9 to 17.4.0 in /web3.js (#15667)
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 17.3.9 to 17.4.0.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v17.3.9...v17.4.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 10:44:01 +00:00
a88f264a25 chore: bump @babel/register from 7.12.13 to 7.13.8 in /web3.js (#15666)
Bumps [@babel/register](https://github.com/babel/babel/tree/HEAD/packages/babel-register) from 7.12.13 to 7.13.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.8/packages/babel-register)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 10:40:37 +00:00
9eefe7a3f2 chore: bump eslint-plugin-flowtype from 5.2.2 to 5.3.1 in /web3.js (#15664)
Bumps [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype) from 5.2.2 to 5.3.1.
- [Release notes](https://github.com/gajus/eslint-plugin-flowtype/releases)
- [Commits](https://github.com/gajus/eslint-plugin-flowtype/compare/v5.2.2...v5.3.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 10:13:06 +00:00
06324c08b8 chore:(deps): bump @project-serum/serum in /explorer (#15663)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.24 to 0.13.25.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 09:58:55 +00:00
0746e780c4 chore: bump eslint from 7.20.0 to 7.21.0 in /web3.js (#15661)
Bumps [eslint](https://github.com/eslint/eslint) from 7.20.0 to 7.21.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.20.0...v7.21.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 09:57:38 +00:00
e107f88f57 chore: bump typescript from 4.1.5 to 4.2.2 in /web3.js (#15659)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.5 to 4.2.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.1.5...v4.2.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 09:41:42 +00:00
b8e28b8c55 Remove unnecessary packet meta abi lock (#15653) 2021-03-03 17:31:52 +08:00
8db31a0edc chore: bump chai from 4.3.0 to 4.3.1 in /web3.js (#15656)
Bumps [chai](https://github.com/chaijs/chai) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/main/History.md)
- [Commits](https://github.com/chaijs/chai/compare/4.3.0...4.3.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 09:26:29 +00:00
053e21f92c chore:(deps): bump @solana/web3.js from 0.93.0 to 0.94.0 in /explorer (#15658)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 0.93.0 to 0.94.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v0.93.0...v0.94.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 09:25:19 +00:00
19ac79b5cc Deprecate UiTokenAmount::ui_amount (#15616)
* Add TokenAmount::ui_amount_string

* Fixup solana-tokens

* Update docs
2021-03-02 22:51:41 -07:00
a9c8dbfd0c Add error reporting to system program (#15644) 2021-03-02 21:44:25 -08:00
a4f0033bd7 Remove ValidatorConfig derive Clone, and fix local-cluster tests (#15647)
* Remove ValidatorConfig derive Clone

* Add local-cluster ValidatorConfig helpers

* Fix benches
2021-03-03 04:21:30 +00:00
b20bf8ebb0 improve cli insufficient funds error messages 2021-03-02 20:07:34 -08:00
00f2b039b4 Remove Hackathon banner 2021-03-02 18:19:37 -08:00
0bd0084b0d adds more metrics for tx counts and batch sizes (#15642) 2021-03-03 01:28:15 +00:00
a2c47db920 extract expected cluster type (#15615)
* extract expected cluster type

* fix clippy warning

* more clippy
2021-03-02 13:55:34 -06:00
7435a7b0ed feat: support creating secp256k1 instructions with eth address (#15626) 2021-03-03 02:16:36 +08:00
43663b1750 Fix clippy warnings (#15632) 2021-03-02 08:58:14 -08:00
da47ab7e50 fix indentation format problem (#15618)
* fix indentation format problem

* fix indentation format problem
2021-03-02 10:46:00 -06:00
aad79d9d5c Remove unused Accounts state (#15611)
* Remove dead state from Accounts

* Refactor to remove reference to self.slot

Account::default() has zero lamports, so would return None anyway
2021-03-02 08:28:25 -08:00
2ff6942ed3 Use cluster average skip rate for stake-o-matic (#15579) 2021-03-02 07:45:17 -08:00
416ea38028 adds metrics for the size and number of batches in bank_send_loop (#15627) 2021-03-02 15:44:35 +00:00
2463cc1e6a Fix typos (#15610) 2021-03-02 06:36:49 -08:00
d73af9c1dd cli: don't overallocate upgradeable buffer accounts (#15603) 2021-03-02 00:45:53 -08:00
4789a13a6e configure rust-bpf toolchain for each tree (#15620) 2021-03-02 00:45:28 -08:00
acf5e4e219 Update Cargo.lock 2021-03-02 00:53:14 -07:00
3cd00965a7 Enable BPF program instruction traces (#15613) 2021-03-01 23:11:58 -08:00
4f63afce32 ci: drop redundant programs/bpf audit 2021-03-01 21:24:57 -07:00
15e1314209 ci: disallow uncommitted Cargo.lock changes 2021-03-01 21:24:57 -07:00
3c1dd891af ci: checks - factor out audit so it can run independently 2021-03-01 21:24:57 -07:00
21f66179ba ci: run clippy before fmt 2021-03-01 21:24:57 -07:00
fbb1012584 cli: dump non-upgradeable programs (#15598) 2021-03-01 18:11:45 -08:00
55f357153a fix: secp256k1 instruction should accept 64 byte public key (#15584) 2021-03-02 09:01:31 +08:00
640e36287e Move ValidatorExit into ValidatorConfig, making it accessible from the solana-validator crate 2021-03-01 16:49:56 -08:00
f1223fb783 Lower blockstore processor error severity (#15578) 2021-03-01 14:57:37 -08:00
8c73187b1e fix: expand vote details card to cover all instructions (#15602) 2021-03-01 13:45:19 -08:00
d679eff3fa fix: remove old hotfix for web3 inner instructions (#15604) 2021-03-01 13:44:43 -08:00
ccb604f8c3 Pass audit ignores to bpf program audit 2021-03-01 21:10:46 +00:00
85252777a6 Add RUSTSEC-2020-0146 to audit ignores 2021-03-01 21:10:46 +00:00
ef63ffce7d Bump ed25519-dalek to 1.0.1 2021-03-01 21:10:46 +00:00
24af9961d2 hotfix: explorer temporary disable vote instruction card (#15596) 2021-03-01 18:05:51 +00:00
aee7012aed Update validator_list.rs 2021-03-01 10:07:57 -07:00
23535bb032 Update validator_list.rs 2021-03-01 10:00:20 -07:00
abe7fbde13 Update validator_list.rs 2021-03-01 09:57:31 -07:00
8a06fc8846 chore: bump @typescript-eslint/parser from 4.15.1 to 4.15.2 in /web3.js (#15594)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.15.1 to 4.15.2.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.15.2/packages/parser)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 13:09:07 +00:00
ebb298819f chore: bump rollup from 2.39.0 to 2.40.0 in /web3.js (#15593)
Bumps [rollup](https://github.com/rollup/rollup) from 2.39.0 to 2.40.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.39.0...v2.40.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 12:43:49 +00:00
0946691209 chore: bump @rollup/plugin-replace from 2.4.0 to 2.4.1 in /web3.js (#15592)
Bumps [@rollup/plugin-replace](https://github.com/rollup/plugins) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Commits](https://github.com/rollup/plugins/compare/replace-v2.4.0...replace-v2.4.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 11:58:05 +00:00
a03a412468 chore: bump @babel/plugin-proposal-class-properties in /web3.js (#15591)
Bumps [@babel/plugin-proposal-class-properties](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-proposal-class-properties) from 7.12.13 to 7.13.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.0/packages/babel-plugin-proposal-class-properties)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 11:30:13 +00:00
958b2281bb chore:(deps): bump @project-serum/serum in /explorer (#15590)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.23 to 0.13.24.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 10:31:10 +00:00
f1d4c58d28 chore: bump @babel/runtime from 7.12.18 to 7.13.8 in /web3.js (#15587)
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.12.18 to 7.13.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.8/packages/babel-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 10:08:53 +00:00
2e54138efc chore:(deps): bump @solana/spl-token-registry in /explorer (#15588)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.1.7 to 0.1.9.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Commits](https://github.com/solana-labs/token-list/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 10:06:14 +00:00
5b9fbc6f53 chore:(deps): bump @testing-library/user-event in /explorer (#15586)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 12.7.3 to 12.8.0.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v12.7.3...v12.8.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 09:36:40 +00:00
ae96ba3459 Plumb slot update pubsub notifications (#15488) 2021-02-28 23:29:11 -08:00
33eaa2b238 Sort forks in "ledger processed..." log message 2021-02-28 17:32:50 -08:00
334b581df2 Skip poh speed test for local demo (#15580) 2021-02-28 13:03:56 -08:00
21e08b5b2c CLI: Support querying fees by blockhash 2021-02-27 12:45:14 -07:00
ebd56f7ff4 cli-output: Minor refactor of CliFees 2021-02-27 12:45:14 -07:00
3998807dcc Update testnet break RPC node identity 2021-02-27 09:34:04 -08:00
30c7ac2157 SoM: Support destaking based on infrastructure concentration 2021-02-27 09:46:44 +00:00
c35ca969b5 SoM: Add client for validators.app API 2021-02-27 09:46:44 +00:00
e7895e4411 notifier: Add log notifier 2021-02-27 09:46:44 +00:00
97eaf3c334 Fix finalize_dead_slot_removal() of cached slots decrementing refcount (#15534) 2021-02-26 17:49:37 -08:00
e92cff3efa create-snapshot subcommad now accepts the ROOT keyword 2021-02-26 16:40:10 -08:00
501696243f --help cleanup 2021-02-26 16:40:10 -08:00
9142a17bc2 Update validator_list.rs 2021-02-26 17:27:00 -07:00
e7bb1b7cd5 feat: introduce upgradeable bpf loader instruction cards (#15563)
* feat: introduce upgradeable bpf loader instruction cards

* feat: text-muted datatype labels consistently
2021-02-26 15:50:37 -08:00
b934e1af17 Update validator_list.rs 2021-02-26 16:48:57 -07:00
f7a049f87f coalesces vote packets into one Packets (#15566) 2021-02-26 23:23:08 +00:00
8399851d11 check program owners (#15495)
* check program owners

* BankSlotDelta should change because InstructionError variant added

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-02-26 22:21:34 +00:00
d47f1fae40 Check delinquency before restarting 2021-02-26 13:34:04 -08:00
0dc482e987 Add wait-for-restart-window subcommand 2021-02-26 13:34:04 -08:00
6f3964c8cb Update validator_list.rs 2021-02-26 13:01:08 -07:00
28a8f142fc feat: standardize timestamps throughout explorer (#15562)
* feat: timestamps should use local time everywhere but cluster stats, monospace text

* feat: normalize timestamp through explorer
2021-02-26 18:47:03 +00:00
05409e51ce Increase tpu coalescing and add parameter (#15536)
Should create larger entries on average
2021-02-26 09:15:45 -08:00
5a9896706c indexes epoch slots in crds table (#15459)
ClusterInfo::get_epoch_slots_since scans the entire crds table to obtain
epoch-slots inserted since a timestamp:
https://github.com/solana-labs/solana/blob/013daa8f4/core/src/cluster_info.rs#L1245-L1262
The alternative is to index epoch-slots in crds table ordered by their
insert timestamp.
2021-02-26 14:12:04 +00:00
d5f4058968 chore:(deps): bump @solana/web3.js from 0.92.2 to 0.93.0 in /explorer (#15558)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 0.92.2 to 0.93.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v0.92.2...v0.93.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-26 09:39:22 +00:00
1c22facc4a chore:(deps): bump @types/chart.js from 2.9.29 to 2.9.31 in /explorer (#15557)
Bumps [@types/chart.js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chart.js) from 2.9.29 to 2.9.31.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chart.js)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-26 09:28:27 +00:00
27582a489d chore:(deps): bump @solana/spl-token-registry in /explorer (#15556)
Bumps [@solana/spl-token-registry](https://github.com/solana-labs/token-list) from 0.1.4 to 0.1.7.
- [Release notes](https://github.com/solana-labs/token-list/releases)
- [Commits](https://github.com/solana-labs/token-list/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-26 09:13:34 +00:00
bb06817e16 feat: update superstruct and future proof type validations (#15491)
* chore: update superstruct

* fix: fix program account notification type coercion
2021-02-26 15:06:12 +08:00
d866f742e2 fix: createAccountWithSeed account handling (#15482) 2021-02-25 23:47:22 -07:00
817b163703 Stop removing stake from neutral nodes
This PR is a proposal to not remove stake from nodes that couldn't get any slot because their stake was too small.

This happened in testnet with at least 2 pubkeys:
ED3Y3cuH3wtHXT8TmbDE5toHU6kwQzevWtvkP6rGFNgc
5dB4Ygb8Sf3Sssdxxrpbb4NFX9bMrYnieiz11Vr5xJkJ

They were good producers in epoch 162 and in #tds-stake they were given 50k bonus stake.

But epoch 163 was a special one, lots of new joiners made nodes with a few stake (less than 1k) have a zero slot schedule.

Check lines 479 to 485. If a node didn't get a slot, the node is not considered a quality neither a poor producer, which is correct.

But removing its bonus stake in the line 1032 to 1050 is not correct IMHO...

We should consider someone good until they prove they are bad right? And if you don't give a single slot (chance) for them to prove there's no reason to say they were bad....

Thanks and I'm happy to discuss this more...
2021-02-25 20:08:48 -08:00
9b204febf3 Add accounts cluster bench (#14096)
* Add accounts cluster bench

* Transaction executor

* Re-allow clippy::integer_arithmetic

* Enable spl-token accounts and fixup transaction send/conf

* saturating_sub for debug builds

* Initialize RpcClients with confirmed commitment

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-02-25 19:51:46 -08:00
d62c8e7f3b fix: explorer vote card has incorrect timestamp conversion (#15552) 2021-02-26 03:22:12 +00:00
a6b9327cd0 Fix root scan in ledger tool (#15532) 2021-02-25 15:52:16 -08:00
28a9926ba1 Log devbuild branch and commit for locally built testnet (#15541) 2021-02-25 14:57:40 -07:00
1ad2c9f741 Revert "Make UiTokenAmount::ui_amount a String (#15447)" (#15542)
This reverts commit d14374bc9f.
2021-02-25 21:53:40 +00:00
d521dfe63c Implement OutputFormat for confirm in Cli and ledger-tool bigtable (#15528)
* Add CliTransaction struct

* Impl DisplayFormat for decode-transaction

* Add block-time to transaction println, writeln

* Impl DisplayFormat for confirm

* Use DisplayFormat in ledger-tool bigtable confirm
2021-02-25 14:15:52 -07:00
f59ec3d1a7 Update validator_list.rs 2021-02-25 12:43:08 -07:00
ebd43938a7 docs: Update stake merging documentation (#15489)
* Update stake merging documentation

* Integrate review feedback

* Integrate review feedback in comment too
2021-02-25 17:24:39 +01:00
21b43009f6 Introduce ttl eviction for RecycleStore (#15513) 2021-02-25 17:27:27 +09:00
d8ba56ec09 Update validator_list.rs 2021-02-24 20:29:40 -07:00
f1c6961f79 Add remaining TdS 12 validators 2021-02-24 20:13:31 -07:00
3563813aa6 Update validator_list.rs 2021-02-24 19:33:57 -07:00
5656c684a5 Ubuntu 20.04 instead of 18.04 (#15525) 2021-02-25 00:03:31 +00:00
d5f235d997 Implement OutputFormat for block in Cli and ledger-tool bigtable (#15524)
* Impl DisplayFormat for solana block

* Use DisplayFormat in ledger-tool bigtable block
2021-02-24 16:14:34 -07:00
7cb44b1095 feat: add program to vote and memo instruction card (#15523) 2021-02-24 21:01:10 +00:00
976a64c25c explorer: introduce vote instruction card (#15521)
* refactor: move instruction section to components

* feat: votes instruction card

* refactor: move program log section into separate component
2021-02-24 20:38:53 +00:00
2483a05786 feat: add solana-token-registry to explorer (#15496)
* feat: add solana-token-registry to explorer

* feat: bump version for token-registry

* fix: ensure tokenName and tokenSymbol exist in incoming json
2021-02-24 12:30:55 -08:00
5b54aed1c0 Speed up getLeaderSchedule 2021-02-24 11:17:25 -08:00
eddb7f98f5 Check vote account initialization (#15503)
* Check account data_len on Vote account init

* Check account data populated on update_cached_accounts
2021-02-24 10:00:48 -07:00
c48f731d48 Update SECURITY.md
Small example for theft of funds
2021-02-24 07:44:57 -08:00
f807e88a34 chore:(deps): bump bn.js from 5.1.3 to 5.2.0 in /explorer (#15514)
Bumps [bn.js](https://github.com/indutny/bn.js) from 5.1.3 to 5.2.0.
- [Release notes](https://github.com/indutny/bn.js/releases)
- [Changelog](https://github.com/indutny/bn.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/indutny/bn.js/compare/v5.1.3...v5.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-24 10:37:26 +00:00
c514e7a338 chore:(deps): bump typescript from 4.1.5 to 4.2.2 in /explorer (#15512)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.5 to 4.2.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-24 10:00:55 +00:00
bc01a33ede chore:(deps): bump @testing-library/user-event in /explorer (#15509)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 12.7.2 to 12.7.3.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v12.7.2...v12.7.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-24 09:24:03 +00:00
61ed980ac0 Fix received notifications for gossip signature subscriptions (#15506) 2021-02-24 16:59:22 +08:00
c2e8814dce Add limit and shrink policy for recycler (#15320) 2021-02-24 00:15:58 -08:00
2f46da346d gracefully handle vote account without authorized voter (#15501) 2021-02-24 00:00:24 -08:00
a07fa5b623 explorer: add fetch polyfill and clean up / message change (#15505) 2021-02-24 05:27:35 +00:00
b8f1ffb483 Update SECURITY.md (#15502) 2021-02-23 17:35:42 -08:00
53dfc211ec explorer: detect if localstorage is available (#15499)
* feat: detect if localstorage is available

* feat: do not show developer settings in cluster modal if localStorage is disabled
2021-02-23 22:53:22 +00:00
52f2d425e5 Count if optimistically confirmed slot is already rooted (#15492) 2021-02-23 22:03:22 +00:00
1b59b163dd Add max retransmit and shred insert slot (#15475) 2021-02-23 13:06:33 -08:00
cf4e31964b Remove limit on program size related to feature cleanup (#15493) 2021-02-23 20:54:18 +00:00
30012818a1 update cpi docs (#15494) 2021-02-23 12:37:50 -08:00
4b0114b991 Limit the number of getProgramAccounts filters 2021-02-23 18:43:22 +00:00
65f1afe5e1 Limit getProgramAccounts memcpy filter string to 128 bytes 2021-02-23 18:43:22 +00:00
41bfbea63d chore:(deps): bump react-scripts from 4.0.2 to 4.0.3 in /explorer (#15486)
Bumps [react-scripts](https://github.com/facebook/create-react-app/tree/HEAD/packages/react-scripts) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/facebook/create-react-app/releases)
- [Changelog](https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/create-react-app/commits/react-scripts@4.0.3/packages/react-scripts)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-23 09:18:52 +00:00
9a7cd8885d Remove read only locks when they hit ref count zero, cleanup accounts locking (#15449) 2021-02-22 23:56:43 -08:00
8680a46458 Transition config program over to ic_msg() logging 2021-02-22 20:19:04 -08:00
123de5de54 Update uiAmount type in docs (#15471) 2021-02-22 16:54:07 -07:00
879370a020 Improve help for split-stake-account 2021-02-22 12:49:23 -08:00
d14374bc9f Make UiTokenAmount::ui_amount a String (#15447)
* Make UiTokenAmount::ui_amount a String

* Fixup solana-tokens

* Ignore spl downstream-project
2021-02-22 13:05:45 -07:00
f7c0b69fd4 Fix solana feature status stake % overflow 2021-02-22 11:49:27 -08:00
5ccaa6336a Print original error from accounts dir remove (#15458) 2021-02-22 21:24:09 +09:00
dc5d58663e chore:(deps): bump @types/node from 14.14.28 to 14.14.31 in /explorer (#15465)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.28 to 14.14.31.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-22 09:40:09 +00:00
242e31e810 chore: bump @rollup/plugin-replace from 2.3.4 to 2.4.0 in /web3.js (#15464)
Bumps [@rollup/plugin-replace](https://github.com/rollup/plugins) from 2.3.4 to 2.4.0.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Commits](https://github.com/rollup/plugins/compare/replace-v2.3.4...replace-v2.4.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-22 09:33:28 +00:00
4579e927c1 chore: bump eslint-config-prettier from 7.2.0 to 8.0.0 in /web3.js (#15462)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 7.2.0 to 8.0.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v7.2.0...v8.0.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-22 09:23:44 +00:00
acf909f1d1 chore:(deps): bump @testing-library/user-event in /explorer (#15463)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 12.7.1 to 12.7.2.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v12.7.1...v12.7.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-22 09:23:39 +00:00
013daa8f47 RPC: Improve snapshot path sanitization 2021-02-20 13:06:07 -08:00
5ae37b9675 Prevent u64 overflow when calculating current stake percentage 2021-02-19 22:57:47 -08:00
1a9956d1c6 chore:(deps): bump @solana/web3.js from 0.92.1 to 0.92.2 in /explorer (#15435)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 0.92.1 to 0.92.2.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v0.92.1...v0.92.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-20 04:44:05 +00:00
a46358b0b0 SoM: Evict cache entries older than five epochs 2021-02-19 21:34:53 -07:00
985ce29dc6 SoM: Cache confirmed blocks queries 2021-02-19 21:34:53 -07:00
513ec31d1e SoM: Retry HTTP 502/504 2021-02-19 21:34:53 -07:00
5df36aec7d Pacify clippy 2021-02-19 20:08:41 -08:00
fd3b71a2c6 cargo fmt 2021-02-19 20:08:41 -08:00
5404e6aed0 Upgrade to Rust v1.50 2021-02-19 20:08:41 -08:00
b12921bf62 Update SECURITY.md 2021-02-19 19:52:33 -08:00
02070c5623 Add TdS 12 validator pubkeys 2021-02-19 17:51:00 -07:00
700685c223 CLI: Add hidden support for SystemInstruction::TransferWithSeed 2021-02-19 23:20:40 +00:00
16e0a4b412 CLI: Make derived address seed.len() check a clap validator 2021-02-19 23:20:40 +00:00
84e7ba0b3f CLI: Factor out ProgramId moniker resolution 2021-02-19 23:20:40 +00:00
aa3aac766f adds metrics for inbound/outbound gossip packets counts (#15407) 2021-02-19 22:49:35 +00:00
4648439f5c cli: improve deploy resume interface (#15418)
* cli: improve deploy resume interface

* add docs
2021-02-19 11:06:05 -08:00
5d31763a3b Update ABI digest 2021-02-19 10:54:39 -08:00
995bd0cb6b Rename IOError to BorshIoError 2021-02-19 10:54:39 -08:00
58b35db384 explorer: block query should be strictly integers (#15442) 2021-02-19 18:37:39 +00:00
5548e599fe explorer: prevent large slot number input stemming from hex strings (#15438)
* explorer: prevent large slot number input stemming from hex strings

* explorer: support IE11
2021-02-19 17:20:03 +00:00
524da78e43 Ship cargo-build-bpf/cargo-test-bpf for windows 2021-02-19 09:11:41 -08:00
13d55b7080 explorer: add confirmation status (#15422) 2021-02-19 08:57:26 -08:00
6a8dd86722 Remove unix path separators 2021-02-19 08:22:36 -08:00
8e6441c1f6 chore: bump @types/node from 14.14.29 to 14.14.30 in /web3.js (#15432)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.29 to 14.14.30.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-19 09:21:18 +00:00
b6da57fc36 chore:(deps): bump @sentry/react from 6.1.0 to 6.2.0 in /explorer (#15433)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/6.1.0...6.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-19 09:19:42 +00:00
15bbe6436d Bump SPL token version to v3.1.0 (#15429)
* Bump SPL token version to v3.1.0

* Cargo.lock
2021-02-19 09:15:41 +00:00
7b67a6d208 Load memo v2 into genesis for test validator (#15425)
* Load memo v2 into genesis for test validator

* feedback

* versions

* remove .so

* add .so
2021-02-19 15:59:31 +08:00
c6d8a1f537 fix: fix browser module resolution for parcel (#15426) 2021-02-19 15:23:45 +08:00
e0e4bed205 explorer: add error message to copy component (#15423)
* explorer: add error message to copy component

* Merge copyable and copy button components

Co-authored-by: Justin Starry <justin@solana.com>
2021-02-19 03:52:05 +00:00
4e84869c8e Send program deploy txs to up to 2 leaders (#15421) 2021-02-18 20:14:48 -07:00
787637e292 chore: bump eslint-plugin-flowtype from 5.2.1 to 5.2.2 in /web3.js (#15420)
Bumps [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/gajus/eslint-plugin-flowtype/releases)
- [Commits](https://github.com/gajus/eslint-plugin-flowtype/compare/v5.2.1...v5.2.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-19 01:01:14 +00:00
e91ec9fd41 chore: bump @types/node from 14.14.28 to 14.14.29 in /web3.js (#15419)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.28 to 14.14.29.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-19 00:26:23 +00:00
faaef6771e Add --max-old-release-version-percentage 2021-02-18 16:14:40 -08:00
ac0e9a6ce1 Add --minimum-release-version argument to allow for destaking of nodes that fail to keep with software updates 2021-02-18 16:14:40 -08:00
7ea2d32243 chore: bump @rollup/plugin-node-resolve in /web3.js (#15417)
Bumps [@rollup/plugin-node-resolve](https://github.com/rollup/plugins) from 11.1.1 to 11.2.0.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Commits](https://github.com/rollup/plugins/compare/node-resolve-v11.1.1...node-resolve-v11.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 23:47:25 +00:00
5e8ed07acc chore: bump flow-remove-types from 2.144.0 to 2.145.0 in /web3.js (#15416)
Bumps [flow-remove-types](https://github.com/facebook/flow) from 2.144.0 to 2.145.0.
- [Release notes](https://github.com/facebook/flow/releases)
- [Changelog](https://github.com/facebook/flow/blob/master/Changelog.md)
- [Commits](https://github.com/facebook/flow/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 23:31:13 +00:00
f485ab11fa chore: bump @babel/plugin-transform-runtime in /web3.js (#15412)
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.12.15 to 7.12.17.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.17/packages/babel-plugin-transform-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 22:25:17 +00:00
954f031ff3 chore: bump rollup-plugin-copy from 3.3.0 to 3.4.0 in /web3.js (#15411)
Bumps [rollup-plugin-copy](https://github.com/vladshcherbin/rollup-plugin-copy) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/vladshcherbin/rollup-plugin-copy/releases)
- [Commits](https://github.com/vladshcherbin/rollup-plugin-copy/compare/3.3.0...3.4.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 21:53:20 +00:00
99ec9e990d chore: bump mocha from 8.2.1 to 8.3.0 in /web3.js (#15409)
Bumps [mocha](https://github.com/mochajs/mocha) from 8.2.1 to 8.3.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v8.2.1...v8.3.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 19:42:28 +00:00
48785b507b Bump Rust-BPF to v1.46 (#15273) 2021-02-18 11:30:08 -08:00
e09c8543e4 chore: bump @babel/runtime from 7.12.13 to 7.12.18 in /web3.js (#15408)
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.12.13 to 7.12.18.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.18/packages/babel-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 19:26:48 +00:00
131aa47475 chore: bump @rollup/plugin-babel from 5.2.3 to 5.3.0 in /web3.js (#15406)
Bumps [@rollup/plugin-babel](https://github.com/rollup/plugins) from 5.2.3 to 5.3.0.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Commits](https://github.com/rollup/plugins/compare/babel-v5.2.3...babel-v5.3.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 18:04:23 +00:00
02432a548f Cleanup old features (#15391) 2021-02-18 09:56:11 -08:00
82850781c9 chore: bump @babel/core from 7.12.13 to 7.12.17 in /web3.js (#15405)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.12.13 to 7.12.17.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.17/packages/babel-core)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 17:52:12 +00:00
77c73e2f87 chore: bump eslint from 7.19.0 to 7.20.0 in /web3.js (#15404)
Bumps [eslint](https://github.com/eslint/eslint) from 7.19.0 to 7.20.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.19.0...v7.20.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 17:29:55 +00:00
493afc7fff chore: bump semantic-release from 17.3.8 to 17.3.9 in /web3.js (#15403)
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 17.3.8 to 17.3.9.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v17.3.8...v17.3.9)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 17:17:14 +00:00
6064d80c45 chore: bump @babel/preset-env from 7.12.16 to 7.12.17 in /web3.js (#15402)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.12.16 to 7.12.17.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.17/packages/babel-preset-env)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 16:57:15 +00:00
d4d3be8c62 chore: bump rollup from 2.38.5 to 2.39.0 in /web3.js (#15401)
Bumps [rollup](https://github.com/rollup/rollup) from 2.38.5 to 2.39.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.38.5...v2.39.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 16:54:45 +00:00
e653261d7a chore: bump @typescript-eslint/parser from 4.15.0 to 4.15.1 in /web3.js (#15400)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.15.0 to 4.15.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.15.1/packages/parser)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 15:53:49 +00:00
283cc58e21 chore: bump mockttp from 1.1.0 to 1.2.0 in /web3.js (#15399)
Bumps [mockttp](https://github.com/httptoolkit/mockttp) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/httptoolkit/mockttp/releases)
- [Commits](https://github.com/httptoolkit/mockttp/compare/v1.1.0...v1.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 15:41:33 +00:00
e3006e3b46 correctly reserve space for pre_accounts vector (#15378) 2021-02-18 09:37:24 -06:00
3164cb9b19 chore: bump @types/node from 14.14.26 to 14.14.28 in /web3.js (#15398)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.26 to 14.14.28.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 15:24:17 +00:00
5393b85723 chore: bump flow-typed from 3.2.1 to 3.3.1 in /web3.js (#15397)
Bumps [flow-typed](https://github.com/flow-typed/flow-typed) from 3.2.1 to 3.3.1.
- [Release notes](https://github.com/flow-typed/flow-typed/releases)
- [Changelog](https://github.com/flow-typed/flow-typed/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flow-typed/flow-typed/compare/v3.2.1...v3.3.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 14:53:35 +00:00
6fb6b11069 chore: bump @typescript-eslint/eslint-plugin in /web3.js (#15396)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.15.0 to 4.15.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.15.1/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 14:34:32 +00:00
b66392d0dc chore: bump eslint-plugin-flowtype from 5.2.0 to 5.2.1 in /web3.js (#15395)
Bumps [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype) from 5.2.0 to 5.2.1.
- [Release notes](https://github.com/gajus/eslint-plugin-flowtype/releases)
- [Commits](https://github.com/gajus/eslint-plugin-flowtype/compare/v5.2.0...v5.2.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 14:29:01 +00:00
54e6172d14 chore: bump @babel/preset-env from 7.12.13 to 7.12.16 in /web3.js (#15287)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.12.13 to 7.12.16.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.16/packages/babel-preset-env)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 22:08:53 +08:00
0f6f6080f3 sdk: Add Borsh support for types and utilities (#15290)
* sdk: Add Borsh to Pubkey

* Add serialization error for easier borsh integration

* Add Borsh usage to banks-client and sdk

* Rename SerializationError -> IOError

* Add new errors to proto

* Update Cargo lock

* Update Cargo.lock based on CI

* Clippy

* Update ABI on bank

* Address review feedback

* Update sanity program instruction count test
2021-02-18 11:14:56 +01:00
fb1f2d54a5 chore:(deps): bump @solana/web3.js from 0.91.3 to 0.92.1 in /explorer (#15392)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 0.91.3 to 0.92.1.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v0.91.3...v0.92.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 09:12:30 +00:00
89b0d803ff Add Dmitri's key (#15390) 2021-02-18 09:23:18 +01:00
b809ed0404 fix: update browser bundle link (#15386) 2021-02-18 11:34:57 +08:00
733c9b48f9 "of of" -> "of" 2021-02-17 18:19:37 -08:00
0c50311d85 First draft of security policy 2021-02-17 18:14:15 -08:00
fcee227021 Add lamports overflow test for nonce withdraw (#15383) 2021-02-18 01:37:13 +00:00
170cb792eb Return blockstore error if previous_blockhash cannot be determined (#15382)
* Return blockstore error if previous_blockhash cannot be determined

* Add require_previous_blockshash flag
2021-02-18 01:04:52 +00:00
8c8f8f3130 feat: update commitment variants (#15253)
* feat: update commitment variants

* fix: make pretty

* fix: deprecate, but leave in commitment types
2021-02-17 16:15:09 -08:00
7f7370c306 Re-allow clippy::integer_arithmetic at crate-level 2021-02-17 13:55:08 -07:00
7035e8485c CI: Globally deny clippy::integer_arithmetic lint 2021-02-17 13:55:08 -07:00
9ba69a7381 Adapt to fs_extra 1.2.0 2021-02-17 12:44:58 -08:00
b9fb595db2 explorer: remove line breaks from wrapped data (#15379) 2021-02-17 12:12:49 -08:00
480b4e08a9 Drop v1.3, add v1.7 2021-02-17 09:01:45 -08:00
b24cb9840e Speedup ledger cleanup test (#15304)
Just clone to produce shreds and use a separate insert thread.
2021-02-17 08:59:25 -08:00
4d16b2fcc5 explorer: Add upgradeable loader to search results (#15373) 2021-02-17 23:00:12 +08:00
3ac7e09de6 docs: Remove references to "create_address_with_seed" (#15339) 2021-02-17 14:25:02 +01:00
51c27dcc1c Clean & check stake (#15363)
* Add failing test

* Fix test

* Clean up redendant if case

* Demonstrate withdrawal boundaries

* Update test to fail on conditions that should be acceptable

* Fix test

* Add test for larger stake source

* Mirror changes for undelegated accounts

* Extra stake checks

* Split accounts must be the right size

Co-authored-by: Stephen Akridge <sakridge@gmail.com>
2021-02-17 03:42:46 +00:00
b821a5d8dd Clean nonce 2021-02-16 19:25:00 -08:00
7e17a0d3bb Move fn to sdk 2021-02-16 19:25:00 -08:00
f929301c60 Vote program updates 2021-02-16 18:59:15 -08:00
98e3e570d2 Add --force arg for bigtable upload 2021-02-16 17:24:07 -08:00
f5c564bc6c cli: Speed up program deploys (#15347)
* Speed up deploys

* fix test
2021-02-17 09:00:47 +08:00
7fee0bc69c move hashing functionality to accounts_hash (#15353) 2021-02-17 00:29:50 +00:00
8367740ff9 compute merkle root on chunks of fanout^3 (#15344)
* compute merkle root on chunks of fanout^3

* improve test_accountsdb_compute_merkle_root_large
2021-02-16 17:03:35 -06:00
ba02452d75 add validator flag no-accounts-db-index-hashing (#15350)
* add validator flag no_accounts_db_index_hashing

* add validator flag no_accounts_db_index_hashing
2021-02-16 21:13:48 +00:00
f79c9d4094 adds an upper bound on cluster-slots size (#15300)
https://github.com/solana-labs/solana/issues/14366#issuecomment-769096305
2021-02-16 21:12:13 +00:00
076c20f1ca checks that prune-messages have the same inner/outer pubkey (#15352) 2021-02-16 21:06:18 +00:00
d83aeebcca change 2d cumulative calculation (#15346) 2021-02-16 14:24:45 -06:00
708b8380b7 assert 2 items in stores don't have same slot and version with different values (#15250)
* assert 2 items in stores don't have same slot and version with different values

* add message to assert
2021-02-16 18:12:59 +00:00
17a328bc6f Fix typo in account docs (#15349) 2021-02-16 09:58:33 -07:00
aaa44355b1 explorer: Display upgradeable program details (#15348) 2021-02-16 18:30:02 +08:00
53959b4bbc divide account scan into bins for more efficient downstream processing (#15303) 2021-02-15 21:27:39 -06:00
78a176fc00 rename CumulativeOffset in preparation of 2d support (#15338) 2021-02-15 20:57:05 -06:00
b3256aa722 Bump rand_core to 0.6.2
https://rustsec.org/advisories/RUSTSEC-2021-0023
2021-02-15 22:51:35 +00:00
ae82b5ebfd stake: add lamports overflow test for withdraw 2021-02-15 11:09:51 -07:00
b43d2bc882 rbpf-v0.2.5 (#15334) 2021-02-15 18:27:41 +01:00
5d3caa57a0 chore:(deps): bump @types/node from 14.14.26 to 14.14.28 in /explorer (#15333)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.26 to 14.14.28.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-15 10:50:33 +00:00
e657b8f12b chore:(deps): bump @testing-library/user-event in /explorer (#15332)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 12.7.0 to 12.7.1.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v12.7.0...v12.7.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-15 10:26:30 +00:00
bf59c5a89c chore:(deps): bump @types/react-dom from 17.0.0 to 17.0.1 in /explorer (#15331)
Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 17.0.0 to 17.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-15 10:09:11 +00:00
dc40eb04ff chore:(deps): bump @solana/web3.js from 0.91.2 to 0.91.3 in /explorer (#15330)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 0.91.2 to 0.91.3.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v0.91.2...v0.91.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-15 09:43:52 +00:00
f41ea77c6f chore:(deps): bump @types/react from 17.0.1 to 17.0.2 in /explorer (#15329)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 17.0.1 to 17.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-15 09:29:58 +00:00
8cdff597b6 chore:(deps): bump @project-serum/serum in /explorer (#15328)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.21 to 0.13.23.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-15 09:11:48 +00:00
30f18319f2 Track RecycleStore basic stats with needed refactor (#15291)
* Track RecycleStore basic stats with needed refactor

* Fix another wrong metrics def
2021-02-15 16:09:17 +09:00
e403aeaf05 adds an inverted index to leader schedule (#15249)
next_leader_slot is doing a linear search for slots in which a pubkey is
the leader:
https://github.com/solana-labs/solana/blob/e59a24d9f/ledger/src/leader_schedule_cache.rs#L123-L157
This can be done more efficiently by adding an inverted index to leader
schedule.
2021-02-15 00:52:52 +00:00
5b8f046c67 More configurable rocksdb compaction (#15213)
rocksdb compaction can cause long stalls, so
make it more configurable to try and reduce those stalls
and also to coordinate between multiple nodes to not induce
stall at the same time.
2021-02-14 10:16:30 -08:00
0812931c38 Log if unsanitary transactions are read from blockstore (#15319) 2021-02-14 06:32:43 +00:00
9c7b3dc1b5 style: Fix the typos 2021-02-13 12:34:21 -07:00
a8d4d746ce Fix broken TdS links 2021-02-13 10:23:34 -07:00
1a20ab968f sdk: sanitize Hash base58 input 2021-02-13 08:40:35 +00:00
b09865e5a0 fix: default preflightCommitment to Connection.commitment when sending tx (#15299) 2021-02-13 01:29:26 +00:00
08f94a2bd2 Stake program update (#15307) 2021-02-12 17:24:43 -08:00
866ce236b1 add another hash check (#15278)
* add another hash check

* update comment
2021-02-12 18:35:11 -06:00
b8448f4189 merkle root code no longer adds lamports (#15298) 2021-02-12 17:30:14 -06:00
2e7aebf0bb Rework spl_token_v2_self_transfer_fix to avoid any SPL Token downtime 2021-02-12 22:46:39 +00:00
aa97da2146 Upgrade to SPL Token 3.1.0 program binary 2021-02-12 21:57:53 +00:00
8944efddf7 combine flatten and hash (#15269) 2021-02-12 11:35:54 -06:00
830ef2bae4 Log validator root slot 2021-02-12 17:32:07 +00:00
760e163190 docs: getLargestAccounts caching notice (#15293) 2021-02-12 08:20:32 -08:00
629dcd0f39 Cleanup buffered packets (#15210) 2021-02-12 03:27:37 -08:00
2a3501d431 chore:(deps): bump @types/node from 14.14.25 to 14.14.26 in /explorer (#15289)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.25 to 14.14.26.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-12 09:44:51 +00:00
790bd51f8b chore:(deps): bump @solana/web3.js from 0.91.1 to 0.91.2 in /explorer (#15288)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 0.91.1 to 0.91.2.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v0.91.1...v0.91.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-12 09:17:56 +00:00
4e99aa5fa6 More failure codepath tracing (#15246) 2021-02-12 15:24:23 +09:00
b09114725a Fix path to solana-stake-o-matic 2021-02-11 21:20:51 -08:00
b64a971610 Fix registration link 2021-02-11 21:52:56 -07:00
b2bf4a5b84 fix: move flow imports inside module declaration 2021-02-12 11:44:37 +08:00
eced3776b0 add metrics to hash calculation and consolidate (#15165)
* add metrics to hash calculation

* add metrics to hash calculation

* create HashStats struct to consolidate hash timing

* formatting
2021-02-11 20:06:04 -06:00
eb54e544c2 add div_ceil (#15267) 2021-02-11 20:05:41 -06:00
59e55f0371 remove hash accumulation with lamports (#15275) 2021-02-11 20:05:22 -06:00
6650fbf443 Add per-byte logging cost (#15279) 2021-02-12 00:55:17 +00:00
6425a748f7 add jwash authorized key (#15280) 2021-02-12 00:55:14 +00:00
45c92b787e Update validator_list.rs 2021-02-11 17:14:42 -07:00
990bb426a9 Fix flaky test test_concurrent_snapshot_packaging (#15252) 2021-02-11 16:03:51 -08:00
762bab7755 explorer: reverse order on market and event queue pubkeys for serum consume events (#15270) 2021-02-11 12:00:03 -08:00
7d3bede00c explorer: update USDT icon (#15272) 2021-02-11 11:46:44 -08:00
4013f91dbe RPC: add caching to getLargestAccounts (#15154)
* introduce get largest accounts cache

* remove cache size and change hash key

* remove eq and hash derivation from commitment config

* add slot to the cache
2021-02-11 11:32:46 -08:00
ab0f4c69aa Improve vote-account for logical flow/reasoning (#15237)
* Improve vote-account for logical flow/reasoning

* Clean up

* Update messages
2021-02-11 21:24:20 +09:00
dce8817880 chore:(deps): bump @project-serum/serum in /explorer (#15265)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.20 to 0.13.21.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/compare/@project-serum/serum@0.13.20...@project-serum/serum@0.13.21)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-11 10:57:51 +00:00
2f585e80f2 chore:(deps): bump typescript from 4.1.4 to 4.1.5 in /explorer (#15264)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.4 to 4.1.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.1.4...v4.1.5)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-11 10:31:05 +00:00
310ca760e1 chore: bump typescript from 4.1.4 to 4.1.5 in /web3.js (#15263)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.4 to 4.1.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.1.4...v4.1.5)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-11 10:00:24 +00:00
3be538306a chore:(deps): bump @types/chai from 4.2.14 to 4.2.15 in /explorer (#15262)
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.14 to 4.2.15.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-11 09:41:25 +00:00
2180bf490a chore: bump @babel/plugin-transform-runtime in /web3.js (#15258)
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.12.10 to 7.12.15.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.15/packages/babel-plugin-transform-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-11 09:26:01 +00:00
c7e2dce338 chore:(deps): bump @testing-library/user-event in /explorer (#15259)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 12.6.3 to 12.7.0.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v12.6.3...v12.7.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-11 09:19:54 +00:00
47c60f8e98 Clean up mainnet-beta inflation candidate features 2021-02-10 17:46:22 -08:00
10abd199e1 Match BPF instruction reporting to dump file (#15254) 2021-02-11 00:48:19 +00:00
e59a24d9f9 pass expected capitalization to hash calculation to improve assert msg (#15191)
* cleanup if

* pass expected capitalization to hash calculation to improve assert message

* fix bank function

* one more level

* calculate_accounts_hash_helper

* add slot to error message

* success
2021-02-10 14:38:00 -06:00
c1e93b3ef9 chore:(deps): bump @testing-library/user-event in /explorer (#15244)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 12.6.2 to 12.6.3.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v12.6.2...v12.6.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 15:30:43 +00:00
c2f6f13395 chore:(deps): bump chai from 4.2.0 to 4.3.0 in /explorer (#15243)
Bumps [chai](https://github.com/chaijs/chai) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/master/History.md)
- [Commits](https://github.com/chaijs/chai/compare/4.2.0...4.3.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 15:18:18 +00:00
dccbd9bc50 chore:(deps): bump @sentry/react from 6.0.1 to 6.1.0 in /explorer (#15242)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 6.0.1 to 6.1.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/6.0.1...6.1.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 15:05:57 +00:00
3b4e3de35d chore:(deps): bump @project-serum/serum in /explorer (#15241)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.19 to 0.13.20.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits/@project-serum/serum@0.13.20)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 14:52:48 +00:00
815d20c3a0 chore:(deps): bump @solana/web3.js from 0.90.1 to 0.91.1 in /explorer (#15240)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 0.90.1 to 0.91.1.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v0.90.1...v0.91.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 14:33:25 +00:00
d733b14b4f chore:(deps): bump typescript from 4.1.3 to 4.1.4 in /explorer (#15239)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.3 to 4.1.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.1.3...v4.1.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 14:14:37 +00:00
42e59961f4 chore:(deps): bump @types/node from 14.14.22 to 14.14.25 in /explorer (#15238)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.22 to 14.14.25.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 14:00:33 +00:00
3a454e899a chore:(deps): bump react-select from 3.2.0 to 4.1.0 in /explorer (#15234)
Bumps [react-select](https://github.com/JedWatson/react-select) from 3.2.0 to 4.1.0.
- [Release notes](https://github.com/JedWatson/react-select/releases)
- [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/JedWatson/react-select/compare/react-select@3.2.0...react-select@4.1.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 13:35:36 +00:00
ac079bf1a4 fix: use more widely accepted browser module config 2021-02-10 21:21:34 +08:00
8c49985b5c custom vm type (#15202) 2021-02-10 04:17:04 -08:00
54d6b4e402 chore: bump typescript from 4.1.3 to 4.1.4 in /web3.js (#15233)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.3 to 4.1.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.1.3...v4.1.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 09:52:18 +00:00
8a2052221a chore:(deps): bump @types/react from 17.0.0 to 17.0.1 in /explorer (#15232)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 17.0.0 to 17.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 09:36:15 +00:00
6b3559521c chore: bump @babel/plugin-proposal-class-properties in /web3.js (#15229)
Bumps [@babel/plugin-proposal-class-properties](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-proposal-class-properties) from 7.12.1 to 7.12.13.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.13/packages/babel-plugin-proposal-class-properties)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 09:21:19 +00:00
8d45156857 chore:(deps): bump react-scripts from 4.0.1 to 4.0.2 in /explorer (#15230)
Bumps [react-scripts](https://github.com/facebook/create-react-app/tree/HEAD/packages/react-scripts) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/facebook/create-react-app/releases)
- [Changelog](https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/create-react-app/commits/react-scripts@4.0.2/packages/react-scripts)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-10 09:17:40 +00:00
B
a0ba59a1ea Add titles for token lending instructions (#15217)
* feat: add lending instruction names

* chore: capitalize words
2021-02-09 19:50:34 -06:00
948819dfa8 Use spl-token-mint secondary index for relevant getProgramAccounts requests (#15219) 2021-02-09 15:49:13 -07:00
da6753b8c0 Warp timestamp and extend max-allowable-drift for accommodate slow blocks (#15204)
* Remove timestamp_correction feature gating

* Remove timestamp_bounding feature gating

* Remove unused deprecated ledger code

* Remove unused deprecated unbounded-timestamp code

* Enable independent adjustment of fast/slow timestamp bounding

* Update timestamp bounds to 25% fast, 80% slow; warp timestamp

* Update bank hash test

* Add PR number to feature

Co-authored-by: Michael Vines <mvines@gmail.com>

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-02-09 15:49:00 -07:00
2758588ddd uses btree-map instead of hash-map for cluster-slots (#15194)
retain traverses all values in the hashmap which is slow:
https://github.com/solana-labs/solana/blob/88f22c360/core/src/cluster_slots.rs#L45
btree-map instead allows more efficient prunning there.

In addition there is potential race condition here:
https://github.com/solana-labs/solana/blob/88f22c360/core/src/cluster_slots.rs#L68-L74
If another thread inserts a value at the same slot key between the read
and write lock, current thread will discard the inserted value.
2021-02-09 22:04:41 +00:00
f063f02c41 solana-test-validator now uses the BPF JIT by default, --no-bpf-jit to disable 2021-02-09 20:24:14 +00:00
8424fe2c12 use index version of calculating hash (#15189)
* use index version of calculating hash

* invert const

* formatting
2021-02-09 10:37:50 -06:00
63feea72b2 chore: bump @typescript-eslint/parser from 4.14.2 to 4.15.0 in /web3.js (#15209)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.14.2 to 4.15.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.15.0/packages/parser)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-09 10:44:28 +00:00
2d5885ac73 chore: bump semantic-release from 17.3.7 to 17.3.8 in /web3.js (#15208)
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 17.3.7 to 17.3.8.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v17.3.7...v17.3.8)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-09 10:12:06 +00:00
b90c64308b chore: bump @babel/preset-env from 7.12.11 to 7.12.13 in /web3.js (#15207)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.12.11 to 7.12.13.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.13/packages/babel-preset-env)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-09 09:35:57 +00:00
8d1788ff60 chore: bump @typescript-eslint/eslint-plugin in /web3.js (#15206)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.14.2 to 4.15.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.15.0/packages/eslint-plugin)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-09 09:29:25 +00:00
2caed6bd4c Complete --rpc-pubsub-max-in-buffer-capacity/--rpc-pubsub-max-out-buffer-capacity plumbing 2021-02-09 07:24:30 +00:00
f2f4003e70 explorer: introduce Token Balances on transaction details page (#14877)
* explorer: introduce Token Balances on transaction details page

* fix: run prettier

* introduce BigNumber.js

* account for case where mint changes

* introduce BalanceDelta component

* remove unneeded import

* break token balances card into own file
2021-02-08 19:54:03 -08:00
c0a6272afd Parse upgradeable loader instructions and accounts (#15195)
* Parse upgradeable-loader instructions

* Parse upgradeable-loader accounts
2021-02-08 17:18:10 -07:00
c51e49a746 Remove ineligible pubkeys 2021-02-08 16:42:53 -07:00
0da11af827 explorer: Introduce flagged accounts provider (#15161) 2021-02-08 12:54:36 -08:00
9e39b815f7 explorer: introduce stake merge instruction card (#15160) 2021-02-08 12:54:11 -08:00
91b374da5a Fix typo (#15190) 2021-02-08 20:37:33 +00:00
88f22c360b Sortable feature status list (#15150) 2021-02-08 12:08:29 -08:00
440c479529 chore: bump flow-remove-types from 2.143.1 to 2.144.0 in /web3.js (#15186)
Bumps [flow-remove-types](https://github.com/facebook/flow) from 2.143.1 to 2.144.0.
- [Release notes](https://github.com/facebook/flow/releases)
- [Changelog](https://github.com/facebook/flow/blob/master/Changelog.md)
- [Commits](https://github.com/facebook/flow/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-08 10:03:45 +00:00
026ceb8255 chore: bump @babel/runtime from 7.12.5 to 7.12.13 in /web3.js (#15184)
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.12.5 to 7.12.13.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.13/packages/babel-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-08 09:25:09 +00:00
c56441b91a chore: bump @babel/preset-flow from 7.12.1 to 7.12.13 in /web3.js (#15183)
Bumps [@babel/preset-flow](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-flow) from 7.12.1 to 7.12.13.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.13/packages/babel-preset-flow)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-08 09:22:58 +00:00
b6f231b60e removes locked pubkey references (#15152) 2021-02-08 02:07:00 +00:00
96e521be28 chore: bump semantic-release from 17.3.6 to 17.3.7 in /web3.js (#14825)
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 17.3.6 to 17.3.7.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v17.3.6...v17.3.7)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-08 00:26:04 +00:00
f0a8aba2e2 chore: cleanup flow and package.json 2021-02-08 07:57:05 +08:00
c675c67c26 chore: replace jest with mocha 2021-02-08 07:57:05 +08:00
612958ece0 fix: update to reasonable babel env target 2021-02-08 07:57:05 +08:00
ddc4565d6a fix: bundle buffer dependencies on browser 2021-02-08 07:57:05 +08:00
08ff2d12f2 feat: add support for browser es modules 2021-02-08 07:57:05 +08:00
bbae23358c ledger-tool cleanup and additions (#15179)
* Plumb allow-dead-slots to ledger-tool verify

* ledger-tool cleanup and add some useful missing args

Print root slots and how many unrooted past last root.
2021-02-06 17:26:42 -08:00
774416a546 Ledger purge printing (#15176) 2021-02-06 15:45:08 -08:00
11b84cb870 Add jit and caching args to ledger-tool (#15177) 2021-02-06 19:49:24 +00:00
47578895e1 Increment hyper versions to pacify cargo audit (#15171) 2021-02-05 23:14:05 -08:00
dc7041ba07 Require lockup authority to change withdraw authority on locked stake (#14861) 2021-02-05 22:40:07 -08:00
f34b8643c7 Add |solana-validator monitor| subcommand (#15118) 2021-02-05 22:39:23 -08:00
819d829c41 Only publish release-tag docs on beta channel (#15158) 2021-02-05 23:39:04 -07:00
af7e799147 Update solana-user-authorized_keys.sh (#15059) 2021-02-05 22:37:34 -08:00
600cea274d change store account scan to not use dashmap (#15104)
* change store account scan to not use dashmap

* add test_accountsdb_de_dup_accounts_from_stores

* add tests

* add test_accountsdb_flatten_hash_intermediate

* add tests

* add sort test

* add test

* clippy

* first_slice -> is_first_slice

* comment

* use partial_cmp
2021-02-05 21:16:30 -06:00
fbf9dc47e9 Threadpool2 (#15151)
* rework thread pool for hash calculation

* rename
2021-02-05 18:48:16 -06:00
3a5c142a9b Update slashing roadmap link 2021-02-05 16:29:03 -07:00
c5be226821 program-test: Add warp tests for rent and stake rewards (#15136)
* program-test Add rent collection and stake rewards

* Improve tests to initialize vote state

* Update comment

* Update program-test/src/lib.rs

Co-authored-by: Michael Vines <mvines@gmail.com>

* Review feedback

* cargo fmt

* Avoid using hard-coded slots in tests

* Make genesis_config private

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-02-05 22:08:00 +01:00
fabecdc86c use thread pool for non-index hash calculations (#15149) 2021-02-05 19:48:55 +00:00
6fd5ec0e4c caches descendants in bank forks (#15107) 2021-02-05 18:00:45 +00:00
210514b136 Add cli deploy tests (#15116) 2021-02-05 09:57:44 -08:00
f85be6259b sentinel value for zero lamport accounts in hash scanning (#15097)
* sentinel value for zero lamport accounts in hash scanning

* fix test
2021-02-05 11:23:48 -06:00
2a60dd8492 Add w3m's inflation pubkeys (#15142) 2021-02-05 08:46:09 -08:00
fa1189fa1a chore: bump @babel/runtime from 7.12.5 to 7.12.13 in /web3.js (#15141)
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.12.5 to 7.12.13.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.13/packages/babel-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-05 14:23:53 +00:00
5af7cc4706 chore: bump ws from 7.4.1 to 7.4.3 in /web3.js (#15140)
Bumps [ws](https://github.com/websockets/ws) from 7.4.1 to 7.4.3.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.1...7.4.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-05 14:01:39 +00:00
004707fa30 chore: bump start-server-and-test from 1.11.7 to 1.12.0 in /web3.js (#15138)
Bumps [start-server-and-test](https://github.com/bahmutov/start-server-and-test) from 1.11.7 to 1.12.0.
- [Release notes](https://github.com/bahmutov/start-server-and-test/releases)
- [Commits](https://github.com/bahmutov/start-server-and-test/compare/v1.11.7...v1.12.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-05 13:40:22 +00:00
8cf0fb63f3 chore: bump @babel/plugin-proposal-function-bind in /web3.js (#15137)
Bumps [@babel/plugin-proposal-function-bind](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-proposal-function-bind) from 7.12.1 to 7.12.13.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.13/packages/babel-plugin-proposal-function-bind)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-05 13:12:48 +00:00
98fa5bcb3f chore: bump @babel/preset-flow from 7.12.1 to 7.12.13 in /web3.js (#15135)
Bumps [@babel/preset-flow](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-flow) from 7.12.1 to 7.12.13.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.13/packages/babel-preset-flow)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-05 12:50:21 +00:00
3849b18bde chore: bump marked from 1.2.7 to 1.2.9 in /web3.js (#15134)
Bumps [marked](https://github.com/markedjs/marked) from 1.2.7 to 1.2.9.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/release.config.js)
- [Commits](https://github.com/markedjs/marked/compare/v1.2.7...v1.2.9)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-05 12:26:57 +00:00
0e4450b77d chore: bump @babel/preset-env from 7.12.11 to 7.12.13 in /web3.js (#15133)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.12.11 to 7.12.13.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.13/packages/babel-preset-env)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-05 12:04:23 +00:00
72d4acd90c chore: bump @babel/plugin-proposal-class-properties in /web3.js (#15132)
Bumps [@babel/plugin-proposal-class-properties](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-proposal-class-properties) from 7.12.1 to 7.12.13.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.13/packages/babel-plugin-proposal-class-properties)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-05 11:42:46 +00:00
bda8868781 chore: bump @babel/plugin-transform-runtime in /web3.js (#15131)
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.12.10 to 7.12.15.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.15/packages/babel-plugin-transform-runtime)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-05 11:20:32 +00:00
a9b6135d9f chore: bump @babel/core from 7.12.10 to 7.12.13 in /web3.js (#15130)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.12.10 to 7.12.13.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.13/packages/babel-core)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-05 10:59:01 +00:00
280aee0fa9 chore: bump acorn from 8.0.4 to 8.0.5 in /web3.js (#15129)
Bumps [acorn](https://github.com/acornjs/acorn) from 8.0.4 to 8.0.5.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/8.0.4...8.0.5)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-05 10:35:39 +00:00
c69027e5aa chore: bump serde from 1.0.118 to 1.0.122 (#15126)
* chore: bump serde from 1.0.118 to 1.0.122

* Update programs/bpf/Cargo.lock
2021-02-05 19:23:24 +09:00
ffc7de4dec chore: bump eslint from 7.18.0 to 7.19.0 in /web3.js (#15128)
Bumps [eslint](https://github.com/eslint/eslint) from 7.18.0 to 7.19.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.18.0...v7.19.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-05 09:57:53 +00:00
cfb2bca5af chore: bump rollup from 2.37.1 to 2.38.5 in /web3.js (#15127)
Bumps [rollup](https://github.com/rollup/rollup) from 2.37.1 to 2.38.5.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.37.1...v2.38.5)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-05 09:32:28 +00:00
d1563f0ccd Bump tonic, prost, tarpc, tokio (#15013)
* Update tonic & prost, and regenerate proto

* Reignore doc code

* Revert pull #14367, but pin tokio to v0.2 for jsonrpc

* Bump backoff and goauth -> and therefore tokio

* Bump tokio in faucet, net-utils

* Bump remaining tokio, plus tarpc
2021-02-05 00:21:53 -07:00
863f08f8d3 Sort inflation candidates alphabetically 2021-02-05 07:16:23 +00:00
85ffc8fa1c Warn lastValidSlot with some terminology tweaks (#15081)
* Warn lastValidSlot with some terminology tweaks

* Apply suggestions from code review

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

* Restore previous arrangment of slot def. and tweak upon it

* Apply suggestions from code review

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

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-02-05 15:47:02 +09:00
e908a4b3fc Inflation Nomination for sotcsa (#15105) 2021-02-04 21:45:17 -08:00
a52a241852 nit: cleanup feature status display (#15113)
* nit: cleanup feature status display

* nudge
2021-02-04 20:23:01 -08:00
7d9f5ad525 remove unused arg from function (#15096) 2021-02-04 20:46:30 -06:00
f0d58f5549 move timer end outside if (#15087) 2021-02-04 20:43:23 -06:00
82350f9350 deploy doc updates (#15109) 2021-02-04 16:18:14 -08:00
bba1b49663 Generate keypair file for c program deployment (#15080)
* Generate keypair file for c program deployment

* Build and use solana-keygen in test-stable-perf
2021-02-04 13:56:12 -08:00
e4d0d4bfae Fix pubkey refcount for shrink + clean (#14987) 2021-02-04 12:44:19 -08:00
53dab29528 Add LowFeeValidation Nomination (#15098) 2021-02-04 10:50:44 -08:00
c6f572c331 Enable inflation candidate for RockX (#15099) 2021-02-04 10:39:33 -08:00
f49a70e626 borrow storages (#15088) 2021-02-04 11:29:03 -06:00
e5225b7e68 Add ref count from storage (#15078) 2021-02-04 09:11:05 -08:00
d87e0c3f1d Inflation Nomination for Diman (#15083) 2021-02-04 09:04:23 -08:00
2ed074ba2a Nomination candidate for p2pvalidator (#15079) 2021-02-04 08:40:14 -08:00
e7f53182e2 fix merge conflict (#15085) 2021-02-04 09:20:50 -06:00
600ff0d915 calculate hash from store instead of index (#15034)
* calculate hash from store instead of index

* restore update hash in abs
2021-02-04 09:00:33 -06:00
d0118a5c42 Add program deployment docs (#15075) 2021-02-04 01:30:50 -08:00
86467d825a removes pubkey references (#15050) 2021-02-03 23:02:11 +00:00
2970b59853 Don't load all accounts into memory for capitalization check (#14957)
* Don't load all accounts into memory for capitalization check
2021-02-03 15:00:42 -08:00
8e93a784f3 program-test: Add ability to warp to the future (#14998)
* program-test: Add ability to warp to the future

* Make `start_local_server` take by value

* Remove clear_invoke_context
2021-02-03 23:31:36 +01:00
ebbaa1f8ea Fix integer overflow in degenerate invoke_signed BPF syscalls (#15051) 2021-02-03 13:32:38 -08:00
02a5f7104a Fix which shared object the test uses (#15060) 2021-02-03 13:31:55 -08:00
2b9a0311d3 Don't reset accounts if the remove_account comes from a clean (#15022)
Store may be in-use with a snapshot creation, so don't disturb
it's state.
2021-02-03 13:06:28 -08:00
c3ba70300b Correct stakeconomy::vote::id() (#15062) 2021-02-03 12:39:55 -08:00
42bf6dc2ab Revert hard nofile limit back to 500000 2021-02-03 19:43:55 +00:00
139ab5e49e Avoid panic when the release cache is empty 2021-02-03 09:35:11 -08:00
d24d5fba0e Upgradeable loader max_data_len limit (#15039) 2021-02-03 09:16:25 -08:00
f2d415cf13 Nomination candidate for buburuza (#15047) 2021-02-03 08:30:44 -08:00
0ad063f4e9 adds flag to disable duplicate instance check (#15006) 2021-02-03 16:26:17 +00:00
971c222cf7 transaction-history -v now shows the transaction timestamp if available 2021-02-03 08:17:58 -08:00
8376781ec8 Don't squash caught errors, please (#15046)
* Don't squash caught errors, please

* Update blockstore.rs

* Update blockstore.rs
2021-02-03 14:42:34 +00:00
4324374ab5 program-test: Set context without panic (#14997)
* program-test: Fix CPI and multiple instructions

* Whitespace

* Add CPI test in program-test
2021-02-03 13:45:29 +01:00
286e4d6924 bump rust-bpf-sysroot to v0.14 (#15040) 2021-02-03 10:43:38 +00:00
87815ae1fd Nomination candidate for bunghi (#15036)
* Update feature_set.rs

* Update feature_set.rs

* Update sdk/src/feature_set.rs

* Update feature_set.rs

* Update sdk/src/feature_set.rs

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-02-03 10:10:38 +00:00
4c53418b19 chore:(deps): bump @testing-library/react in /explorer (#15041)
Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 11.2.2 to 11.2.5.
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v11.2.2...v11.2.5)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-03 09:20:21 +00:00
38e2fe8997 Cli: some moniker follow-up (#14981)
* Enable monikers in config set

* Fixup websocket compute
2021-02-03 00:33:02 -07:00
9c6d899efb cli: add command to dump the upgradeable program to a file (#15029) 2021-02-02 22:33:03 -08:00
31d30bb5e8 CLI: Move solana validators summary to end of output 2021-02-03 05:19:20 +00:00
894b412aef docs: bump nofiles recommendations to match maps 2021-02-02 21:59:21 -07:00
a5ba6b43bc Add more MB onboarders 2021-02-02 20:51:18 -07:00
fa96119daa Update validator_list.rs 2021-02-02 20:39:24 -07:00
98aa1fa4ea Upgrade jsonrpc crates to v17.0.0 (#15018)
* Upgrade to jsonrpc 17.0.0

* Fix test

* tree

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-02-02 19:53:08 -07:00
a1b9e00c14 cli: Don't overallocate upgradeable program if --final specified (#15011) 2021-02-02 17:20:42 -08:00
53423c99aa keygen: Improve messaging around BIP39 passphrase usage 2021-02-02 17:30:13 -07:00
3abb39c04f CLI: Surface account query errors 2021-02-02 17:25:11 -07:00
6cf6ef3a32 cli: add query command to solana program (#15017) 2021-02-02 15:36:02 -08:00
903a08c4b3 Add USDT to token registry (#15019)
Co-authored-by: publish-docs.sh <maintainers@solana.com>
2021-02-02 15:52:00 -07:00
7831428e82 Allow passing buffer by keypair to cli program deploy (#15010) 2021-02-02 13:35:37 -08:00
37aac5a12d Cleanup v1 shrink path (#15009)
move legacy functions to another impl block
2021-02-02 13:29:46 -08:00
fddbfe1052 CLI: Modernize decode-transaction about message 2021-02-02 18:44:22 +00:00
d547585041 cli: Add sigverify status to decode-transaction output 2021-02-02 18:44:22 +00:00
a2aea0ca33 cli-output: Add option sigverify status to println_transaction() output 2021-02-02 18:44:22 +00:00
22800054e6 streamline calculate_accounts_hash (#14980) 2021-02-02 10:58:19 -06:00
b57f33948d Add Hackathon banner (#15004) 2021-02-02 09:43:41 -07:00
2780214e71 Clean up some old commitment names (#14994) 2021-02-02 16:33:45 +00:00
31168fe343 Disable AppendVec warn! for now (#14996)
* Disable AppendVed warn! for now

* Fix version...

* Update append_vec.rs
2021-02-02 14:52:30 +00:00
3eea88a3a8 Update transactions.md 2021-02-02 22:42:59 +08:00
1df93fa2be chore: bump serde from 1.0.112 to 1.0.118 (#14828)
* chore: bump serde from 1.0.112 to 1.0.122

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.112 to 1.0.122.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.112...v1.0.122)

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

* [auto-commit] Update all Cargo lock files

* Update frozen_abi digest following serde update

* Revert "chore: bump serde from 1.0.112 to 1.0.122"

This reverts commit a3ef4442a4.

* Revert "[auto-commit] Update all Cargo lock files"

This reverts commit c41c3b005f.

* chore: bump serde from 1.0.112 to 1.0.118

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.112 to 1.0.118.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.112...v1.0.118)

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

* [auto-commit] Update all Cargo lock files

* Remove serum-dex pinning

* blind commit!

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-02-02 23:28:16 +09:00
0ccac9b790 Sanity check that the RPC endpoint is healthy before performing too much work 2021-02-01 20:21:52 -08:00
8e0fdff17c Inflation Nomination for BL (#14972) 2021-02-01 20:21:30 -08:00
34dfcc9c6f Parse SPL Memo v3 (#14979)
* Parse memo v3 too

* tree
2021-02-02 04:02:57 +00:00
709aa74e11 Adapt create-snapshot to avoid triggering recent internal bank sanity checks 2021-02-01 18:29:05 -08:00
7614c2e341 Update economics docs (#14965)
* clarified inflation split and equation

* clarify staking yield description
2021-02-01 23:38:22 +01:00
d978cd1a2a TestValidator store cpi and logs 2021-02-01 15:35:33 -07:00
cbb8b79a60 Add validator flag to opt in to cpi and logs storage (#14922)
* Add validator flag to opt in to cpi and logs storage

* Default TestValidator to opt-in; allow using in multinode-demo

* No clone

Co-authored-by: Carl Lin <carl@solana.com>
2021-02-01 14:00:51 -07:00
73d9186502 More rich runtime logging (#14938) 2021-02-01 11:40:49 -08:00
c8d83ae019 cli: Improve stake-history output readability 2021-02-01 19:19:11 +00:00
1c6f31241a cli-output: Minor refactor of build_balance_message() 2021-02-01 19:19:11 +00:00
52f0de3207 Impl OutputFormat for solana program (#14911) 2021-02-01 10:39:37 -07:00
49c908dc50 Add "init" subcommand 2021-02-01 08:12:28 -08:00
c06568f3db Certus One inflation enablement feature pair (#14961) 2021-02-01 08:12:01 -08:00
cde7b583b8 explorer: Add MAPS to token Registry (#14959) 2021-02-01 12:49:26 +01:00
cc8be7869b Add more MB nodes to stake bot 2021-01-31 10:54:54 -07:00
63c44bd690 Use helper for count() in accountsDB (#14953) 2021-01-31 09:32:02 -08:00
164fae44df /i/o/ 2021-01-31 08:22:01 -08:00
d34770e3b3 Log each validator's identity/vote/baseline/bonus address for easier issue triage 2021-01-30 18:55:16 +00:00
e0f6695cc2 Update sdk/src/feature_set.rs 2021-01-30 10:04:50 -08:00
4ba9e39941 Update feature_set.rs 2021-01-30 10:04:50 -08:00
15baf43d1e Template for an Inflation Candidate nomination
To submit your nomination:
1. Replace all instances of "my_name" with a suitable alternative then address the "TODO" code comments
2. Submit a new Github pull request and work with the project contributors to merge your pull request
2021-01-30 10:04:50 -08:00
33dc63ccbd Add new Mainnet Beta nodes Jan 29 2021-01-30 00:19:28 -07:00
f98889adc0 style(spacing): reformat tab spacing 2021-01-29 23:08:24 -08:00
a7ff1684f5 Template for an Inflation Candidate nomination
To submit your nomination:
1. Replace all instances of "my_name" with a suitable alternative then address the "TODO" code comments
2. Submit a new Github pull request and work with the project contributors to merge your pull request
2021-01-29 23:08:24 -08:00
ea4f516f84 Garbage collect old releases 2021-01-30 01:09:32 +00:00
9e3c130ac9 Help capitalization fixes 2021-01-30 01:09:32 +00:00
af04a265dd Manually camelCase solana program json (#14907) (#14936) 2021-01-29 22:52:26 +00:00
7ad9870071 Prevent bricked install when ^C is pressed during archive extraction 2021-01-29 14:27:04 -08:00
07cef5a557 Buffer authority must match upgrade authority for deploys and upgrades (#14923) 2021-01-29 12:43:42 -08:00
65315fa4c2 Use already-generated key set to populate dirty keys for clean (#14905)
Don't need to scan the stores again when we already found the key
set of updates per slot. Just insert it earlier.
2021-01-29 11:44:43 -08:00
2e54b6acb1 Fix cli usage build 2021-01-29 19:03:10 +00:00
84e52b6065 Increase vm map limit recommendation (#14892)
Give some more buffer from 400k
2021-01-29 09:01:01 -08:00
0ce08274f9 program-test: Expose bank task to fix fuzzing (#14908)
* program-test: Expose bank task to fix fuzzing

* Run cargo fmt and clippy

* Remove unnecessary print in test

* Review feedback

* Transition to AtomicBool
2021-01-29 14:23:59 +01:00
d026da4a1b Ignore syscalls which are not registered in cached rbpf executable. (#14898) 2021-01-29 12:30:10 +01:00
996a27d475 cli: Improve reliability of program deploys (#14902)
* cli: Improve reliability of program deploys

* chore: fix clippy
2021-01-29 15:15:22 +08:00
01230a0105 Remove serial_test_derive dependency (#14891) 2021-01-28 22:35:31 -07:00
52326d53be docs: Fix mangled getConfirmedTransaction parameter list 2021-01-28 22:13:03 -07:00
85b5dbead6 Add feature for pending SPL Token self-transfer fix 2021-01-29 04:19:33 +00:00
31019e9828 fix: do not download and execute binaries via HTTP (#14914)
This fixes a couple of trivial remote code execution opportunities.
2021-01-29 01:59:40 +00:00
d6873b82ab Remove potentially too costly Packets::default() (#14821)
* Remove potentially too costly Packets::default()

* Fix test...

* Restore Packets::default()

* Restore Packets::default() more
2021-01-29 09:32:38 +09:00
8993ac0c74 Surface faucet start failures to the user of solana-test-validator 2021-01-28 22:35:58 +00:00
fdfc0f409d format to list 2021-01-28 22:47:06 +01:00
ad9ea91c1d explorer: add pagination to block rewards (#14906) 2021-01-28 13:26:06 -08:00
0b1015f7d3 Richer runtime failure logging (#14875) 2021-01-28 10:04:54 -08:00
a53b8558cd Only mmap file from snapshot once (#14815) 2021-01-28 08:15:33 -08:00
2ca0872a98 nit: message doesn't represent (#14893) 2021-01-27 17:21:45 -08:00
63429507b2 Add syscall feature activation test (#14890) 2021-01-27 17:21:25 -08:00
6b8e710988 RPC documentation updates for token deltas / blockTimes in getConfirmedSignatures2/getConfirmedTransaction (#14871)
* docs: add token balances response info

* docs: add blockTime to getConfirmedSignatures and getConfirmedTransaction

* docs: update example responses

* fix: remove space
2021-01-27 16:15:37 -08:00
5594a7122d Reorg and cleanup of economics section of docs (#14868)
* reorg validator economics

* overview cleanup

* terminology

* terminology formatting

* katex for docusaurus

* adjusted staking yield writeup

* more reorg

* move section header

* rm unlinked mds

* add new mds

* Update docs/src/inflation/terminology.md

Co-authored-by: Dan Albert <dan@solana.com>

* Update docs/src/inflation/terminology.md

Co-authored-by: Dan Albert <dan@solana.com>

* Update docs/src/inflation/terminology.md

Co-authored-by: Dan Albert <dan@solana.com>

* Update docs/src/inflation/terminology.md

Co-authored-by: Dan Albert <dan@solana.com>

* Update docs/src/inflation/terminology.md

Co-authored-by: Dan Albert <dan@solana.com>

* Update docs/src/transaction_fees.md

Co-authored-by: Dan Albert <dan@solana.com>

* addressing Dans comments in #14868

* incorporating pr commits

* trailing whitespaces

* more trailing whitespaces

* remove services link and add plot

* add plots

Co-authored-by: Dan Albert <dan@solana.com>
2021-01-27 22:54:00 +01:00
577310380a explorer: Introduce scam registry and flag on account pages (#14886)
* explorer: add spam registry

* explorer: adjust warning messaging

* fix: remove red borders

* explorer: change spam to scam

* explorer: no need for this to be a prop now
2021-01-27 13:50:02 -08:00
b948ede624 keygen: Add num-threads argument for grind (#14884)
* keygen: Add num-threads argument

* Review feedback
2021-01-27 21:18:12 +01:00
30ff1d6c9c Remove inactive pubkeys from Mainnet Beta list 2021-01-27 10:45:12 -07:00
aebc1af1d8 Update validator_list.rs 2021-01-27 09:42:52 -07:00
72f10f5f29 Aggregate purge and shrink metrics (#14763)
Co-authored-by: Carl Lin <carl@solana.com>
2021-01-27 01:39:47 -08:00
daddcd361a Snapshots missing slots from accounts cache clean optimization (#14852)
Co-authored-by: Carl Lin <carl@solana.com>
2021-01-26 20:08:55 -08:00
545d93590b fix: add missing token delta type on ConfirmedMeta (#14872) 2021-01-26 19:47:59 -08:00
dcb6f68287 install: Add version envvar to info --eval output 2021-01-26 17:04:16 -08:00
51dbc2785f Update validator_list.rs 2021-01-26 18:00:06 -07:00
9411af4a95 explorer: Only report getBlockTime error under max confs (#14869) 2021-01-26 14:57:50 -08:00
7686b70381 Bumps RBPF to v0.2.4 (#14865) 2021-01-26 14:45:03 -08:00
a3e0a365a5 explorer: Add timestamps to transaction history (#14782)
* add timestamps to transaction history

* use local timestamps for blocktime display

* revert to showing full universal time systemwide
2021-01-26 12:20:09 -08:00
5bf5a5ec41 Enable accounts caching by default (#14854)
Co-authored-by: Carl Lin <carl@solana.com>
2021-01-26 12:06:39 -08:00
ff22091a98 Add StakeInstruction::Merge logging 2021-01-26 11:52:39 -08:00
a395037671 explorer: Add block rewards to block details page (#14786)
* explorer: add block rewards

* add key to tr map
2021-01-26 11:51:58 -08:00
119e2c75dd cli now supports a custodian for stake authorize operations 2021-01-26 11:48:28 -08:00
ffa5c7dcc8 Deprecate commitment variants (#14797)
* Deprecate commitment variants

* Add new CommitmentConfig builders

* Add helpers to avoid allowing deprecated variants

* Remove deprecated transaction-status code

* Include new commitment variants in runtime commitment; allow deprecated as long as old variants persist

* Remove deprecated banks code

* Remove deprecated variants in core; allow deprecated in rpc/rpc-subscriptions for now

* Heavier hand with rpc/rpc-subscription commitment

* Remove deprecated variants from local-cluster

* Remove deprecated variants from various tools

* Remove deprecated variants from validator

* Update docs

* Remove deprecated client code

* Add new variants to cli; remove deprecated variants as possible

* Don't send new commitment variants to old clusters

* Retain deprecated method in test_validator_saves_tower

* Fix clippy matches! suggestion for BPF solana-sdk legacy compile test

* Refactor node version check to handle commitment variants and transaction encoding

* Hide deprecated variants from cli help

* Add cli App comments
2021-01-26 19:23:07 +00:00
e08d2e6fcc fix: add custodian key support to stake instructions 2021-01-26 10:27:20 -08:00
1d6e9335ff rent text cleanup (#14837) 2021-01-26 09:07:38 -06:00
e57b9c3b02 Add more upgradeable tests (#14846) 2021-01-25 21:04:59 -08:00
8cd036938e chore: comment blockHeight 2021-01-25 19:38:10 -08:00
fba0e933a4 test: account for rent collection to avoid bogus test failure 2021-01-25 19:38:10 -08:00
fd06c1f8fa fix: add Clock sysvar to AuthorizeWithSeed instruction 2021-01-25 19:38:10 -08:00
8359f4f5ff Include Clock sysvar in AuthorizeWithSeed instruction 2021-01-25 19:38:10 -08:00
2b50433099 Remove legacy_stake program 2021-01-25 19:34:40 -08:00
4a4881d30f Update find_program_address docs (#14840) 2021-01-25 16:03:26 -08:00
60611ae8a0 Add security best practice sections (#14798) 2021-01-25 15:36:11 -08:00
74c83e6854 Rotate feature key: use loaded executable accounts (#14838) 2021-01-25 15:34:45 -08:00
1b85114a9c remove legacy merkle root (#14772)
* remove legacy merkle root
f78197a

* clippy

* compile error

* borrow error

* derministic results

* clippy

* borrow
2021-01-25 15:26:08 -06:00
d1df9da7d3 fixes test_filter_current flakiness (#14816) 2021-01-25 15:57:46 +00:00
5700e835ef Refactors tuple of TransactionLoadResult into a struct. (#14773) 2021-01-25 10:35:08 +01:00
bd0433c373 Clean up VerifiedVotePackets (#14822) 2021-01-25 09:01:47 +00:00
015058e0b7 Reduce ~2 GBs mem by avoiding another overalloc. (#14806)
* Reduce few GBs mem by avoiding another overalloc.

* Use x.len() for the last item from chunks()
2021-01-25 04:27:47 +00:00
e1021d9f83 removes redundant epoch stakes cache in retransmit (#14781)
Following d6d76219b, staked nodes computed from vote accounts are
already cached in runtime::Stakes, so the caching in retransmit_stage is
redundant.
2021-01-24 21:15:09 +00:00
0d32a0e0f4 Partial clean (#14800)
* Revert "Revert "Partial accounts clean (#14652)" (#14777)"

This reverts commit ad2e10e17b.

* Remove squashed uncleaned keys
2021-01-24 09:50:19 -08:00
491b059755 broadcasts duplicate shreds through gossip (#14699) 2021-01-24 15:47:43 +00:00
cbffab7850 Upgrade to Rust v1.49.0 2021-01-23 19:16:36 -08:00
7604edb16f Added BRZ token on explorer token registry 2021-01-23 11:41:55 -08:00
Leo
561d385281 explorer: fix typo in InitializeMarketDetailsCard 2021-01-23 11:40:03 -08:00
96b27ca0cb Remove zero_lamport_pubkeys reference (#14808) 2021-01-23 18:31:55 +00:00
424bb797a6 Speed up generate_index (#14792) 2021-01-23 08:05:05 -08:00
c77461e428 Remove unnecesary flushes in previous roots (#14596)
Co-authored-by: Carl Lin <carl@solana.com>
2021-01-23 04:02:44 -08:00
170a3aec14 Add new instructions and program id to explorer (#14771) 2021-01-23 12:31:59 +01:00
1d87091d51 Improve documentation of sendTransaction (#14770)
* Improve documentation of sendTransaction

* Apply suggestions from code review

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

* Word wrap and improve terminology

* Tweak

* Oops

* Apply suggestions from code review

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

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-01-23 09:51:25 +00:00
66fd187f16 Make exchange listening-for-deposits language stronger (#14775)
* Make exchange listening-for-deposits language stronger

* Update docs/src/integrations/exchange.md

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>

* Update from deprecated method

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2021-01-23 07:16:42 +00:00
191193289f Upgrade sha2 to 0.9.3 (#14746) 2021-01-22 22:25:22 -08:00
bf1943e489 Add solana-test-validator --warp-slot argument 2021-01-22 21:17:02 -08:00
dd5a2ef05f Add convenience function to create a snapshot archive out of any Bank 2021-01-22 21:17:02 -08:00
82b29891d1 Retry more 2021-01-22 19:45:58 -08:00
78c2a9ef52 Fetch blockhash for each transaction simulation to avoid stale blockhashes 2021-01-22 19:45:58 -08:00
a44392048d CLI: Reinstate logging, disabled by default 2021-01-23 02:41:40 +00:00
ad2e10e17b Revert "Partial accounts clean (#14652)" (#14777)
This reverts commit ca7914aa3d.
2021-01-22 18:05:49 -08:00
e505a9b209 Revert disabling script (#14788) 2021-01-23 01:08:06 +00:00
77572a7c53 Track account writable deescalation (#14626) 2021-01-22 15:28:01 -08:00
cbb9ac19b9 Add ability to clone accounts from an RPC endpoint 2021-01-22 13:29:36 -08:00
c3548f790c Add ability to force feature activation without code modification 2021-01-22 21:26:00 +00:00
802fd49905 typo (#14774) 2021-01-22 13:36:26 -06:00
e9c98f2416 CLI: Don't scare the users 2021-01-22 11:16:27 -07:00
90e1778cd2 CLI: Allow missing pubkey in --verbose config output 2021-01-22 11:16:27 -07:00
8f8d593457 CLI: Strive for at least one signer 2021-01-22 11:16:27 -07:00
18bd0c9a5b speed up merkle calculation (#14710) 2021-01-22 09:21:50 -06:00
e31eb09e3e chore:(deps): bump @testing-library/user-event in /explorer (#14769)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 12.6.0 to 12.6.2.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v12.6.0...v12.6.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-22 09:25:07 +00:00
37ad3b6c6d chore:(deps): bump @sentry/react from 6.0.0 to 6.0.1 in /explorer (#14768)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/6.0.0...6.0.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-22 09:08:39 +00:00
71e9958e06 Rpc: Add custom error for BigTable data not found (#14762)
* Expose not-found bigtable error

* Add custom rpc error for bigtable data not found

* Return custom rpc error when bigtable block is not found

* Generalize long-term storage
2021-01-22 04:40:47 +00:00
12410541a4 CLI: Add calculate-rent subcommand 2021-01-21 15:45:05 -07:00
2820d0a23d cli-output: Genericize writeln_name_value() 2021-01-21 15:45:05 -07:00
e4da6761a7 fixes test_filter_current flakiness (#14749) 2021-01-21 21:53:10 +00:00
3c6dbd21d2 Add ic_msg()/ic_logger_msg() macros 2021-01-21 21:41:33 +00:00
ca95302038 Update bigtable confirm to use confirmation_status (#14750) 2021-01-21 20:36:11 +00:00
ca7914aa3d Partial accounts clean (#14652)
Clean less keys by tracking the two cases:
* Touched keys per slot in uncleaned_keys derived from
accounts delta hash operation.
* Set of keys with any zero-lamport updates.
2021-01-21 11:01:53 -08:00
d52c94a366 adds missing block_time field (#14743) 2021-01-21 18:29:48 +00:00
8e581601d6 patches crds vote-index assignment bug (#14438)
If tower is full, old votes are evicted from the front of the deque:
https://github.com/solana-labs/solana/blob/2074e407c/programs/vote/src/vote_state/mod.rs#L367-L373
whereas recent votes if expire are evicted from the back:
https://github.com/solana-labs/solana/blob/2074e407c/programs/vote/src/vote_state/mod.rs#L529-L537

As a result, from a single tower_index scalar, we cannot infer which crds-vote
should be overwritten:
https://github.com/solana-labs/solana/blob/2074e407c/core/src/crds_value.rs#L576

In addition there is an off by one bug in the existing code. tower_index is
bounded by MAX_LOCKOUT_HISTORY - 1:
https://github.com/solana-labs/solana/blob/2074e407c/core/src/consensus.rs#L382
So, it is at most 30, whereas MAX_VOTES is 32:
https://github.com/solana-labs/solana/blob/2074e407c/core/src/crds_value.rs#L29
Which means that this branch is never taken:
https://github.com/solana-labs/solana/blob/2074e407c/core/src/crds_value.rs#L590-L593
so crds table alwasys keeps 29 **oldest** votes by wallclock, and then
only overrides the 30st one each time. (i.e a tally of only two most
recent votes).
2021-01-21 13:08:07 +00:00
fcd72f309a chore: bump semantic-release from 17.3.4 to 17.3.6 in /web3.js (#14740)
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 17.3.4 to 17.3.6.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v17.3.4...v17.3.6)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-21 09:54:55 +00:00
f8e6969eb2 chore:(deps): bump @solana/web3.js from 0.90.0 to 0.90.1 in /explorer (#14737)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 0.90.0 to 0.90.1.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v0.90.0...v0.90.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-21 09:26:22 +00:00
ebc97b711a chore: bump rollup from 2.37.0 to 2.37.1 in /web3.js (#14736)
Bumps [rollup](https://github.com/rollup/rollup) from 2.37.0 to 2.37.1.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.37.0...v2.37.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-21 09:24:20 +00:00
aa96ad042b Add signer/writable de/escalation tests (#14726) 2021-01-21 09:19:46 +00:00
04ce33a04e Ensure sanitary transactions 2021-01-20 23:59:32 -08:00
e9b5d65f40 solana decode-transaction no longer panics on unsanitary transactions 2021-01-20 23:59:32 -08:00
5ac536d0fb Minor doc clarification 2021-01-20 23:58:39 -08:00
1e45b3e6d2 explorer: introduce transfer with seed instruction card (#14730) 2021-01-20 23:49:32 -08:00
072e5e54d8 Add generalized voting process to enable full inflation 2021-01-20 23:37:21 -08:00
1de6d28eaf Add block_time to getConfirmedSignaturesForAddress2 and getConfirmedTransaction (#14572)
* add block_time to get_confirmed_signatures_for_address2 and protobuf implementation for tx_by_addr

* add tests for convert

* update cargo lock

* run cargo format after rebase

* introduce legacy TransactionByAddrInfo

* move LegacyTransactionByAddrInfo back to storage-bigtable
2021-01-20 22:10:35 -08:00
447e3de1f2 Nonce address doesn't sign AdvanceNonceAccount 2021-01-21 04:14:36 +00:00
7c48743669 fix(web3): align doc comments with class field names 2021-01-21 03:51:11 +00:00
0e87572eb0 Return confirmation-status (#14709) 2021-01-20 18:32:48 -07:00
2783aee483 SDK: Sanitize base58 signature input 2021-01-20 23:59:26 +00:00
250b3969d4 SDK: Sanitize base58 pubkey input 2021-01-20 23:59:26 +00:00
c64d4f7693 Default to highest finalized block if no slot provided (#14701) 2021-01-20 13:51:57 -07:00
a7086a0f83 Cli: promote commitment to a global arg + config.yml (#14684)
* Make commitment a global arg

* Add commitment to solana/cli/config.yml

* Fixup a couple Display/Verbose bugs
2021-01-20 09:48:10 -07:00
ed90ef76d4 Update validator_list.rs 2021-01-20 08:50:01 -07:00
df8cafe941 chore:(deps): bump @types/node from 14.14.21 to 14.14.22 in /explorer (#14690)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.21 to 14.14.22.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-20 10:20:21 +00:00
9003d8f808 chore: bump semantic-release from 17.3.3 to 17.3.4 in /web3.js (#14688)
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 17.3.3 to 17.3.4.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v17.3.3...v17.3.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-20 09:53:08 +00:00
dfd265b971 chore:(deps): bump @sentry/react from 5.30.0 to 6.0.0 in /explorer (#14689)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 5.30.0 to 6.0.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/5.30.0...6.0.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-20 09:49:58 +00:00
7f79c70831 chore:(deps): bump bootstrap from 4.5.3 to 4.6.0 in /explorer (#14687)
Bumps [bootstrap](https://github.com/twbs/bootstrap) from 4.5.3 to 4.6.0.
- [Release notes](https://github.com/twbs/bootstrap/releases)
- [Commits](https://github.com/twbs/bootstrap/compare/v4.5.3...v4.6.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-20 09:22:44 +00:00
3ca8295ec5 chore: bump rollup from 2.36.2 to 2.37.0 in /web3.js (#14686)
Bumps [rollup](https://github.com/rollup/rollup) from 2.36.2 to 2.37.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.36.2...v2.37.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-20 09:21:11 +00:00
2745b79b74 Parallel cache scan (#14544)
* Parallel cache scan

* PR comments

* PR comments

Co-authored-by: Carl Lin <carl@solana.com>
2021-01-20 08:50:17 +00:00
a480b63234 Bail on small deploy buffers (#14677) 2021-01-20 01:56:44 +00:00
e3bd9e5300 Prevent the invoke and upgrade of programs in the same tx batch (#14653)
* Prevent the invoke and upgrade of programs in the same tx batch

* Pass program address as writable in the upgrade instruction
2021-01-19 16:24:44 -08:00
4964b0fe61 Cli: default to single gossip (#14673)
* Init cli RpcClient with chosen commitment; default to single_gossip

* Fill in missing client methods

* Cli tests: make RpcClient commitment specific

* Simply rpc_client calls, using configured commitment

* Check validator vote account with single-gossip commitment
2021-01-19 15:33:03 -07:00
fba4e51171 Add retries for getConfirmBlocks RPC operations for robustness 2021-01-19 21:08:07 +00:00
e99d7d3458 Require a notifier before affecting stake 2021-01-19 11:01:08 -08:00
332371635d Generalize notification handling 2021-01-19 11:01:08 -08:00
dcaa025822 Configure Bigtable's timeout, enabling by default (#14657)
* Configure bigtable's timeout when read-only

* Review comments

* Apply nits (thanks!)

Co-authored-by: Michael Vines <mvines@gmail.com>

* Timeout in the streamed decoding as well

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-01-19 13:57:16 +00:00
8a604de3c3 chore:(deps): bump @types/bn.js from 4.11.6 to 5.1.0 in /explorer (#14666)
Bumps [@types/bn.js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/bn.js) from 4.11.6 to 5.1.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/bn.js)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-19 09:31:11 +00:00
cbbfeb8f3e chore: bump eslint-config-prettier from 7.0.0 to 7.2.0 in /web3.js (#14665)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 7.0.0 to 7.2.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v7.0.0...v7.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-19 09:31:02 +00:00
cb868dd6ad chore:(deps): bump @project-serum/serum in /explorer (#14664)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.18 to 0.13.19.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-19 09:11:35 +00:00
37b7c6a6cf Remove SearchBar swizzled component, update search (#14649) 2021-01-19 00:38:30 -07:00
2eb19fa5e5 Improve docs around bigtable read limit (#14660) 2021-01-19 06:33:51 +00:00
b5fd0ed859 rewrites turbine retransmit peers computation (#14584) 2021-01-19 04:18:47 +00:00
c6ae0667e6 feature gates turbine retransmit peers patch (#14631) 2021-01-19 04:16:19 +00:00
5d9dc609b1 Rename RpcNodeUnhealthy error to NodeUnhealthy, generalize getHealth RPC error object for the future 2021-01-18 19:57:25 -08:00
cbf8ef7480 Make Bigtable::get_confirmed_blocks inclusive of requested start_slot and end_slot (#14651)
* Fix off-by-one error

* Filter out blocks greater than end slot
2021-01-18 19:14:10 -07:00
d63b2baf0e Make it possible to opt-out jemalloc for heaptrack (#14634) 2021-01-18 20:58:52 +09:00
fa53f0293d chore: bump semantic-release from 17.3.0 to 17.3.3 in /web3.js (#14646)
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 17.3.0 to 17.3.3.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v17.3.0...v17.3.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 10:15:54 +00:00
56c59bdb14 chore: bump start-server-and-test from 1.11.6 to 1.11.7 in /web3.js (#14645)
Bumps [start-server-and-test](https://github.com/bahmutov/start-server-and-test) from 1.11.6 to 1.11.7.
- [Release notes](https://github.com/bahmutov/start-server-and-test/releases)
- [Commits](https://github.com/bahmutov/start-server-and-test/compare/v1.11.6...v1.11.7)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 09:55:55 +00:00
d5f477eb5e chore: bump rollup from 2.35.1 to 2.36.2 in /web3.js (#14644)
Bumps [rollup](https://github.com/rollup/rollup) from 2.35.1 to 2.36.2.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.35.1...v2.36.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 09:35:52 +00:00
2637dbd653 chore: bump eslint from 7.15.0 to 7.18.0 in /web3.js (#14642)
Bumps [eslint](https://github.com/eslint/eslint) from 7.15.0 to 7.18.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.15.0...v7.18.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 09:23:09 +00:00
205cdbd45d chore:(deps): bump @solana/web3.js from 0.89.0 to 0.90.0 in /explorer (#14643)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 0.89.0 to 0.90.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v0.89.0...v0.90.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 09:19:12 +00:00
5f14f45282 More generic accounts purge functions (#14595)
Co-authored-by: Carl Lin <carl@solana.com>
2021-01-17 20:31:03 -08:00
8d4ab1bab1 Clean up and add comment 2021-01-17 19:59:59 -08:00
5cf9094bb9 WIP fix the occasional stuck RPC request 2021-01-17 19:59:59 -08:00
a12ede8e7d Add --minimum-validator-identity-balance 2021-01-18 02:18:54 +00:00
391a1ea760 Add panel to show slot production (#14615) 2021-01-17 08:35:01 -08:00
4003f86f04 Add getSnapshotSlot RPC method 2021-01-16 19:31:21 +00:00
dacb95083d Add getHealth RPC method 2021-01-16 10:10:48 -08:00
4d12cf61cc feat: support blockTime on getConfirmedSignaturesForAddress2 (#14573)
* feat: support blockTime on getConfirmedSignaturesForAddress2

* feat: support getConfirmedTransaction blockTime

* fix: add ConfirmedBlock typings

* fix: modify property description

* fix: fix formatting in type files
2021-01-15 20:28:28 -08:00
66b54b852d Update-executable flag in pre-accounts (#14622) 2021-01-15 17:48:29 -08:00
97f499ce12 Fix cli error message (#14619) 2021-01-15 15:53:30 -08:00
3175cf1deb net/gce.sh: Add cusom RAM arg instead of doubling default with tmpfs 2021-01-15 16:10:39 -07:00
ff599ace4d net/: Support accounts on swap-backed tmpfs 2021-01-15 16:10:39 -07:00
ddf1d2dbf5 gce.sh: Factor out default custom memory 2021-01-15 16:10:39 -07:00
327be55acc multinode-demo: Pass --accounts through bootstrap leader wrapper 2021-01-15 16:10:39 -07:00
7b67228bc1 net/net.sh: Quite pre-emptible instance status check 2021-01-15 20:09:04 +00:00
9a89689ad3 Use optimistic confirmation in getSignatureStatuses, and various downstream client methods (#14430)
* Add optimistically_confirmed field to TransactionStatus

* Update docs

* Convert new field to confirmation_status

* Update docs to confirmationStatus

* Update variants

* Update docs

* Just Confirmed
2021-01-15 16:05:05 +00:00
299b3eb99d fix: handle confirmationStatus field in TransactionStatus (#14583) 2021-01-15 07:40:47 -07:00
0fd21018d6 chore:(deps): bump react and react-dom in /explorer (#14608)
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) and [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom). These dependencies needed to be updated together.

Updates `react` from 16.14.0 to 17.0.1
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v17.0.1/packages/react)

Updates `react-dom` from 16.14.0 to 17.0.1
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v17.0.1/packages/react-dom)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-15 09:47:24 +00:00
a78001935c chore:(deps): bump @solana/web3.js from 0.88.0 to 0.89.0 in /explorer (#14606)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 0.88.0 to 0.89.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v0.88.0...v0.89.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-15 09:28:12 +00:00
970cf8e985 chore:(deps): bump @types/node from 14.14.20 to 14.14.21 in /explorer (#14605)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.20 to 14.14.21.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-15 09:13:16 +00:00
4ecc0f4fa6 chore: bump rayon from 1.4.1 to 1.5.0 (#14177)
* chore: bump rayon from 1.4.1 to 1.5.0

Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.4.1 to 1.5.0.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.4.1...rayon-core-v1.5.0)

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-01-15 18:07:35 +09:00
d4fae886a2 Fix up stake-o-matic BigTable fetching 2021-01-15 08:40:51 +00:00
465f991035 Use highest-confirmed-root for max check (#14599) 2021-01-15 07:45:44 +00:00
1c2ae15b1d Improve solana-test-validator output 2021-01-14 23:07:24 -08:00
cc2886c13c Display solana version (including commit sha1) before starting SoM 2021-01-14 21:17:54 -08:00
0d29f9e82c Fix program-test's CPI support (#14594)
* Fix program-test's CPI support

* feedback
2021-01-15 03:27:37 +00:00
b758e4cb27 Fetch confirmed blocks from BigTable if all epoch data is not in the local ledger 2021-01-14 17:01:37 -08:00
907f518f6d Add load/execute/store timings (#14561) 2021-01-14 14:14:16 -08:00
404be810bf feat: add system-program TransferWithSeed implementation 2021-01-14 11:26:27 -07:00
1eb7681a85 solana-web3: add TransferWithSeed implementation (#14570)
* fix: add handling for TransferWithSeed system instruction

* chore: add failing Assign/AllocateWithSeed test

* fix: broken Allocate/AssignWithSeed methods
2021-01-14 09:59:31 -07:00
b37dbed479 docs: Add stake programming documentation (#14529)
* Add stake programming documentation

We had some questions about stake programming documentation, and there
wasn't a place that contained information about the stake-o-matic and
other stake development in one place.  This adds a page with that
information.

* Update docs/src/staking/stake-programming.md

Co-authored-by: Eric Williams <eric@solana.com>

* Update docs/src/staking/stake-programming.md

Co-authored-by: Eric Williams <eric@solana.com>

* Update docs/src/staking/stake-programming.md

Co-authored-by: Eric Williams <eric@solana.com>

* Update docs/src/staking/stake-programming.md

Co-authored-by: Eric Williams <eric@solana.com>

* Update docs/src/staking/stake-programming.md

Co-authored-by: Eric Williams <eric@solana.com>

* Apply suggestions from code review

* Remove trailing whitespace

Co-authored-by: Eric Williams <eric@solana.com>
2021-01-14 17:04:04 +01:00
3ed83b53a5 chore:(deps): bump react-select from 3.1.1 to 3.2.0 in /explorer (#14579)
Bumps [react-select](https://github.com/JedWatson/react-select) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/JedWatson/react-select/releases)
- [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/JedWatson/react-select/compare/react-select@3.1.1...react-select@3.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-14 09:33:13 +00:00
b147e0bb55 chore:(deps): bump @sentry/react from 5.29.2 to 5.30.0 in /explorer (#14577)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 5.29.2 to 5.30.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/5.29.2...5.30.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-14 09:13:56 +00:00
6e8a1ba7de Load executable accounts from invoke context (#14574) 2021-01-14 00:19:22 -08:00
cfcca1cd3c patches bug in turbine's neighbors computation (#14565)
Removing local node's index early from the set here:
https://github.com/solana-labs/solana/blob/e1b59ded4/core/src/retransmit_stage.rs#L346
distorts the order of nodes depending on which node is computing the
turbine fan-out tree, and results in incorrect neighbors computation.
2021-01-13 22:25:29 +00:00
19bd30262a Add --max-commission argument, default 100% 2021-01-13 14:19:24 -08:00
11daaadc93 Add --rpc-threads argument 2021-01-13 13:34:46 -08:00
e1b59ded4b Use leader_forward_count for tx retries too (#14547) 2021-01-13 11:14:22 -07:00
673cb39975 adds pubkey for behzad@solana.com (#14558) 2021-01-13 16:26:17 +00:00
935dfdf0f6 fill in timing gaps in replay_stage (#14550)
* fill in timing gaps in replay_stage

* add replay_stage bank_count metric

* formatting

* handle another gap

* cleanup wait_receive_time to be more straightforward
2021-01-13 10:08:53 -06:00
e95ebcf864 Don't stop to find newer cluster-confirmed roots (#14557)
* Don't stop to find newer cluster-confirmed roots

* Fix and add new tests

* nits
2021-01-13 15:47:06 +00:00
0dc17bb073 chore:(deps): bump @testing-library/jest-dom in /explorer (#14554)
Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.11.8 to 5.11.9.
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v5.11.8...v5.11.9)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-13 09:09:57 +00:00
85fdbd87be chore:(deps): bump @types/socket.io-client in /explorer (#14549)
Bumps [@types/socket.io-client](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/socket.io-client) from 1.4.34 to 1.4.35.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/socket.io-client)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-12 09:15:46 +00:00
0d26cb6d37 Bump RBPF version to v0.2.3 2021-01-11 21:29:00 -08:00
5f7d79e4f7 chore:(deps): bump @types/react-select from 3.0.26 to 3.1.2 in /explorer (#14385)
Bumps [@types/react-select](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-select) from 3.0.26 to 3.1.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-select)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-12 09:48:51 +08:00
6dfad0652f Cache account stores, flush from AccountsBackgroundService (#13140) 2021-01-11 17:00:23 -08:00
4a66e3eddc Use standard tmp-snapshot- file prefix for the "new_state" archive for better cleanup/consistency 2021-01-11 16:51:26 -08:00
b0e6e29527 Update timestamp max allowable drift to 50% of PoH (#14531)
* Repurpose warp-timestamp feature for general bump

* Change max_allowable_drift to 50%

* Fill in PR#

* Fix rpc test setup
2021-01-11 23:27:30 +00:00
8ad5931bfc Check native account owner (#14535) 2021-01-11 22:36:52 +00:00
d8105bb7d7 Add rocskdb high priority threads (#14515)
Without them, memtable writes can stall on compactions.
2021-01-11 13:32:02 -08:00
872a249e97 Restore snapshot hard linking 2021-01-11 12:11:25 -08:00
3bd4c38a84 Clarify log message, the remote snapshot might not actually be newer 2021-01-11 11:53:13 -08:00
a95675a7ce Avoid tmp snapshot backlog in SnapshotPackagerService under high load (#14516) 2021-01-11 10:21:15 -08:00
3fb9f017d3 chore:(deps): bump @project-serum/serum in /explorer (#14525)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.17 to 0.13.18.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-11 09:10:13 +00:00
b87d6cd03d chore:(deps): bump typescript from 4.0.5 to 4.1.3 in /explorer (#14284)
* chore:(deps): bump typescript from 4.0.5 to 4.1.3 in /explorer

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.0.5 to 4.1.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.0.5...v4.1.3)

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

* bump

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Starry <justin@solana.com>
2021-01-11 09:40:56 +08:00
9f28758efa Add TdS 11 validators 2021-01-10 11:04:58 -07:00
e4cf845974 Cli: Implement OutputFormat for some missing subcommands (#14518)
* Implement OutputFormat for solana leader-schedule

* Implement OutputFormat for solana inflation
2021-01-10 00:02:22 +00:00
c981a0ba6f Update kin.svg
Replace Kin token logo SVG to cropped "coin" style icon rather than full brand logo, improving visibility particularly at lower resolutions in explorer UI.
2021-01-09 09:53:33 -08:00
7be6770808 Rename CompressionType to ArchiveFormat 2021-01-09 09:07:49 -08:00
141e6706e6 Rename AccountsPackage::root to AccountsPackage::slot 2021-01-09 09:07:49 -08:00
9f70f7dc3e Reduce TempDir exposure 2021-01-09 09:07:49 -08:00
f2a7f561a0 Replace incorrect symlink_dir usage with symlink_file 2021-01-09 09:07:49 -08:00
fe0ba4a429 Create account paths once 2021-01-09 09:07:49 -08:00
86c81a0ba2 Humanize the 'ledger processed...' time 2021-01-08 22:56:21 -08:00
0d8acd1f79 chore: fix flaky web3 stake-program test (#14504)
* chore: remove dangling skipPreflight

* chore: rearrange stake test to deactivate sooner after delegate

* chore: ensure stake is inactive before trying to withdraw
2021-01-09 03:17:57 +00:00
ec48631fc5 Bail on all CPI errors (#14500)
* Bail on all CPI errors

* whitespace
2021-01-09 02:27:39 +00:00
638f225dc4 Add cli command to query upgradeable account authorities (#14491) 2021-01-08 14:43:36 -08:00
9d53eca6e3 Report correct program id (#14486) 2021-01-08 14:43:24 -08:00
b9f0fb5525 chore: don't match specific error text (#14494) 2021-01-08 14:59:01 -07:00
21a0a83543 Bump smallvec version 2021-01-08 20:20:34 +00:00
3eaa826ad9 Suppress cargo audit failure for difference crate, there's no newer crate to upgrade to yet 2021-01-08 20:20:34 +00:00
766195dded limits number of crds values associated with a pubkey (#14467) 2021-01-08 18:54:40 +00:00
58487c6360 Add buffer authority to upgradeable loader (#14482) 2021-01-08 09:37:57 -08:00
30038a8849 docs: Add RUST_LOG explainer 2021-01-07 19:27:46 +00:00
c035f2a745 docs: Prefer dd to fallocate when creating swap file 2021-01-07 19:27:46 +00:00
140642ea21 docs: wrap lines 2021-01-07 19:27:46 +00:00
769b8f5613 Remove unlock banner (#14477)
Co-authored-by: Ryan Shea <rmshea@users.noreply.github.com>
2021-01-07 09:54:25 -07:00
773b21b34e consolidate DEFAULT_HASHES_PER_TICK (#14463) 2021-01-07 09:49:42 -06:00
938d482135 consolidate constants related to time for future refactoring (#14440) 2021-01-07 09:49:24 -06:00
3fc7362486 explorer: Hide banner when lockup has expired (#14473) 2021-01-07 21:26:18 +08:00
17337441c6 chore:(deps): bump @types/jest from 26.0.19 to 26.0.20 in /explorer (#14472)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.19 to 26.0.20.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-07 09:16:11 +00:00
5eacc5d08d Enable program upgrades via CPI (#14449) 2021-01-06 14:31:14 -08:00
a89ba32b24 explorer: remove UTC from cluster time (#14466)
* remove UTC mentions

* remove UTC from cluster stats
2021-01-06 13:02:32 -08:00
069d6a067c remove UTC mentions (#14465) 2021-01-06 12:45:01 -08:00
b7b3de528b explorer: format cluster time and locked stake accounts as utc (#14461) 2021-01-06 09:58:55 -08:00
a31f5f467b Add UTC timing, tweak copy (#14460)
* Add UTC timing, tweak copy

* More copy tweaks

* More copy
2021-01-06 10:35:30 -07:00
0767ea174e explorer: add temporary unlock alert box (#14457)
* Add token unlock banner

* make cluster time dynamic

* remove seconds display since it differs slightly from cluster stats

Co-authored-by: rmshea <8948187+rmshea@users.noreply.github.com>
2021-01-05 21:00:36 -08:00
c282586753 Add fixed tick rate adjustment (#14447) 2021-01-05 19:25:44 -08:00
ce1766d798 Enable program-id account index for supply calculations (#14444)
* Enable program-id account index for supply calculations

* Fixup comments
2021-01-06 02:42:33 +00:00
d2b0fd973f Bump serum-dex pegged commit (#14448) 2021-01-05 18:19:19 -07:00
c9df6134fa Save 7G mem on mainnet fixing AccIndex overalloc. (#14435) 2021-01-06 09:48:59 +09:00
e5b10d8b7e explorer: display block time on cluster stats (#14439)
* explorer: display block time on cluster stats

* interpolate blocktime values between fetches

* prevent time from going backwards
2021-01-05 14:22:12 -08:00
a8b5a32b50 Gate cpi program account passing (#14443) 2021-01-05 21:53:41 +00:00
53d65009a0 Lower recycle store count (#14429)
Too many stores can cause swap usage which
is detrimental to account store times.
2021-01-05 12:21:17 -08:00
ecde98401b explorer: add load button for largest accounts card (#14437) 2021-01-05 11:22:15 -08:00
54a5876c48 Introduce rpc url monikers for cli (#14409)
* Introduce rpc url monikers for cli

* Use https:// and support initials as well
2021-01-05 20:00:55 +09:00
ffbbffe42a chore:(deps): bump @types/node from 14.14.19 to 14.14.20 in /explorer (#14431)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.19 to 14.14.20.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-05 09:10:28 +00:00
efd9b769fc Add validator --account-index docs (#14418) 2021-01-04 19:51:06 -07:00
974eb6e1ef Fix pre-merge old name in the docs (#14425) 2021-01-05 02:41:24 +00:00
aa4da339ff Improve solana catchup (#14313)
* Improve solana catchup

* Overidable port, retry, args error clean up

* print cleanup

* Reduce diff

* Tweak warns a bit
2021-01-05 10:10:27 +09:00
0619805806 Upgradeable programs needs program account's address as program id (#14417) 2021-01-04 21:45:05 +00:00
a41b5137f6 docs: Use "msg!" instead of "info!" (#14411)
* docs: Use "msg!" instead of "info!"

* Update docs/src/developing/deployed-programs/developing-rust.md

Co-authored-by: Michael Vines <mvines@gmail.com>

* Fix typo / format

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-01-04 20:49:09 +01:00
f24d361e1a Revert validator list changes (#14413) 2021-01-04 12:34:39 -07:00
5424f54cf5 chore:(deps): bump @types/node from 14.14.17 to 14.14.19 in /explorer (#14408)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.17 to 14.14.19.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-04 09:20:46 +00:00
2724f37d0e Use max commitment when fetching epoch info for block production 2021-01-04 04:33:39 +00:00
9bb08ce75e Update docs/src/running-validator/validator-start.md
Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2021-01-03 01:34:15 +00:00
68a84cf581 Update tmpfs partition guidance to include swap 2021-01-03 01:34:15 +00:00
db6ee289c9 Don't bother restoring snapshots, they're never used 2021-01-02 17:26:33 -08:00
b6dcdb90e8 Remove dead code 2021-01-02 17:26:33 -08:00
560ed90168 Tune rewards output 2021-01-02 17:22:03 -08:00
c63e14dd0e Use singleGossip for program deployment 2021-01-02 07:47:51 -08:00
5affd8aa72 Add secondary indexes (#14212) 2020-12-31 18:06:03 -08:00
4a3d217839 Only initialize BigTable upload service when requested 2020-12-31 17:40:51 -08:00
6c167615ad Add --ignore-http-bad-gateway flag 2020-12-31 12:43:53 -08:00
cb8ba739a2 chore:(deps): bump @types/react-router-dom in /explorer (#14373)
Bumps [@types/react-router-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-router-dom) from 5.1.6 to 5.1.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-router-dom)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-31 09:33:31 +00:00
d869ee12f0 chore:(deps): bump @types/node from 14.14.16 to 14.14.17 in /explorer (#14371)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.16 to 14.14.17.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-31 09:11:39 +00:00
0b23abd479 Bind RPC and faucet to 0.0.0.0 2020-12-31 07:55:26 +00:00
04bf5ce830 Minor help improvements 2020-12-31 07:55:26 +00:00
e5bd9ee0ff Require tokio 0.3.5 2020-12-31 06:26:53 +00:00
3d077fb656 Revert "Upgrade in-tree tokio 0.2 usage to tokio 0.3"
This reverts commit 444ed768dc.
2020-12-31 06:26:53 +00:00
2d8dacb72b Gate CPI authorized programs (#14361) 2020-12-30 18:13:37 -08:00
1c5427ff17 Remove assert (#14356) 2020-12-30 21:07:22 +00:00
6c6095abe7 nit: clarify loader id (#14355) 2020-12-30 20:02:29 +00:00
b36ad91792 read hash mismatch errors from influx and error if > 0 (#14240) 2020-12-30 12:47:48 -06:00
71b88da48e Speed up UDP reachable port checks 2020-12-30 09:29:52 -08:00
fb6c660cfd Port ip-echo-server to tokio 0.3 2020-12-30 09:29:16 -08:00
1c61d005b5 Re-enable shrink test (#14331) 2020-12-30 08:25:45 -08:00
5684d6e570 chore:(deps): bump @testing-library/jest-dom in /explorer (#14348)
Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.11.6 to 5.11.8.
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v5.11.6...v5.11.8)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-30 09:10:30 +00:00
3d0cd2cdb0 Add --test arg to cargo-test-bpf (#14342) 2020-12-30 04:03:26 +00:00
d63dd95806 Rewrite faucet with tokio v0.3 (#14336)
* Rewrite faucet for contemporary tokio

* Move away from framed decoder
2020-12-29 20:51:01 -07:00
fe667db910 validator: Add experimental flag to select PoH pinned core 2020-12-29 19:15:44 -07:00
82f61c0c4a core: Update stale error message 2020-12-29 19:15:44 -07:00
f8a4afc7c1 Fix flaky broadcast test (#14329) 2020-12-29 12:35:04 -08:00
2074e407cd Add poh speed check and tick speed calibration (#14292) 2020-12-29 09:35:57 -08:00
444ed768dc Upgrade in-tree tokio 0.2 usage to tokio 0.3 2020-12-29 09:23:23 -08:00
3f10fb993b Retry durable-nonce transactions (#14308)
* Retry durable-nonce transactions

* Add metric to track durable-nonce txs in queue

* Populate send-tx-service initial addresses with tpu_address if empty (primarily for testing)

* Reinstate last_valid_slot check for durable-nonce txs; use arbitrary future slot
2020-12-29 09:48:43 -07:00
3a1e01cced Allow setting max poor block producer percentage (#14266)
Co-authored-by: publish-docs.sh <maintainers@solana.com>
2020-12-29 10:53:56 -05:00
5524938a50 Limit CPI instruction size (#14317) 2020-12-29 01:14:17 +00:00
7893e2e307 Remove Testnet-specific old code (#14305) 2020-12-29 05:11:46 +09:00
bd761e2a52 CLI: Support displaying past leader schedules 2020-12-28 20:03:48 +00:00
a709850ee4 clap-utils: Add epoch validator 2020-12-28 20:03:48 +00:00
addffd7694 Log error from AppendVec removal & a panic clean (#14302) 2020-12-29 04:59:09 +09:00
4af33674a7 run.sh: add env knob for solana-validor (#14303) 2020-12-28 19:38:59 +00:00
90deadb396 Avoid creating "..tmp" files 2020-12-28 08:58:09 -08:00
d830406991 chore:(deps): bump @project-serum/serum in /explorer (#14300)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.16 to 0.13.17.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits/@project-serum/serum@0.13.17)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-28 09:09:46 +00:00
9ddd6f08e8 Persist gossip contact info 2020-12-27 20:46:54 -08:00
c693ffaa08 Fix subtraction overflow in metrics (#14290) 2020-12-27 16:26:22 -08:00
7b49c85aa7 Fix download speed (#14291) 2020-12-27 16:25:41 -08:00
2fd38d9912 indexes votes in crds table (#14272) 2020-12-27 13:31:05 +00:00
49019c6613 obtains staked-nodes from the root-bank (#14257)
... as opposed to the working bank
2020-12-27 13:28:05 +00:00
a267300f06 Fix windows build 2020-12-24 17:49:11 -08:00
5ee4dd9c4b chore:(deps): bump @solana/web3.js from 0.87.1 to 0.88.0 in /explorer (#14288)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 0.87.1 to 0.88.0.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v0.87.1...v0.88.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-24 21:24:45 +00:00
5ced2f75a6 fix: clean up racy tests 2020-12-24 12:31:02 -08:00
87eb924d2a Remove stray dbg 2020-12-24 10:44:39 -08:00
d6d9053649 chore:(deps): bump @project-serum/serum in /explorer (#14283)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.15 to 0.13.16.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-24 09:30:41 +00:00
82bbfc1493 chore:(deps): bump @testing-library/user-event in /explorer (#14282)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 12.2.2 to 12.6.0.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v12.2.2...v12.6.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-24 09:19:29 +00:00
0cfadeb887 chore:(deps): bump @types/node from 14.14.14 to 14.14.16 in /explorer (#14280)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.14 to 14.14.16.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-24 09:09:22 +00:00
ee0a80a092 Prevent bpf loader impersonators (#14278) 2020-12-24 03:04:48 +00:00
b1d702a618 Don't use caller passed executable account (#14276) 2020-12-23 14:34:14 -08:00
0b479ab180 Limit CPI from calling loader or native programs (#14252) 2020-12-23 10:44:34 -08:00
5945305b1d Save cloning program account data (#14251) 2020-12-23 10:18:14 -08:00
29221904b9 chore:(deps): bump @types/node from 14.14.9 to 14.14.14 in /explorer (#14271)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.9 to 14.14.14.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-23 09:09:39 +00:00
65dcb3dc81 Add log message for when a local snapshot is too old 2020-12-22 19:39:17 -08:00
50710473a8 Deinitialize stake data upon zero balance 2020-12-22 19:37:26 -07:00
db5bd6ea1a Deinitialize vote data upon zero balance 2020-12-22 19:37:26 -07:00
5b903318b2 vote: Add helper for creating current-versioned states 2020-12-22 19:37:26 -07:00
3881ae10fb Deinitialize nonce data upon zero balance 2020-12-22 19:37:26 -07:00
ace360ade2 Multiple entrypoint support 2020-12-22 18:35:31 -08:00
3373082ffa Update entrypoint contact info even when shred version adoption is not requested 2020-12-22 18:35:31 -08:00
a14cfd660a removes &Arc<Self> receivers (#14234) 2020-12-22 23:51:53 +00:00
c276513b84 Ignore long/hanging test (#14261) 2020-12-22 16:13:03 -07:00
7042f11791 Feature-gate stake-program-v3 (#14232)
* Remove deprecated legacy stake program

* Add legacy stake program

* Strip out duplicative legacy code

* Feature-deploy stake-program-v3

* Add ownership check in stake processor
2020-12-22 11:20:38 -07:00
bfcfdcf0ee Legal disclaimers (#14237)
* Legal disclaimers

* Newline

Co-authored-by: Ryan Shea <rmshea@users.noreply.github.com>
2020-12-22 11:15:32 -07:00
ab205b682a Upgradeable programs called same as non-upgradeable (#14239)
* Upgradeable programs called same as non-upgradeable

* nudge
2020-12-22 09:26:55 -08:00
1b30155dc3 chore:(deps): bump @types/chart.js from 2.9.28 to 2.9.29 in /explorer (#14247)
Bumps [@types/chart.js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chart.js) from 2.9.28 to 2.9.29.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chart.js)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-22 09:39:07 +00:00
663ff98271 chore:(deps): bump @sentry/react from 5.29.0 to 5.29.2 in /explorer (#14246)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 5.29.0 to 5.29.2.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/5.29.0...5.29.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-22 09:23:16 +00:00
621066ed7f chore:(deps): bump @types/react from 16.9.56 to 17.0.0 in /explorer (#14245)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 16.9.56 to 17.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-22 09:14:17 +00:00
baa9602411 Add shrink paths (#14238) 2020-12-21 21:33:37 -08:00
3316e7166c Rework upgradeable loader cli (#14209) 2020-12-21 13:02:53 -08:00
7b08cb1f0d improves performance in replay-stage (#14217)
bank::vote_accounts returns a hash-map which is slow to iterate, but all uses
only require an iterator:
https://github.com/solana-labs/solana/blob/b3dc98856/runtime/src/bank.rs#L4300-L4306
Similarly, calculate_stake_weighted_timestamp takes a hash-map whereas it only
requires an iterator:
https://github.com/solana-labs/solana/blob/b3dc98856/sdk/src/stake_weighted_timestamp.rs#L21-L28
2020-12-21 19:18:19 +00:00
079424d7d1 Warp-timestamp pr# 2020-12-21 10:52:18 -07:00
8f685d44e1 chore:(deps): bump @project-serum/serum in /explorer (#14229)
Bumps [@project-serum/serum](https://github.com/project-serum/serum-ts) from 0.13.12 to 0.13.15.
- [Release notes](https://github.com/project-serum/serum-ts/releases)
- [Commits](https://github.com/project-serum/serum-ts/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-21 09:16:45 +00:00
93ae177503 Do not delete ALL other snapshots before downloading a new snapshot 2020-12-21 08:58:52 +00:00
8082a2454c Allow multiple --accounts arguments 2020-12-21 07:39:23 +00:00
57b03c5bc1 Restore Content-Length header for streaming snapshot download 2020-12-20 23:22:26 -08:00
e15f95a36f Fix timestamp handling on ledger warp (#14210)
* Reset timestamp for slot and epoch-start on warp

* Fix genesis timestamp metric source

* Remove check that timestamp > unix_timestamp_from_genesis

Default to previous timestamp, not genesis timestamp

* Move timestamp metrics to report even on warp

* Initialize slot 0 timestamps correctly

* Add feature gate to warp testnet timestamp

* Review suggestion: simplify warp-timestamp slot check
2020-12-20 21:36:56 +00:00
b3dc988564 Stream RPC snapshot downloads 2020-12-19 15:54:23 -08:00
0090106f60 getBlockTime RPC method now falls back to BigTable in all cases 2020-12-18 20:51:49 +00:00
691031fefd limits number of crds values returned when responding to pull requests (#13739)
Crds values buffered when responding to pull-requests can be very large taking a lot of memory.
Added a limit for number of buffered crds values based on outbound data budget.
2020-12-18 18:45:12 +00:00
6a3797e164 adds crds-value for broadcasting duplicate shreds through gossip (#14133)
In gossip, the header overhead we get from:
https://github.com/solana-labs/solana/blob/de9ac43eb/core/src/cluster_info.rs#L434-L435
https://github.com/solana-labs/solana/blob/de9ac43eb/core/src/crds_value.rs#L31-L36
https://github.com/solana-labs/solana/blob/de9ac43eb/core/src/crds_value.rs#L73
already exceeds SIZE_OF_NONCE in shreds. We also need aditional
meta-data (wallclock, source pubkey, ...). Which means that given the
SHRED_PAYLOAD_SIZE, we cannot fit all these in PACKET_DATA_SIZE:
https://github.com/solana-labs/solana/blob/de9ac43eb/ledger/src/shred.rs#L80

On top of that, we need 2 shred payloads as the proof of duplicate. So
each DuplicateShred crds value includes only a chunk of the payload,
along with the meta-data to reconstruct the full payload from the chunks
on the receiving end.
2020-12-18 14:32:43 +00:00
3c9b853268 Reject invalid --expected-shred-version (#14183)
* Reject invalid --expected-shred-version

* less code
2020-12-18 07:01:26 +00:00
e8cc0bef6c Add CPI support for upgradeable loader (#14193) 2020-12-17 15:39:49 -08:00
a5db6399ad Fix test_max_hashes (#14189) 2020-12-17 15:12:18 -08:00
da7d1e2302 Improved Transaction Forwarding (#13944)
* Forwarding

* Dedupe leaders

* Use consistent commitment for last_valid_slot in rpc send_transaction

* Plumb rpc send_transaction options into solana-validator

* Extend num slots banking-stage holds forwarded txs

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2020-12-17 15:37:22 -07:00
3322b83183 net/gce.sh: Upgrade to Ubuntu 20.04 2020-12-17 22:04:49 +00:00
a0507505f4 net/gce.sh: Switch to SSD boot disks 2020-12-17 22:04:49 +00:00
ffe0532ded net/gce.sh: Bump machine type to 24-core, 64GB RAM 2020-12-17 22:04:49 +00:00
d6d76219b6 caches staked nodes computed from vote-accounts (#13929) 2020-12-17 21:22:50 +00:00
fd7d2f82ae chore: port web3.js to solana-test-validator 2020-12-17 20:53:10 +00:00
efc091e28a Add transactionCount field to GetEpochInfo 2020-12-17 12:29:50 -08:00
01fe835e73 fix: add transactionCount field to GetEpochInfo 2020-12-17 12:29:50 -08:00
e1f2d384db Don't require increased open file limit at ledger creation
Follow-up to 0b92720fdb, `create_new_ledger()` does not require a higher fd limit
2020-12-17 08:46:13 -08:00
593ad80954 Fix program account rent exemption (#14176) 2020-12-17 09:02:31 +00:00
dc0f5adc36 feat: support pre and post token balances (#13603)
* feat: support pre and post token balances

* fix: define tokenbalance

* fix: change pre/post balances to array
2020-12-16 23:15:25 -08:00
0b92720fdb Don't require increased open file limit in solana-test-validator
Travis CI in particular does not allow the open file limit to be
increased.
2020-12-16 20:43:08 -08:00
8d700c3b94 Use an ephemeral mint address if the client keypair is not available
Typically this can occur in a CI environment
2020-12-16 20:43:08 -08:00
edbeb5fe92 Update validator_list.rs 2020-12-16 21:41:12 -07:00
d296963c27 Update validator_list.rs 2020-12-16 20:39:08 -07:00
33de9300d2 explorer: add Kin to token registry (#14168) 2020-12-16 19:29:26 -08:00
5617ab65d8 Revert "Ignore RUSTSEC-2020-0077 until next 1.4 release"
This reverts commit 1792100e2b.
2020-12-17 01:54:22 +00:00
6875113d82 Bump SPL crates 2020-12-17 01:54:22 +00:00
ac0d32bc7e Add blockstore skipped api (#14145)
* Add blockstore api to determine if a slot was skipped

* Return custom rpc error if slot is skipped
2020-12-16 13:40:36 -07:00
636a455790 Create a random -keypair.json file alongside the program deploy artifact for easy upgrades 2020-12-16 19:51:16 +00:00
9993d2c623 Use AsRef 2020-12-16 19:51:16 +00:00
41a93ced23 fix formatting error in docs 2020-12-16 10:38:37 -08:00
bd393b8697 chore: bump byte-unit from 4.0.8 to 4.0.9
Bumps [byte-unit](https://github.com/magiclen/byte-unit) from 4.0.8 to 4.0.9.
- [Release notes](https://github.com/magiclen/byte-unit/releases)
- [Commits](https://github.com/magiclen/byte-unit/compare/v4.0.8...v4.0.9)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-16 10:38:01 -08:00
bebfa6e93c Correctly show reward percent changes 2020-12-16 08:51:41 -08:00
49c3f14016 Remove lock files from programs/bpf/rust (#14148) 2020-12-16 02:14:04 -08:00
125865f7ec chore: bump @babel/preset-env from 7.12.10 to 7.12.11 in /web3.js (#14156)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.12.10 to 7.12.11.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.12.11/packages/babel-preset-env)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-16 09:41:20 +00:00
1a86d374a9 chore: bump marked from 1.2.6 to 1.2.7 in /web3.js (#14154)
Bumps [marked](https://github.com/markedjs/marked) from 1.2.6 to 1.2.7.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/release.config.js)
- [Commits](https://github.com/markedjs/marked/compare/v1.2.6...v1.2.7)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-16 09:27:21 +00:00
281bca1c91 chore:(deps): bump @sentry/react from 5.28.0 to 5.29.0 in /explorer (#14155)
Bumps [@sentry/react](https://github.com/getsentry/sentry-javascript) from 5.28.0 to 5.29.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-javascript/compare/5.28.0...5.29.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-16 09:27:15 +00:00
ce9c5142c6 chore: bump assert_cmd from 1.0.1 to 1.0.2 (#14103)
Bumps [assert_cmd](https://github.com/assert-rs/assert_cmd) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/assert-rs/assert_cmd/releases)
- [Changelog](https://github.com/assert-rs/assert_cmd/blob/master/CHANGELOG.md)
- [Commits](https://github.com/assert-rs/assert_cmd/compare/v1.0.1...v1.0.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-16 16:22:02 +09:00
025f886e10 check for resize access violations (#14142) 2020-12-15 23:21:08 -08:00
501fd83afd Fix up upgradeable bpf loader activation 2020-12-16 06:36:14 +00:00
3a154e8056 explorer: Token history dropdown filter (#14032)
* feat: add filter on token history card

* rename to filter

* use unicode ellipsis

* better naming

* filter options read better and use just pubkey strings

* memoize filtered list

* only fetch filtered

* pre filter tokens

* fix prettier
2020-12-15 20:19:50 -08:00
db4ac17259 Switch solana deploy commitment default from "max" to "singleGossip" 2020-12-15 19:18:10 -08:00
d4a174fb7c Partial shred deserialize cleanup and shred type differentiation (#14094)
* Partial shred deserialize cleanup and shred type differentiation in retransmit

* consolidate packet hashing logic
2020-12-15 16:50:40 -08:00
aeda8d8b91 Remove stray println 2020-12-15 16:44:31 -08:00
31f8daa73b Update validator_list.rs 2020-12-15 16:58:18 -07:00
00c46c528e Add --reset flag to allow for easy ledger reset 2020-12-15 21:51:37 +00:00
f3272db7f7 Prevent multiple test-validators from using the same ledger directory 2020-12-15 21:51:37 +00:00
d2af09a647 Clean up Cargo.toml 2020-12-15 21:51:37 +00:00
75e9e321de Fix race between setting tick height and calculating accounts hash (#14101)
Co-authored-by: Carl Lin <carl@solana.com>
2020-12-15 12:45:40 -08:00
582418de5e Cleanup ledger builtins (#14083) 2020-12-15 12:23:49 -08:00
1e977ac025 Bump version to v1.6.0 2020-12-15 18:28:04 +00:00
d513b0c4ca Add Program loader/environment instruction errors (#14120) 2020-12-15 09:54:07 -08:00
1626 changed files with 285429 additions and 116569 deletions

View File

@ -2,6 +2,6 @@
"_public_key": "ae29f4f7ad2fc92de70d470e411c8426d5d48db8817c9e3dae574b122192335f",
"_comment": "These credentials are encrypted and pose no risk",
"environment": {
"CODECOV_TOKEN": "EJ[1:Z7OneT3RdJJ0DipCHQ7rC84snQ+FPbgHwZADQiz54wk=:3K68mE38LJ2RB98VWmjuNLFBNn1XTGR4:cR4r05/TOZQKmEZp1v4CSgUJtC6QJiOaL85QjXW0qZ061fMnsBA8AtAPMDoDq4WCGOZM1A==]"
"CODECOV_TOKEN": "EJ[1:KToenD1Sr3w82lHGxz1n+j3hwNlLk/1pYrjZHlvY6kE=:hN1Q25omtJ+4yYVn+qzIsPLKT3O6J9XN:DMLNLXi/pkWgvwF6gNIcNF222sgsRR9LnwLZYj0P0wGj7q6w8YQnd1Rskj+sRroI/z5pQg==]"
}
}

View File

@ -36,4 +36,7 @@ export CARGO_TARGET_CACHE=$HOME/cargo-target-cache/"$CHANNEL"-"$BUILDKITE_LABEL"
# `std:
# "found possibly newer version of crate `std` which `xyz` depends on
rm -rf target/bpfel-unknown-unknown
if [[ $BUILDKITE_LABEL = "stable-perf" ]]; then
rm -rf target/release
fi
)

4
.gitignore vendored
View File

@ -1,7 +1,3 @@
/docs/html/
/docs/src/tests.ok
/docs/src/cli/usage.md
/docs/src/.gitbook/assets/*.svg
/farf/
/solana-release/
/solana-release.tar.bz2

View File

@ -50,14 +50,6 @@ pull_request_rules:
label:
add:
- automerge
- name: v1.3 backport
conditions:
- label=v1.3
actions:
backport:
ignore_conflicts: true
branches:
- v1.3
- name: v1.4 backport
conditions:
- label=v1.4
@ -82,3 +74,11 @@ pull_request_rules:
ignore_conflicts: true
branches:
- v1.6
- name: v1.7 backport
conditions:
- label=v1.7
actions:
backport:
ignore_conflicts: true
branches:
- v1.7

View File

@ -29,6 +29,7 @@ jobs:
if: type IN (api, cron) OR tag IS present
name: "macOS release artifacts"
os: osx
osx_image: xcode12
language: rust
rust:
- stable
@ -36,8 +37,12 @@ jobs:
- source ci/rust-version.sh
- PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
- readlink -f .
- brew install gnu-tar
- PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"
- tar --version
script:
- source ci/env.sh
- rustup set profile default
- ci/publish-tarball.sh
deploy:
- provider: s3
@ -60,6 +65,12 @@ jobs:
- <<: *release-artifacts
name: "Windows release artifacts"
os: windows
install:
- choco install openssl
- export OPENSSL_DIR="C:\Program Files\OpenSSL-Win64"
- source ci/rust-version.sh
- PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
- readlink -f .
# Linux release artifacts are still built by ci/buildkite-secondary.yml
#- <<: *release-artifacts
# name: "Linux release artifacts"
@ -73,7 +84,7 @@ jobs:
language: node_js
node_js:
- "node"
- "lts/*"
cache:
directories:
@ -116,7 +127,7 @@ jobs:
if: type IN (push, pull_request) OR tag IS present
language: node_js
node_js:
- "node"
- "lts/*"
services:
- docker

3753
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,9 @@
[workspace]
members = [
"accountsdb-plugin-interface",
"accountsdb-plugin-manager",
"accountsdb-plugin-postgres",
"accounts-cluster-bench",
"bench-exchange",
"bench-streamer",
"bench-tps",
@ -20,6 +24,7 @@ members = [
"perf",
"validator",
"genesis",
"genesis-utils",
"gossip",
"install",
"keygen",
@ -28,8 +33,8 @@ members = [
"local-cluster",
"logger",
"log-analyzer",
"merkle-root-bench",
"merkle-tree",
"stake-o-matic",
"storage-bigtable",
"storage-proto",
"streamer",
@ -37,21 +42,19 @@ members = [
"metrics",
"net-shaper",
"notifier",
"poh",
"poh-bench",
"program-test",
"programs/secp256k1",
"programs/bpf_loader",
"programs/budget",
"programs/compute-budget",
"programs/config",
"programs/exchange",
"programs/failure",
"programs/noop",
"programs/ownable",
"programs/ed25519",
"programs/secp256k1",
"programs/stake",
"programs/vest",
"programs/vote",
"remote-wallet",
"ramp-tps",
"rpc",
"runtime",
"runtime/store-tool",
"sdk",
@ -59,7 +62,6 @@ members = [
"sdk/cargo-test-bpf",
"scripts",
"stake-accounts",
"stake-monitor",
"sys-tuner",
"tokens",
"transaction-status",
@ -75,3 +77,11 @@ members = [
exclude = [
"programs/bpf",
]
# TODO: Remove once the "simd-accel" feature from the reed-solomon-erasure
# dependency is supported on Apple M1. v2 of the feature resolver is needed to
# specify arch-specific features.
resolver = "2"
[profile.dev]
split-debuginfo = "unpacked"

View File

@ -1,6 +1,6 @@
<p align="center">
<a href="https://solana.com">
<img alt="Solana" src="https://i.imgur.com/OMnvVEz.png" width="250" />
<img alt="Solana" src="https://i.imgur.com/IKyzQ6T.png" width="250" />
</a>
</p>
@ -19,7 +19,7 @@ $ source $HOME/.cargo/env
$ rustup component add rustfmt
```
Please sure you are always using the latest stable rust version by running:
Please make sure you are always using the latest stable rust version by running:
```bash
$ rustup update
@ -32,6 +32,12 @@ $ sudo apt-get update
$ sudo apt-get install libssl-dev libudev-dev pkg-config zlib1g-dev llvm clang make
```
On Mac M1s, make sure you set up your terminal & homebrew [to use](https://5balloons.info/correct-way-to-install-and-use-homebrew-on-m1-macs/) Rosetta. You can install it with:
```bash
$ softwareupdate --install-rosetta
```
## **2. Download the source code.**
```bash
@ -45,11 +51,6 @@ $ cd solana
$ cargo build
```
## **4. Run a minimal local cluster.**
```bash
$ ./run.sh
```
# Testing
**Run the test suite:**
@ -107,6 +108,41 @@ send us that patch!
# Disclaimer
All claims, content, designs, algorithms, estimates, roadmaps, specifications, and performance measurements described in this project are done with the author's best effort. It is up to the reader to check and validate their accuracy and truthfulness. Furthermore nothing in this project constitutes a solicitation for investment.
All claims, content, designs, algorithms, estimates, roadmaps,
specifications, and performance measurements described in this project
are done with the Solana Foundation's ("SF") best efforts. It is up to
the reader to check and validate their accuracy and truthfulness.
Furthermore nothing in this project constitutes a solicitation for
investment.
Any content produced by Solana, or developer resources that Solana provides, are for educational and inspiration purposes only. Solana does not encourage, induce or sanction the deployment of any such applications in violation of applicable laws or regulations.
Any content produced by SF or developer resources that SF provides, are
for educational and inspiration purposes only. SF does not encourage,
induce or sanction the deployment, integration or use of any such
applications (including the code comprising the Solana blockchain
protocol) in violation of applicable laws or regulations and hereby
prohibits any such deployment, integration or use. This includes use of
any such applications by the reader (a) in violation of export control
or sanctions laws of the United States or any other applicable
jurisdiction, (b) if the reader is located in or ordinarily resident in
a country or territory subject to comprehensive sanctions administered
by the U.S. Office of Foreign Assets Control (OFAC), or (c) if the
reader is or is working on behalf of a Specially Designated National
(SDN) or a person subject to similar blocking or denied party
prohibitions.
The reader should be aware that U.S. export control and sanctions laws
prohibit U.S. persons (and other persons that are subject to such laws)
from transacting with persons in certain countries and territories or
that are on the SDN list. As a project based primarily on open-source
software, it is possible that such sanctioned persons may nevertheless
bypass prohibitions, obtain the code comprising the Solana blockchain
protocol (or other project code or applications) and deploy, integrate,
or otherwise use it. Accordingly, there is a risk to individuals that
other persons using the Solana blockchain protocol may be sanctioned
persons and that transactions with such persons would be a violation of
U.S. export controls and sanctions law. This risk applies to
individuals, organizations, and other ecosystem participants that
deploy, integrate, or use the Solana blockchain protocol code directly
(e.g., as a node operator), and individuals that transact on the Solana
blockchain through light clients, third party interfaces, and/or wallet
software.

169
SECURITY.md Normal file
View File

@ -0,0 +1,169 @@
# Security Policy
1. [Reporting security problems](#reporting)
4. [Security Bug Bounties](#bounty)
2. [Incident Response Process](#process)
<a name="reporting"></a>
## Reporting security problems to Solana
**DO NOT CREATE AN ISSUE** to report a security problem. Instead, please send an
email to security@solana.com and provide your github username so we can add you
to a new draft security advisory for further discussion.
Expect a response as fast as possible, within one business day at the latest.
<a name="bounty"></a>
## Security Bug Bounties
We offer bounties for critical security issues. Please see below for more details.
Loss of Funds:
$500,000 USD in locked SOL tokens (locked for 12 months)
* Theft of funds without users signature from any account
* Theft of funds without users interaction in system, token, stake, vote programs
* Theft of funds that requires users signature - creating a vote program that drains the delegated stakes.
Consensus/Safety Violations:
$250,000 USD in locked SOL tokens (locked for 12 months)
* Consensus safety violation
* Tricking a validator to accept an optimistic confirmation or rooted slot without a double vote, etc..
Other Attacks:
$100,000 USD in locked SOL tokens (locked for 12 months)
* Protocol liveness attacks,
* Eclipse attacks,
* Remote attacks that partition the network,
DoS Attacks:
$25,000 USD in locked SOL tokens (locked for 12 months)
* Remote resource exaustion via Non-RPC protocols
RPC DoS/Crashes:
$5,000 USD in locked SOL tokens (locked for 12 months)
* RPC attacks
Out of Scope:
The following components are out of scope for the bounty program
* Metrics: `/metrics` in the monorepo as well as https://metrics.solana.com
* Explorer: `/explorer` in the monorepo as well as https://explorer.solana.com
* Any encrypted credentials, auth tokens, etc. checked into the repo
* Bugs in dependencies. Please take them upstream!
* Attacks that require social engineering
Eligibility:
* The participant submitting the bug report shall follow the process outlined within this document
* Valid exploits can be eligible even if they are not successfully executed on the cluster
* Multiple submissions for the same class of exploit are still eligible for compensation, though may be compensated at a lower rate, however these will be assessed on a case-by-case basis
* Participants must complete KYC and sign the participation agreement here when the registrations are open https://solana.com/validator-registration. Security exploits will still be assessed and open for submission at all times. This needs only be done prior to distribution of tokens.
Payment of Bug Bounties:
* Payments for eligible bug reports are distributed monthly.
* Bounties for all bug reports submitted in a given month are paid out in the middle of the
following month.
* The SOL/USD conversion rate used for payments is the market price at the end of
the last day of the month for the month in which the bug was submitted.
* The reference for this price is the Closing Price given by Coingecko.com on
that date given here:
https://www.coingecko.com/en/coins/solana/historical_data/usd#panel
* For example, for all bugs submitted in March 2021, the SOL/USD price for bug
payouts is the Close price on 2021-03-31 of $19.49. This applies to all bugs
submitted in March 2021, to be paid in mid-April 2021.
* Bug bounties are paid out in
[stake accounts](https://solana.com/staking) with a
[lockup](https://docs.solana.com/staking/stake-accounts#lockups)
expiring 12 months from the last day of the month in which the bug was submitted.
<a name="process"></a>
## Incident Response Process
In case an incident is discovered or reported, the following process will be
followed to contain, respond and remediate:
### 1. Establish a new draft security advisory
In response to an email to security@solana.com, a member of the `solana-labs/admins` group will
1. Create a new draft security advisory for the incident at https://github.com/solana-labs/solana/security/advisories
1. Add the reporter's github user and the `solana-labs/security-incident-response` group to the draft security advisory
1. Create a private fork of the repository (grey button towards the bottom of the page)
1. Respond to the reporter by email, sharing a link to the draft security advisory
### 2. Triage
Within the draft security advisory, discuss and determine the severity of the
issue. If necessary, members of the `solana-labs/security-incident-response`
group may add other github users to the advisory to assist.
If it is determined that this not a critical network issue then the advisory
should be closed and if more follow-up is required a normal Solana public github
issue should be created.
### 3. Prepare Fixes
For the affected branches, typically all three (edge, beta and stable), prepare
a fix for the issue and push them to the corresponding branch in the private
repository associated with the draft security advisory.
There is no CI available in the private repository so you must build from source
and manually verify fixes.
Code review from the reporter is ideal, as well as from multiple members of the
core development team.
### 4. Notify Security Group Validators
Once an ETA is available for the fix, a member of the
`solana-labs/security-incident-response` group should notify the validators so
they can prepare for an update using the "Solana Red Alert" notification system.
The teams are all over the world and it's critical to provide actionable
information at the right time. Don't be the person that wakes everybody up at
2am when a fix won't be available for hours.
### 5. Ship the patch
Once the fix is accepted, a member of the
`solana-labs/security-incident-response` group should prepare a single patch
file for each affected branch. The commit title for the patch should only
contain the advisory id, and not disclose any further details about the
incident.
Copy the patches to https://release.solana.com/ under a subdirectory named after
the advisory id (example:
https://release.solana.com/GHSA-hx59-f5g4-jghh/v1.4.patch). Contact a member of
the `solana-labs/admins` group if you require access to release.solana.com
Using the "Solana Red Alert" channel:
1. Notify validators that there's an issue and a patch will be provided in X minutes
2. If X minutes expires and there's no patch, notify of the delay and provide a
new ETA
3. Provide links to patches of https://release.solana.com/ for each affected branch
Validators can be expected to build the patch from source against the latest
release for the affected branch.
Since the software version will not change after the patch is applied, request
that each validator notify in the existing channel once they've updated. Manually
monitor the roll out until a sufficient amount of stake has updated - typically
at least 33.3% or 66.6% depending on the issue.
### 6. Public Disclosure and Release
Once the fix has been deployed to the security group validators, the patches from the security
advisory may be merged into the main source repository. A new official release
for each affected branch should be shipped and all validators requested to
upgrade as quickly as possible.
### 7. Security Advisory Bounty Accounting and Cleanup
If this issue is eligible for a bounty, prefix the title of the security
advisory with one of the following, depending on the severity:
* `[Bounty Category: Critical: Loss of Funds]`
* `[Bounty Category: Critical: Loss of Availability]`
* `[Bounty Category: Critical: DoS]`
* `[Bounty Category: Critical: Other]`
* `[Bounty Category: Non-critical]`
* `[Bounty Category: RPC]`
Confirm with the reporter that they agree with the severity assessment, and
discuss as required to reach a conclusion.
We currently do not use the Github workflow to publish security advisories.
Once the issue and fix have been disclosed, and a bounty category is assessed if
appropriate, the GitHub security advisory is no longer needed and can be closed.
Bounties are currently awarded once a quarter (TODO: link to this process, or
inline the workflow)

View File

@ -1,10 +1,11 @@
[package]
name = "solana-account-decoder"
version = "1.5.0"
version = "1.8.12"
description = "Solana account decoder"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
homepage = "https://solana.com/"
documentation = "https://docs.rs/solana-account-decoder"
license = "Apache-2.0"
edition = "2018"
@ -15,14 +16,13 @@ bs58 = "0.3.1"
bv = "0.11.1"
Inflector = "0.11.4"
lazy_static = "1.4.0"
serde = "1.0.112"
serde = "1.0.122"
serde_derive = "1.0.103"
serde_json = "1.0.56"
solana-config-program = { path = "../programs/config", version = "1.5.0" }
solana-sdk = { path = "../sdk", version = "1.5.0" }
solana-stake-program = { path = "../programs/stake", version = "1.5.0" }
solana-vote-program = { path = "../programs/vote", version = "1.5.0" }
spl-token-v2-0 = { package = "spl-token", version = "=3.0.0", features = ["no-entrypoint"] }
solana-config-program = { path = "../programs/config", version = "=1.8.12" }
solana-sdk = { path = "../sdk", version = "=1.8.12" }
solana-vote-program = { path = "../programs/vote", version = "=1.8.12" }
spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
thiserror = "1.0"
zstd = "0.5.1"

View File

@ -1,9 +1,11 @@
#![allow(clippy::integer_arithmetic)]
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate serde_derive;
pub mod parse_account_data;
pub mod parse_bpf_loader;
pub mod parse_config;
pub mod parse_nonce;
pub mod parse_stake;
@ -14,7 +16,12 @@ pub mod validator_info;
use {
crate::parse_account_data::{parse_account_data, AccountAdditionalData, ParsedAccount},
solana_sdk::{account::Account, clock::Epoch, fee_calculator::FeeCalculator, pubkey::Pubkey},
solana_sdk::{
account::{ReadableAccount, WritableAccount},
clock::Epoch,
fee_calculator::FeeCalculator,
pubkey::Pubkey,
},
std::{
io::{Read, Write},
str::FromStr,
@ -22,6 +29,8 @@ use {
};
pub type StringAmount = String;
pub type StringDecimals = String;
pub const MAX_BASE58_BYTES: usize = 128;
/// A duplicate representation of an Account for pretty JSON serialization
#[derive(Serialize, Deserialize, Clone, Debug)]
@ -42,7 +51,7 @@ pub enum UiAccountData {
Binary(String, UiAccountEncoding),
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[serde(rename_all = "camelCase")]
pub enum UiAccountEncoding {
Binary, // Legacy. Retained for RPC backwards compatibility
@ -54,58 +63,73 @@ pub enum UiAccountEncoding {
}
impl UiAccount {
pub fn encode(
fn encode_bs58<T: ReadableAccount>(
account: &T,
data_slice_config: Option<UiDataSliceConfig>,
) -> String {
if account.data().len() <= MAX_BASE58_BYTES {
bs58::encode(slice_data(account.data(), data_slice_config)).into_string()
} else {
"error: data too large for bs58 encoding".to_string()
}
}
pub fn encode<T: ReadableAccount>(
pubkey: &Pubkey,
account: Account,
account: &T,
encoding: UiAccountEncoding,
additional_data: Option<AccountAdditionalData>,
data_slice_config: Option<UiDataSliceConfig>,
) -> Self {
let data = match encoding {
UiAccountEncoding::Binary => UiAccountData::LegacyBinary(
bs58::encode(slice_data(&account.data, data_slice_config)).into_string(),
),
UiAccountEncoding::Base58 => UiAccountData::Binary(
bs58::encode(slice_data(&account.data, data_slice_config)).into_string(),
encoding,
),
UiAccountEncoding::Binary => {
let data = Self::encode_bs58(account, data_slice_config);
UiAccountData::LegacyBinary(data)
}
UiAccountEncoding::Base58 => {
let data = Self::encode_bs58(account, data_slice_config);
UiAccountData::Binary(data, encoding)
}
UiAccountEncoding::Base64 => UiAccountData::Binary(
base64::encode(slice_data(&account.data, data_slice_config)),
base64::encode(slice_data(account.data(), data_slice_config)),
encoding,
),
UiAccountEncoding::Base64Zstd => {
let mut encoder = zstd::stream::write::Encoder::new(Vec::new(), 0).unwrap();
match encoder
.write_all(slice_data(&account.data, data_slice_config))
.write_all(slice_data(account.data(), data_slice_config))
.and_then(|()| encoder.finish())
{
Ok(zstd_data) => UiAccountData::Binary(base64::encode(zstd_data), encoding),
Err(_) => UiAccountData::Binary(
base64::encode(slice_data(&account.data, data_slice_config)),
base64::encode(slice_data(account.data(), data_slice_config)),
UiAccountEncoding::Base64,
),
}
}
UiAccountEncoding::JsonParsed => {
if let Ok(parsed_data) =
parse_account_data(pubkey, &account.owner, &account.data, additional_data)
parse_account_data(pubkey, account.owner(), account.data(), additional_data)
{
UiAccountData::Json(parsed_data)
} else {
UiAccountData::Binary(base64::encode(&account.data), UiAccountEncoding::Base64)
UiAccountData::Binary(
base64::encode(&account.data()),
UiAccountEncoding::Base64,
)
}
}
};
UiAccount {
lamports: account.lamports,
lamports: account.lamports(),
data,
owner: account.owner.to_string(),
executable: account.executable,
rent_epoch: account.rent_epoch,
owner: account.owner().to_string(),
executable: account.executable(),
rent_epoch: account.rent_epoch(),
}
}
pub fn decode(&self) -> Option<Account> {
pub fn decode<T: WritableAccount>(&self) -> Option<T> {
let data = match &self.data {
UiAccountData::Json(_) => None,
UiAccountData::LegacyBinary(blob) => bs58::decode(blob).into_vec().ok(),
@ -125,13 +149,13 @@ impl UiAccount {
UiAccountEncoding::Binary | UiAccountEncoding::JsonParsed => None,
},
}?;
Some(Account {
lamports: self.lamports,
Some(T::create(
self.lamports,
data,
owner: Pubkey::from_str(&self.owner).ok()?,
executable: self.executable,
rent_epoch: self.rent_epoch,
})
Pubkey::from_str(&self.owner).ok()?,
self.executable,
self.rent_epoch,
))
}
}
@ -157,7 +181,7 @@ impl Default for UiFeeCalculator {
}
}
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct UiDataSliceConfig {
pub offset: usize,
@ -180,7 +204,10 @@ fn slice_data(data: &[u8], data_slice_config: Option<UiDataSliceConfig>) -> &[u8
#[cfg(test)]
mod test {
use super::*;
use {
super::*,
solana_sdk::account::{Account, AccountSharedData},
};
#[test]
fn test_slice_data() {
@ -214,10 +241,10 @@ mod test {
fn test_base64_zstd() {
let encoded_account = UiAccount::encode(
&Pubkey::default(),
Account {
&AccountSharedData::from(Account {
data: vec![0; 1024],
..Account::default()
},
}),
UiAccountEncoding::Base64Zstd,
None,
None,
@ -227,7 +254,9 @@ mod test {
UiAccountData::Binary(_, UiAccountEncoding::Base64Zstd)
));
let decoded_account = encoded_account.decode().unwrap();
assert_eq!(decoded_account.data, vec![0; 1024]);
let decoded_account = encoded_account.decode::<Account>().unwrap();
assert_eq!(decoded_account.data(), &vec![0; 1024]);
let decoded_account = encoded_account.decode::<AccountSharedData>().unwrap();
assert_eq!(decoded_account.data(), &vec![0; 1024]);
}
}

View File

@ -1,26 +1,34 @@
use crate::{
parse_config::parse_config,
parse_nonce::parse_nonce,
parse_stake::parse_stake,
parse_sysvar::parse_sysvar,
parse_token::{parse_token, spl_token_id_v2_0},
parse_vote::parse_vote,
use {
crate::{
parse_bpf_loader::parse_bpf_upgradeable_loader,
parse_config::parse_config,
parse_nonce::parse_nonce,
parse_stake::parse_stake,
parse_sysvar::parse_sysvar,
parse_token::{parse_token, spl_token_id},
parse_vote::parse_vote,
},
inflector::Inflector,
serde_json::Value,
solana_sdk::{instruction::InstructionError, pubkey::Pubkey, stake, system_program, sysvar},
std::collections::HashMap,
thiserror::Error,
};
use inflector::Inflector;
use serde_json::Value;
use solana_sdk::{instruction::InstructionError, pubkey::Pubkey, system_program, sysvar};
use std::collections::HashMap;
use thiserror::Error;
lazy_static! {
static ref BPF_UPGRADEABLE_LOADER_PROGRAM_ID: Pubkey = solana_sdk::bpf_loader_upgradeable::id();
static ref CONFIG_PROGRAM_ID: Pubkey = solana_config_program::id();
static ref STAKE_PROGRAM_ID: Pubkey = solana_stake_program::id();
static ref STAKE_PROGRAM_ID: Pubkey = stake::program::id();
static ref SYSTEM_PROGRAM_ID: Pubkey = system_program::id();
static ref SYSVAR_PROGRAM_ID: Pubkey = sysvar::id();
static ref TOKEN_PROGRAM_ID: Pubkey = spl_token_id_v2_0();
static ref TOKEN_PROGRAM_ID: Pubkey = spl_token_id();
static ref VOTE_PROGRAM_ID: Pubkey = solana_vote_program::id();
pub static ref PARSABLE_PROGRAM_IDS: HashMap<Pubkey, ParsableAccount> = {
let mut m = HashMap::new();
m.insert(
*BPF_UPGRADEABLE_LOADER_PROGRAM_ID,
ParsableAccount::BpfUpgradeableLoader,
);
m.insert(*CONFIG_PROGRAM_ID, ParsableAccount::Config);
m.insert(*SYSTEM_PROGRAM_ID, ParsableAccount::Nonce);
m.insert(*TOKEN_PROGRAM_ID, ParsableAccount::SplToken);
@ -60,6 +68,7 @@ pub struct ParsedAccount {
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum ParsableAccount {
BpfUpgradeableLoader,
Config,
Nonce,
SplToken,
@ -84,6 +93,9 @@ pub fn parse_account_data(
.ok_or(ParseAccountError::ProgramNotParsable)?;
let additional_data = additional_data.unwrap_or_default();
let parsed_json = match program_name {
ParsableAccount::BpfUpgradeableLoader => {
serde_json::to_value(parse_bpf_upgradeable_loader(data)?)?
}
ParsableAccount::Config => serde_json::to_value(parse_config(data, pubkey)?)?,
ParsableAccount::Nonce => serde_json::to_value(parse_nonce(data)?)?,
ParsableAccount::SplToken => {
@ -102,12 +114,14 @@ pub fn parse_account_data(
#[cfg(test)]
mod test {
use super::*;
use solana_sdk::nonce::{
state::{Data, Versions},
State,
use {
super::*,
solana_sdk::nonce::{
state::{Data, Versions},
State,
},
solana_vote_program::vote_state::{VoteState, VoteStateVersions},
};
use solana_vote_program::vote_state::{VoteState, VoteStateVersions};
#[test]
fn test_parse_account_data() {
@ -118,7 +132,7 @@ mod test {
let vote_state = VoteState::default();
let mut vote_account_data: Vec<u8> = vec![0; VoteState::size_of()];
let versioned = VoteStateVersions::Current(Box::new(vote_state));
let versioned = VoteStateVersions::new_current(vote_state);
VoteState::serialize(&versioned, &mut vote_account_data).unwrap();
let parsed = parse_account_data(
&account_pubkey,

View File

@ -0,0 +1,181 @@
use {
crate::{
parse_account_data::{ParsableAccount, ParseAccountError},
UiAccountData, UiAccountEncoding,
},
bincode::{deserialize, serialized_size},
solana_sdk::{bpf_loader_upgradeable::UpgradeableLoaderState, pubkey::Pubkey},
};
pub fn parse_bpf_upgradeable_loader(
data: &[u8],
) -> Result<BpfUpgradeableLoaderAccountType, ParseAccountError> {
let account_state: UpgradeableLoaderState = deserialize(data).map_err(|_| {
ParseAccountError::AccountNotParsable(ParsableAccount::BpfUpgradeableLoader)
})?;
let parsed_account = match account_state {
UpgradeableLoaderState::Uninitialized => BpfUpgradeableLoaderAccountType::Uninitialized,
UpgradeableLoaderState::Buffer { authority_address } => {
let offset = if authority_address.is_some() {
UpgradeableLoaderState::buffer_data_offset().unwrap()
} else {
// This case included for code completeness; in practice, a Buffer account will
// always have authority_address.is_some()
UpgradeableLoaderState::buffer_data_offset().unwrap()
- serialized_size(&Pubkey::default()).unwrap() as usize
};
BpfUpgradeableLoaderAccountType::Buffer(UiBuffer {
authority: authority_address.map(|pubkey| pubkey.to_string()),
data: UiAccountData::Binary(
base64::encode(&data[offset as usize..]),
UiAccountEncoding::Base64,
),
})
}
UpgradeableLoaderState::Program {
programdata_address,
} => BpfUpgradeableLoaderAccountType::Program(UiProgram {
program_data: programdata_address.to_string(),
}),
UpgradeableLoaderState::ProgramData {
slot,
upgrade_authority_address,
} => {
let offset = if upgrade_authority_address.is_some() {
UpgradeableLoaderState::programdata_data_offset().unwrap()
} else {
UpgradeableLoaderState::programdata_data_offset().unwrap()
- serialized_size(&Pubkey::default()).unwrap() as usize
};
BpfUpgradeableLoaderAccountType::ProgramData(UiProgramData {
slot,
authority: upgrade_authority_address.map(|pubkey| pubkey.to_string()),
data: UiAccountData::Binary(
base64::encode(&data[offset as usize..]),
UiAccountEncoding::Base64,
),
})
}
};
Ok(parsed_account)
}
#[derive(Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase", tag = "type", content = "info")]
pub enum BpfUpgradeableLoaderAccountType {
Uninitialized,
Buffer(UiBuffer),
Program(UiProgram),
ProgramData(UiProgramData),
}
#[derive(Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct UiBuffer {
pub authority: Option<String>,
pub data: UiAccountData,
}
#[derive(Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct UiProgram {
pub program_data: String,
}
#[derive(Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct UiProgramData {
pub slot: u64,
pub authority: Option<String>,
pub data: UiAccountData,
}
#[cfg(test)]
mod test {
use {super::*, bincode::serialize, solana_sdk::pubkey::Pubkey};
#[test]
fn test_parse_bpf_upgradeable_loader_accounts() {
let bpf_loader_state = UpgradeableLoaderState::Uninitialized;
let account_data = serialize(&bpf_loader_state).unwrap();
assert_eq!(
parse_bpf_upgradeable_loader(&account_data).unwrap(),
BpfUpgradeableLoaderAccountType::Uninitialized
);
let program = vec![7u8; 64]; // Arbitrary program data
let authority = Pubkey::new_unique();
let bpf_loader_state = UpgradeableLoaderState::Buffer {
authority_address: Some(authority),
};
let mut account_data = serialize(&bpf_loader_state).unwrap();
account_data.extend_from_slice(&program);
assert_eq!(
parse_bpf_upgradeable_loader(&account_data).unwrap(),
BpfUpgradeableLoaderAccountType::Buffer(UiBuffer {
authority: Some(authority.to_string()),
data: UiAccountData::Binary(base64::encode(&program), UiAccountEncoding::Base64),
})
);
// This case included for code completeness; in practice, a Buffer account will always have
// authority_address.is_some()
let bpf_loader_state = UpgradeableLoaderState::Buffer {
authority_address: None,
};
let mut account_data = serialize(&bpf_loader_state).unwrap();
account_data.extend_from_slice(&program);
assert_eq!(
parse_bpf_upgradeable_loader(&account_data).unwrap(),
BpfUpgradeableLoaderAccountType::Buffer(UiBuffer {
authority: None,
data: UiAccountData::Binary(base64::encode(&program), UiAccountEncoding::Base64),
})
);
let programdata_address = Pubkey::new_unique();
let bpf_loader_state = UpgradeableLoaderState::Program {
programdata_address,
};
let account_data = serialize(&bpf_loader_state).unwrap();
assert_eq!(
parse_bpf_upgradeable_loader(&account_data).unwrap(),
BpfUpgradeableLoaderAccountType::Program(UiProgram {
program_data: programdata_address.to_string(),
})
);
let authority = Pubkey::new_unique();
let slot = 42;
let bpf_loader_state = UpgradeableLoaderState::ProgramData {
slot,
upgrade_authority_address: Some(authority),
};
let mut account_data = serialize(&bpf_loader_state).unwrap();
account_data.extend_from_slice(&program);
assert_eq!(
parse_bpf_upgradeable_loader(&account_data).unwrap(),
BpfUpgradeableLoaderAccountType::ProgramData(UiProgramData {
slot,
authority: Some(authority.to_string()),
data: UiAccountData::Binary(base64::encode(&program), UiAccountEncoding::Base64),
})
);
let bpf_loader_state = UpgradeableLoaderState::ProgramData {
slot,
upgrade_authority_address: None,
};
let mut account_data = serialize(&bpf_loader_state).unwrap();
account_data.extend_from_slice(&program);
assert_eq!(
parse_bpf_upgradeable_loader(&account_data).unwrap(),
BpfUpgradeableLoaderAccountType::ProgramData(UiProgramData {
slot,
authority: None,
data: UiAccountData::Binary(base64::encode(&program), UiAccountEncoding::Base64),
})
);
}
}

View File

@ -1,15 +1,19 @@
use crate::{
parse_account_data::{ParsableAccount, ParseAccountError},
validator_info,
use {
crate::{
parse_account_data::{ParsableAccount, ParseAccountError},
validator_info,
},
bincode::deserialize,
serde_json::Value,
solana_config_program::{get_config_data, ConfigKeys},
solana_sdk::{
pubkey::Pubkey,
stake::config::{self as stake_config, Config as StakeConfig},
},
};
use bincode::deserialize;
use serde_json::Value;
use solana_config_program::{get_config_data, ConfigKeys};
use solana_sdk::pubkey::Pubkey;
use solana_stake_program::config::Config as StakeConfig;
pub fn parse_config(data: &[u8], pubkey: &Pubkey) -> Result<ConfigAccountType, ParseAccountError> {
let parsed_account = if pubkey == &solana_stake_program::config::id() {
let parsed_account = if pubkey == &stake_config::id() {
get_config_data(data)
.ok()
.and_then(|data| deserialize::<StakeConfig>(data).ok())
@ -37,7 +41,7 @@ fn parse_config_data<T>(data: &[u8], keys: Vec<(Pubkey, bool)>) -> Option<UiConf
where
T: serde::de::DeserializeOwned,
{
let config_data: T = deserialize(&get_config_data(data).ok()?).ok()?;
let config_data: T = deserialize(get_config_data(data).ok()?).ok()?;
let keys = keys
.iter()
.map(|key| UiConfigKey {
@ -87,10 +91,10 @@ pub struct UiConfig<T> {
#[cfg(test)]
mod test {
use super::*;
use crate::validator_info::ValidatorInfo;
use serde_json::json;
use solana_config_program::create_config_account;
use {
super::*, crate::validator_info::ValidatorInfo, serde_json::json,
solana_config_program::create_config_account, solana_sdk::account::ReadableAccount,
};
#[test]
fn test_parse_config() {
@ -100,11 +104,7 @@ mod test {
};
let stake_config_account = create_config_account(vec![], &stake_config, 10);
assert_eq!(
parse_config(
&stake_config_account.data,
&solana_stake_program::config::id()
)
.unwrap(),
parse_config(stake_config_account.data(), &stake_config::id()).unwrap(),
ConfigAccountType::StakeConfig(UiStakeConfig {
warmup_cooldown_rate: 0.25,
slash_penalty: 50,
@ -124,7 +124,7 @@ mod test {
10,
);
assert_eq!(
parse_config(&validator_info_config_account.data, &info_pubkey).unwrap(),
parse_config(validator_info_config_account.data(), &info_pubkey).unwrap(),
ConfigAccountType::ValidatorInfo(UiConfig {
keys: vec![
UiConfigKey {

View File

@ -1,7 +1,9 @@
use crate::{parse_account_data::ParseAccountError, UiFeeCalculator};
use solana_sdk::{
instruction::InstructionError,
nonce::{state::Versions, State},
use {
crate::{parse_account_data::ParseAccountError, UiFeeCalculator},
solana_sdk::{
instruction::InstructionError,
nonce::{state::Versions, State},
},
};
pub fn parse_nonce(data: &[u8]) -> Result<UiNonceState, ParseAccountError> {
@ -9,7 +11,13 @@ pub fn parse_nonce(data: &[u8]) -> Result<UiNonceState, ParseAccountError> {
.map_err(|_| ParseAccountError::from(InstructionError::InvalidAccountData))?;
let nonce_state = nonce_state.convert_to_current();
match nonce_state {
State::Uninitialized => Ok(UiNonceState::Uninitialized),
// This prevents parsing an allocated System-owned account with empty data of any non-zero
// length as `uninitialized` nonce. An empty account of the wrong length can never be
// initialized as a nonce account, and an empty account of the correct length may not be an
// uninitialized nonce account, since it can be assigned to another program.
State::Uninitialized => Err(ParseAccountError::from(
InstructionError::InvalidAccountData,
)),
State::Initialized(data) => Ok(UiNonceState::Initialized(UiNonceData {
authority: data.authority.to_string(),
blockhash: data.blockhash.to_string(),
@ -36,14 +44,16 @@ pub struct UiNonceData {
#[cfg(test)]
mod test {
use super::*;
use solana_sdk::{
hash::Hash,
nonce::{
state::{Data, Versions},
State,
use {
super::*,
solana_sdk::{
hash::Hash,
nonce::{
state::{Data, Versions},
State,
},
pubkey::Pubkey,
},
pubkey::Pubkey,
};
#[test]

View File

@ -1,10 +1,14 @@
use crate::{
parse_account_data::{ParsableAccount, ParseAccountError},
StringAmount,
use {
crate::{
parse_account_data::{ParsableAccount, ParseAccountError},
StringAmount,
},
bincode::deserialize,
solana_sdk::{
clock::{Epoch, UnixTimestamp},
stake::state::{Authorized, Delegation, Lockup, Meta, Stake, StakeState},
},
};
use bincode::deserialize;
use solana_sdk::clock::{Epoch, UnixTimestamp};
use solana_stake_program::stake_state::{Authorized, Delegation, Lockup, Meta, Stake, StakeState};
pub fn parse_stake(data: &[u8]) -> Result<StakeAccountType, ParseAccountError> {
let stake_state: StakeState = deserialize(data)
@ -132,8 +136,7 @@ impl From<Delegation> for UiDelegation {
#[cfg(test)]
mod test {
use super::*;
use bincode::serialize;
use {super::*, bincode::serialize};
#[test]
fn test_parse_stake() {

View File

@ -1,18 +1,20 @@
use crate::{
parse_account_data::{ParsableAccount, ParseAccountError},
StringAmount, UiFeeCalculator,
};
use bincode::deserialize;
use bv::BitVec;
use solana_sdk::{
clock::{Clock, Epoch, Slot, UnixTimestamp},
epoch_schedule::EpochSchedule,
pubkey::Pubkey,
rent::Rent,
slot_hashes::SlotHashes,
slot_history::{self, SlotHistory},
stake_history::{StakeHistory, StakeHistoryEntry},
sysvar::{self, fees::Fees, recent_blockhashes::RecentBlockhashes, rewards::Rewards},
use {
crate::{
parse_account_data::{ParsableAccount, ParseAccountError},
StringAmount, UiFeeCalculator,
},
bincode::deserialize,
bv::BitVec,
solana_sdk::{
clock::{Clock, Epoch, Slot, UnixTimestamp},
epoch_schedule::EpochSchedule,
pubkey::Pubkey,
rent::Rent,
slot_hashes::SlotHashes,
slot_history::{self, SlotHistory},
stake_history::{StakeHistory, StakeHistoryEntry},
sysvar::{self, fees::Fees, recent_blockhashes::RecentBlockhashes, rewards::Rewards},
},
};
pub fn parse_sysvar(data: &[u8], pubkey: &Pubkey) -> Result<SysvarAccountType, ParseAccountError> {
@ -212,15 +214,17 @@ pub struct UiStakeHistoryEntry {
#[cfg(test)]
mod test {
use super::*;
use solana_sdk::{
account::create_account, fee_calculator::FeeCalculator, hash::Hash,
sysvar::recent_blockhashes::IterItem,
use {
super::*,
solana_sdk::{
account::create_account_for_test, fee_calculator::FeeCalculator, hash::Hash,
sysvar::recent_blockhashes::IterItem,
},
};
#[test]
fn test_parse_sysvars() {
let clock_sysvar = create_account(&Clock::default(), 1);
let clock_sysvar = create_account_for_test(&Clock::default());
assert_eq!(
parse_sysvar(&clock_sysvar.data, &sysvar::clock::id()).unwrap(),
SysvarAccountType::Clock(UiClock::default()),
@ -233,13 +237,13 @@ mod test {
first_normal_epoch: 1,
first_normal_slot: 12,
};
let epoch_schedule_sysvar = create_account(&epoch_schedule, 1);
let epoch_schedule_sysvar = create_account_for_test(&epoch_schedule);
assert_eq!(
parse_sysvar(&epoch_schedule_sysvar.data, &sysvar::epoch_schedule::id()).unwrap(),
SysvarAccountType::EpochSchedule(epoch_schedule),
);
let fees_sysvar = create_account(&Fees::default(), 1);
let fees_sysvar = create_account_for_test(&Fees::default());
assert_eq!(
parse_sysvar(&fees_sysvar.data, &sysvar::fees::id()).unwrap(),
SysvarAccountType::Fees(UiFees::default()),
@ -252,7 +256,7 @@ mod test {
let recent_blockhashes: RecentBlockhashes = vec![IterItem(0, &hash, &fee_calculator)]
.into_iter()
.collect();
let recent_blockhashes_sysvar = create_account(&recent_blockhashes, 1);
let recent_blockhashes_sysvar = create_account_for_test(&recent_blockhashes);
assert_eq!(
parse_sysvar(
&recent_blockhashes_sysvar.data,
@ -270,13 +274,13 @@ mod test {
exemption_threshold: 2.0,
burn_percent: 5,
};
let rent_sysvar = create_account(&rent, 1);
let rent_sysvar = create_account_for_test(&rent);
assert_eq!(
parse_sysvar(&rent_sysvar.data, &sysvar::rent::id()).unwrap(),
SysvarAccountType::Rent(rent.into()),
);
let rewards_sysvar = create_account(&Rewards::default(), 1);
let rewards_sysvar = create_account_for_test(&Rewards::default());
assert_eq!(
parse_sysvar(&rewards_sysvar.data, &sysvar::rewards::id()).unwrap(),
SysvarAccountType::Rewards(UiRewards::default()),
@ -284,7 +288,7 @@ mod test {
let mut slot_hashes = SlotHashes::default();
slot_hashes.add(1, hash);
let slot_hashes_sysvar = create_account(&slot_hashes, 1);
let slot_hashes_sysvar = create_account_for_test(&slot_hashes);
assert_eq!(
parse_sysvar(&slot_hashes_sysvar.data, &sysvar::slot_hashes::id()).unwrap(),
SysvarAccountType::SlotHashes(vec![UiSlotHashEntry {
@ -295,7 +299,7 @@ mod test {
let mut slot_history = SlotHistory::default();
slot_history.add(42);
let slot_history_sysvar = create_account(&slot_history, 1);
let slot_history_sysvar = create_account_for_test(&slot_history);
assert_eq!(
parse_sysvar(&slot_history_sysvar.data, &sysvar::slot_history::id()).unwrap(),
SysvarAccountType::SlotHistory(UiSlotHistory {
@ -311,7 +315,7 @@ mod test {
deactivating: 3,
};
stake_history.add(1, stake_history_entry.clone());
let stake_history_sysvar = create_account(&stake_history, 1);
let stake_history_sysvar = create_account_for_test(&stake_history);
assert_eq!(
parse_sysvar(&stake_history_sysvar.data, &sysvar::stake_history::id()).unwrap(),
SysvarAccountType::StakeHistory(vec![UiStakeHistoryEntry {

View File

@ -1,36 +1,38 @@
use crate::{
parse_account_data::{ParsableAccount, ParseAccountError},
StringAmount,
};
use solana_sdk::pubkey::Pubkey;
use spl_token_v2_0::{
solana_program::{
program_option::COption, program_pack::Pack, pubkey::Pubkey as SplTokenPubkey,
use {
crate::{
parse_account_data::{ParsableAccount, ParseAccountError},
StringAmount, StringDecimals,
},
state::{Account, AccountState, Mint, Multisig},
solana_sdk::pubkey::Pubkey,
spl_token::{
solana_program::{
program_option::COption, program_pack::Pack, pubkey::Pubkey as SplTokenPubkey,
},
state::{Account, AccountState, Mint, Multisig},
},
std::str::FromStr,
};
use std::str::FromStr;
// A helper function to convert spl_token_v2_0::id() as spl_sdk::pubkey::Pubkey to
// A helper function to convert spl_token::id() as spl_sdk::pubkey::Pubkey to
// solana_sdk::pubkey::Pubkey
pub fn spl_token_id_v2_0() -> Pubkey {
Pubkey::from_str(&spl_token_v2_0::id().to_string()).unwrap()
pub fn spl_token_id() -> Pubkey {
Pubkey::new_from_array(spl_token::id().to_bytes())
}
// A helper function to convert spl_token_v2_0::native_mint::id() as spl_sdk::pubkey::Pubkey to
// A helper function to convert spl_token::native_mint::id() as spl_sdk::pubkey::Pubkey to
// solana_sdk::pubkey::Pubkey
pub fn spl_token_v2_0_native_mint() -> Pubkey {
Pubkey::from_str(&spl_token_v2_0::native_mint::id().to_string()).unwrap()
pub fn spl_token_native_mint() -> Pubkey {
Pubkey::new_from_array(spl_token::native_mint::id().to_bytes())
}
// A helper function to convert a solana_sdk::pubkey::Pubkey to spl_sdk::pubkey::Pubkey
pub fn spl_token_v2_0_pubkey(pubkey: &Pubkey) -> SplTokenPubkey {
SplTokenPubkey::from_str(&pubkey.to_string()).unwrap()
pub fn spl_token_pubkey(pubkey: &Pubkey) -> SplTokenPubkey {
SplTokenPubkey::new_from_array(pubkey.to_bytes())
}
// A helper function to convert a spl_sdk::pubkey::Pubkey to solana_sdk::pubkey::Pubkey
pub fn pubkey_from_spl_token_v2_0(pubkey: &SplTokenPubkey) -> Pubkey {
Pubkey::from_str(&pubkey.to_string()).unwrap()
pub fn pubkey_from_spl_token(pubkey: &SplTokenPubkey) -> Pubkey {
Pubkey::new_from_array(pubkey.to_bytes())
}
pub fn parse_token(
@ -158,46 +160,66 @@ impl From<AccountState> for UiAccountState {
}
}
pub fn real_number_string(amount: u64, decimals: u8) -> StringDecimals {
let decimals = decimals as usize;
if decimals > 0 {
// Left-pad zeros to decimals + 1, so we at least have an integer zero
let mut s = format!("{:01$}", amount, decimals + 1);
// Add the decimal point (Sorry, "," locales!)
s.insert(s.len() - decimals, '.');
s
} else {
amount.to_string()
}
}
pub fn real_number_string_trimmed(amount: u64, decimals: u8) -> StringDecimals {
let mut s = real_number_string(amount, decimals);
if decimals > 0 {
let zeros_trimmed = s.trim_end_matches('0');
s = zeros_trimmed.trim_end_matches('.').to_string();
}
s
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct UiTokenAmount {
pub ui_amount: f64,
pub ui_amount: Option<f64>,
pub decimals: u8,
pub amount: StringAmount,
pub ui_amount_string: StringDecimals,
}
impl UiTokenAmount {
pub fn real_number_string(&self) -> String {
let decimals = self.decimals as usize;
if decimals > 0 {
let amount = u64::from_str(&self.amount).unwrap_or(0);
// Left-pad zeros to decimals + 1, so we at least have an integer zero
let mut s = format!("{:01$}", amount, decimals + 1);
// Add the decimal point (Sorry, "," locales!)
s.insert(s.len() - decimals, '.');
s
} else {
self.amount.clone()
}
real_number_string(
u64::from_str(&self.amount).unwrap_or_default(),
self.decimals as u8,
)
}
pub fn real_number_string_trimmed(&self) -> String {
let s = self.real_number_string();
let zeros_trimmed = s.trim_end_matches('0');
let decimal_trimmed = zeros_trimmed.trim_end_matches('.');
decimal_trimmed.to_string()
if !self.ui_amount_string.is_empty() {
self.ui_amount_string.clone()
} else {
real_number_string_trimmed(
u64::from_str(&self.amount).unwrap_or_default(),
self.decimals as u8,
)
}
}
}
pub fn token_amount_to_ui_amount(amount: u64, decimals: u8) -> UiTokenAmount {
// Use `amount_to_ui_amount()` once spl_token is bumped to a version that supports it: https://github.com/solana-labs/solana-program-library/pull/211
let amount_decimals = amount as f64 / 10_usize.pow(decimals as u32) as f64;
let amount_decimals = 10_usize
.checked_pow(decimals as u32)
.map(|dividend| amount as f64 / dividend as f64);
UiTokenAmount {
ui_amount: amount_decimals,
decimals,
amount: amount.to_string(),
ui_amount_string: real_number_string_trimmed(amount, decimals),
}
}
@ -253,9 +275,10 @@ mod test {
mint: mint_pubkey.to_string(),
owner: owner_pubkey.to_string(),
token_amount: UiTokenAmount {
ui_amount: 0.42,
ui_amount: Some(0.42),
decimals: 2,
amount: "42".to_string()
amount: "42".to_string(),
ui_amount_string: "0.42".to_string()
},
delegate: None,
state: UiAccountState::Initialized,
@ -336,17 +359,87 @@ mod test {
#[test]
fn test_ui_token_amount_real_string() {
assert_eq!(&real_number_string(1, 0), "1");
assert_eq!(&real_number_string_trimmed(1, 0), "1");
let token_amount = token_amount_to_ui_amount(1, 0);
assert_eq!(&token_amount.real_number_string(), "1");
assert_eq!(&token_amount.real_number_string_trimmed(), "1");
assert_eq!(
token_amount.ui_amount_string,
real_number_string_trimmed(1, 0)
);
assert_eq!(token_amount.ui_amount, Some(1.0));
assert_eq!(&real_number_string(10, 0), "10");
assert_eq!(&real_number_string_trimmed(10, 0), "10");
let token_amount = token_amount_to_ui_amount(10, 0);
assert_eq!(
token_amount.ui_amount_string,
real_number_string_trimmed(10, 0)
);
assert_eq!(token_amount.ui_amount, Some(10.0));
assert_eq!(&real_number_string(1, 9), "0.000000001");
assert_eq!(&real_number_string_trimmed(1, 9), "0.000000001");
let token_amount = token_amount_to_ui_amount(1, 9);
assert_eq!(&token_amount.real_number_string(), "0.000000001");
assert_eq!(&token_amount.real_number_string_trimmed(), "0.000000001");
assert_eq!(
token_amount.ui_amount_string,
real_number_string_trimmed(1, 9)
);
assert_eq!(token_amount.ui_amount, Some(0.000000001));
assert_eq!(&real_number_string(1_000_000_000, 9), "1.000000000");
assert_eq!(&real_number_string_trimmed(1_000_000_000, 9), "1");
let token_amount = token_amount_to_ui_amount(1_000_000_000, 9);
assert_eq!(&token_amount.real_number_string(), "1.000000000");
assert_eq!(&token_amount.real_number_string_trimmed(), "1");
assert_eq!(
token_amount.ui_amount_string,
real_number_string_trimmed(1_000_000_000, 9)
);
assert_eq!(token_amount.ui_amount, Some(1.0));
assert_eq!(&real_number_string(1_234_567_890, 3), "1234567.890");
assert_eq!(&real_number_string_trimmed(1_234_567_890, 3), "1234567.89");
let token_amount = token_amount_to_ui_amount(1_234_567_890, 3);
assert_eq!(&token_amount.real_number_string(), "1234567.890");
assert_eq!(&token_amount.real_number_string_trimmed(), "1234567.89");
assert_eq!(
token_amount.ui_amount_string,
real_number_string_trimmed(1_234_567_890, 3)
);
assert_eq!(token_amount.ui_amount, Some(1234567.89));
assert_eq!(
&real_number_string(1_234_567_890, 25),
"0.0000000000000001234567890"
);
assert_eq!(
&real_number_string_trimmed(1_234_567_890, 25),
"0.000000000000000123456789"
);
let token_amount = token_amount_to_ui_amount(1_234_567_890, 20);
assert_eq!(
token_amount.ui_amount_string,
real_number_string_trimmed(1_234_567_890, 20)
);
assert_eq!(token_amount.ui_amount, None);
}
#[test]
fn test_ui_token_amount_real_string_zero() {
assert_eq!(&real_number_string(0, 0), "0");
assert_eq!(&real_number_string_trimmed(0, 0), "0");
let token_amount = token_amount_to_ui_amount(0, 0);
assert_eq!(
token_amount.ui_amount_string,
real_number_string_trimmed(0, 0)
);
assert_eq!(token_amount.ui_amount, Some(0.0));
assert_eq!(&real_number_string(0, 9), "0.000000000");
assert_eq!(&real_number_string_trimmed(0, 9), "0");
let token_amount = token_amount_to_ui_amount(0, 9);
assert_eq!(
token_amount.ui_amount_string,
real_number_string_trimmed(0, 9)
);
assert_eq!(token_amount.ui_amount, Some(0.0));
assert_eq!(&real_number_string(0, 25), "0.0000000000000000000000000");
assert_eq!(&real_number_string_trimmed(0, 25), "0");
let token_amount = token_amount_to_ui_amount(0, 20);
assert_eq!(
token_amount.ui_amount_string,
real_number_string_trimmed(0, 20)
);
assert_eq!(token_amount.ui_amount, None);
}
}

View File

@ -1,9 +1,11 @@
use crate::{parse_account_data::ParseAccountError, StringAmount};
use solana_sdk::{
clock::{Epoch, Slot},
pubkey::Pubkey,
use {
crate::{parse_account_data::ParseAccountError, StringAmount},
solana_sdk::{
clock::{Epoch, Slot},
pubkey::Pubkey,
},
solana_vote_program::vote_state::{BlockTimestamp, Lockout, VoteState},
};
use solana_vote_program::vote_state::{BlockTimestamp, Lockout, VoteState};
pub fn parse_vote(data: &[u8]) -> Result<VoteAccountType, ParseAccountError> {
let mut vote_state = VoteState::deserialize(data).map_err(ParseAccountError::from)?;
@ -121,14 +123,13 @@ struct UiEpochCredits {
#[cfg(test)]
mod test {
use super::*;
use solana_vote_program::vote_state::VoteStateVersions;
use {super::*, solana_vote_program::vote_state::VoteStateVersions};
#[test]
fn test_parse_vote() {
let vote_state = VoteState::default();
let mut vote_account_data: Vec<u8> = vec![0; VoteState::size_of()];
let versioned = VoteStateVersions::Current(Box::new(vote_state));
let versioned = VoteStateVersions::new_current(vote_state);
VoteState::serialize(&versioned, &mut vote_account_data).unwrap();
let expected_vote_state = UiVoteState {
node_pubkey: Pubkey::default().to_string(),

View File

@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-accounts-bench"
version = "1.5.0"
version = "1.8.12"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@ -10,12 +10,12 @@ publish = false
[dependencies]
log = "0.4.11"
rayon = "1.4.0"
solana-logger = { path = "../logger", version = "1.5.0" }
solana-runtime = { path = "../runtime", version = "1.5.0" }
solana-measure = { path = "../measure", version = "1.5.0" }
solana-sdk = { path = "../sdk", version = "1.5.0" }
solana-version = { path = "../version", version = "1.5.0" }
rayon = "1.5.0"
solana-logger = { path = "../logger", version = "=1.8.12" }
solana-runtime = { path = "../runtime", version = "=1.8.12" }
solana-measure = { path = "../measure", version = "=1.8.12" }
solana-sdk = { path = "../sdk", version = "=1.8.12" }
solana-version = { path = "../version", version = "=1.8.12" }
rand = "0.7.0"
clap = "2.33.1"
crossbeam-channel = "0.4"

View File

@ -1,14 +1,19 @@
use clap::{crate_description, crate_name, value_t, App, Arg};
use rayon::prelude::*;
use solana_measure::measure::Measure;
use solana_runtime::{
accounts::{create_test_accounts, update_accounts, Accounts},
accounts_index::Ancestors,
#![allow(clippy::integer_arithmetic)]
#[macro_use]
extern crate log;
use {
clap::{crate_description, crate_name, value_t, App, Arg},
rayon::prelude::*,
solana_measure::measure::Measure,
solana_runtime::{
accounts::{create_test_accounts, update_accounts_bench, Accounts},
accounts_db::AccountShrinkThreshold,
accounts_index::AccountSecondaryIndexes,
ancestors::Ancestors,
},
solana_sdk::{genesis_config::ClusterType, pubkey::Pubkey},
std::{env, fs, path::PathBuf},
};
use solana_sdk::{genesis_config::ClusterType, pubkey::Pubkey};
use std::env;
use std::fs;
use std::path::PathBuf;
fn main() {
solana_logger::setup();
@ -53,10 +58,18 @@ fn main() {
let path = PathBuf::from(env::var("FARF_DIR").unwrap_or_else(|_| "farf".to_owned()))
.join("accounts-bench");
println!("cleaning file system: {:?}", path);
if fs::remove_dir_all(path.clone()).is_err() {
println!("Warning: Couldn't remove {:?}", path);
}
let accounts = Accounts::new(vec![path], &ClusterType::Testnet);
let accounts = Accounts::new_with_config(
vec![path],
&ClusterType::Testnet,
AccountSecondaryIndexes::default(),
false,
AccountShrinkThreshold::default(),
None,
);
println!("Creating {} accounts", num_accounts);
let mut create_time = Measure::start("create accounts");
let pubkeys: Vec<_> = (0..num_slots)
@ -80,31 +93,61 @@ fn main() {
num_slots,
create_time
);
let mut ancestors: Ancestors = vec![(0, 0)].into_iter().collect();
let mut ancestors = Vec::with_capacity(num_slots);
ancestors.push(0);
for i in 1..num_slots {
ancestors.insert(i as u64, i - 1);
ancestors.push(i as u64);
accounts.add_root(i as u64);
}
let ancestors = Ancestors::from(ancestors);
let mut elapsed = vec![0; iterations];
let mut elapsed_store = vec![0; iterations];
for x in 0..iterations {
if clean {
let mut time = Measure::start("clean");
accounts.accounts_db.clean_accounts(None);
accounts.accounts_db.clean_accounts(None, false);
time.stop();
println!("{}", time);
for slot in 0..num_slots {
update_accounts(&accounts, &pubkeys, ((x + 1) * num_slots + slot) as u64);
update_accounts_bench(&accounts, &pubkeys, ((x + 1) * num_slots + slot) as u64);
accounts.add_root((x * num_slots + slot) as u64);
}
} else {
let mut pubkeys: Vec<Pubkey> = vec![];
let mut time = Measure::start("hash");
let hash = accounts
.accounts_db
.update_accounts_hash(0, &ancestors, true)
.0;
let results = accounts.accounts_db.update_accounts_hash(0, &ancestors);
time.stop();
println!("hash: {} {}", hash, time);
let mut time_store = Measure::start("hash using store");
let results_store = accounts.accounts_db.update_accounts_hash_with_index_option(
false,
false,
solana_sdk::clock::Slot::default(),
&ancestors,
None,
false,
None,
);
time_store.stop();
if results != results_store {
error!("results different: \n{:?}\n{:?}", results, results_store);
}
println!(
"hash,{},{},{},{}%",
results.0,
time,
time_store,
(time_store.as_us() as f64 / time.as_us() as f64 * 100.0f64) as u32
);
create_test_accounts(&accounts, &mut pubkeys, 1, 0);
elapsed[x] = time.as_us();
elapsed_store[x] = time_store.as_us();
}
}
for x in elapsed {
info!("update_accounts_hash(us),{}", x);
}
for x in elapsed_store {
info!("calculate_accounts_hash_without_index(us),{}", x);
}
}

1
accounts-cluster-bench/.gitignore vendored Normal file
View File

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

View File

@ -0,0 +1,36 @@
[package]
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-accounts-cluster-bench"
version = "1.8.12"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
publish = false
[dependencies]
clap = "2.33.1"
log = "0.4.11"
rand = "0.7.0"
rayon = "1.4.1"
solana-account-decoder = { path = "../account-decoder", version = "=1.8.12" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.12" }
solana-client = { path = "../client", version = "=1.8.12" }
solana-core = { path = "../core", version = "=1.8.12" }
solana-faucet = { path = "../faucet", version = "=1.8.12" }
solana-gossip = { path = "../gossip", version = "=1.8.12" }
solana-logger = { path = "../logger", version = "=1.8.12" }
solana-measure = { path = "../measure", version = "=1.8.12" }
solana-net-utils = { path = "../net-utils", version = "=1.8.12" }
solana-runtime = { path = "../runtime", version = "=1.8.12" }
solana-sdk = { path = "../sdk", version = "=1.8.12" }
solana-streamer = { path = "../streamer", version = "=1.8.12" }
solana-transaction-status = { path = "../transaction-status", version = "=1.8.12" }
solana-version = { path = "../version", version = "=1.8.12" }
spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
[dev-dependencies]
solana-local-cluster = { path = "../local-cluster", version = "=1.8.12" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -0,0 +1,753 @@
#![allow(clippy::integer_arithmetic)]
use {
clap::{crate_description, crate_name, value_t, values_t_or_exit, App, Arg},
log::*,
rand::{thread_rng, Rng},
rayon::prelude::*,
solana_account_decoder::parse_token::spl_token_pubkey,
solana_clap_utils::input_parsers::pubkey_of,
solana_client::rpc_client::RpcClient,
solana_faucet::faucet::{request_airdrop_transaction, FAUCET_PORT},
solana_gossip::gossip_service::discover,
solana_measure::measure::Measure,
solana_runtime::inline_spl_token,
solana_sdk::{
commitment_config::CommitmentConfig,
message::Message,
pubkey::Pubkey,
rpc_port::DEFAULT_RPC_PORT,
signature::{read_keypair_file, Keypair, Signature, Signer},
system_instruction, system_program,
timing::timestamp,
transaction::Transaction,
},
solana_streamer::socket::SocketAddrSpace,
solana_transaction_status::parse_token::spl_token_instruction,
std::{
net::SocketAddr,
process::exit,
sync::{
atomic::{AtomicBool, AtomicU64, Ordering},
Arc, RwLock,
},
thread::{sleep, Builder, JoinHandle},
time::{Duration, Instant},
},
};
// Create and close messages both require 2 signatures; if transaction construction changes, update
// this magic number
const NUM_SIGNATURES: u64 = 2;
pub fn airdrop_lamports(
client: &RpcClient,
faucet_addr: &SocketAddr,
id: &Keypair,
desired_balance: u64,
) -> bool {
let starting_balance = client.get_balance(&id.pubkey()).unwrap_or(0);
info!("starting balance {}", starting_balance);
if starting_balance < desired_balance {
let airdrop_amount = desired_balance - starting_balance;
info!(
"Airdropping {:?} lamports from {} for {}",
airdrop_amount,
faucet_addr,
id.pubkey(),
);
let (blockhash, _fee_calculator) = client.get_recent_blockhash().unwrap();
match request_airdrop_transaction(faucet_addr, &id.pubkey(), airdrop_amount, blockhash) {
Ok(transaction) => {
let mut tries = 0;
loop {
tries += 1;
let result = client.send_and_confirm_transaction(&transaction);
if result.is_ok() {
break;
}
if tries >= 5 {
panic!(
"Error requesting airdrop: to addr: {:?} amount: {} {:?}",
faucet_addr, airdrop_amount, result
)
}
}
}
Err(err) => {
panic!(
"Error requesting airdrop: {:?} to addr: {:?} amount: {}",
err, faucet_addr, airdrop_amount
);
}
};
let current_balance = client.get_balance(&id.pubkey()).unwrap_or_else(|e| {
panic!("airdrop error {}", e);
});
info!("current balance {}...", current_balance);
if current_balance - starting_balance != airdrop_amount {
info!(
"Airdrop failed? {} {} {} {}",
id.pubkey(),
current_balance,
starting_balance,
airdrop_amount,
);
}
}
true
}
// signature, timestamp, id
type PendingQueue = Vec<(Signature, u64, u64)>;
struct TransactionExecutor {
sig_clear_t: JoinHandle<()>,
sigs: Arc<RwLock<PendingQueue>>,
cleared: Arc<RwLock<Vec<u64>>>,
exit: Arc<AtomicBool>,
counter: AtomicU64,
client: RpcClient,
}
impl TransactionExecutor {
fn new(entrypoint_addr: SocketAddr) -> Self {
let sigs = Arc::new(RwLock::new(Vec::new()));
let cleared = Arc::new(RwLock::new(Vec::new()));
let exit = Arc::new(AtomicBool::new(false));
let sig_clear_t = Self::start_sig_clear_thread(&exit, &sigs, &cleared, entrypoint_addr);
let client =
RpcClient::new_socket_with_commitment(entrypoint_addr, CommitmentConfig::confirmed());
Self {
sigs,
cleared,
sig_clear_t,
exit,
counter: AtomicU64::new(0),
client,
}
}
fn num_outstanding(&self) -> usize {
self.sigs.read().unwrap().len()
}
fn push_transactions(&self, txs: Vec<Transaction>) -> Vec<u64> {
let mut ids = vec![];
let new_sigs = txs.into_iter().filter_map(|tx| {
let id = self.counter.fetch_add(1, Ordering::Relaxed);
ids.push(id);
match self.client.send_transaction(&tx) {
Ok(sig) => {
return Some((sig, timestamp(), id));
}
Err(e) => {
info!("error: {:#?}", e);
}
}
None
});
let mut sigs_w = self.sigs.write().unwrap();
sigs_w.extend(new_sigs);
ids
}
fn drain_cleared(&self) -> Vec<u64> {
std::mem::take(&mut *self.cleared.write().unwrap())
}
fn close(self) {
self.exit.store(true, Ordering::Relaxed);
self.sig_clear_t.join().unwrap();
}
fn start_sig_clear_thread(
exit: &Arc<AtomicBool>,
sigs: &Arc<RwLock<PendingQueue>>,
cleared: &Arc<RwLock<Vec<u64>>>,
entrypoint_addr: SocketAddr,
) -> JoinHandle<()> {
let sigs = sigs.clone();
let exit = exit.clone();
let cleared = cleared.clone();
Builder::new()
.name("sig_clear".to_string())
.spawn(move || {
let client = RpcClient::new_socket_with_commitment(
entrypoint_addr,
CommitmentConfig::confirmed(),
);
let mut success = 0;
let mut error_count = 0;
let mut timed_out = 0;
let mut last_log = Instant::now();
while !exit.load(Ordering::Relaxed) {
let sigs_len = sigs.read().unwrap().len();
if sigs_len > 0 {
let mut sigs_w = sigs.write().unwrap();
let mut start = Measure::start("sig_status");
let statuses: Vec<_> = sigs_w
.chunks(200)
.flat_map(|sig_chunk| {
let only_sigs: Vec<_> = sig_chunk.iter().map(|s| s.0).collect();
client
.get_signature_statuses(&only_sigs)
.expect("status fail")
.value
})
.collect();
let mut num_cleared = 0;
let start_len = sigs_w.len();
let now = timestamp();
let mut new_ids = vec![];
let mut i = 0;
let mut j = 0;
while i != sigs_w.len() {
let mut retain = true;
let sent_ts = sigs_w[i].1;
if let Some(e) = &statuses[j] {
debug!("error: {:?}", e);
if e.status.is_ok() {
success += 1;
} else {
error_count += 1;
}
num_cleared += 1;
retain = false;
} else if now - sent_ts > 30_000 {
retain = false;
timed_out += 1;
}
if !retain {
new_ids.push(sigs_w.remove(i).2);
} else {
i += 1;
}
j += 1;
}
let final_sigs_len = sigs_w.len();
drop(sigs_w);
cleared.write().unwrap().extend(new_ids);
start.stop();
debug!(
"sigs len: {:?} success: {} took: {}ms cleared: {}/{}",
final_sigs_len,
success,
start.as_ms(),
num_cleared,
start_len,
);
if last_log.elapsed().as_millis() > 5000 {
info!(
"success: {} error: {} timed_out: {}",
success, error_count, timed_out,
);
last_log = Instant::now();
}
}
sleep(Duration::from_millis(200));
}
})
.unwrap()
}
}
struct SeedTracker {
max_created: Arc<AtomicU64>,
max_closed: Arc<AtomicU64>,
}
fn make_create_message(
keypair: &Keypair,
base_keypair: &Keypair,
max_created_seed: Arc<AtomicU64>,
num_instructions: usize,
balance: u64,
maybe_space: Option<u64>,
mint: Option<Pubkey>,
) -> Message {
let space = maybe_space.unwrap_or_else(|| thread_rng().gen_range(0, 1000));
let instructions: Vec<_> = (0..num_instructions)
.into_iter()
.map(|_| {
let program_id = if mint.is_some() {
inline_spl_token::id()
} else {
system_program::id()
};
let seed = max_created_seed.fetch_add(1, Ordering::Relaxed).to_string();
let to_pubkey =
Pubkey::create_with_seed(&base_keypair.pubkey(), &seed, &program_id).unwrap();
let mut instructions = vec![system_instruction::create_account_with_seed(
&keypair.pubkey(),
&to_pubkey,
&base_keypair.pubkey(),
&seed,
balance,
space,
&program_id,
)];
if let Some(mint_address) = mint {
instructions.push(spl_token_instruction(
spl_token::instruction::initialize_account(
&spl_token::id(),
&spl_token_pubkey(&to_pubkey),
&spl_token_pubkey(&mint_address),
&spl_token_pubkey(&base_keypair.pubkey()),
)
.unwrap(),
));
}
instructions
})
.collect();
let instructions: Vec<_> = instructions.into_iter().flatten().collect();
Message::new(&instructions, Some(&keypair.pubkey()))
}
fn make_close_message(
keypair: &Keypair,
base_keypair: &Keypair,
max_closed_seed: Arc<AtomicU64>,
num_instructions: usize,
balance: u64,
spl_token: bool,
) -> Message {
let instructions: Vec<_> = (0..num_instructions)
.into_iter()
.map(|_| {
let program_id = if spl_token {
inline_spl_token::id()
} else {
system_program::id()
};
let seed = max_closed_seed.fetch_add(1, Ordering::Relaxed).to_string();
let address =
Pubkey::create_with_seed(&base_keypair.pubkey(), &seed, &program_id).unwrap();
if spl_token {
spl_token_instruction(
spl_token::instruction::close_account(
&spl_token::id(),
&spl_token_pubkey(&address),
&spl_token_pubkey(&keypair.pubkey()),
&spl_token_pubkey(&base_keypair.pubkey()),
&[],
)
.unwrap(),
)
} else {
system_instruction::transfer_with_seed(
&address,
&base_keypair.pubkey(),
seed,
&program_id,
&keypair.pubkey(),
balance,
)
}
})
.collect();
Message::new(&instructions, Some(&keypair.pubkey()))
}
#[allow(clippy::too_many_arguments)]
fn run_accounts_bench(
entrypoint_addr: SocketAddr,
faucet_addr: SocketAddr,
payer_keypairs: &[&Keypair],
iterations: usize,
maybe_space: Option<u64>,
batch_size: usize,
close_nth_batch: u64,
maybe_lamports: Option<u64>,
num_instructions: usize,
mint: Option<Pubkey>,
) {
assert!(num_instructions > 0);
let client =
RpcClient::new_socket_with_commitment(entrypoint_addr, CommitmentConfig::confirmed());
info!("Targeting {}", entrypoint_addr);
let mut last_blockhash = Instant::now();
let mut last_log = Instant::now();
let mut count = 0;
let mut recent_blockhash = client.get_recent_blockhash().expect("blockhash");
let mut tx_sent_count = 0;
let mut total_accounts_created = 0;
let mut total_accounts_closed = 0;
let mut balances: Vec<_> = payer_keypairs
.iter()
.map(|keypair| client.get_balance(&keypair.pubkey()).unwrap_or(0))
.collect();
let mut last_balance = Instant::now();
let default_max_lamports = 1000;
let min_balance = maybe_lamports.unwrap_or_else(|| {
let space = maybe_space.unwrap_or(default_max_lamports);
client
.get_minimum_balance_for_rent_exemption(space as usize)
.expect("min balance")
});
let base_keypair = Keypair::new();
let seed_tracker = SeedTracker {
max_created: Arc::new(AtomicU64::default()),
max_closed: Arc::new(AtomicU64::default()),
};
info!("Starting balance(s): {:?}", balances);
let executor = TransactionExecutor::new(entrypoint_addr);
loop {
if last_blockhash.elapsed().as_millis() > 10_000 {
recent_blockhash = client.get_recent_blockhash().expect("blockhash");
last_blockhash = Instant::now();
}
let fee = recent_blockhash
.1
.lamports_per_signature
.saturating_mul(NUM_SIGNATURES);
let lamports = min_balance + fee;
for (i, balance) in balances.iter_mut().enumerate() {
if *balance < lamports || last_balance.elapsed().as_millis() > 2000 {
if let Ok(b) = client.get_balance(&payer_keypairs[i].pubkey()) {
*balance = b;
}
last_balance = Instant::now();
if *balance < lamports * 2 {
info!(
"Balance {} is less than needed: {}, doing aidrop...",
balance, lamports
);
if !airdrop_lamports(
&client,
&faucet_addr,
payer_keypairs[i],
lamports * 100_000,
) {
warn!("failed airdrop, exiting");
return;
}
}
}
}
// Create accounts
let sigs_len = executor.num_outstanding();
if sigs_len < batch_size {
let num_to_create = batch_size - sigs_len;
if num_to_create >= payer_keypairs.len() {
info!("creating {} new", num_to_create);
let chunk_size = num_to_create / payer_keypairs.len();
if chunk_size > 0 {
for (i, keypair) in payer_keypairs.iter().enumerate() {
let txs: Vec<_> = (0..chunk_size)
.into_par_iter()
.map(|_| {
let message = make_create_message(
keypair,
&base_keypair,
seed_tracker.max_created.clone(),
num_instructions,
min_balance,
maybe_space,
mint,
);
let signers: Vec<&Keypair> = vec![keypair, &base_keypair];
Transaction::new(&signers, message, recent_blockhash.0)
})
.collect();
balances[i] = balances[i].saturating_sub(lamports * txs.len() as u64);
info!("txs: {}", txs.len());
let new_ids = executor.push_transactions(txs);
info!("ids: {}", new_ids.len());
tx_sent_count += new_ids.len();
total_accounts_created += num_instructions * new_ids.len();
}
}
}
if close_nth_batch > 0 {
let num_batches_to_close =
total_accounts_created as u64 / (close_nth_batch * batch_size as u64);
let expected_closed = num_batches_to_close * batch_size as u64;
let max_closed_seed = seed_tracker.max_closed.load(Ordering::Relaxed);
// Close every account we've created with seed between max_closed_seed..expected_closed
if max_closed_seed < expected_closed {
let txs: Vec<_> = (0..expected_closed - max_closed_seed)
.into_par_iter()
.map(|_| {
let message = make_close_message(
payer_keypairs[0],
&base_keypair,
seed_tracker.max_closed.clone(),
1,
min_balance,
mint.is_some(),
);
let signers: Vec<&Keypair> = vec![payer_keypairs[0], &base_keypair];
Transaction::new(&signers, message, recent_blockhash.0)
})
.collect();
balances[0] = balances[0].saturating_sub(fee * txs.len() as u64);
info!("close txs: {}", txs.len());
let new_ids = executor.push_transactions(txs);
info!("close ids: {}", new_ids.len());
tx_sent_count += new_ids.len();
total_accounts_closed += new_ids.len() as u64;
}
}
} else {
let _ = executor.drain_cleared();
}
count += 1;
if last_log.elapsed().as_millis() > 3000 {
info!(
"total_accounts_created: {} total_accounts_closed: {} tx_sent_count: {} loop_count: {} balance(s): {:?}",
total_accounts_created, total_accounts_closed, tx_sent_count, count, balances
);
last_log = Instant::now();
}
if iterations != 0 && count >= iterations {
break;
}
if executor.num_outstanding() >= batch_size {
sleep(Duration::from_millis(500));
}
}
executor.close();
}
fn main() {
solana_logger::setup_with_default("solana=info");
let matches = App::new(crate_name!())
.about(crate_description!())
.version(solana_version::version!())
.arg(
Arg::with_name("entrypoint")
.long("entrypoint")
.takes_value(true)
.value_name("HOST:PORT")
.help("RPC entrypoint address. Usually <ip>:8899"),
)
.arg(
Arg::with_name("faucet_addr")
.long("faucet")
.takes_value(true)
.value_name("HOST:PORT")
.help("Faucet entrypoint address. Usually <ip>:9900"),
)
.arg(
Arg::with_name("space")
.long("space")
.takes_value(true)
.value_name("BYTES")
.help("Size of accounts to create"),
)
.arg(
Arg::with_name("lamports")
.long("lamports")
.takes_value(true)
.value_name("LAMPORTS")
.help("How many lamports to fund each account"),
)
.arg(
Arg::with_name("identity")
.long("identity")
.takes_value(true)
.multiple(true)
.value_name("FILE")
.help("keypair file"),
)
.arg(
Arg::with_name("batch_size")
.long("batch-size")
.takes_value(true)
.value_name("BYTES")
.help("Number of transactions to send per batch"),
)
.arg(
Arg::with_name("close_nth_batch")
.long("close-frequency")
.takes_value(true)
.value_name("BYTES")
.help(
"Every `n` batches, create a batch of close transactions for
the earliest remaining batch of accounts created.
Note: Should be > 1 to avoid situations where the close \
transactions will be submitted before the corresponding \
create transactions have been confirmed",
),
)
.arg(
Arg::with_name("num_instructions")
.long("num-instructions")
.takes_value(true)
.value_name("NUM")
.help("Number of accounts to create on each transaction"),
)
.arg(
Arg::with_name("iterations")
.long("iterations")
.takes_value(true)
.value_name("NUM")
.help("Number of iterations to make"),
)
.arg(
Arg::with_name("check_gossip")
.long("check-gossip")
.help("Just use entrypoint address directly"),
)
.arg(
Arg::with_name("mint")
.long("mint")
.takes_value(true)
.help("Mint address to initialize account"),
)
.get_matches();
let skip_gossip = !matches.is_present("check_gossip");
let port = if skip_gossip { DEFAULT_RPC_PORT } else { 8001 };
let mut entrypoint_addr = SocketAddr::from(([127, 0, 0, 1], port));
if let Some(addr) = matches.value_of("entrypoint") {
entrypoint_addr = solana_net_utils::parse_host_port(addr).unwrap_or_else(|e| {
eprintln!("failed to parse entrypoint address: {}", e);
exit(1)
});
}
let mut faucet_addr = SocketAddr::from(([127, 0, 0, 1], FAUCET_PORT));
if let Some(addr) = matches.value_of("faucet_addr") {
faucet_addr = solana_net_utils::parse_host_port(addr).unwrap_or_else(|e| {
eprintln!("failed to parse entrypoint address: {}", e);
exit(1)
});
}
let space = value_t!(matches, "space", u64).ok();
let lamports = value_t!(matches, "lamports", u64).ok();
let batch_size = value_t!(matches, "batch_size", usize).unwrap_or(4);
let close_nth_batch = value_t!(matches, "close_nth_batch", u64).unwrap_or(0);
let iterations = value_t!(matches, "iterations", usize).unwrap_or(10);
let num_instructions = value_t!(matches, "num_instructions", usize).unwrap_or(1);
if num_instructions == 0 || num_instructions > 500 {
eprintln!("bad num_instructions: {}", num_instructions);
exit(1);
}
let mint = pubkey_of(&matches, "mint");
let payer_keypairs: Vec<_> = values_t_or_exit!(matches, "identity", String)
.iter()
.map(|keypair_string| {
read_keypair_file(keypair_string)
.unwrap_or_else(|_| panic!("bad keypair {:?}", keypair_string))
})
.collect();
let mut payer_keypair_refs: Vec<&Keypair> = vec![];
for keypair in payer_keypairs.iter() {
payer_keypair_refs.push(keypair);
}
let rpc_addr = if !skip_gossip {
info!("Finding cluster entry: {:?}", entrypoint_addr);
let (gossip_nodes, _validators) = discover(
None, // keypair
Some(&entrypoint_addr),
None, // num_nodes
Duration::from_secs(60), // timeout
None, // find_node_by_pubkey
Some(&entrypoint_addr), // find_node_by_gossip_addr
None, // my_gossip_addr
0, // my_shred_version
SocketAddrSpace::Unspecified,
)
.unwrap_or_else(|err| {
eprintln!("Failed to discover {} node: {:?}", entrypoint_addr, err);
exit(1);
});
info!("done found {} nodes", gossip_nodes.len());
gossip_nodes[0].rpc
} else {
info!("Using {:?} as the RPC address", entrypoint_addr);
entrypoint_addr
};
run_accounts_bench(
rpc_addr,
faucet_addr,
&payer_keypair_refs,
iterations,
space,
batch_size,
close_nth_batch,
lamports,
num_instructions,
mint,
);
}
#[cfg(test)]
pub mod test {
use {
super::*,
solana_core::validator::ValidatorConfig,
solana_local_cluster::{
local_cluster::{ClusterConfig, LocalCluster},
validator_configs::make_identical_validator_configs,
},
solana_sdk::poh_config::PohConfig,
};
#[test]
fn test_accounts_cluster_bench() {
solana_logger::setup();
let validator_config = ValidatorConfig::default();
let num_nodes = 1;
let mut config = ClusterConfig {
cluster_lamports: 10_000_000,
poh_config: PohConfig::new_sleep(Duration::from_millis(50)),
node_stakes: vec![100; num_nodes],
validator_configs: make_identical_validator_configs(&validator_config, num_nodes),
..ClusterConfig::default()
};
let faucet_addr = SocketAddr::from(([127, 0, 0, 1], 9900));
let cluster = LocalCluster::new(&mut config, SocketAddrSpace::Unspecified);
let iterations = 10;
let maybe_space = None;
let batch_size = 100;
let close_nth_batch = 100;
let maybe_lamports = None;
let num_instructions = 2;
let mut start = Measure::start("total accounts run");
run_accounts_bench(
cluster.entry_point_info.rpc,
faucet_addr,
&[&cluster.funding_keypair],
iterations,
maybe_space,
batch_size,
close_nth_batch,
maybe_lamports,
num_instructions,
None,
);
start.stop();
info!("{}", start);
}
}

View File

@ -1,22 +1,17 @@
[package]
name = "solana-noop-program"
version = "1.5.0"
description = "Solana Noop program"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-accountsdb-plugin-interface"
description = "The Solana AccountsDb plugin interface."
version = "1.8.12"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
edition = "2018"
documentation = "https://docs.rs/solana-accountsdb-plugin-interface"
[dependencies]
log = "0.4.11"
solana-logger = { path = "../../logger", version = "1.5.0" }
solana-sdk = { path = "../../sdk", version = "1.5.0" }
[lib]
crate-type = ["lib", "cdylib"]
name = "solana_noop_program"
thiserror = "1.0.29"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -0,0 +1,20 @@
<p align="center">
<a href="https://solana.com">
<img alt="Solana" src="https://i.imgur.com/IKyzQ6T.png" width="250" />
</a>
</p>
# Solana AccountsDb Plugin Interface
This crate enables an AccountsDb plugin to be plugged into the Solana Validator runtime to take actions
at the time of each account update; for example, saving the account state to an external database. The plugin must implement the `AccountsDbPlugin` trait. Please see the detail of the `accountsdb_plugin_interface.rs` for the interface definition.
The plugin should produce a `cdylib` dynamic library, which must expose a `C` function `_create_plugin()` that
instantiates the implementation of the interface.
The `solana-accountsdb-plugin-postgres` crate provides an example of how to create a plugin which saves the accounts data into an
external PostgreSQL databases.
More information about Solana is available in the [Solana documentation](https://docs.solana.com/).
Still have questions? Ask us on [Discord](https://discordapp.com/invite/pquxPsq)

View File

@ -0,0 +1,143 @@
/// The interface for AccountsDb plugins. A plugin must implement
/// the AccountsDbPlugin trait to work with the runtime.
/// In addition, the dynamic library must export a "C" function _create_plugin which
/// creates the implementation of the plugin.
use {
std::{any::Any, error, io},
thiserror::Error,
};
impl Eq for ReplicaAccountInfo<'_> {}
#[derive(Clone, PartialEq, Debug)]
/// Information about an account being updated
pub struct ReplicaAccountInfo<'a> {
/// The Pubkey for the account
pub pubkey: &'a [u8],
/// The lamports for the account
pub lamports: u64,
/// The Pubkey of the owner program account
pub owner: &'a [u8],
/// This account's data contains a loaded program (and is now read-only)
pub executable: bool,
/// The epoch at which this account will next owe rent
pub rent_epoch: u64,
/// The data held in this account.
pub data: &'a [u8],
/// A global monotonically increasing atomic number, which can be used
/// to tell the order of the account update. For example, when an
/// account is updated in the same slot multiple times, the update
/// with higher write_version should supersede the one with lower
/// write_version.
pub write_version: u64,
}
/// A wrapper to future-proof ReplicaAccountInfo handling.
/// If there were a change to the structure of ReplicaAccountInfo,
/// there would be new enum entry for the newer version, forcing
/// plugin implementations to handle the change.
pub enum ReplicaAccountInfoVersions<'a> {
V0_0_1(&'a ReplicaAccountInfo<'a>),
}
/// Errors returned by plugin calls
#[derive(Error, Debug)]
pub enum AccountsDbPluginError {
/// Error opening the configuration file; for example, when the file
/// is not found or when the validator process has no permission to read it.
#[error("Error opening config file. Error detail: ({0}).")]
ConfigFileOpenError(#[from] io::Error),
/// Error in reading the content of the config file or the content
/// is not in the expected format.
#[error("Error reading config file. Error message: ({msg})")]
ConfigFileReadError { msg: String },
/// Error when updating the account.
#[error("Error updating account. Error message: ({msg})")]
AccountsUpdateError { msg: String },
/// Error when updating the slot status
#[error("Error updating slot status. Error message: ({msg})")]
SlotStatusUpdateError { msg: String },
/// Any custom error defined by the plugin.
#[error("Plugin-defined custom error. Error message: ({0})")]
Custom(Box<dyn error::Error + Send + Sync>),
}
/// The current status of a slot
#[derive(Debug, Clone)]
pub enum SlotStatus {
/// The highest slot of the heaviest fork processed by the node. Ledger state at this slot is
/// not derived from a confirmed or finalized block, but if multiple forks are present, is from
/// the fork the validator believes is most likely to finalize.
Processed,
/// The highest slot having reached max vote lockout.
Rooted,
/// The highest slot that has been voted on by supermajority of the cluster, ie. is confirmed.
Confirmed,
}
impl SlotStatus {
pub fn as_str(&self) -> &'static str {
match self {
SlotStatus::Confirmed => "confirmed",
SlotStatus::Processed => "processed",
SlotStatus::Rooted => "rooted",
}
}
}
pub type Result<T> = std::result::Result<T, AccountsDbPluginError>;
/// Defines an AccountsDb plugin, to stream data from the runtime.
/// AccountsDb plugins must describe desired behavior for load and unload,
/// as well as how they will handle streamed data.
pub trait AccountsDbPlugin: Any + Send + Sync + std::fmt::Debug {
fn name(&self) -> &'static str;
/// The callback called when a plugin is loaded by the system,
/// used for doing whatever initialization is required by the plugin.
/// The _config_file contains the name of the
/// of the config file. The config must be in JSON format and
/// include a field "libpath" indicating the full path
/// name of the shared library implementing this interface.
fn on_load(&mut self, _config_file: &str) -> Result<()> {
Ok(())
}
/// The callback called right before a plugin is unloaded by the system
/// Used for doing cleanup before unload.
fn on_unload(&mut self) {}
/// Called when an account is updated at a slot.
/// When `is_startup` is true, it indicates the account is loaded from
/// snapshots when the validator starts up. When `is_startup` is false,
/// the account is updated during transaction processing.
fn update_account(
&mut self,
account: ReplicaAccountInfoVersions,
slot: u64,
is_startup: bool,
) -> Result<()>;
/// Called when all accounts are notified of during startup.
fn notify_end_of_startup(&mut self) -> Result<()>;
/// Called when a slot status is updated
fn update_slot_status(
&mut self,
slot: u64,
parent: Option<u64>,
status: SlotStatus,
) -> Result<()>;
}

View File

@ -0,0 +1 @@
pub mod accountsdb_plugin_interface;

View File

@ -0,0 +1,30 @@
[package]
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-accountsdb-plugin-manager"
description = "The Solana AccountsDb plugin manager."
version = "1.8.12"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
documentation = "https://docs.rs/solana-validator"
[dependencies]
bs58 = "0.4.0"
crossbeam-channel = "0.4"
libloading = "0.7.0"
log = "0.4.11"
serde = "1.0.130"
serde_derive = "1.0.103"
serde_json = "1.0.67"
solana-accountsdb-plugin-interface = { path = "../accountsdb-plugin-interface", version = "=1.8.12" }
solana-logger = { path = "../logger", version = "=1.8.12" }
solana-measure = { path = "../measure", version = "=1.8.12" }
solana-metrics = { path = "../metrics", version = "=1.8.12" }
solana-rpc = { path = "../rpc", version = "=1.8.12" }
solana-runtime = { path = "../runtime", version = "=1.8.12" }
solana-sdk = { path = "../sdk", version = "=1.8.12" }
thiserror = "1.0.21"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -0,0 +1,227 @@
/// Module responsible for notifying plugins of account updates
use {
crate::accountsdb_plugin_manager::AccountsDbPluginManager,
log::*,
solana_accountsdb_plugin_interface::accountsdb_plugin_interface::{
ReplicaAccountInfo, ReplicaAccountInfoVersions, SlotStatus,
},
solana_measure::measure::Measure,
solana_metrics::*,
solana_runtime::{
accounts_update_notifier_interface::AccountsUpdateNotifierInterface,
append_vec::{StoredAccountMeta, StoredMeta},
},
solana_sdk::{
account::{AccountSharedData, ReadableAccount},
clock::Slot,
},
std::sync::{Arc, RwLock},
};
#[derive(Debug)]
pub(crate) struct AccountsUpdateNotifierImpl {
plugin_manager: Arc<RwLock<AccountsDbPluginManager>>,
}
impl AccountsUpdateNotifierInterface for AccountsUpdateNotifierImpl {
fn notify_account_update(&self, slot: Slot, meta: &StoredMeta, account: &AccountSharedData) {
if let Some(account_info) = self.accountinfo_from_shared_account_data(meta, account) {
self.notify_plugins_of_account_update(account_info, slot, false);
}
}
fn notify_account_restore_from_snapshot(&self, slot: Slot, account: &StoredAccountMeta) {
let mut measure_all = Measure::start("accountsdb-plugin-notify-account-restore-all");
let mut measure_copy = Measure::start("accountsdb-plugin-copy-stored-account-info");
let account = self.accountinfo_from_stored_account_meta(account);
measure_copy.stop();
inc_new_counter_debug!(
"accountsdb-plugin-copy-stored-account-info-us",
measure_copy.as_us() as usize,
100000,
100000
);
if let Some(account_info) = account {
self.notify_plugins_of_account_update(account_info, slot, true);
}
measure_all.stop();
inc_new_counter_debug!(
"accountsdb-plugin-notify-account-restore-all-us",
measure_all.as_us() as usize,
100000,
100000
);
}
fn notify_end_of_restore_from_snapshot(&self) {
let mut plugin_manager = self.plugin_manager.write().unwrap();
if plugin_manager.plugins.is_empty() {
return;
}
for plugin in plugin_manager.plugins.iter_mut() {
let mut measure = Measure::start("accountsdb-plugin-end-of-restore-from-snapshot");
match plugin.notify_end_of_startup() {
Err(err) => {
error!(
"Failed to notify the end of restore from snapshot, error: {} to plugin {}",
err,
plugin.name()
)
}
Ok(_) => {
trace!(
"Successfully notified the end of restore from snapshot to plugin {}",
plugin.name()
);
}
}
measure.stop();
inc_new_counter_debug!(
"accountsdb-plugin-end-of-restore-from-snapshot",
measure.as_us() as usize
);
}
}
fn notify_slot_confirmed(&self, slot: Slot, parent: Option<Slot>) {
self.notify_slot_status(slot, parent, SlotStatus::Confirmed);
}
fn notify_slot_processed(&self, slot: Slot, parent: Option<Slot>) {
self.notify_slot_status(slot, parent, SlotStatus::Processed);
}
fn notify_slot_rooted(&self, slot: Slot, parent: Option<Slot>) {
self.notify_slot_status(slot, parent, SlotStatus::Rooted);
}
}
impl AccountsUpdateNotifierImpl {
pub fn new(plugin_manager: Arc<RwLock<AccountsDbPluginManager>>) -> Self {
AccountsUpdateNotifierImpl { plugin_manager }
}
fn accountinfo_from_shared_account_data<'a>(
&self,
meta: &'a StoredMeta,
account: &'a AccountSharedData,
) -> Option<ReplicaAccountInfo<'a>> {
Some(ReplicaAccountInfo {
pubkey: meta.pubkey.as_ref(),
lamports: account.lamports(),
owner: account.owner().as_ref(),
executable: account.executable(),
rent_epoch: account.rent_epoch(),
data: account.data(),
write_version: meta.write_version,
})
}
fn accountinfo_from_stored_account_meta<'a>(
&self,
stored_account_meta: &'a StoredAccountMeta,
) -> Option<ReplicaAccountInfo<'a>> {
Some(ReplicaAccountInfo {
pubkey: stored_account_meta.meta.pubkey.as_ref(),
lamports: stored_account_meta.account_meta.lamports,
owner: stored_account_meta.account_meta.owner.as_ref(),
executable: stored_account_meta.account_meta.executable,
rent_epoch: stored_account_meta.account_meta.rent_epoch,
data: stored_account_meta.data,
write_version: stored_account_meta.meta.write_version,
})
}
fn notify_plugins_of_account_update(
&self,
account: ReplicaAccountInfo,
slot: Slot,
is_startup: bool,
) {
let mut measure2 = Measure::start("accountsdb-plugin-notify_plugins_of_account_update");
let mut plugin_manager = self.plugin_manager.write().unwrap();
if plugin_manager.plugins.is_empty() {
return;
}
for plugin in plugin_manager.plugins.iter_mut() {
let mut measure = Measure::start("accountsdb-plugin-update-account");
match plugin.update_account(
ReplicaAccountInfoVersions::V0_0_1(&account),
slot,
is_startup,
) {
Err(err) => {
error!(
"Failed to update account {} at slot {}, error: {} to plugin {}",
bs58::encode(account.pubkey).into_string(),
slot,
err,
plugin.name()
)
}
Ok(_) => {
trace!(
"Successfully updated account {} at slot {} to plugin {}",
bs58::encode(account.pubkey).into_string(),
slot,
plugin.name()
);
}
}
measure.stop();
inc_new_counter_debug!(
"accountsdb-plugin-update-account-us",
measure.as_us() as usize,
100000,
100000
);
}
measure2.stop();
inc_new_counter_debug!(
"accountsdb-plugin-notify_plugins_of_account_update-us",
measure2.as_us() as usize,
100000,
100000
);
}
pub fn notify_slot_status(&self, slot: Slot, parent: Option<Slot>, slot_status: SlotStatus) {
let mut plugin_manager = self.plugin_manager.write().unwrap();
if plugin_manager.plugins.is_empty() {
return;
}
for plugin in plugin_manager.plugins.iter_mut() {
let mut measure = Measure::start("accountsdb-plugin-update-slot");
match plugin.update_slot_status(slot, parent, slot_status.clone()) {
Err(err) => {
error!(
"Failed to update slot status at slot {}, error: {} to plugin {}",
slot,
err,
plugin.name()
)
}
Ok(_) => {
trace!(
"Successfully updated slot status at slot {} to plugin {}",
slot,
plugin.name()
);
}
}
measure.stop();
inc_new_counter_debug!(
"accountsdb-plugin-update-slot-us",
measure.as_us() as usize,
1000,
1000
);
}
}
}

View File

@ -0,0 +1,55 @@
/// Managing the AccountsDb plugins
use {
libloading::{Library, Symbol},
log::*,
solana_accountsdb_plugin_interface::accountsdb_plugin_interface::AccountsDbPlugin,
std::error::Error,
};
#[derive(Default, Debug)]
pub struct AccountsDbPluginManager {
pub plugins: Vec<Box<dyn AccountsDbPlugin>>,
libs: Vec<Library>,
}
impl AccountsDbPluginManager {
pub fn new() -> Self {
AccountsDbPluginManager {
plugins: Vec::default(),
libs: Vec::default(),
}
}
/// # Safety
///
/// This function loads the dynamically linked library specified in the path. The library
/// must do necessary initializations.
pub unsafe fn load_plugin(
&mut self,
libpath: &str,
config_file: &str,
) -> Result<(), Box<dyn Error>> {
type PluginConstructor = unsafe fn() -> *mut dyn AccountsDbPlugin;
let lib = Library::new(libpath)?;
let constructor: Symbol<PluginConstructor> = lib.get(b"_create_plugin")?;
let plugin_raw = constructor();
let mut plugin = Box::from_raw(plugin_raw);
plugin.on_load(config_file)?;
self.plugins.push(plugin);
self.libs.push(lib);
Ok(())
}
/// Unload all plugins and loaded plugin libraries, making sure to fire
/// their `on_plugin_unload()` methods so they can do any necessary cleanup.
pub fn unload(&mut self) {
for mut plugin in self.plugins.drain(..) {
info!("Unloading plugin for {:?}", plugin.name());
plugin.on_unload();
}
for lib in self.libs.drain(..) {
drop(lib);
}
}
}

View File

@ -0,0 +1,157 @@
use {
crate::{
accounts_update_notifier::AccountsUpdateNotifierImpl,
accountsdb_plugin_manager::AccountsDbPluginManager,
slot_status_observer::SlotStatusObserver,
},
crossbeam_channel::Receiver,
log::*,
serde_json,
solana_rpc::optimistically_confirmed_bank_tracker::BankNotification,
solana_runtime::accounts_update_notifier_interface::AccountsUpdateNotifier,
std::{
fs::File,
io::Read,
path::{Path, PathBuf},
sync::{Arc, RwLock},
thread,
},
thiserror::Error,
};
#[derive(Error, Debug)]
pub enum AccountsdbPluginServiceError {
#[error("Cannot open the the plugin config file")]
CannotOpenConfigFile(String),
#[error("Cannot read the the plugin config file")]
CannotReadConfigFile(String),
#[error("The config file is not in a valid Json format")]
InvalidConfigFileFormat(String),
#[error("Plugin library path is not specified in the config file")]
LibPathNotSet,
#[error("Invalid plugin path")]
InvalidPluginPath,
#[error("Cannot load plugin shared library")]
PluginLoadError(String),
}
/// The service managing the AccountsDb plugin workflow.
pub struct AccountsDbPluginService {
slot_status_observer: SlotStatusObserver,
plugin_manager: Arc<RwLock<AccountsDbPluginManager>>,
accounts_update_notifier: AccountsUpdateNotifier,
}
impl AccountsDbPluginService {
/// Creates and returns the AccountsDbPluginService.
/// # Arguments
/// * `confirmed_bank_receiver` - The receiver for confirmed bank notification
/// * `accountsdb_plugin_config_file` - The config file path for the plugin. The
/// config file controls the plugin responsible
/// for transporting the data to external data stores. It is defined in JSON format.
/// The `libpath` field should be pointed to the full path of the dynamic shared library
/// (.so file) to be loaded. The shared library must implement the `AccountsDbPlugin`
/// trait. And the shared library shall export a `C` function `_create_plugin` which
/// shall create the implementation of `AccountsDbPlugin` and returns to the caller.
/// The rest of the JSON fields' definition is up to to the concrete plugin implementation
/// It is usually used to configure the connection information for the external data store.
pub fn new(
confirmed_bank_receiver: Receiver<BankNotification>,
accountsdb_plugin_config_files: &[PathBuf],
) -> Result<Self, AccountsdbPluginServiceError> {
info!(
"Starting AccountsDbPluginService from config files: {:?}",
accountsdb_plugin_config_files
);
let mut plugin_manager = AccountsDbPluginManager::new();
for accountsdb_plugin_config_file in accountsdb_plugin_config_files {
Self::load_plugin(&mut plugin_manager, accountsdb_plugin_config_file)?;
}
let plugin_manager = Arc::new(RwLock::new(plugin_manager));
let accounts_update_notifier = Arc::new(RwLock::new(AccountsUpdateNotifierImpl::new(
plugin_manager.clone(),
)));
let slot_status_observer =
SlotStatusObserver::new(confirmed_bank_receiver, accounts_update_notifier.clone());
info!("Started AccountsDbPluginService");
Ok(AccountsDbPluginService {
slot_status_observer,
plugin_manager,
accounts_update_notifier,
})
}
fn load_plugin(
plugin_manager: &mut AccountsDbPluginManager,
accountsdb_plugin_config_file: &Path,
) -> Result<(), AccountsdbPluginServiceError> {
let mut file = match File::open(accountsdb_plugin_config_file) {
Ok(file) => file,
Err(err) => {
return Err(AccountsdbPluginServiceError::CannotOpenConfigFile(format!(
"Failed to open the plugin config file {:?}, error: {:?}",
accountsdb_plugin_config_file, err
)));
}
};
let mut contents = String::new();
if let Err(err) = file.read_to_string(&mut contents) {
return Err(AccountsdbPluginServiceError::CannotReadConfigFile(format!(
"Failed to read the plugin config file {:?}, error: {:?}",
accountsdb_plugin_config_file, err
)));
}
let result: serde_json::Value = match serde_json::from_str(&contents) {
Ok(value) => value,
Err(err) => {
return Err(AccountsdbPluginServiceError::InvalidConfigFileFormat(
format!(
"The config file {:?} is not in a valid Json format, error: {:?}",
accountsdb_plugin_config_file, err
),
));
}
};
let libpath = result["libpath"]
.as_str()
.ok_or(AccountsdbPluginServiceError::LibPathNotSet)?;
let config_file = accountsdb_plugin_config_file
.as_os_str()
.to_str()
.ok_or(AccountsdbPluginServiceError::InvalidPluginPath)?;
unsafe {
let result = plugin_manager.load_plugin(libpath, config_file);
if let Err(err) = result {
let msg = format!(
"Failed to load the plugin library: {:?}, error: {:?}",
libpath, err
);
return Err(AccountsdbPluginServiceError::PluginLoadError(msg));
}
}
Ok(())
}
pub fn get_accounts_update_notifier(&self) -> AccountsUpdateNotifier {
self.accounts_update_notifier.clone()
}
pub fn join(mut self) -> thread::Result<()> {
self.slot_status_observer.join()?;
self.plugin_manager.write().unwrap().unload();
Ok(())
}
}

View File

@ -0,0 +1,4 @@
pub mod accounts_update_notifier;
pub mod accountsdb_plugin_manager;
pub mod accountsdb_plugin_service;
pub mod slot_status_observer;

View File

@ -0,0 +1,80 @@
use {
crossbeam_channel::Receiver,
solana_rpc::optimistically_confirmed_bank_tracker::BankNotification,
solana_runtime::accounts_update_notifier_interface::AccountsUpdateNotifier,
std::{
sync::{
atomic::{AtomicBool, Ordering},
Arc,
},
thread::{self, Builder, JoinHandle},
},
};
#[derive(Debug)]
pub(crate) struct SlotStatusObserver {
bank_notification_receiver_service: Option<JoinHandle<()>>,
exit_updated_slot_server: Arc<AtomicBool>,
}
impl SlotStatusObserver {
pub fn new(
bank_notification_receiver: Receiver<BankNotification>,
accounts_update_notifier: AccountsUpdateNotifier,
) -> Self {
let exit_updated_slot_server = Arc::new(AtomicBool::new(false));
Self {
bank_notification_receiver_service: Some(Self::run_bank_notification_receiver(
bank_notification_receiver,
exit_updated_slot_server.clone(),
accounts_update_notifier,
)),
exit_updated_slot_server,
}
}
pub fn join(&mut self) -> thread::Result<()> {
self.exit_updated_slot_server.store(true, Ordering::Relaxed);
self.bank_notification_receiver_service
.take()
.map(JoinHandle::join)
.unwrap()
}
fn run_bank_notification_receiver(
bank_notification_receiver: Receiver<BankNotification>,
exit: Arc<AtomicBool>,
accounts_update_notifier: AccountsUpdateNotifier,
) -> JoinHandle<()> {
Builder::new()
.name("bank_notification_receiver".to_string())
.spawn(move || {
while !exit.load(Ordering::Relaxed) {
if let Ok(slot) = bank_notification_receiver.recv() {
match slot {
BankNotification::OptimisticallyConfirmed(slot) => {
accounts_update_notifier
.read()
.unwrap()
.notify_slot_confirmed(slot, None);
}
BankNotification::Frozen(bank) => {
accounts_update_notifier
.read()
.unwrap()
.notify_slot_processed(bank.slot(), Some(bank.parent_slot()));
}
BankNotification::Root(bank) => {
accounts_update_notifier
.read()
.unwrap()
.notify_slot_rooted(bank.slot(), Some(bank.parent_slot()));
}
}
}
}
})
.unwrap()
}
}

View File

@ -0,0 +1,33 @@
[package]
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-accountsdb-plugin-postgres"
description = "The Solana AccountsDb plugin for PostgreSQL database."
version = "1.8.12"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
documentation = "https://docs.rs/solana-validator"
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
bs58 = "0.4.0"
chrono = { version = "0.4.11", features = ["serde"] }
crossbeam-channel = "0.5"
log = "0.4.14"
postgres = { version = "0.19.1", features = ["with-chrono-0_4"] }
serde = "1.0.130"
serde_derive = "1.0.103"
serde_json = "1.0.67"
solana-accountsdb-plugin-interface = { path = "../accountsdb-plugin-interface", version = "=1.8.12" }
solana-logger = { path = "../logger", version = "=1.8.12" }
solana-measure = { path = "../measure", version = "=1.8.12" }
solana-metrics = { path = "../metrics", version = "=1.8.12" }
solana-sdk = { path = "../sdk", version = "=1.8.12" }
thiserror = "1.0.21"
tokio-postgres = "0.7.3"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -0,0 +1,5 @@
This is an example implementing the AccountsDb plugin for PostgreSQL database.
Please see the `src/accountsdb_plugin_postgres.rs` for the format of the plugin's configuration file.
To create the schema objects for the database, please use `scripts/create_schema.sql`.
`scripts/drop_schema.sql` can be used to tear down the schema objects.

View File

@ -0,0 +1,54 @@
/**
* This plugin implementation for PostgreSQL requires the following tables
*/
-- The table storing accounts
CREATE TABLE account (
pubkey BYTEA PRIMARY KEY,
owner BYTEA,
lamports BIGINT NOT NULL,
slot BIGINT NOT NULL,
executable BOOL NOT NULL,
rent_epoch BIGINT NOT NULL,
data BYTEA,
write_version BIGINT NOT NULL,
updated_on TIMESTAMP NOT NULL
);
-- The table storing slot information
CREATE TABLE slot (
slot BIGINT PRIMARY KEY,
parent BIGINT,
status varchar(16) NOT NULL,
updated_on TIMESTAMP NOT NULL
);
/**
* The following is for keeping historical data for accounts and is not required for plugin to work.
*/
-- The table storing historical data for accounts
CREATE TABLE account_audit (
pubkey BYTEA,
owner BYTEA,
lamports BIGINT NOT NULL,
slot BIGINT NOT NULL,
executable BOOL NOT NULL,
rent_epoch BIGINT NOT NULL,
data BYTEA,
write_version BIGINT NOT NULL,
updated_on TIMESTAMP NOT NULL
);
CREATE FUNCTION audit_account_update() RETURNS trigger AS $audit_account_update$
BEGIN
INSERT INTO account_audit (pubkey, owner, lamports, slot, executable, rent_epoch, data, write_version, updated_on)
VALUES (OLD.pubkey, OLD.owner, OLD.lamports, OLD.slot,
OLD.executable, OLD.rent_epoch, OLD.data, OLD.write_version, OLD.updated_on);
RETURN NEW;
END;
$audit_account_update$ LANGUAGE plpgsql;
CREATE TRIGGER account_update_trigger AFTER UPDATE OR DELETE ON account
FOR EACH ROW EXECUTE PROCEDURE audit_account_update();

View File

@ -0,0 +1,9 @@
/**
* Script for cleaning up the schema for PostgreSQL used for the AccountsDb plugin.
*/
DROP TRIGGER account_update_trigger ON account;
DROP FUNCTION audit_account_update;
DROP TABLE account_audit;
DROP TABLE account;
DROP TABLE slot;

View File

@ -0,0 +1,802 @@
# This a reference configuration file for the PostgreSQL database version 14.
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The "=" is optional.) Whitespace may be used. Comments are introduced with
# "#" anywhere on a line. The complete list of parameter names and allowed
# values can be found in the PostgreSQL documentation.
#
# The commented-out settings shown in this file represent the default values.
# Re-commenting a setting is NOT sufficient to revert it to the default value;
# you need to reload the server.
#
# This file is read on server startup and when the server receives a SIGHUP
# signal. If you edit the file on a running system, you have to SIGHUP the
# server for the changes to take effect, run "pg_ctl reload", or execute
# "SELECT pg_reload_conf()". Some parameters, which are marked below,
# require a server shutdown and restart to take effect.
#
# Any parameter can also be given as a command-line option to the server, e.g.,
# "postgres -c log_connections=on". Some parameters can be changed at run time
# with the "SET" SQL command.
#
# Memory units: B = bytes Time units: us = microseconds
# kB = kilobytes ms = milliseconds
# MB = megabytes s = seconds
# GB = gigabytes min = minutes
# TB = terabytes h = hours
# d = days
#------------------------------------------------------------------------------
# FILE LOCATIONS
#------------------------------------------------------------------------------
# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.
data_directory = '/var/lib/postgresql/14/main' # use data in another directory
# (change requires restart)
hba_file = '/etc/postgresql/14/main/pg_hba.conf' # host-based authentication file
# (change requires restart)
ident_file = '/etc/postgresql/14/main/pg_ident.conf' # ident configuration file
# (change requires restart)
# If external_pid_file is not explicitly set, no extra PID file is written.
external_pid_file = '/var/run/postgresql/14-main.pid' # write an extra PID file
# (change requires restart)
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------
# - Connection Settings -
#listen_addresses = 'localhost' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
listen_addresses = '*'
port = 5433 # (change requires restart)
max_connections = 200 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
# (change requires restart)
#unix_socket_group = '' # (change requires restart)
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
# (change requires restart)
#bonjour = off # advertise server via Bonjour
# (change requires restart)
#bonjour_name = '' # defaults to the computer name
# (change requires restart)
# - TCP settings -
# see "man tcp" for details
#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
# 0 selects the system default
#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
# 0 selects the system default
#tcp_keepalives_count = 0 # TCP_KEEPCNT;
# 0 selects the system default
#tcp_user_timeout = 0 # TCP_USER_TIMEOUT, in milliseconds;
# 0 selects the system default
#client_connection_check_interval = 0 # time between checks for client
# disconnection while running queries;
# 0 for never
# - Authentication -
#authentication_timeout = 1min # 1s-600s
#password_encryption = scram-sha-256 # scram-sha-256 or md5
#db_user_namespace = off
# GSSAPI using Kerberos
#krb_server_keyfile = 'FILE:${sysconfdir}/krb5.keytab'
#krb_caseins_users = off
# - SSL -
ssl = on
#ssl_ca_file = ''
ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
#ssl_crl_file = ''
#ssl_crl_dir = ''
ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'
#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers
#ssl_prefer_server_ciphers = on
#ssl_ecdh_curve = 'prime256v1'
#ssl_min_protocol_version = 'TLSv1.2'
#ssl_max_protocol_version = ''
#ssl_dh_params_file = ''
#ssl_passphrase_command = ''
#ssl_passphrase_command_supports_reload = off
#------------------------------------------------------------------------------
# RESOURCE USAGE (except WAL)
#------------------------------------------------------------------------------
# - Memory -
shared_buffers = 1GB # min 128kB
# (change requires restart)
#huge_pages = try # on, off, or try
# (change requires restart)
#huge_page_size = 0 # zero for system default
# (change requires restart)
#temp_buffers = 8MB # min 800kB
#max_prepared_transactions = 0 # zero disables the feature
# (change requires restart)
# Caution: it is not advisable to set max_prepared_transactions nonzero unless
# you actively intend to use prepared transactions.
#work_mem = 4MB # min 64kB
#hash_mem_multiplier = 1.0 # 1-1000.0 multiplier on hash table work_mem
#maintenance_work_mem = 64MB # min 1MB
#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem
#logical_decoding_work_mem = 64MB # min 64kB
#max_stack_depth = 2MB # min 100kB
#shared_memory_type = mmap # the default is the first option
# supported by the operating system:
# mmap
# sysv
# windows
# (change requires restart)
dynamic_shared_memory_type = posix # the default is the first option
# supported by the operating system:
# posix
# sysv
# windows
# mmap
# (change requires restart)
#min_dynamic_shared_memory = 0MB # (change requires restart)
# - Disk -
#temp_file_limit = -1 # limits per-process temp file space
# in kilobytes, or -1 for no limit
# - Kernel Resources -
#max_files_per_process = 1000 # min 64
# (change requires restart)
# - Cost-Based Vacuum Delay -
#vacuum_cost_delay = 0 # 0-100 milliseconds (0 disables)
#vacuum_cost_page_hit = 1 # 0-10000 credits
#vacuum_cost_page_miss = 2 # 0-10000 credits
#vacuum_cost_page_dirty = 20 # 0-10000 credits
#vacuum_cost_limit = 200 # 1-10000 credits
# - Background Writer -
#bgwriter_delay = 200ms # 10-10000ms between rounds
#bgwriter_lru_maxpages = 100 # max buffers written/round, 0 disables
#bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round
#bgwriter_flush_after = 512kB # measured in pages, 0 disables
# - Asynchronous Behavior -
#backend_flush_after = 0 # measured in pages, 0 disables
effective_io_concurrency = 1000 # 1-1000; 0 disables prefetching
#maintenance_io_concurrency = 10 # 1-1000; 0 disables prefetching
#max_worker_processes = 8 # (change requires restart)
#max_parallel_workers_per_gather = 2 # taken from max_parallel_workers
#max_parallel_maintenance_workers = 2 # taken from max_parallel_workers
#max_parallel_workers = 8 # maximum number of max_worker_processes that
# can be used in parallel operations
#parallel_leader_participation = on
#old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate
# (change requires restart)
#------------------------------------------------------------------------------
# WRITE-AHEAD LOG
#------------------------------------------------------------------------------
# - Settings -
wal_level = minimal # minimal, replica, or logical
# (change requires restart)
fsync = off # flush data to disk for crash safety
# (turning this off can cause
# unrecoverable data corruption)
synchronous_commit = off # synchronization level;
# off, local, remote_write, remote_apply, or on
#wal_sync_method = fsync # the default is the first option
# supported by the operating system:
# open_datasync
# fdatasync (default on Linux and FreeBSD)
# fsync
# fsync_writethrough
# open_sync
full_page_writes = off # recover from partial page writes
#wal_log_hints = off # also do full page writes of non-critical updates
# (change requires restart)
#wal_compression = off # enable compression of full-page writes
#wal_init_zero = on # zero-fill new WAL files
#wal_recycle = on # recycle WAL files
#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
# (change requires restart)
#wal_writer_delay = 200ms # 1-10000 milliseconds
#wal_writer_flush_after = 1MB # measured in pages, 0 disables
#wal_skip_threshold = 2MB
#commit_delay = 0 # range 0-100000, in microseconds
#commit_siblings = 5 # range 1-1000
# - Checkpoints -
#checkpoint_timeout = 5min # range 30s-1d
#checkpoint_completion_target = 0.9 # checkpoint target duration, 0.0 - 1.0
#checkpoint_flush_after = 256kB # measured in pages, 0 disables
#checkpoint_warning = 30s # 0 disables
max_wal_size = 1GB
min_wal_size = 80MB
# - Archiving -
#archive_mode = off # enables archiving; off, on, or always
# (change requires restart)
#archive_command = '' # command to use to archive a logfile segment
# placeholders: %p = path of file to archive
# %f = file name only
# e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
#archive_timeout = 0 # force a logfile segment switch after this
# number of seconds; 0 disables
# - Archive Recovery -
# These are only used in recovery mode.
#restore_command = '' # command to use to restore an archived logfile segment
# placeholders: %p = path of file to restore
# %f = file name only
# e.g. 'cp /mnt/server/archivedir/%f %p'
#archive_cleanup_command = '' # command to execute at every restartpoint
#recovery_end_command = '' # command to execute at completion of recovery
# - Recovery Target -
# Set these only when performing a targeted recovery.
#recovery_target = '' # 'immediate' to end recovery as soon as a
# consistent state is reached
# (change requires restart)
#recovery_target_name = '' # the named restore point to which recovery will proceed
# (change requires restart)
#recovery_target_time = '' # the time stamp up to which recovery will proceed
# (change requires restart)
#recovery_target_xid = '' # the transaction ID up to which recovery will proceed
# (change requires restart)
#recovery_target_lsn = '' # the WAL LSN up to which recovery will proceed
# (change requires restart)
#recovery_target_inclusive = on # Specifies whether to stop:
# just after the specified recovery target (on)
# just before the recovery target (off)
# (change requires restart)
#recovery_target_timeline = 'latest' # 'current', 'latest', or timeline ID
# (change requires restart)
#recovery_target_action = 'pause' # 'pause', 'promote', 'shutdown'
# (change requires restart)
#------------------------------------------------------------------------------
# REPLICATION
#------------------------------------------------------------------------------
# - Sending Servers -
# Set these on the primary and on any standby that will send replication data.
max_wal_senders = 0 # max number of walsender processes
# (change requires restart)
#max_replication_slots = 10 # max number of replication slots
# (change requires restart)
#wal_keep_size = 0 # in megabytes; 0 disables
#max_slot_wal_keep_size = -1 # in megabytes; -1 disables
#wal_sender_timeout = 60s # in milliseconds; 0 disables
#track_commit_timestamp = off # collect timestamp of transaction commit
# (change requires restart)
# - Primary Server -
# These settings are ignored on a standby server.
#synchronous_standby_names = '' # standby servers that provide sync rep
# method to choose sync standbys, number of sync standbys,
# and comma-separated list of application_name
# from standby(s); '*' = all
#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed
# - Standby Servers -
# These settings are ignored on a primary server.
#primary_conninfo = '' # connection string to sending server
#primary_slot_name = '' # replication slot on sending server
#promote_trigger_file = '' # file name whose presence ends recovery
#hot_standby = on # "off" disallows queries during recovery
# (change requires restart)
#max_standby_archive_delay = 30s # max delay before canceling queries
# when reading WAL from archive;
# -1 allows indefinite delay
#max_standby_streaming_delay = 30s # max delay before canceling queries
# when reading streaming WAL;
# -1 allows indefinite delay
#wal_receiver_create_temp_slot = off # create temp slot if primary_slot_name
# is not set
#wal_receiver_status_interval = 10s # send replies at least this often
# 0 disables
#hot_standby_feedback = off # send info from standby to prevent
# query conflicts
#wal_receiver_timeout = 60s # time that receiver waits for
# communication from primary
# in milliseconds; 0 disables
#wal_retrieve_retry_interval = 5s # time to wait before retrying to
# retrieve WAL after a failed attempt
#recovery_min_apply_delay = 0 # minimum delay for applying changes during recovery
# - Subscribers -
# These settings are ignored on a publisher.
#max_logical_replication_workers = 4 # taken from max_worker_processes
# (change requires restart)
#max_sync_workers_per_subscription = 2 # taken from max_logical_replication_workers
#------------------------------------------------------------------------------
# QUERY TUNING
#------------------------------------------------------------------------------
# - Planner Method Configuration -
#enable_async_append = on
#enable_bitmapscan = on
#enable_gathermerge = on
#enable_hashagg = on
#enable_hashjoin = on
#enable_incremental_sort = on
#enable_indexscan = on
#enable_indexonlyscan = on
#enable_material = on
#enable_memoize = on
#enable_mergejoin = on
#enable_nestloop = on
#enable_parallel_append = on
#enable_parallel_hash = on
#enable_partition_pruning = on
#enable_partitionwise_join = off
#enable_partitionwise_aggregate = off
#enable_seqscan = on
#enable_sort = on
#enable_tidscan = on
# - Planner Cost Constants -
#seq_page_cost = 1.0 # measured on an arbitrary scale
#random_page_cost = 4.0 # same scale as above
#cpu_tuple_cost = 0.01 # same scale as above
#cpu_index_tuple_cost = 0.005 # same scale as above
#cpu_operator_cost = 0.0025 # same scale as above
#parallel_setup_cost = 1000.0 # same scale as above
#parallel_tuple_cost = 0.1 # same scale as above
#min_parallel_table_scan_size = 8MB
#min_parallel_index_scan_size = 512kB
#effective_cache_size = 4GB
#jit_above_cost = 100000 # perform JIT compilation if available
# and query more expensive than this;
# -1 disables
#jit_inline_above_cost = 500000 # inline small functions if query is
# more expensive than this; -1 disables
#jit_optimize_above_cost = 500000 # use expensive JIT optimizations if
# query is more expensive than this;
# -1 disables
# - Genetic Query Optimizer -
#geqo = on
#geqo_threshold = 12
#geqo_effort = 5 # range 1-10
#geqo_pool_size = 0 # selects default based on effort
#geqo_generations = 0 # selects default based on effort
#geqo_selection_bias = 2.0 # range 1.5-2.0
#geqo_seed = 0.0 # range 0.0-1.0
# - Other Planner Options -
#default_statistics_target = 100 # range 1-10000
#constraint_exclusion = partition # on, off, or partition
#cursor_tuple_fraction = 0.1 # range 0.0-1.0
#from_collapse_limit = 8
#jit = on # allow JIT compilation
#join_collapse_limit = 8 # 1 disables collapsing of explicit
# JOIN clauses
#plan_cache_mode = auto # auto, force_generic_plan or
# force_custom_plan
#------------------------------------------------------------------------------
# REPORTING AND LOGGING
#------------------------------------------------------------------------------
# - Where to Log -
#log_destination = 'stderr' # Valid values are combinations of
# stderr, csvlog, syslog, and eventlog,
# depending on platform. csvlog
# requires logging_collector to be on.
# This is used when logging to stderr:
#logging_collector = off # Enable capturing of stderr and csvlog
# into log files. Required to be on for
# csvlogs.
# (change requires restart)
# These are only used if logging_collector is on:
#log_directory = 'log' # directory where log files are written,
# can be absolute or relative to PGDATA
#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
# can include strftime() escapes
#log_file_mode = 0600 # creation mode for log files,
# begin with 0 to use octal notation
#log_rotation_age = 1d # Automatic rotation of logfiles will
# happen after that time. 0 disables.
#log_rotation_size = 10MB # Automatic rotation of logfiles will
# happen after that much log output.
# 0 disables.
#log_truncate_on_rotation = off # If on, an existing log file with the
# same name as the new log file will be
# truncated rather than appended to.
# But such truncation only occurs on
# time-driven rotation, not on restarts
# or size-driven rotation. Default is
# off, meaning append to existing files
# in all cases.
# These are relevant when logging to syslog:
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'
#syslog_sequence_numbers = on
#syslog_split_messages = on
# This is only relevant when logging to eventlog (Windows):
# (change requires restart)
#event_source = 'PostgreSQL'
# - When to Log -
#log_min_messages = warning # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic
#log_min_error_statement = error # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic (effectively off)
#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
# and their durations, > 0 logs only
# statements running at least this number
# of milliseconds
#log_min_duration_sample = -1 # -1 is disabled, 0 logs a sample of statements
# and their durations, > 0 logs only a sample of
# statements running at least this number
# of milliseconds;
# sample fraction is determined by log_statement_sample_rate
#log_statement_sample_rate = 1.0 # fraction of logged statements exceeding
# log_min_duration_sample to be logged;
# 1.0 logs all such statements, 0.0 never logs
#log_transaction_sample_rate = 0.0 # fraction of transactions whose statements
# are logged regardless of their duration; 1.0 logs all
# statements from all transactions, 0.0 never logs
# - What to Log -
#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = on
#log_autovacuum_min_duration = -1 # log autovacuum activity;
# -1 disables, 0 logs all actions and
# their durations, > 0 logs only
# actions running at least this number
# of milliseconds.
#log_checkpoints = off
#log_connections = off
#log_disconnections = off
#log_duration = off
#log_error_verbosity = default # terse, default, or verbose messages
#log_hostname = off
log_line_prefix = '%m [%p] %q%u@%d ' # special values:
# %a = application name
# %u = user name
# %d = database name
# %r = remote host and port
# %h = remote host
# %b = backend type
# %p = process ID
# %P = process ID of parallel group leader
# %t = timestamp without milliseconds
# %m = timestamp with milliseconds
# %n = timestamp with milliseconds (as a Unix epoch)
# %Q = query ID (0 if none or not computed)
# %i = command tag
# %e = SQL state
# %c = session ID
# %l = session line number
# %s = session start timestamp
# %v = virtual transaction ID
# %x = transaction ID (0 if none)
# %q = stop here in non-session
# processes
# %% = '%'
# e.g. '<%u%%%d> '
#log_lock_waits = off # log lock waits >= deadlock_timeout
#log_recovery_conflict_waits = off # log standby recovery conflict waits
# >= deadlock_timeout
#log_parameter_max_length = -1 # when logging statements, limit logged
# bind-parameter values to N bytes;
# -1 means print in full, 0 disables
#log_parameter_max_length_on_error = 0 # when logging an error, limit logged
# bind-parameter values to N bytes;
# -1 means print in full, 0 disables
#log_statement = 'none' # none, ddl, mod, all
#log_replication_commands = off
#log_temp_files = -1 # log temporary files equal or larger
# than the specified size in kilobytes;
# -1 disables, 0 logs all temp files
log_timezone = 'Etc/UTC'
#------------------------------------------------------------------------------
# PROCESS TITLE
#------------------------------------------------------------------------------
cluster_name = '14/main' # added to process titles if nonempty
# (change requires restart)
#update_process_title = on
#------------------------------------------------------------------------------
# STATISTICS
#------------------------------------------------------------------------------
# - Query and Index Statistics Collector -
#track_activities = on
#track_activity_query_size = 1024 # (change requires restart)
#track_counts = on
#track_io_timing = off
#track_wal_io_timing = off
#track_functions = none # none, pl, all
stats_temp_directory = '/var/run/postgresql/14-main.pg_stat_tmp'
# - Monitoring -
#compute_query_id = auto
#log_statement_stats = off
#log_parser_stats = off
#log_planner_stats = off
#log_executor_stats = off
#------------------------------------------------------------------------------
# AUTOVACUUM
#------------------------------------------------------------------------------
#autovacuum = on # Enable autovacuum subprocess? 'on'
# requires track_counts to also be on.
#autovacuum_max_workers = 3 # max number of autovacuum subprocesses
# (change requires restart)
#autovacuum_naptime = 1min # time between autovacuum runs
#autovacuum_vacuum_threshold = 50 # min number of row updates before
# vacuum
#autovacuum_vacuum_insert_threshold = 1000 # min number of row inserts
# before vacuum; -1 disables insert
# vacuums
#autovacuum_analyze_threshold = 50 # min number of row updates before
# analyze
#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
#autovacuum_vacuum_insert_scale_factor = 0.2 # fraction of inserts over table
# size before insert vacuum
#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
# (change requires restart)
#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age
# before forced vacuum
# (change requires restart)
#autovacuum_vacuum_cost_delay = 2ms # default vacuum cost delay for
# autovacuum, in milliseconds;
# -1 means use vacuum_cost_delay
#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
# autovacuum, -1 means use
# vacuum_cost_limit
#------------------------------------------------------------------------------
# CLIENT CONNECTION DEFAULTS
#------------------------------------------------------------------------------
# - Statement Behavior -
#client_min_messages = notice # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# log
# notice
# warning
# error
#search_path = '"$user", public' # schema names
#row_security = on
#default_table_access_method = 'heap'
#default_tablespace = '' # a tablespace name, '' uses the default
#default_toast_compression = 'pglz' # 'pglz' or 'lz4'
#temp_tablespaces = '' # a list of tablespace names, '' uses
# only default tablespace
#check_function_bodies = on
#default_transaction_isolation = 'read committed'
#default_transaction_read_only = off
#default_transaction_deferrable = off
#session_replication_role = 'origin'
#statement_timeout = 0 # in milliseconds, 0 is disabled
#lock_timeout = 0 # in milliseconds, 0 is disabled
#idle_in_transaction_session_timeout = 0 # in milliseconds, 0 is disabled
#idle_session_timeout = 0 # in milliseconds, 0 is disabled
#vacuum_freeze_table_age = 150000000
#vacuum_freeze_min_age = 50000000
#vacuum_failsafe_age = 1600000000
#vacuum_multixact_freeze_table_age = 150000000
#vacuum_multixact_freeze_min_age = 5000000
#vacuum_multixact_failsafe_age = 1600000000
#bytea_output = 'hex' # hex, escape
#xmlbinary = 'base64'
#xmloption = 'content'
#gin_pending_list_limit = 4MB
# - Locale and Formatting -
datestyle = 'iso, mdy'
#intervalstyle = 'postgres'
timezone = 'Etc/UTC'
#timezone_abbreviations = 'Default' # Select the set of available time zone
# abbreviations. Currently, there are
# Default
# Australia (historical usage)
# India
# You can create your own file in
# share/timezonesets/.
#extra_float_digits = 1 # min -15, max 3; any value >0 actually
# selects precise output mode
#client_encoding = sql_ascii # actually, defaults to database
# encoding
# These settings are initialized by initdb, but they can be changed.
lc_messages = 'C.UTF-8' # locale for system error message
# strings
lc_monetary = 'C.UTF-8' # locale for monetary formatting
lc_numeric = 'C.UTF-8' # locale for number formatting
lc_time = 'C.UTF-8' # locale for time formatting
# default configuration for text search
default_text_search_config = 'pg_catalog.english'
# - Shared Library Preloading -
#local_preload_libraries = ''
#session_preload_libraries = ''
#shared_preload_libraries = '' # (change requires restart)
#jit_provider = 'llvmjit' # JIT library to use
# - Other Defaults -
#dynamic_library_path = '$libdir'
#extension_destdir = '' # prepend path when loading extensions
# and shared objects (added by Debian)
#gin_fuzzy_search_limit = 0
#------------------------------------------------------------------------------
# LOCK MANAGEMENT
#------------------------------------------------------------------------------
#deadlock_timeout = 1s
#max_locks_per_transaction = 64 # min 10
# (change requires restart)
#max_pred_locks_per_transaction = 64 # min 10
# (change requires restart)
#max_pred_locks_per_relation = -2 # negative values mean
# (max_pred_locks_per_transaction
# / -max_pred_locks_per_relation) - 1
#max_pred_locks_per_page = 2 # min 0
#------------------------------------------------------------------------------
# VERSION AND PLATFORM COMPATIBILITY
#------------------------------------------------------------------------------
# - Previous PostgreSQL Versions -
#array_nulls = on
#backslash_quote = safe_encoding # on, off, or safe_encoding
#escape_string_warning = on
#lo_compat_privileges = off
#quote_all_identifiers = off
#standard_conforming_strings = on
#synchronize_seqscans = on
# - Other Platforms and Clients -
#transform_null_equals = off
#------------------------------------------------------------------------------
# ERROR HANDLING
#------------------------------------------------------------------------------
#exit_on_error = off # terminate session on any error?
#restart_after_crash = on # reinitialize after backend crash?
#data_sync_retry = off # retry or panic on failure to fsync
# data?
# (change requires restart)
#recovery_init_sync_method = fsync # fsync, syncfs (Linux 5.8+)
#------------------------------------------------------------------------------
# CONFIG FILE INCLUDES
#------------------------------------------------------------------------------
# These options allow settings to be loaded from files other than the
# default postgresql.conf. Note that these are directives, not variable
# assignments, so they can usefully be given more than once.
include_dir = 'conf.d' # include files ending in '.conf' from
# a directory, e.g., 'conf.d'
#include_if_exists = '...' # include file only if it exists
#include = '...' # include file
#------------------------------------------------------------------------------
# CUSTOMIZED OPTIONS
#------------------------------------------------------------------------------
# Add settings for extensions here

View File

@ -0,0 +1,69 @@
use {log::*, std::collections::HashSet};
#[derive(Debug)]
pub(crate) struct AccountsSelector {
pub accounts: HashSet<Vec<u8>>,
pub owners: HashSet<Vec<u8>>,
pub select_all_accounts: bool,
}
impl AccountsSelector {
pub fn default() -> Self {
AccountsSelector {
accounts: HashSet::default(),
owners: HashSet::default(),
select_all_accounts: true,
}
}
pub fn new(accounts: &[String], owners: &[String]) -> Self {
info!(
"Creating AccountsSelector from accounts: {:?}, owners: {:?}",
accounts, owners
);
let select_all_accounts = accounts.iter().any(|key| key == "*");
if select_all_accounts {
return AccountsSelector {
accounts: HashSet::default(),
owners: HashSet::default(),
select_all_accounts,
};
}
let accounts = accounts
.iter()
.map(|key| bs58::decode(key).into_vec().unwrap())
.collect();
let owners = owners
.iter()
.map(|key| bs58::decode(key).into_vec().unwrap())
.collect();
AccountsSelector {
accounts,
owners,
select_all_accounts,
}
}
pub fn is_account_selected(&self, account: &[u8], owner: &[u8]) -> bool {
self.select_all_accounts || self.accounts.contains(account) || self.owners.contains(owner)
}
}
#[cfg(test)]
pub(crate) mod tests {
use super::*;
#[test]
fn test_create_accounts_selector() {
AccountsSelector::new(
&["9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin".to_string()],
&[],
);
AccountsSelector::new(
&[],
&["9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin".to_string()],
);
}
}

View File

@ -0,0 +1,345 @@
use solana_measure::measure::Measure;
/// Main entry for the PostgreSQL plugin
use {
crate::{
accounts_selector::AccountsSelector,
postgres_client::{ParallelPostgresClient, PostgresClientBuilder},
},
bs58,
log::*,
serde_derive::{Deserialize, Serialize},
serde_json,
solana_accountsdb_plugin_interface::accountsdb_plugin_interface::{
AccountsDbPlugin, AccountsDbPluginError, ReplicaAccountInfoVersions, Result, SlotStatus,
},
solana_metrics::*,
std::{fs::File, io::Read},
thiserror::Error,
};
#[derive(Default)]
pub struct AccountsDbPluginPostgres {
client: Option<ParallelPostgresClient>,
accounts_selector: Option<AccountsSelector>,
}
impl std::fmt::Debug for AccountsDbPluginPostgres {
fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Ok(())
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AccountsDbPluginPostgresConfig {
pub host: Option<String>,
pub user: Option<String>,
pub port: Option<u16>,
pub connection_str: Option<String>,
pub threads: Option<usize>,
pub batch_size: Option<usize>,
pub panic_on_db_errors: Option<bool>,
}
#[derive(Error, Debug)]
pub enum AccountsDbPluginPostgresError {
#[error("Error connecting to the backend data store. Error message: ({msg})")]
DataStoreConnectionError { msg: String },
#[error("Error preparing data store schema. Error message: ({msg})")]
DataSchemaError { msg: String },
#[error("Error preparing data store schema. Error message: ({msg})")]
ConfigurationError { msg: String },
}
impl AccountsDbPlugin for AccountsDbPluginPostgres {
fn name(&self) -> &'static str {
"AccountsDbPluginPostgres"
}
/// Do initialization for the PostgreSQL plugin.
///
/// # Format of the config file:
/// * The `accounts_selector` section allows the user to controls accounts selections.
/// "accounts_selector" : {
/// "accounts" : \["pubkey-1", "pubkey-2", ..., "pubkey-n"\],
/// }
/// or:
/// "accounts_selector" = {
/// "owners" : \["pubkey-1", "pubkey-2", ..., "pubkey-m"\]
/// }
/// Accounts either satisyfing the accounts condition or owners condition will be selected.
/// When only owners is specified,
/// all accounts belonging to the owners will be streamed.
/// The accounts field support wildcard to select all accounts:
/// "accounts_selector" : {
/// "accounts" : \["*"\],
/// }
/// * "host", optional, specifies the PostgreSQL server.
/// * "user", optional, specifies the PostgreSQL user.
/// * "port", optional, specifies the PostgreSQL server's port.
/// * "connection_str", optional, the custom PostgreSQL connection string.
/// Please refer to https://docs.rs/postgres/0.19.2/postgres/config/struct.Config.html for the connection configuration.
/// When `connection_str` is set, the values in "host", "user" and "port" are ignored. If `connection_str` is not given,
/// `host` and `user` must be given.
/// * "threads" optional, specifies the number of worker threads for the plugin. A thread
/// maintains a PostgreSQL connection to the server. The default is '10'.
/// * "batch_size" optional, specifies the batch size of bulk insert when the AccountsDb is created
/// from restoring a snapshot. The default is '10'.
/// * "panic_on_db_errors", optional, contols if to panic when there are errors replicating data to the
/// PostgreSQL database. The default is 'false'.
/// # Examples
///
/// {
/// "libpath": "/home/solana/target/release/libsolana_accountsdb_plugin_postgres.so",
/// "host": "host_foo",
/// "user": "solana",
/// "threads": 10,
/// "accounts_selector" : {
/// "owners" : ["9oT9R5ZyRovSVnt37QvVoBttGpNqR3J7unkb567NP8k3"]
/// }
/// }
fn on_load(&mut self, config_file: &str) -> Result<()> {
solana_logger::setup_with_default("info");
info!(
"Loading plugin {:?} from config_file {:?}",
self.name(),
config_file
);
let mut file = File::open(config_file)?;
let mut contents = String::new();
file.read_to_string(&mut contents)?;
let result: serde_json::Value = serde_json::from_str(&contents).unwrap();
self.accounts_selector = Some(Self::create_accounts_selector_from_config(&result));
let result: serde_json::Result<AccountsDbPluginPostgresConfig> =
serde_json::from_str(&contents);
match result {
Err(err) => {
return Err(AccountsDbPluginError::ConfigFileReadError {
msg: format!(
"The config file is not in the JSON format expected: {:?}",
err
),
})
}
Ok(config) => {
let client = PostgresClientBuilder::build_pararallel_postgres_client(&config)?;
self.client = Some(client);
}
}
Ok(())
}
fn on_unload(&mut self) {
info!("Unloading plugin: {:?}", self.name());
match &mut self.client {
None => {}
Some(client) => {
client.join().unwrap();
}
}
}
fn update_account(
&mut self,
account: ReplicaAccountInfoVersions,
slot: u64,
is_startup: bool,
) -> Result<()> {
let mut measure_all = Measure::start("accountsdb-plugin-postgres-update-account-main");
match account {
ReplicaAccountInfoVersions::V0_0_1(account) => {
let mut measure_select =
Measure::start("accountsdb-plugin-postgres-update-account-select");
if let Some(accounts_selector) = &self.accounts_selector {
if !accounts_selector.is_account_selected(account.pubkey, account.owner) {
return Ok(());
}
} else {
return Ok(());
}
measure_select.stop();
inc_new_counter_debug!(
"accountsdb-plugin-postgres-update-account-select-us",
measure_select.as_us() as usize,
100000,
100000
);
debug!(
"Updating account {:?} with owner {:?} at slot {:?} using account selector {:?}",
bs58::encode(account.pubkey).into_string(),
bs58::encode(account.owner).into_string(),
slot,
self.accounts_selector.as_ref().unwrap()
);
match &mut self.client {
None => {
return Err(AccountsDbPluginError::Custom(Box::new(
AccountsDbPluginPostgresError::DataStoreConnectionError {
msg: "There is no connection to the PostgreSQL database."
.to_string(),
},
)));
}
Some(client) => {
let mut measure_update =
Measure::start("accountsdb-plugin-postgres-update-account-client");
let result = { client.update_account(account, slot, is_startup) };
measure_update.stop();
inc_new_counter_debug!(
"accountsdb-plugin-postgres-update-account-client-us",
measure_update.as_us() as usize,
100000,
100000
);
if let Err(err) = result {
return Err(AccountsDbPluginError::AccountsUpdateError {
msg: format!("Failed to persist the update of account to the PostgreSQL database. Error: {:?}", err)
});
}
}
}
}
}
measure_all.stop();
inc_new_counter_debug!(
"accountsdb-plugin-postgres-update-account-main-us",
measure_all.as_us() as usize,
100000,
100000
);
Ok(())
}
fn update_slot_status(
&mut self,
slot: u64,
parent: Option<u64>,
status: SlotStatus,
) -> Result<()> {
info!("Updating slot {:?} at with status {:?}", slot, status);
match &mut self.client {
None => {
return Err(AccountsDbPluginError::Custom(Box::new(
AccountsDbPluginPostgresError::DataStoreConnectionError {
msg: "There is no connection to the PostgreSQL database.".to_string(),
},
)));
}
Some(client) => {
let result = client.update_slot_status(slot, parent, status);
if let Err(err) = result {
return Err(AccountsDbPluginError::SlotStatusUpdateError{
msg: format!("Failed to persist the update of slot to the PostgreSQL database. Error: {:?}", err)
});
}
}
}
Ok(())
}
fn notify_end_of_startup(&mut self) -> Result<()> {
info!("Notifying the end of startup for accounts notifications");
match &mut self.client {
None => {
return Err(AccountsDbPluginError::Custom(Box::new(
AccountsDbPluginPostgresError::DataStoreConnectionError {
msg: "There is no connection to the PostgreSQL database.".to_string(),
},
)));
}
Some(client) => {
let result = client.notify_end_of_startup();
if let Err(err) = result {
return Err(AccountsDbPluginError::SlotStatusUpdateError{
msg: format!("Failed to notify the end of startup for accounts notifications. Error: {:?}", err)
});
}
}
}
Ok(())
}
}
impl AccountsDbPluginPostgres {
fn create_accounts_selector_from_config(config: &serde_json::Value) -> AccountsSelector {
let accounts_selector = &config["accounts_selector"];
if accounts_selector.is_null() {
AccountsSelector::default()
} else {
let accounts = &accounts_selector["accounts"];
let accounts: Vec<String> = if accounts.is_array() {
accounts
.as_array()
.unwrap()
.iter()
.map(|val| val.as_str().unwrap().to_string())
.collect()
} else {
Vec::default()
};
let owners = &accounts_selector["owners"];
let owners: Vec<String> = if owners.is_array() {
owners
.as_array()
.unwrap()
.iter()
.map(|val| val.as_str().unwrap().to_string())
.collect()
} else {
Vec::default()
};
AccountsSelector::new(&accounts, &owners)
}
}
pub fn new() -> Self {
AccountsDbPluginPostgres {
client: None,
accounts_selector: None,
}
}
}
#[no_mangle]
#[allow(improper_ctypes_definitions)]
/// # Safety
///
/// This function returns the AccountsDbPluginPostgres pointer as trait AccountsDbPlugin.
pub unsafe extern "C" fn _create_plugin() -> *mut dyn AccountsDbPlugin {
let plugin = AccountsDbPluginPostgres::new();
let plugin: Box<dyn AccountsDbPlugin> = Box::new(plugin);
Box::into_raw(plugin)
}
#[cfg(test)]
pub(crate) mod tests {
use {super::*, serde_json};
#[test]
fn test_accounts_selector_from_config() {
let config = "{\"accounts_selector\" : { \
\"owners\" : [\"9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin\"] \
}}";
let config: serde_json::Value = serde_json::from_str(config).unwrap();
AccountsDbPluginPostgres::create_accounts_selector_from_config(&config);
}
}

View File

@ -0,0 +1,3 @@
pub mod accounts_selector;
pub mod accountsdb_plugin_postgres;
pub mod postgres_client;

View File

@ -0,0 +1,879 @@
#![allow(clippy::integer_arithmetic)]
/// A concurrent implementation for writing accounts into the PostgreSQL in parallel.
use {
crate::accountsdb_plugin_postgres::{
AccountsDbPluginPostgresConfig, AccountsDbPluginPostgresError,
},
chrono::Utc,
crossbeam_channel::{bounded, Receiver, RecvTimeoutError, Sender},
log::*,
postgres::{Client, NoTls, Statement},
solana_accountsdb_plugin_interface::accountsdb_plugin_interface::{
AccountsDbPluginError, ReplicaAccountInfo, SlotStatus,
},
solana_measure::measure::Measure,
solana_metrics::*,
solana_sdk::timing::AtomicInterval,
std::{
sync::{
atomic::{AtomicBool, AtomicUsize, Ordering},
Arc, Mutex,
},
thread::{self, sleep, Builder, JoinHandle},
time::Duration,
},
tokio_postgres::types::ToSql,
};
/// The maximum asynchronous requests allowed in the channel to avoid excessive
/// memory usage. The downside -- calls after this threshold is reached can get blocked.
const MAX_ASYNC_REQUESTS: usize = 40960;
const DEFAULT_POSTGRES_PORT: u16 = 5432;
const DEFAULT_THREADS_COUNT: usize = 100;
const DEFAULT_ACCOUNTS_INSERT_BATCH_SIZE: usize = 10;
const ACCOUNT_COLUMN_COUNT: usize = 9;
const DEFAULT_PANIC_ON_DB_ERROR: bool = false;
struct PostgresSqlClientWrapper {
client: Client,
update_account_stmt: Statement,
bulk_account_insert_stmt: Statement,
update_slot_with_parent_stmt: Statement,
update_slot_without_parent_stmt: Statement,
}
pub struct SimplePostgresClient {
batch_size: usize,
pending_account_updates: Vec<DbAccountInfo>,
client: Mutex<PostgresSqlClientWrapper>,
}
struct PostgresClientWorker {
client: SimplePostgresClient,
/// Indicating if accounts notification during startup is done.
is_startup_done: bool,
}
impl Eq for DbAccountInfo {}
#[derive(Clone, PartialEq, Debug)]
pub struct DbAccountInfo {
pub pubkey: Vec<u8>,
pub lamports: i64,
pub owner: Vec<u8>,
pub executable: bool,
pub rent_epoch: i64,
pub data: Vec<u8>,
pub slot: i64,
pub write_version: i64,
}
pub(crate) fn abort() -> ! {
#[cfg(not(test))]
{
// standard error is usually redirected to a log file, cry for help on standard output as
// well
eprintln!("Validator process aborted. The validator log may contain further details");
std::process::exit(1);
}
#[cfg(test)]
panic!("process::exit(1) is intercepted for friendly test failure...");
}
impl DbAccountInfo {
fn new<T: ReadableAccountInfo>(account: &T, slot: u64) -> DbAccountInfo {
let data = account.data().to_vec();
Self {
pubkey: account.pubkey().to_vec(),
lamports: account.lamports() as i64,
owner: account.owner().to_vec(),
executable: account.executable(),
rent_epoch: account.rent_epoch() as i64,
data,
slot: slot as i64,
write_version: account.write_version(),
}
}
}
pub trait ReadableAccountInfo: Sized {
fn pubkey(&self) -> &[u8];
fn owner(&self) -> &[u8];
fn lamports(&self) -> i64;
fn executable(&self) -> bool;
fn rent_epoch(&self) -> i64;
fn data(&self) -> &[u8];
fn write_version(&self) -> i64;
}
impl ReadableAccountInfo for DbAccountInfo {
fn pubkey(&self) -> &[u8] {
&self.pubkey
}
fn owner(&self) -> &[u8] {
&self.owner
}
fn lamports(&self) -> i64 {
self.lamports
}
fn executable(&self) -> bool {
self.executable
}
fn rent_epoch(&self) -> i64 {
self.rent_epoch
}
fn data(&self) -> &[u8] {
&self.data
}
fn write_version(&self) -> i64 {
self.write_version
}
}
impl<'a> ReadableAccountInfo for ReplicaAccountInfo<'a> {
fn pubkey(&self) -> &[u8] {
self.pubkey
}
fn owner(&self) -> &[u8] {
self.owner
}
fn lamports(&self) -> i64 {
self.lamports as i64
}
fn executable(&self) -> bool {
self.executable
}
fn rent_epoch(&self) -> i64 {
self.rent_epoch as i64
}
fn data(&self) -> &[u8] {
self.data
}
fn write_version(&self) -> i64 {
self.write_version as i64
}
}
pub trait PostgresClient {
fn join(&mut self) -> thread::Result<()> {
Ok(())
}
fn update_account(
&mut self,
account: DbAccountInfo,
is_startup: bool,
) -> Result<(), AccountsDbPluginError>;
fn update_slot_status(
&mut self,
slot: u64,
parent: Option<u64>,
status: SlotStatus,
) -> Result<(), AccountsDbPluginError>;
fn notify_end_of_startup(&mut self) -> Result<(), AccountsDbPluginError>;
}
impl SimplePostgresClient {
fn connect_to_db(
config: &AccountsDbPluginPostgresConfig,
) -> Result<Client, AccountsDbPluginError> {
let port = config.port.unwrap_or(DEFAULT_POSTGRES_PORT);
let connection_str = if let Some(connection_str) = &config.connection_str {
connection_str.clone()
} else {
if config.host.is_none() || config.user.is_none() {
let msg = format!(
"\"connection_str\": {:?}, or \"host\": {:?} \"user\": {:?} must be specified",
config.connection_str, config.host, config.user
);
return Err(AccountsDbPluginError::Custom(Box::new(
AccountsDbPluginPostgresError::ConfigurationError { msg },
)));
}
format!(
"host={} user={} port={}",
config.host.as_ref().unwrap(),
config.user.as_ref().unwrap(),
port
)
};
match Client::connect(&connection_str, NoTls) {
Err(err) => {
let msg = format!(
"Error in connecting to the PostgreSQL database: {:?} connection_str: {:?}",
err, connection_str
);
error!("{}", msg);
Err(AccountsDbPluginError::Custom(Box::new(
AccountsDbPluginPostgresError::DataStoreConnectionError { msg },
)))
}
Ok(client) => Ok(client),
}
}
fn build_bulk_account_insert_statement(
client: &mut Client,
config: &AccountsDbPluginPostgresConfig,
) -> Result<Statement, AccountsDbPluginError> {
let batch_size = config
.batch_size
.unwrap_or(DEFAULT_ACCOUNTS_INSERT_BATCH_SIZE);
let mut stmt = String::from("INSERT INTO account AS acct (pubkey, slot, owner, lamports, executable, rent_epoch, data, write_version, updated_on) VALUES");
for j in 0..batch_size {
let row = j * ACCOUNT_COLUMN_COUNT;
let val_str = format!(
"(${}, ${}, ${}, ${}, ${}, ${}, ${}, ${}, ${})",
row + 1,
row + 2,
row + 3,
row + 4,
row + 5,
row + 6,
row + 7,
row + 8,
row + 9,
);
if j == 0 {
stmt = format!("{} {}", &stmt, val_str);
} else {
stmt = format!("{}, {}", &stmt, val_str);
}
}
let handle_conflict = "ON CONFLICT (pubkey) DO UPDATE SET slot=excluded.slot, owner=excluded.owner, lamports=excluded.lamports, executable=excluded.executable, rent_epoch=excluded.rent_epoch, \
data=excluded.data, write_version=excluded.write_version, updated_on=excluded.updated_on WHERE acct.slot < excluded.slot OR (\
acct.slot = excluded.slot AND acct.write_version < excluded.write_version)";
stmt = format!("{} {}", stmt, handle_conflict);
info!("{}", stmt);
let bulk_stmt = client.prepare(&stmt);
match bulk_stmt {
Err(err) => {
return Err(AccountsDbPluginError::Custom(Box::new(AccountsDbPluginPostgresError::DataSchemaError {
msg: format!(
"Error in preparing for the accounts update PostgreSQL database: {} host: {:?} user: {:?} config: {:?}",
err, config.host, config.user, config
),
})));
}
Ok(update_account_stmt) => Ok(update_account_stmt),
}
}
fn build_single_account_upsert_statement(
client: &mut Client,
config: &AccountsDbPluginPostgresConfig,
) -> Result<Statement, AccountsDbPluginError> {
let stmt = "INSERT INTO account AS acct (pubkey, slot, owner, lamports, executable, rent_epoch, data, write_version, updated_on) \
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) \
ON CONFLICT (pubkey) DO UPDATE SET slot=excluded.slot, owner=excluded.owner, lamports=excluded.lamports, executable=excluded.executable, rent_epoch=excluded.rent_epoch, \
data=excluded.data, write_version=excluded.write_version, updated_on=excluded.updated_on WHERE acct.slot < excluded.slot OR (\
acct.slot = excluded.slot AND acct.write_version < excluded.write_version)";
let stmt = client.prepare(stmt);
match stmt {
Err(err) => {
return Err(AccountsDbPluginError::Custom(Box::new(AccountsDbPluginPostgresError::DataSchemaError {
msg: format!(
"Error in preparing for the accounts update PostgreSQL database: {} host: {:?} user: {:?} config: {:?}",
err, config.host, config.user, config
),
})));
}
Ok(update_account_stmt) => Ok(update_account_stmt),
}
}
fn build_slot_upsert_statement_with_parent(
client: &mut Client,
config: &AccountsDbPluginPostgresConfig,
) -> Result<Statement, AccountsDbPluginError> {
let stmt = "INSERT INTO slot (slot, parent, status, updated_on) \
VALUES ($1, $2, $3, $4) \
ON CONFLICT (slot) DO UPDATE SET parent=excluded.parent, status=excluded.status, updated_on=excluded.updated_on";
let stmt = client.prepare(stmt);
match stmt {
Err(err) => {
return Err(AccountsDbPluginError::Custom(Box::new(AccountsDbPluginPostgresError::DataSchemaError {
msg: format!(
"Error in preparing for the slot update PostgreSQL database: {} host: {:?} user: {:?} config: {:?}",
err, config.host, config.user, config
),
})));
}
Ok(stmt) => Ok(stmt),
}
}
fn build_slot_upsert_statement_without_parent(
client: &mut Client,
config: &AccountsDbPluginPostgresConfig,
) -> Result<Statement, AccountsDbPluginError> {
let stmt = "INSERT INTO slot (slot, status, updated_on) \
VALUES ($1, $2, $3) \
ON CONFLICT (slot) DO UPDATE SET status=excluded.status, updated_on=excluded.updated_on";
let stmt = client.prepare(stmt);
match stmt {
Err(err) => {
return Err(AccountsDbPluginError::Custom(Box::new(AccountsDbPluginPostgresError::DataSchemaError {
msg: format!(
"Error in preparing for the slot update PostgreSQL database: {} host: {:?} user: {:?} config: {:?}",
err, config.host, config.user, config
),
})));
}
Ok(stmt) => Ok(stmt),
}
}
/// Internal function for updating or inserting a single account
fn upsert_account_internal(
account: &DbAccountInfo,
statement: &Statement,
client: &mut Client,
) -> Result<(), AccountsDbPluginError> {
let lamports = account.lamports() as i64;
let rent_epoch = account.rent_epoch() as i64;
let updated_on = Utc::now().naive_utc();
let result = client.query(
statement,
&[
&account.pubkey(),
&account.slot,
&account.owner(),
&lamports,
&account.executable(),
&rent_epoch,
&account.data(),
&account.write_version(),
&updated_on,
],
);
if let Err(err) = result {
let msg = format!(
"Failed to persist the update of account to the PostgreSQL database. Error: {:?}",
err
);
error!("{}", msg);
return Err(AccountsDbPluginError::AccountsUpdateError { msg });
}
Ok(())
}
/// Update or insert a single account
fn upsert_account(&mut self, account: &DbAccountInfo) -> Result<(), AccountsDbPluginError> {
let client = self.client.get_mut().unwrap();
let statement = &client.update_account_stmt;
let client = &mut client.client;
Self::upsert_account_internal(account, statement, client)
}
/// Insert accounts in batch to reduce network overhead
fn insert_accounts_in_batch(
&mut self,
account: DbAccountInfo,
) -> Result<(), AccountsDbPluginError> {
self.pending_account_updates.push(account);
if self.pending_account_updates.len() == self.batch_size {
let mut measure = Measure::start("accountsdb-plugin-postgres-prepare-values");
let mut values: Vec<&(dyn ToSql + Sync)> =
Vec::with_capacity(self.batch_size * ACCOUNT_COLUMN_COUNT);
let updated_on = Utc::now().naive_utc();
for j in 0..self.batch_size {
let account = &self.pending_account_updates[j];
values.push(&account.pubkey);
values.push(&account.slot);
values.push(&account.owner);
values.push(&account.lamports);
values.push(&account.executable);
values.push(&account.rent_epoch);
values.push(&account.data);
values.push(&account.write_version);
values.push(&updated_on);
}
measure.stop();
inc_new_counter_debug!(
"accountsdb-plugin-postgres-prepare-values-us",
measure.as_us() as usize,
10000,
10000
);
let mut measure = Measure::start("accountsdb-plugin-postgres-update-account");
let client = self.client.get_mut().unwrap();
let result = client
.client
.query(&client.bulk_account_insert_stmt, &values);
self.pending_account_updates.clear();
if let Err(err) = result {
let msg = format!(
"Failed to persist the update of account to the PostgreSQL database. Error: {:?}",
err
);
error!("{}", msg);
return Err(AccountsDbPluginError::AccountsUpdateError { msg });
}
measure.stop();
inc_new_counter_debug!(
"accountsdb-plugin-postgres-update-account-us",
measure.as_us() as usize,
10000,
10000
);
inc_new_counter_debug!(
"accountsdb-plugin-postgres-update-account-count",
self.batch_size,
10000,
10000
);
}
Ok(())
}
/// Flush any left over accounts in batch which are not processed in the last batch
fn flush_buffered_writes(&mut self) -> Result<(), AccountsDbPluginError> {
if self.pending_account_updates.is_empty() {
return Ok(());
}
let client = self.client.get_mut().unwrap();
let statement = &client.update_account_stmt;
let client = &mut client.client;
for account in self.pending_account_updates.drain(..) {
Self::upsert_account_internal(&account, statement, client)?;
}
Ok(())
}
pub fn new(config: &AccountsDbPluginPostgresConfig) -> Result<Self, AccountsDbPluginError> {
info!("Creating SimplePostgresClient...");
let mut client = Self::connect_to_db(config)?;
let bulk_account_insert_stmt =
Self::build_bulk_account_insert_statement(&mut client, config)?;
let update_account_stmt = Self::build_single_account_upsert_statement(&mut client, config)?;
let update_slot_with_parent_stmt =
Self::build_slot_upsert_statement_with_parent(&mut client, config)?;
let update_slot_without_parent_stmt =
Self::build_slot_upsert_statement_without_parent(&mut client, config)?;
let batch_size = config
.batch_size
.unwrap_or(DEFAULT_ACCOUNTS_INSERT_BATCH_SIZE);
info!("Created SimplePostgresClient.");
Ok(Self {
batch_size,
pending_account_updates: Vec::with_capacity(batch_size),
client: Mutex::new(PostgresSqlClientWrapper {
client,
update_account_stmt,
bulk_account_insert_stmt,
update_slot_with_parent_stmt,
update_slot_without_parent_stmt,
}),
})
}
}
impl PostgresClient for SimplePostgresClient {
fn update_account(
&mut self,
account: DbAccountInfo,
is_startup: bool,
) -> Result<(), AccountsDbPluginError> {
trace!(
"Updating account {} with owner {} at slot {}",
bs58::encode(account.pubkey()).into_string(),
bs58::encode(account.owner()).into_string(),
account.slot,
);
if !is_startup {
return self.upsert_account(&account);
}
self.insert_accounts_in_batch(account)
}
fn update_slot_status(
&mut self,
slot: u64,
parent: Option<u64>,
status: SlotStatus,
) -> Result<(), AccountsDbPluginError> {
info!("Updating slot {:?} at with status {:?}", slot, status);
let slot = slot as i64; // postgres only supports i64
let parent = parent.map(|parent| parent as i64);
let updated_on = Utc::now().naive_utc();
let status_str = status.as_str();
let client = self.client.get_mut().unwrap();
let result = match parent {
Some(parent) => client.client.execute(
&client.update_slot_with_parent_stmt,
&[&slot, &parent, &status_str, &updated_on],
),
None => client.client.execute(
&client.update_slot_without_parent_stmt,
&[&slot, &status_str, &updated_on],
),
};
match result {
Err(err) => {
let msg = format!(
"Failed to persist the update of slot to the PostgreSQL database. Error: {:?}",
err
);
error!("{:?}", msg);
return Err(AccountsDbPluginError::SlotStatusUpdateError { msg });
}
Ok(rows) => {
assert_eq!(1, rows, "Expected one rows to be updated a time");
}
}
Ok(())
}
fn notify_end_of_startup(&mut self) -> Result<(), AccountsDbPluginError> {
self.flush_buffered_writes()
}
}
struct UpdateAccountRequest {
account: DbAccountInfo,
is_startup: bool,
}
struct UpdateSlotRequest {
slot: u64,
parent: Option<u64>,
slot_status: SlotStatus,
}
enum DbWorkItem {
UpdateAccount(UpdateAccountRequest),
UpdateSlot(UpdateSlotRequest),
}
impl PostgresClientWorker {
fn new(config: AccountsDbPluginPostgresConfig) -> Result<Self, AccountsDbPluginError> {
let result = SimplePostgresClient::new(&config);
match result {
Ok(client) => Ok(PostgresClientWorker {
client,
is_startup_done: false,
}),
Err(err) => {
error!("Error in creating SimplePostgresClient: {}", err);
Err(err)
}
}
}
fn do_work(
&mut self,
receiver: Receiver<DbWorkItem>,
exit_worker: Arc<AtomicBool>,
is_startup_done: Arc<AtomicBool>,
startup_done_count: Arc<AtomicUsize>,
panic_on_db_errors: bool,
) -> Result<(), AccountsDbPluginError> {
while !exit_worker.load(Ordering::Relaxed) {
let mut measure = Measure::start("accountsdb-plugin-postgres-worker-recv");
let work = receiver.recv_timeout(Duration::from_millis(500));
measure.stop();
inc_new_counter_debug!(
"accountsdb-plugin-postgres-worker-recv-us",
measure.as_us() as usize,
100000,
100000
);
match work {
Ok(work) => match work {
DbWorkItem::UpdateAccount(request) => {
if let Err(err) = self
.client
.update_account(request.account, request.is_startup)
{
error!("Failed to update account: ({})", err);
if panic_on_db_errors {
abort();
}
}
}
DbWorkItem::UpdateSlot(request) => {
if let Err(err) = self.client.update_slot_status(
request.slot,
request.parent,
request.slot_status,
) {
error!("Failed to update slot: ({})", err);
if panic_on_db_errors {
abort();
}
}
}
},
Err(err) => match err {
RecvTimeoutError::Timeout => {
if !self.is_startup_done && is_startup_done.load(Ordering::Relaxed) {
if let Err(err) = self.client.notify_end_of_startup() {
error!("Error in notifying end of startup: ({})", err);
if panic_on_db_errors {
abort();
}
}
self.is_startup_done = true;
startup_done_count.fetch_add(1, Ordering::Relaxed);
}
continue;
}
_ => {
error!("Error in receiving the item {:?}", err);
if panic_on_db_errors {
abort();
}
break;
}
},
}
}
Ok(())
}
}
pub struct ParallelPostgresClient {
workers: Vec<JoinHandle<Result<(), AccountsDbPluginError>>>,
exit_worker: Arc<AtomicBool>,
is_startup_done: Arc<AtomicBool>,
startup_done_count: Arc<AtomicUsize>,
initialized_worker_count: Arc<AtomicUsize>,
sender: Sender<DbWorkItem>,
last_report: AtomicInterval,
}
impl ParallelPostgresClient {
pub fn new(config: &AccountsDbPluginPostgresConfig) -> Result<Self, AccountsDbPluginError> {
info!("Creating ParallelPostgresClient...");
let (sender, receiver) = bounded(MAX_ASYNC_REQUESTS);
let exit_worker = Arc::new(AtomicBool::new(false));
let mut workers = Vec::default();
let is_startup_done = Arc::new(AtomicBool::new(false));
let startup_done_count = Arc::new(AtomicUsize::new(0));
let worker_count = config.threads.unwrap_or(DEFAULT_THREADS_COUNT);
let initialized_worker_count = Arc::new(AtomicUsize::new(0));
for i in 0..worker_count {
let cloned_receiver = receiver.clone();
let exit_clone = exit_worker.clone();
let is_startup_done_clone = is_startup_done.clone();
let startup_done_count_clone = startup_done_count.clone();
let initialized_worker_count_clone = initialized_worker_count.clone();
let config = config.clone();
let worker = Builder::new()
.name(format!("worker-{}", i))
.spawn(move || -> Result<(), AccountsDbPluginError> {
let panic_on_db_errors = *config
.panic_on_db_errors
.as_ref()
.unwrap_or(&DEFAULT_PANIC_ON_DB_ERROR);
let result = PostgresClientWorker::new(config);
match result {
Ok(mut worker) => {
initialized_worker_count_clone.fetch_add(1, Ordering::Relaxed);
worker.do_work(
cloned_receiver,
exit_clone,
is_startup_done_clone,
startup_done_count_clone,
panic_on_db_errors,
)?;
Ok(())
}
Err(err) => {
error!("Error when making connection to database: ({})", err);
if panic_on_db_errors {
abort();
}
Err(err)
}
}
})
.unwrap();
workers.push(worker);
}
info!("Created ParallelPostgresClient.");
Ok(Self {
last_report: AtomicInterval::default(),
workers,
exit_worker,
is_startup_done,
startup_done_count,
initialized_worker_count,
sender,
})
}
pub fn join(&mut self) -> thread::Result<()> {
self.exit_worker.store(true, Ordering::Relaxed);
while !self.workers.is_empty() {
let worker = self.workers.pop();
if worker.is_none() {
break;
}
let worker = worker.unwrap();
let result = worker.join().unwrap();
if result.is_err() {
error!("The worker thread has failed: {:?}", result);
}
}
Ok(())
}
pub fn update_account(
&mut self,
account: &ReplicaAccountInfo,
slot: u64,
is_startup: bool,
) -> Result<(), AccountsDbPluginError> {
if self.last_report.should_update(30000) {
datapoint_debug!(
"postgres-plugin-stats",
("message-queue-length", self.sender.len() as i64, i64),
);
}
let mut measure = Measure::start("accountsdb-plugin-posgres-create-work-item");
let wrk_item = DbWorkItem::UpdateAccount(UpdateAccountRequest {
account: DbAccountInfo::new(account, slot),
is_startup,
});
measure.stop();
inc_new_counter_debug!(
"accountsdb-plugin-posgres-create-work-item-us",
measure.as_us() as usize,
100000,
100000
);
let mut measure = Measure::start("accountsdb-plugin-posgres-send-msg");
if let Err(err) = self.sender.send(wrk_item) {
return Err(AccountsDbPluginError::AccountsUpdateError {
msg: format!(
"Failed to update the account {:?}, error: {:?}",
bs58::encode(account.pubkey()).into_string(),
err
),
});
}
measure.stop();
inc_new_counter_debug!(
"accountsdb-plugin-posgres-send-msg-us",
measure.as_us() as usize,
100000,
100000
);
Ok(())
}
pub fn update_slot_status(
&mut self,
slot: u64,
parent: Option<u64>,
status: SlotStatus,
) -> Result<(), AccountsDbPluginError> {
if let Err(err) = self.sender.send(DbWorkItem::UpdateSlot(UpdateSlotRequest {
slot,
parent,
slot_status: status,
})) {
return Err(AccountsDbPluginError::SlotStatusUpdateError {
msg: format!("Failed to update the slot {:?}, error: {:?}", slot, err),
});
}
Ok(())
}
pub fn notify_end_of_startup(&mut self) -> Result<(), AccountsDbPluginError> {
info!("Notifying the end of startup");
// Ensure all items in the queue has been received by the workers
while !self.sender.is_empty() {
sleep(Duration::from_millis(100));
}
self.is_startup_done.store(true, Ordering::Relaxed);
// Wait for all worker threads to be done with flushing
while self.startup_done_count.load(Ordering::Relaxed)
!= self.initialized_worker_count.load(Ordering::Relaxed)
{
info!(
"Startup done count: {}, good worker thread count: {}",
self.startup_done_count.load(Ordering::Relaxed),
self.initialized_worker_count.load(Ordering::Relaxed)
);
sleep(Duration::from_millis(100));
}
info!("Done with notifying the end of startup");
Ok(())
}
}
pub struct PostgresClientBuilder {}
impl PostgresClientBuilder {
pub fn build_pararallel_postgres_client(
config: &AccountsDbPluginPostgresConfig,
) -> Result<ParallelPostgresClient, AccountsDbPluginError> {
ParallelPostgresClient::new(config)
}
pub fn build_simple_postgres_client(
config: &AccountsDbPluginPostgresConfig,
) -> Result<SimplePostgresClient, AccountsDbPluginError> {
SimplePostgresClient::new(config)
}
}

View File

@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-banking-bench"
version = "1.5.0"
version = "1.8.12"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@ -13,17 +13,19 @@ clap = "2.33.1"
crossbeam-channel = "0.4"
log = "0.4.11"
rand = "0.7.0"
rayon = "1.4.0"
solana-core = { path = "../core", version = "1.5.0" }
solana-clap-utils = { path = "../clap-utils", version = "1.5.0" }
solana-streamer = { path = "../streamer", version = "1.5.0" }
solana-perf = { path = "../perf", version = "1.5.0" }
solana-ledger = { path = "../ledger", version = "1.5.0" }
solana-logger = { path = "../logger", version = "1.5.0" }
solana-runtime = { path = "../runtime", version = "1.5.0" }
solana-measure = { path = "../measure", version = "1.5.0" }
solana-sdk = { path = "../sdk", version = "1.5.0" }
solana-version = { path = "../version", version = "1.5.0" }
rayon = "1.5.0"
solana-core = { path = "../core", version = "=1.8.12" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.12" }
solana-gossip = { path = "../gossip", version = "=1.8.12" }
solana-ledger = { path = "../ledger", version = "=1.8.12" }
solana-logger = { path = "../logger", version = "=1.8.12" }
solana-measure = { path = "../measure", version = "=1.8.12" }
solana-perf = { path = "../perf", version = "=1.8.12" }
solana-poh = { path = "../poh", version = "=1.8.12" }
solana-runtime = { path = "../runtime", version = "=1.8.12" }
solana-streamer = { path = "../streamer", version = "=1.8.12" }
solana-sdk = { path = "../sdk", version = "=1.8.12" }
solana-version = { path = "../version", version = "=1.8.12" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -1,37 +1,37 @@
use clap::{crate_description, crate_name, value_t, App, Arg};
use crossbeam_channel::unbounded;
use log::*;
use rand::{thread_rng, Rng};
use rayon::prelude::*;
use solana_core::{
banking_stage::{create_test_recorder, BankingStage},
cluster_info::ClusterInfo,
cluster_info::Node,
poh_recorder::PohRecorder,
poh_recorder::WorkingBankEntry,
};
use solana_ledger::{
blockstore::Blockstore,
genesis_utils::{create_genesis_config, GenesisConfigInfo},
get_tmp_ledger_path,
};
use solana_measure::measure::Measure;
use solana_perf::packet::to_packets_chunked;
use solana_runtime::{
accounts_background_service::ABSRequestSender, bank::Bank, bank_forks::BankForks,
};
use solana_sdk::{
hash::Hash,
signature::Keypair,
signature::Signature,
system_transaction,
timing::{duration_as_us, timestamp},
transaction::Transaction,
};
use std::{
sync::{atomic::Ordering, mpsc::Receiver, Arc, Mutex},
thread::sleep,
time::{Duration, Instant},
#![allow(clippy::integer_arithmetic)]
use {
clap::{crate_description, crate_name, value_t, App, Arg},
crossbeam_channel::unbounded,
log::*,
rand::{thread_rng, Rng},
rayon::prelude::*,
solana_core::banking_stage::BankingStage,
solana_gossip::cluster_info::{ClusterInfo, Node},
solana_ledger::{
blockstore::Blockstore,
genesis_utils::{create_genesis_config, GenesisConfigInfo},
get_tmp_ledger_path,
},
solana_measure::measure::Measure,
solana_perf::packet::to_packet_batches,
solana_poh::poh_recorder::{create_test_recorder, PohRecorder, WorkingBankEntry},
solana_runtime::{
accounts_background_service::AbsRequestSender, bank::Bank, bank_forks::BankForks,
cost_model::CostModel,
},
solana_sdk::{
hash::Hash,
signature::{Keypair, Signature},
system_transaction,
timing::{duration_as_us, timestamp},
transaction::Transaction,
},
solana_streamer::socket::SocketAddrSpace,
std::{
sync::{atomic::Ordering, mpsc::Receiver, Arc, Mutex, RwLock},
thread::sleep,
time::{Duration, Instant},
},
};
fn check_txs(
@ -77,7 +77,7 @@ fn make_accounts_txs(
.into_par_iter()
.map(|_| {
let mut new = dummy.clone();
let sig: Vec<u8> = (0..64).map(|_| thread_rng().gen()).collect();
let sig: Vec<u8> = (0..64).map(|_| thread_rng().gen::<u8>()).collect();
if !same_payer {
new.message.account_keys[0] = solana_sdk::pubkey::new_rand();
}
@ -168,6 +168,7 @@ fn main() {
let (verified_sender, verified_receiver) = unbounded();
let (vote_sender, vote_receiver) = unbounded();
let (tpu_vote_sender, tpu_vote_receiver) = unbounded();
let (replay_vote_sender, _replay_vote_receiver) = unbounded();
let bank0 = Bank::new(&genesis_config);
let mut bank_forks = BankForks::new(bank0);
@ -188,7 +189,7 @@ fn main() {
genesis_config.hash(),
);
// Ignore any pesky duplicate signature errors in the case we are using single-payer
let sig: Vec<u8> = (0..64).map(|_| thread_rng().gen()).collect();
let sig: Vec<u8> = (0..64).map(|_| thread_rng().gen::<u8>()).collect();
fund.signatures = vec![Signature::new(&sig[0..64])];
let x = bank.process_transaction(&fund);
x.unwrap();
@ -198,7 +199,7 @@ fn main() {
if !skip_sanity {
//sanity check, make sure all the transactions can execute sequentially
transactions.iter().for_each(|tx| {
let res = bank.process_transaction(&tx);
let res = bank.process_transaction(tx);
assert!(res.is_ok(), "sanity test transactions error: {:?}", res);
});
bank.clear_signatures();
@ -210,7 +211,7 @@ fn main() {
bank.clear_signatures();
}
let mut verified: Vec<_> = to_packets_chunked(&transactions, packets_per_chunk);
let mut verified: Vec<_> = to_packet_batches(&transactions, packets_per_chunk);
let ledger_path = get_tmp_ledger_path!();
{
let blockstore = Arc::new(
@ -218,15 +219,21 @@ fn main() {
);
let (exit, poh_recorder, poh_service, signal_receiver) =
create_test_recorder(&bank, &blockstore, None);
let cluster_info = ClusterInfo::new_with_invalid_keypair(Node::new_localhost().info);
let cluster_info = ClusterInfo::new(
Node::new_localhost().info,
Arc::new(Keypair::new()),
SocketAddrSpace::Unspecified,
);
let cluster_info = Arc::new(cluster_info);
let banking_stage = BankingStage::new(
&cluster_info,
&poh_recorder,
verified_receiver,
tpu_vote_receiver,
vote_receiver,
None,
replay_vote_sender,
Arc::new(RwLock::new(CostModel::default())),
);
poh_recorder.lock().unwrap().set_bank(&bank);
@ -325,7 +332,7 @@ fn main() {
poh_recorder.lock().unwrap().set_bank(&bank);
assert!(poh_recorder.lock().unwrap().bank().is_some());
if bank.slot() > 32 {
bank_forks.set_root(root, &ABSRequestSender::default(), None);
bank_forks.set_root(root, &AbsRequestSender::default(), None);
root += 1;
}
debug!(
@ -354,10 +361,10 @@ fn main() {
if bank.slot() > 0 && bank.slot() % 16 == 0 {
for tx in transactions.iter_mut() {
tx.message.recent_blockhash = bank.last_blockhash();
let sig: Vec<u8> = (0..64).map(|_| thread_rng().gen()).collect();
let sig: Vec<u8> = (0..64).map(|_| thread_rng().gen::<u8>()).collect();
tx.signatures[0] = Signature::new(&sig[0..64]);
}
verified = to_packets_chunked(&transactions.clone(), packets_per_chunk);
verified = to_packet_batches(&transactions.clone(), packets_per_chunk);
}
start += chunk_len;
@ -379,6 +386,7 @@ fn main() {
);
drop(verified_sender);
drop(tpu_vote_sender);
drop(vote_sender);
exit.store(true, Ordering::Relaxed);
banking_stage.join().unwrap();

View File

@ -1,26 +1,30 @@
[package]
name = "solana-banks-client"
version = "1.5.0"
version = "1.8.12"
description = "Solana banks client"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
documentation = "https://docs.rs/solana-banks-client"
edition = "2018"
[dependencies]
bincode = "1.3.1"
borsh = "0.9.0"
borsh-derive = "0.9.0"
futures = "0.3"
mio = "0.7.6"
solana-banks-interface = { path = "../banks-interface", version = "1.5.0" }
solana-sdk = { path = "../sdk", version = "1.5.0" }
tarpc = { version = "0.23.0", features = ["full"] }
tokio = { version = "0.3", features = ["full"] }
tokio-serde = { version = "0.6", features = ["bincode"] }
solana-banks-interface = { path = "../banks-interface", version = "=1.8.12" }
solana-program = { path = "../sdk/program", version = "=1.8.12" }
solana-sdk = { path = "../sdk", version = "=1.8.12" }
tarpc = { version = "0.24.1", features = ["full"] }
tokio = { version = "1", features = ["full"] }
tokio-serde = { version = "0.8", features = ["bincode"] }
[dev-dependencies]
solana-runtime = { path = "../runtime", version = "1.5.0" }
solana-banks-server = { path = "../banks-server", version = "1.5.0" }
solana-runtime = { path = "../runtime", version = "=1.8.12" }
solana-banks-server = { path = "../banks-server", version = "=1.8.12" }
[lib]
crate-type = ["lib"]

View File

@ -5,32 +5,38 @@
//! but they are undocumented, may change over time, and are generally more
//! cumbersome to use.
use futures::{future::join_all, Future, FutureExt};
pub use solana_banks_interface::{BanksClient as TarpcClient, TransactionStatus};
use solana_banks_interface::{BanksRequest, BanksResponse};
use solana_sdk::{
account::{from_account, Account},
clock::Slot,
commitment_config::CommitmentLevel,
fee_calculator::FeeCalculator,
hash::Hash,
pubkey::Pubkey,
rent::Rent,
signature::Signature,
sysvar,
transaction::{self, Transaction},
transport,
use {
borsh::BorshDeserialize,
futures::{future::join_all, Future, FutureExt},
solana_banks_interface::{BanksRequest, BanksResponse},
solana_program::{
clock::{Clock, Slot},
fee_calculator::FeeCalculator,
hash::Hash,
program_pack::Pack,
pubkey::Pubkey,
rent::Rent,
sysvar::{self, Sysvar},
},
solana_sdk::{
account::{from_account, Account},
commitment_config::CommitmentLevel,
signature::Signature,
transaction::{self, Transaction},
transport,
},
std::io::{self, Error, ErrorKind},
tarpc::{
client::{self, channel::RequestDispatch, NewClient},
context::{self, Context},
rpc::{ClientMessage, Response},
serde_transport::tcp,
Transport,
},
tokio::{net::ToSocketAddrs, time::Duration},
tokio_serde::formats::Bincode,
};
use std::io::{self, Error, ErrorKind};
use tarpc::{
client::{self, channel::RequestDispatch, NewClient},
context::{self, Context},
rpc::{ClientMessage, Response},
serde_transport::tcp,
Transport,
};
use tokio::{net::ToSocketAddrs, time::Duration};
use tokio_serde::formats::Bincode;
// This exists only for backward compatibility
pub trait BanksClientExt {}
@ -64,7 +70,7 @@ impl BanksClient {
&mut self,
ctx: Context,
commitment: CommitmentLevel,
) -> impl Future<Output = io::Result<(FeeCalculator, Hash, Slot)>> + '_ {
) -> impl Future<Output = io::Result<(FeeCalculator, Hash, u64)>> + '_ {
self.inner
.get_fees_with_commitment_and_context(ctx, commitment)
}
@ -86,6 +92,14 @@ impl BanksClient {
self.inner.get_slot_with_context(ctx, commitment)
}
pub fn get_block_height_with_context(
&mut self,
ctx: Context,
commitment: CommitmentLevel,
) -> impl Future<Output = io::Result<Slot>> + '_ {
self.inner.get_block_height_with_context(ctx, commitment)
}
pub fn process_transaction_with_commitment_and_context(
&mut self,
ctx: Context,
@ -116,24 +130,39 @@ impl BanksClient {
self.send_transaction_with_context(context::current(), transaction)
}
/// Return the cluster clock
pub fn get_clock(&mut self) -> impl Future<Output = io::Result<Clock>> + '_ {
self.get_account(sysvar::clock::id()).map(|result| {
let clock_sysvar = result?
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "Clock sysvar not present"))?;
from_account::<Clock, _>(&clock_sysvar).ok_or_else(|| {
io::Error::new(io::ErrorKind::Other, "Failed to deserialize Clock sysvar")
})
})
}
/// Return the fee parameters associated with a recent, rooted blockhash. The cluster
/// will use the transaction's blockhash to look up these same fee parameters and
/// use them to calculate the transaction fee.
pub fn get_fees(
&mut self,
) -> impl Future<Output = io::Result<(FeeCalculator, Hash, Slot)>> + '_ {
self.get_fees_with_commitment_and_context(context::current(), CommitmentLevel::Root)
) -> impl Future<Output = io::Result<(FeeCalculator, Hash, u64)>> + '_ {
self.get_fees_with_commitment_and_context(context::current(), CommitmentLevel::default())
}
/// Return the cluster Sysvar
pub fn get_sysvar<T: Sysvar>(&mut self) -> impl Future<Output = io::Result<T>> + '_ {
self.get_account(T::id()).map(|result| {
let sysvar = result?
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "Sysvar not present"))?;
from_account::<T, _>(&sysvar)
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "Failed to deserialize sysvar"))
})
}
/// Return the cluster rent
pub fn get_rent(&mut self) -> impl Future<Output = io::Result<Rent>> + '_ {
self.get_account(sysvar::rent::id()).map(|result| {
let rent_sysvar = result?
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "Rent sysvar not present"))?;
from_account::<Rent>(&rent_sysvar).ok_or_else(|| {
io::Error::new(io::ErrorKind::Other, "Failed to deserialize Rent sysvar")
})
})
self.get_sysvar::<Rent>()
}
/// Return a recent, rooted blockhash from the server. The cluster will only accept
@ -193,10 +222,16 @@ impl BanksClient {
self.process_transactions_with_commitment(transactions, CommitmentLevel::default())
}
/// Return the most recent rooted slot height. All transactions at or below this height
/// are said to be finalized. The cluster will not fork to a higher slot height.
/// Return the most recent rooted slot. All transactions at or below this slot
/// are said to be finalized. The cluster will not fork to a higher slot.
pub fn get_root_slot(&mut self) -> impl Future<Output = io::Result<Slot>> + '_ {
self.get_slot_with_context(context::current(), CommitmentLevel::Root)
self.get_slot_with_context(context::current(), CommitmentLevel::default())
}
/// Return the most recent rooted block height. All transactions at or below this height
/// are said to be finalized. The cluster will not fork to a higher block height.
pub fn get_root_block_height(&mut self) -> impl Future<Output = io::Result<Slot>> + '_ {
self.get_block_height_with_context(context::current(), CommitmentLevel::default())
}
/// Return the account at the given address at the slot corresponding to the given
@ -218,6 +253,33 @@ impl BanksClient {
self.get_account_with_commitment(address, CommitmentLevel::default())
}
/// Return the unpacked account data at the given address
/// If the account is not found, an error is returned
pub fn get_packed_account_data<T: Pack>(
&mut self,
address: Pubkey,
) -> impl Future<Output = io::Result<T>> + '_ {
self.get_account(address).map(|result| {
let account =
result?.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "Account not found"))?;
T::unpack_from_slice(&account.data)
.map_err(|_| io::Error::new(io::ErrorKind::Other, "Failed to deserialize account"))
})
}
/// Return the unpacked account data at the given address
/// If the account is not found, an error is returned
pub fn get_account_data_with_borsh<T: BorshDeserialize>(
&mut self,
address: Pubkey,
) -> impl Future<Output = io::Result<T>> + '_ {
self.get_account(address).map(|result| {
let account =
result?.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "account not found"))?;
T::try_from_slice(&account.data)
})
}
/// Return the balance in lamports of an account at the given address at the slot
/// corresponding to the given commitment level.
pub fn get_balance_with_commitment(
@ -287,13 +349,18 @@ pub async fn start_tcp_client<T: ToSocketAddrs>(addr: T) -> io::Result<BanksClie
#[cfg(test)]
mod tests {
use super::*;
use solana_banks_server::banks_server::start_local_server;
use solana_runtime::{bank::Bank, bank_forks::BankForks, genesis_utils::create_genesis_config};
use solana_sdk::{message::Message, signature::Signer, system_instruction};
use std::sync::{Arc, RwLock};
use tarpc::transport;
use tokio::{runtime::Runtime, time::sleep};
use {
super::*,
solana_banks_server::banks_server::start_local_server,
solana_runtime::{
bank::Bank, bank_forks::BankForks, commitment::BlockCommitmentCache,
genesis_utils::create_genesis_config,
},
solana_sdk::{message::Message, signature::Signer, system_instruction},
std::sync::{Arc, RwLock},
tarpc::transport,
tokio::{runtime::Runtime, time::sleep},
};
#[test]
fn test_banks_client_new() {
@ -308,9 +375,12 @@ mod tests {
// `runtime.block_on()` just once, to run all the async code.
let genesis = create_genesis_config(10);
let bank_forks = Arc::new(RwLock::new(BankForks::new(Bank::new(
&genesis.genesis_config,
))));
let bank = Bank::new(&genesis.genesis_config);
let slot = bank.slot();
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::new_for_tests_with_slots(slot, slot),
));
let bank_forks = Arc::new(RwLock::new(BankForks::new(bank)));
let bob_pubkey = solana_sdk::pubkey::new_rand();
let mint_pubkey = genesis.mint_keypair.pubkey();
@ -318,7 +388,9 @@ mod tests {
let message = Message::new(&[instruction], Some(&mint_pubkey));
Runtime::new()?.block_on(async {
let client_transport = start_local_server(&bank_forks).await;
let client_transport =
start_local_server(bank_forks, block_commitment_cache, Duration::from_millis(1))
.await;
let mut banks_client = start_client(client_transport).await?;
let recent_blockhash = banks_client.get_recent_blockhash().await?;
@ -336,19 +408,24 @@ mod tests {
// server-side functionality is available to the client.
let genesis = create_genesis_config(10);
let bank_forks = Arc::new(RwLock::new(BankForks::new(Bank::new(
&genesis.genesis_config,
))));
let bank = Bank::new(&genesis.genesis_config);
let slot = bank.slot();
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::new_for_tests_with_slots(slot, slot),
));
let bank_forks = Arc::new(RwLock::new(BankForks::new(bank)));
let mint_pubkey = &genesis.mint_keypair.pubkey();
let bob_pubkey = solana_sdk::pubkey::new_rand();
let instruction = system_instruction::transfer(&mint_pubkey, &bob_pubkey, 1);
let message = Message::new(&[instruction], Some(&mint_pubkey));
let instruction = system_instruction::transfer(mint_pubkey, &bob_pubkey, 1);
let message = Message::new(&[instruction], Some(mint_pubkey));
Runtime::new()?.block_on(async {
let client_transport = start_local_server(&bank_forks).await;
let client_transport =
start_local_server(bank_forks, block_commitment_cache, Duration::from_millis(1))
.await;
let mut banks_client = start_client(client_transport).await?;
let (_, recent_blockhash, last_valid_slot) = banks_client.get_fees().await?;
let (_, recent_blockhash, last_valid_block_height) = banks_client.get_fees().await?;
let transaction = Transaction::new(&[&genesis.mint_keypair], message, recent_blockhash);
let signature = transaction.signatures[0];
banks_client.send_transaction(transaction).await?;
@ -356,8 +433,8 @@ mod tests {
let mut status = banks_client.get_transaction_status(signature).await?;
while status.is_none() {
let root_slot = banks_client.get_root_slot().await?;
if root_slot > last_valid_slot {
let root_block_height = banks_client.get_root_block_height().await?;
if root_block_height > last_valid_block_height {
break;
}
sleep(Duration::from_millis(100)).await;

View File

@ -1,21 +1,22 @@
[package]
name = "solana-banks-interface"
version = "1.5.0"
version = "1.8.12"
description = "Solana banks RPC interface"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
documentation = "https://docs.rs/solana-banks-interface"
edition = "2018"
[dependencies]
mio = "0.7.6"
serde = { version = "1.0.112", features = ["derive"] }
solana-sdk = { path = "../sdk", version = "1.5.0" }
tarpc = { version = "0.23.0", features = ["full"] }
serde = { version = "1.0.122", features = ["derive"] }
solana-sdk = { path = "../sdk", version = "=1.8.12" }
tarpc = { version = "0.24.1", features = ["full"] }
[dev-dependencies]
tokio = { version = "0.3", features = ["full"] }
tokio = { version = "1", features = ["full"] }
[lib]
crate-type = ["lib"]

View File

@ -1,20 +1,30 @@
use serde::{Deserialize, Serialize};
use solana_sdk::{
account::Account,
clock::Slot,
commitment_config::CommitmentLevel,
fee_calculator::FeeCalculator,
hash::Hash,
pubkey::Pubkey,
signature::Signature,
transaction::{self, Transaction, TransactionError},
use {
serde::{Deserialize, Serialize},
solana_sdk::{
account::Account,
clock::Slot,
commitment_config::CommitmentLevel,
fee_calculator::FeeCalculator,
hash::Hash,
pubkey::Pubkey,
signature::Signature,
transaction::{self, Transaction, TransactionError},
},
};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum TransactionConfirmationStatus {
Processed,
Confirmed,
Finalized,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionStatus {
pub slot: Slot,
pub confirmations: Option<usize>, // None = rooted
pub err: Option<TransactionError>,
pub confirmation_status: Option<TransactionConfirmationStatus>,
}
#[tarpc::service]
@ -26,6 +36,7 @@ pub trait Banks {
async fn get_transaction_status_with_context(signature: Signature)
-> Option<TransactionStatus>;
async fn get_slot_with_context(commitment: CommitmentLevel) -> Slot;
async fn get_block_height_with_context(commitment: CommitmentLevel) -> u64;
async fn process_transaction_with_commitment_and_context(
transaction: Transaction,
commitment: CommitmentLevel,
@ -38,8 +49,10 @@ pub trait Banks {
#[cfg(test)]
mod tests {
use super::*;
use tarpc::{client, transport};
use {
super::*,
tarpc::{client, transport},
};
#[test]
fn test_banks_client_new() {

View File

@ -1,11 +1,12 @@
[package]
name = "solana-banks-server"
version = "1.5.0"
version = "1.8.12"
description = "Solana banks server"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
documentation = "https://docs.rs/solana-banks-server"
edition = "2018"
[dependencies]
@ -13,13 +14,14 @@ bincode = "1.3.1"
futures = "0.3"
log = "0.4.11"
mio = "0.7.6"
solana-banks-interface = { path = "../banks-interface", version = "1.5.0" }
solana-runtime = { path = "../runtime", version = "1.5.0" }
solana-sdk = { path = "../sdk", version = "1.5.0" }
solana-metrics = { path = "../metrics", version = "1.5.0" }
tarpc = { version = "0.23.0", features = ["full"] }
tokio = { version = "0.3", features = ["full"] }
tokio-serde = { version = "0.6", features = ["bincode"] }
solana-banks-interface = { path = "../banks-interface", version = "=1.8.12" }
solana-runtime = { path = "../runtime", version = "=1.8.12" }
solana-sdk = { path = "../sdk", version = "=1.8.12" }
solana-metrics = { path = "../metrics", version = "=1.8.12" }
tarpc = { version = "0.24.1", features = ["full"] }
tokio = { version = "1", features = ["full"] }
tokio-serde = { version = "0.8", features = ["bincode"] }
tokio-stream = "0.1"
[lib]
crate-type = ["lib"]

View File

@ -1,46 +1,52 @@
use crate::send_transaction_service::{SendTransactionService, TransactionInfo};
use bincode::{deserialize, serialize};
use futures::{
future,
prelude::stream::{self, StreamExt},
};
use solana_banks_interface::{Banks, BanksRequest, BanksResponse, TransactionStatus};
use solana_runtime::{bank::Bank, bank_forks::BankForks, commitment::BlockCommitmentCache};
use solana_sdk::{
account::Account,
clock::Slot,
commitment_config::CommitmentLevel,
fee_calculator::FeeCalculator,
hash::Hash,
pubkey::Pubkey,
signature::Signature,
transaction::{self, Transaction},
};
use std::{
io,
net::{Ipv4Addr, SocketAddr},
sync::{
mpsc::{channel, Receiver, Sender},
Arc, RwLock,
use {
crate::send_transaction_service::{SendTransactionService, TransactionInfo},
bincode::{deserialize, serialize},
futures::{
future,
prelude::stream::{self, StreamExt},
},
thread::Builder,
time::Duration,
solana_banks_interface::{
Banks, BanksRequest, BanksResponse, TransactionConfirmationStatus, TransactionStatus,
},
solana_runtime::{bank::Bank, bank_forks::BankForks, commitment::BlockCommitmentCache},
solana_sdk::{
account::Account,
clock::Slot,
commitment_config::CommitmentLevel,
feature_set::FeatureSet,
fee_calculator::FeeCalculator,
hash::Hash,
pubkey::Pubkey,
signature::Signature,
transaction::{self, Transaction},
},
std::{
io,
net::{Ipv4Addr, SocketAddr},
sync::{
mpsc::{channel, Receiver, Sender},
Arc, RwLock,
},
thread::Builder,
time::Duration,
},
tarpc::{
context::Context,
rpc::{transport::channel::UnboundedChannel, ClientMessage, Response},
serde_transport::tcp,
server::{self, Channel, Handler},
transport,
},
tokio::time::sleep,
tokio_serde::formats::Bincode,
};
use tarpc::{
context::Context,
rpc::{transport::channel::UnboundedChannel, ClientMessage, Response},
serde_transport::tcp,
server::{self, Channel, Handler},
transport,
};
use tokio::time::sleep;
use tokio_serde::formats::Bincode;
#[derive(Clone)]
struct BanksServer {
bank_forks: Arc<RwLock<BankForks>>,
block_commitment_cache: Arc<RwLock<BlockCommitmentCache>>,
transaction_sender: Sender<TransactionInfo>,
poll_signature_status_sleep_duration: Duration,
}
impl BanksServer {
@ -52,15 +58,17 @@ impl BanksServer {
bank_forks: Arc<RwLock<BankForks>>,
block_commitment_cache: Arc<RwLock<BlockCommitmentCache>>,
transaction_sender: Sender<TransactionInfo>,
poll_signature_status_sleep_duration: Duration,
) -> Self {
Self {
bank_forks,
block_commitment_cache,
transaction_sender,
poll_signature_status_sleep_duration,
}
}
fn run(bank: &Bank, transaction_receiver: Receiver<TransactionInfo>) {
fn run(bank_forks: Arc<RwLock<BankForks>>, transaction_receiver: Receiver<TransactionInfo>) {
while let Ok(info) = transaction_receiver.recv() {
let mut transaction_infos = vec![info];
while let Ok(info) = transaction_receiver.try_recv() {
@ -70,23 +78,36 @@ impl BanksServer {
.into_iter()
.map(|info| deserialize(&info.wire_transaction).unwrap())
.collect();
let bank = bank_forks.read().unwrap().working_bank();
let _ = bank.process_transactions(&transactions);
}
}
/// Useful for unit-testing
fn new_loopback(bank_forks: Arc<RwLock<BankForks>>) -> Self {
fn new_loopback(
bank_forks: Arc<RwLock<BankForks>>,
block_commitment_cache: Arc<RwLock<BlockCommitmentCache>>,
poll_signature_status_sleep_duration: Duration,
) -> Self {
let (transaction_sender, transaction_receiver) = channel();
let bank = bank_forks.read().unwrap().working_bank();
let slot = bank.slot();
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::new_for_tests_with_slots(slot, slot),
));
{
// ensure that the commitment cache and bank are synced
let mut w_block_commitment_cache = block_commitment_cache.write().unwrap();
w_block_commitment_cache.set_all_slots(slot, slot);
}
let server_bank_forks = bank_forks.clone();
Builder::new()
.name("solana-bank-forks-client".to_string())
.spawn(move || Self::run(&bank, transaction_receiver))
.spawn(move || Self::run(server_bank_forks, transaction_receiver))
.unwrap();
Self::new(bank_forks, block_commitment_cache, transaction_sender)
Self::new(
bank_forks,
block_commitment_cache,
transaction_sender,
poll_signature_status_sleep_duration,
)
}
fn slot(&self, commitment: CommitmentLevel) -> Slot {
@ -104,16 +125,16 @@ impl BanksServer {
self,
signature: &Signature,
blockhash: &Hash,
last_valid_slot: Slot,
last_valid_block_height: u64,
commitment: CommitmentLevel,
) -> Option<transaction::Result<()>> {
let mut status = self
.bank(commitment)
.get_signature_status_with_blockhash(signature, blockhash);
while status.is_none() {
sleep(Duration::from_millis(200)).await;
sleep(self.poll_signature_status_sleep_duration).await;
let bank = self.bank(commitment);
if bank.slot() > last_valid_slot {
if bank.block_height() > last_valid_block_height {
break;
}
status = bank.get_signature_status_with_blockhash(signature, blockhash);
@ -122,10 +143,13 @@ impl BanksServer {
}
}
fn verify_transaction(transaction: &Transaction) -> transaction::Result<()> {
fn verify_transaction(
transaction: &Transaction,
feature_set: &Arc<FeatureSet>,
) -> transaction::Result<()> {
if let Err(err) = transaction.verify() {
Err(err)
} else if let Err(err) = transaction.verify_precompiles() {
} else if let Err(err) = transaction.verify_precompiles(feature_set) {
Err(err)
} else {
Ok(())
@ -136,16 +160,19 @@ fn verify_transaction(transaction: &Transaction) -> transaction::Result<()> {
impl Banks for BanksServer {
async fn send_transaction_with_context(self, _: Context, transaction: Transaction) {
let blockhash = &transaction.message.recent_blockhash;
let last_valid_slot = self
let last_valid_block_height = self
.bank_forks
.read()
.unwrap()
.root_bank()
.get_blockhash_last_valid_slot(&blockhash)
.get_blockhash_last_valid_block_height(blockhash)
.unwrap();
let signature = transaction.signatures.get(0).cloned().unwrap_or_default();
let info =
TransactionInfo::new(signature, serialize(&transaction).unwrap(), last_valid_slot);
let info = TransactionInfo::new(
signature,
serialize(&transaction).unwrap(),
last_valid_block_height,
);
self.transaction_sender.send(info).unwrap();
}
@ -153,11 +180,13 @@ impl Banks for BanksServer {
self,
_: Context,
commitment: CommitmentLevel,
) -> (FeeCalculator, Hash, Slot) {
) -> (FeeCalculator, Hash, u64) {
let bank = self.bank(commitment);
let (blockhash, fee_calculator) = bank.last_blockhash_with_fee_calculator();
let last_valid_slot = bank.get_blockhash_last_valid_slot(&blockhash).unwrap();
(fee_calculator, blockhash, last_valid_slot)
let last_valid_block_height = bank
.get_blockhash_last_valid_block_height(&blockhash)
.unwrap();
(fee_calculator, blockhash, last_valid_block_height)
}
async fn get_transaction_status_with_context(
@ -165,11 +194,17 @@ impl Banks for BanksServer {
_: Context,
signature: Signature,
) -> Option<TransactionStatus> {
let bank = self.bank(CommitmentLevel::Recent);
let bank = self.bank(CommitmentLevel::Processed);
let (slot, status) = bank.get_signature_status_slot(&signature)?;
let r_block_commitment_cache = self.block_commitment_cache.read().unwrap();
let confirmations = if r_block_commitment_cache.root() >= slot {
let optimistically_confirmed_bank = self.bank(CommitmentLevel::Confirmed);
let optimistically_confirmed =
optimistically_confirmed_bank.get_signature_status_slot(&signature);
let confirmations = if r_block_commitment_cache.root() >= slot
&& r_block_commitment_cache.highest_confirmed_root() >= slot
{
None
} else {
r_block_commitment_cache
@ -180,6 +215,13 @@ impl Banks for BanksServer {
slot,
confirmations,
err: status.err(),
confirmation_status: if confirmations.is_none() {
Some(TransactionConfirmationStatus::Finalized)
} else if optimistically_confirmed.is_some() {
Some(TransactionConfirmationStatus::Confirmed)
} else {
Some(TransactionConfirmationStatus::Processed)
},
})
}
@ -187,29 +229,33 @@ impl Banks for BanksServer {
self.slot(commitment)
}
async fn get_block_height_with_context(self, _: Context, commitment: CommitmentLevel) -> u64 {
self.bank(commitment).block_height()
}
async fn process_transaction_with_commitment_and_context(
self,
_: Context,
transaction: Transaction,
commitment: CommitmentLevel,
) -> Option<transaction::Result<()>> {
if let Err(err) = verify_transaction(&transaction) {
if let Err(err) = verify_transaction(&transaction, &self.bank(commitment).feature_set) {
return Some(Err(err));
}
let blockhash = &transaction.message.recent_blockhash;
let last_valid_slot = self
.bank_forks
.read()
.unwrap()
.root_bank()
.get_blockhash_last_valid_slot(blockhash)
let last_valid_block_height = self
.bank(commitment)
.get_blockhash_last_valid_block_height(blockhash)
.unwrap();
let signature = transaction.signatures.get(0).cloned().unwrap_or_default();
let info =
TransactionInfo::new(signature, serialize(&transaction).unwrap(), last_valid_slot);
let info = TransactionInfo::new(
signature,
serialize(&transaction).unwrap(),
last_valid_block_height,
);
self.transaction_sender.send(info).unwrap();
self.poll_signature_status(&signature, blockhash, last_valid_slot, commitment)
self.poll_signature_status(&signature, blockhash, last_valid_block_height, commitment)
.await
}
@ -220,14 +266,20 @@ impl Banks for BanksServer {
commitment: CommitmentLevel,
) -> Option<Account> {
let bank = self.bank(commitment);
bank.get_account(&address)
bank.get_account(&address).map(Account::from)
}
}
pub async fn start_local_server(
bank_forks: &Arc<RwLock<BankForks>>,
bank_forks: Arc<RwLock<BankForks>>,
block_commitment_cache: Arc<RwLock<BlockCommitmentCache>>,
poll_signature_status_sleep_duration: Duration,
) -> UnboundedChannel<Response<BanksResponse>, ClientMessage<BanksRequest>> {
let banks_server = BanksServer::new_loopback(bank_forks.clone());
let banks_server = BanksServer::new_loopback(
bank_forks,
block_commitment_cache,
poll_signature_status_sleep_duration,
);
let (client_transport, server_transport) = transport::channel::unbounded();
let server = server::new(server::Config::default())
.incoming(stream::once(future::ready(server_transport)))
@ -262,8 +314,12 @@ pub async fn start_tcp_server(
SendTransactionService::new(tpu_addr, &bank_forks, receiver);
let server =
BanksServer::new(bank_forks.clone(), block_commitment_cache.clone(), sender);
let server = BanksServer::new(
bank_forks.clone(),
block_commitment_cache.clone(),
sender,
Duration::from_millis(200),
);
chan.respond_with(server.serve()).execute()
})
// Max 10 channels.

View File

@ -1,3 +1,4 @@
#![allow(clippy::integer_arithmetic)]
pub mod banks_server;
pub mod rpc_banks_service;
pub mod send_transaction_service;

View File

@ -1,19 +1,22 @@
//! The `rpc_banks_service` module implements the Solana Banks RPC API.
use crate::banks_server::start_tcp_server;
use futures::{future::FutureExt, pin_mut, prelude::stream::StreamExt, select};
use solana_runtime::{bank_forks::BankForks, commitment::BlockCommitmentCache};
use std::{
net::SocketAddr,
sync::{
atomic::{AtomicBool, Ordering},
Arc, RwLock,
use {
crate::banks_server::start_tcp_server,
futures::{future::FutureExt, pin_mut, prelude::stream::StreamExt, select},
solana_runtime::{bank_forks::BankForks, commitment::BlockCommitmentCache},
std::{
net::SocketAddr,
sync::{
atomic::{AtomicBool, Ordering},
Arc, RwLock,
},
thread::{self, Builder, JoinHandle},
},
thread::{self, Builder, JoinHandle},
};
use tokio::{
runtime::Runtime,
time::{self, Duration},
tokio::{
runtime::Runtime,
time::{self, Duration},
},
tokio_stream::wrappers::IntervalStream,
};
pub struct RpcBanksService {
@ -35,7 +38,7 @@ async fn start_abortable_tcp_server(
block_commitment_cache.clone(),
)
.fuse();
let interval = time::interval(Duration::from_millis(100)).fuse();
let interval = IntervalStream::new(time::interval(Duration::from_millis(100))).fuse();
pin_mut!(server, interval);
loop {
select! {
@ -100,8 +103,7 @@ impl RpcBanksService {
#[cfg(test)]
mod tests {
use super::*;
use solana_runtime::bank::Bank;
use {super::*, solana_runtime::bank::Bank};
#[test]
fn test_rpc_banks_server_exit() {

View File

@ -1,17 +1,19 @@
// TODO: Merge this implementation with the one at `core/src/send_transaction_service.rs`
use log::*;
use solana_metrics::{datapoint_warn, inc_new_counter_info};
use solana_runtime::{bank::Bank, bank_forks::BankForks};
use solana_sdk::{clock::Slot, signature::Signature};
use std::{
collections::HashMap,
net::{SocketAddr, UdpSocket},
sync::{
mpsc::{Receiver, RecvTimeoutError},
Arc, RwLock,
use {
log::*,
solana_metrics::{datapoint_warn, inc_new_counter_info},
solana_runtime::{bank::Bank, bank_forks::BankForks},
solana_sdk::signature::Signature,
std::{
collections::HashMap,
net::{SocketAddr, UdpSocket},
sync::{
mpsc::{Receiver, RecvTimeoutError},
Arc, RwLock,
},
thread::{self, Builder, JoinHandle},
time::{Duration, Instant},
},
thread::{self, Builder, JoinHandle},
time::{Duration, Instant},
};
/// Maximum size of the transaction queue
@ -24,15 +26,19 @@ pub struct SendTransactionService {
pub struct TransactionInfo {
pub signature: Signature,
pub wire_transaction: Vec<u8>,
pub last_valid_slot: Slot,
pub last_valid_block_height: u64,
}
impl TransactionInfo {
pub fn new(signature: Signature, wire_transaction: Vec<u8>, last_valid_slot: Slot) -> Self {
pub fn new(
signature: Signature,
wire_transaction: Vec<u8>,
last_valid_block_height: u64,
) -> Self {
Self {
signature,
wire_transaction,
last_valid_slot,
last_valid_block_height,
}
}
}
@ -124,7 +130,7 @@ impl SendTransactionService {
result.rooted += 1;
inc_new_counter_info!("send_transaction_service-rooted", 1);
false
} else if transaction_info.last_valid_slot < root_bank.slot() {
} else if transaction_info.last_valid_block_height < root_bank.block_height() {
info!("Dropping expired transaction: {}", signature);
result.expired += 1;
inc_new_counter_info!("send_transaction_service-expired", 1);
@ -138,8 +144,8 @@ impl SendTransactionService {
result.retried += 1;
inc_new_counter_info!("send_transaction_service-retry", 1);
Self::send_transaction(
&send_socket,
&tpu_address,
send_socket,
tpu_address,
&transaction_info.wire_transaction,
);
true
@ -179,12 +185,14 @@ impl SendTransactionService {
#[cfg(test)]
mod test {
use super::*;
use solana_sdk::{
genesis_config::create_genesis_config, pubkey::Pubkey, signature::Signer,
system_transaction,
use {
super::*,
solana_sdk::{
genesis_config::create_genesis_config, pubkey::Pubkey, signature::Signer,
system_transaction,
},
std::sync::mpsc::channel,
};
use std::sync::mpsc::channel;
#[test]
fn service_exit() {

View File

@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-bench-exchange"
version = "1.5.0"
version = "1.8.12"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@ -15,24 +15,26 @@ log = "0.4.11"
num-derive = "0.3"
num-traits = "0.2"
rand = "0.7.0"
rayon = "1.4.0"
rayon = "1.5.0"
serde_json = "1.0.56"
serde_yaml = "0.8.13"
solana-clap-utils = { path = "../clap-utils", version = "1.5.0" }
solana-core = { path = "../core", version = "1.5.0" }
solana-genesis = { path = "../genesis", version = "1.5.0" }
solana-client = { path = "../client", version = "1.5.0" }
solana-faucet = { path = "../faucet", version = "1.5.0" }
solana-exchange-program = { path = "../programs/exchange", version = "1.5.0" }
solana-logger = { path = "../logger", version = "1.5.0" }
solana-metrics = { path = "../metrics", version = "1.5.0" }
solana-net-utils = { path = "../net-utils", version = "1.5.0" }
solana-runtime = { path = "../runtime", version = "1.5.0" }
solana-sdk = { path = "../sdk", version = "1.5.0" }
solana-version = { path = "../version", version = "1.5.0" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.12" }
solana-core = { path = "../core", version = "=1.8.12" }
solana-genesis = { path = "../genesis", version = "=1.8.12" }
solana-client = { path = "../client", version = "=1.8.12" }
solana-exchange-program = { path = "../programs/exchange", version = "=1.8.12" }
solana-faucet = { path = "../faucet", version = "=1.8.12" }
solana-gossip = { path = "../gossip", version = "=1.8.12" }
solana-logger = { path = "../logger", version = "=1.8.12" }
solana-metrics = { path = "../metrics", version = "=1.8.12" }
solana-net-utils = { path = "../net-utils", version = "=1.8.12" }
solana-runtime = { path = "../runtime", version = "=1.8.12" }
solana-sdk = { path = "../sdk", version = "=1.8.12" }
solana-streamer = { path = "../streamer", version = "=1.8.12" }
solana-version = { path = "../version", version = "=1.8.12" }
[dev-dependencies]
solana-local-cluster = { path = "../local-cluster", version = "1.5.0" }
solana-local-cluster = { path = "../local-cluster", version = "=1.8.12" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -1,42 +1,45 @@
#![allow(clippy::useless_attribute)]
#![allow(clippy::integer_arithmetic)]
use crate::order_book::*;
use itertools::izip;
use log::*;
use rand::{thread_rng, Rng};
use rayon::prelude::*;
use solana_client::perf_utils::{sample_txs, SampleStats};
use solana_core::gen_keys::GenKeys;
use solana_exchange_program::{exchange_instruction, exchange_state::*, id};
use solana_faucet::faucet::request_airdrop_transaction;
use solana_genesis::Base64Account;
use solana_metrics::datapoint_info;
use solana_sdk::{
client::{Client, SyncClient},
commitment_config::CommitmentConfig,
message::Message,
pubkey::Pubkey,
signature::{Keypair, Signer},
timing::{duration_as_ms, duration_as_s},
transaction::Transaction,
{system_instruction, system_program},
};
use std::{
cmp,
collections::{HashMap, VecDeque},
fs::File,
io::prelude::*,
mem,
net::SocketAddr,
path::Path,
process::exit,
sync::{
atomic::{AtomicBool, AtomicUsize, Ordering},
mpsc::{channel, Receiver, Sender},
Arc, RwLock,
use {
crate::order_book::*,
itertools::izip,
log::*,
rand::{thread_rng, Rng},
rayon::prelude::*,
solana_client::perf_utils::{sample_txs, SampleStats},
solana_core::gen_keys::GenKeys,
solana_exchange_program::{exchange_instruction, exchange_state::*, id},
solana_faucet::faucet::request_airdrop_transaction,
solana_genesis::Base64Account,
solana_metrics::datapoint_info,
solana_sdk::{
client::{Client, SyncClient},
commitment_config::CommitmentConfig,
message::Message,
pubkey::Pubkey,
signature::{Keypair, Signer},
system_instruction, system_program,
timing::{duration_as_ms, duration_as_s},
transaction::Transaction,
},
std::{
cmp,
collections::{HashMap, VecDeque},
fs::File,
io::prelude::*,
mem,
net::SocketAddr,
path::Path,
process::exit,
sync::{
atomic::{AtomicBool, AtomicUsize, Ordering},
mpsc::{channel, Receiver, Sender},
Arc, RwLock,
},
thread::{sleep, Builder},
time::{Duration, Instant},
},
thread::{sleep, Builder},
time::{Duration, Instant},
};
// TODO Chunk length as specified results in a bunch of failures, divide by 10 helps...
@ -390,7 +393,7 @@ fn swapper<T>(
while client
.get_balance_with_commitment(
&trade_infos[trade_index].trade_account,
CommitmentConfig::recent(),
CommitmentConfig::processed(),
)
.unwrap_or(0)
== 0
@ -445,18 +448,18 @@ fn swapper<T>(
account_group = (account_group + 1) % account_groups as usize;
let (blockhash, _fee_calculator, _last_valid_slot) = client
.get_recent_blockhash_with_commitment(CommitmentConfig::recent())
.get_recent_blockhash_with_commitment(CommitmentConfig::processed())
.expect("Failed to get blockhash");
let to_swap_txs: Vec<_> = to_swap
.par_iter()
.map(|(signer, swap, profit)| {
let s: &Keypair = &signer;
let s: &Keypair = signer;
let owner = &signer.pubkey();
let instruction = exchange_instruction::swap_request(
owner,
&swap.0.pubkey,
&swap.1.pubkey,
&profit,
profit,
);
let message = Message::new(&[instruction], Some(&s.pubkey()));
Transaction::new(&[s], message, blockhash)
@ -571,7 +574,7 @@ fn trader<T>(
account_group = (account_group + 1) % account_groups as usize;
let (blockhash, _fee_calculator, _last_valid_slot) = client
.get_recent_blockhash_with_commitment(CommitmentConfig::recent())
.get_recent_blockhash_with_commitment(CommitmentConfig::processed())
.expect("Failed to get blockhash");
trades.chunks(chunk_size).for_each(|chunk| {
@ -599,7 +602,7 @@ fn trader<T>(
src,
),
];
let message = Message::new(&instructions, Some(&owner_pubkey));
let message = Message::new(&instructions, Some(owner_pubkey));
Transaction::new(&[owner.as_ref(), trade], message, blockhash)
})
.collect();
@ -658,7 +661,7 @@ where
{
for s in &tx.signatures {
if let Ok(Some(r)) =
sync_client.get_signature_status_with_commitment(s, CommitmentConfig::recent())
sync_client.get_signature_status_with_commitment(s, CommitmentConfig::processed())
{
match r {
Ok(_) => {
@ -681,7 +684,7 @@ fn verify_funding_transfer<T: SyncClient + ?Sized>(
if verify_transaction(client, tx) {
for a in &tx.message().account_keys[1..] {
if client
.get_balance_with_commitment(a, CommitmentConfig::recent())
.get_balance_with_commitment(a, CommitmentConfig::processed())
.unwrap_or(0)
>= amount
{
@ -738,7 +741,7 @@ pub fn fund_keys<T: Client>(client: &T, source: &Keypair, dests: &[Arc<Keypair>]
let mut to_fund_txs: Vec<_> = chunk
.par_iter()
.map(|(k, m)| {
let instructions = system_instruction::transfer_many(&k.pubkey(), &m);
let instructions = system_instruction::transfer_many(&k.pubkey(), m);
let message = Message::new(&instructions, Some(&k.pubkey()));
(k.clone(), Transaction::new_unsigned(message))
})
@ -764,7 +767,7 @@ pub fn fund_keys<T: Client>(client: &T, source: &Keypair, dests: &[Arc<Keypair>]
);
let (blockhash, _fee_calculator, _last_valid_slot) = client
.get_recent_blockhash_with_commitment(CommitmentConfig::recent())
.get_recent_blockhash_with_commitment(CommitmentConfig::processed())
.expect("blockhash");
to_fund_txs.par_iter_mut().for_each(|(k, tx)| {
tx.sign(&[*k], blockhash);
@ -776,7 +779,7 @@ pub fn fund_keys<T: Client>(client: &T, source: &Keypair, dests: &[Arc<Keypair>]
let mut waits = 0;
loop {
sleep(Duration::from_millis(200));
to_fund_txs.retain(|(_, tx)| !verify_funding_transfer(client, &tx, amount));
to_fund_txs.retain(|(_, tx)| !verify_funding_transfer(client, tx, amount));
if to_fund_txs.is_empty() {
break;
}
@ -803,7 +806,7 @@ pub fn fund_keys<T: Client>(client: &T, source: &Keypair, dests: &[Arc<Keypair>]
funded.append(&mut new_funded);
funded.retain(|(k, b)| {
client
.get_balance_with_commitment(&k.pubkey(), CommitmentConfig::recent())
.get_balance_with_commitment(&k.pubkey(), CommitmentConfig::processed())
.unwrap_or(0)
> lamports
&& *b > lamports
@ -835,7 +838,7 @@ pub fn create_token_accounts<T: Client>(
);
let request_ix =
exchange_instruction::account_request(owner_pubkey, &new_keypair.pubkey());
let message = Message::new(&[create_ix, request_ix], Some(&owner_pubkey));
let message = Message::new(&[create_ix, request_ix], Some(owner_pubkey));
(
(from_keypair, new_keypair),
Transaction::new_unsigned(message),
@ -857,7 +860,7 @@ pub fn create_token_accounts<T: Client>(
let mut retries = 0;
while !to_create_txs.is_empty() {
let (blockhash, _fee_calculator, _last_valid_slot) = client
.get_recent_blockhash_with_commitment(CommitmentConfig::recent())
.get_recent_blockhash_with_commitment(CommitmentConfig::processed())
.expect("Failed to get blockhash");
to_create_txs
.par_iter_mut()
@ -871,7 +874,7 @@ pub fn create_token_accounts<T: Client>(
let mut waits = 0;
while !to_create_txs.is_empty() {
sleep(Duration::from_millis(200));
to_create_txs.retain(|(_, tx)| !verify_transaction(client, &tx));
to_create_txs.retain(|(_, tx)| !verify_transaction(client, tx));
if to_create_txs.is_empty() {
break;
}
@ -903,7 +906,7 @@ pub fn create_token_accounts<T: Client>(
let mut new_notfunded: Vec<(&Arc<Keypair>, &Keypair)> = vec![];
for f in &notfunded {
if client
.get_balance_with_commitment(&f.1.pubkey(), CommitmentConfig::recent())
.get_balance_with_commitment(&f.1.pubkey(), CommitmentConfig::processed())
.unwrap_or(0)
== 0
{
@ -957,7 +960,7 @@ fn compute_and_report_stats(maxes: &Arc<RwLock<Vec<(String, SampleStats)>>>, tot
fn generate_keypairs(num: u64) -> Vec<Keypair> {
let mut seed = [0_u8; 32];
seed.copy_from_slice(&Keypair::new().pubkey().as_ref());
seed.copy_from_slice(Keypair::new().pubkey().as_ref());
let mut rnd = GenKeys::new(seed);
rnd.gen_n_keypairs(num)
}
@ -968,7 +971,7 @@ pub fn airdrop_lamports<T: Client>(
id: &Keypair,
amount: u64,
) {
let balance = client.get_balance_with_commitment(&id.pubkey(), CommitmentConfig::recent());
let balance = client.get_balance_with_commitment(&id.pubkey(), CommitmentConfig::processed());
let balance = balance.unwrap_or(0);
if balance >= amount {
return;
@ -986,23 +989,23 @@ pub fn airdrop_lamports<T: Client>(
let mut tries = 0;
loop {
let (blockhash, _fee_calculator, _last_valid_slot) = client
.get_recent_blockhash_with_commitment(CommitmentConfig::recent())
.get_recent_blockhash_with_commitment(CommitmentConfig::processed())
.expect("Failed to get blockhash");
match request_airdrop_transaction(&faucet_addr, &id.pubkey(), amount_to_drop, blockhash) {
match request_airdrop_transaction(faucet_addr, &id.pubkey(), amount_to_drop, blockhash) {
Ok(transaction) => {
let signature = client.async_send_transaction(transaction).unwrap();
for _ in 0..30 {
if let Ok(Some(_)) = client.get_signature_status_with_commitment(
&signature,
CommitmentConfig::recent(),
CommitmentConfig::processed(),
) {
break;
}
sleep(Duration::from_millis(100));
}
if client
.get_balance_with_commitment(&id.pubkey(), CommitmentConfig::recent())
.get_balance_with_commitment(&id.pubkey(), CommitmentConfig::processed())
.unwrap_or(0)
>= amount
{

View File

@ -1,10 +1,10 @@
use clap::{crate_description, crate_name, value_t, App, Arg, ArgMatches};
use solana_core::gen_keys::GenKeys;
use solana_faucet::faucet::FAUCET_PORT;
use solana_sdk::signature::{read_keypair_file, Keypair};
use std::net::SocketAddr;
use std::process::exit;
use std::time::Duration;
use {
clap::{crate_description, crate_name, value_t, App, Arg, ArgMatches},
solana_core::gen_keys::GenKeys,
solana_faucet::faucet::FAUCET_PORT,
solana_sdk::signature::{read_keypair_file, Keypair},
std::{net::SocketAddr, process::exit, time::Duration},
};
pub struct Config {
pub entrypoint_addr: SocketAddr,

View File

@ -1,11 +1,15 @@
#![allow(clippy::integer_arithmetic)]
pub mod bench;
mod cli;
pub mod order_book;
use crate::bench::{airdrop_lamports, create_client_accounts_file, do_bench_exchange, Config};
use log::*;
use solana_core::gossip_service::{discover_cluster, get_multi_client};
use solana_sdk::signature::Signer;
use {
crate::bench::{airdrop_lamports, create_client_accounts_file, do_bench_exchange, Config},
log::*,
solana_gossip::gossip_service::{discover_cluster, get_multi_client},
solana_sdk::signature::Signer,
solana_streamer::socket::SocketAddrSpace,
};
fn main() {
solana_logger::setup();
@ -54,11 +58,12 @@ fn main() {
);
} else {
info!("Connecting to the cluster");
let nodes = discover_cluster(&entrypoint_addr, num_nodes).unwrap_or_else(|_| {
panic!("Failed to discover nodes");
});
let nodes = discover_cluster(&entrypoint_addr, num_nodes, SocketAddrSpace::Unspecified)
.unwrap_or_else(|_| {
panic!("Failed to discover nodes");
});
let (client, num_clients) = get_multi_client(&nodes);
let (client, num_clients) = get_multi_client(&nodes, &SocketAddrSpace::Unspecified);
info!("{} nodes found", num_clients);
if num_clients < num_nodes {

View File

@ -1,11 +1,13 @@
use itertools::EitherOrBoth::{Both, Left, Right};
use itertools::Itertools;
use log::*;
use solana_exchange_program::exchange_state::*;
use solana_sdk::pubkey::Pubkey;
use std::cmp::Ordering;
use std::collections::BinaryHeap;
use std::{error, fmt};
use {
itertools::{
EitherOrBoth::{Both, Left, Right},
Itertools,
},
log::*,
solana_exchange_program::exchange_state::*,
solana_sdk::pubkey::Pubkey,
std::{cmp::Ordering, collections::BinaryHeap, error, fmt},
};
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct ToOrder {

View File

@ -1,19 +1,24 @@
use log::*;
use solana_bench_exchange::bench::{airdrop_lamports, do_bench_exchange, Config};
use solana_core::gossip_service::{discover_cluster, get_multi_client};
use solana_core::validator::ValidatorConfig;
use solana_exchange_program::exchange_processor::process_instruction;
use solana_exchange_program::id;
use solana_exchange_program::solana_exchange_program;
use solana_faucet::faucet::run_local_faucet;
use solana_local_cluster::local_cluster::{ClusterConfig, LocalCluster};
use solana_runtime::bank::Bank;
use solana_runtime::bank_client::BankClient;
use solana_sdk::genesis_config::create_genesis_config;
use solana_sdk::signature::{Keypair, Signer};
use std::process::exit;
use std::sync::mpsc::channel;
use std::time::Duration;
use {
log::*,
solana_bench_exchange::bench::{airdrop_lamports, do_bench_exchange, Config},
solana_core::validator::ValidatorConfig,
solana_exchange_program::{
exchange_processor::process_instruction, id, solana_exchange_program,
},
solana_faucet::faucet::run_local_faucet_with_port,
solana_gossip::gossip_service::{discover_cluster, get_multi_client},
solana_local_cluster::{
local_cluster::{ClusterConfig, LocalCluster},
validator_configs::make_identical_validator_configs,
},
solana_runtime::{bank::Bank, bank_client::BankClient},
solana_sdk::{
genesis_config::create_genesis_config,
signature::{Keypair, Signer},
},
solana_streamer::socket::SocketAddrSpace,
std::{process::exit, sync::mpsc::channel, time::Duration},
};
#[test]
#[ignore]
@ -41,13 +46,19 @@ fn test_exchange_local_cluster() {
} = config;
let accounts_in_groups = batch_size * account_groups;
let cluster = LocalCluster::new(&mut ClusterConfig {
node_stakes: vec![100_000; NUM_NODES],
cluster_lamports: 100_000_000_000_000,
validator_configs: vec![ValidatorConfig::default(); NUM_NODES],
native_instruction_processors: [solana_exchange_program!()].to_vec(),
..ClusterConfig::default()
});
let cluster = LocalCluster::new(
&mut ClusterConfig {
node_stakes: vec![100_000; NUM_NODES],
cluster_lamports: 100_000_000_000_000,
validator_configs: make_identical_validator_configs(
&ValidatorConfig::default(),
NUM_NODES,
),
native_instruction_processors: [solana_exchange_program!()].to_vec(),
..ClusterConfig::default()
},
SocketAddrSpace::Unspecified,
);
let faucet_keypair = Keypair::new();
cluster.transfer(
@ -57,17 +68,24 @@ fn test_exchange_local_cluster() {
);
let (addr_sender, addr_receiver) = channel();
run_local_faucet(faucet_keypair, addr_sender, Some(1_000_000_000_000));
let faucet_addr = addr_receiver.recv_timeout(Duration::from_secs(2)).unwrap();
run_local_faucet_with_port(faucet_keypair, addr_sender, Some(1_000_000_000_000), 0);
let faucet_addr = addr_receiver
.recv_timeout(Duration::from_secs(2))
.expect("run_local_faucet")
.expect("faucet_addr");
info!("Connecting to the cluster");
let nodes =
discover_cluster(&cluster.entry_point_info.gossip, NUM_NODES).unwrap_or_else(|err| {
error!("Failed to discover {} nodes: {:?}", NUM_NODES, err);
exit(1);
});
let nodes = discover_cluster(
&cluster.entry_point_info.gossip,
NUM_NODES,
SocketAddrSpace::Unspecified,
)
.unwrap_or_else(|err| {
error!("Failed to discover {} nodes: {:?}", NUM_NODES, err);
exit(1);
});
let (client, num_clients) = get_multi_client(&nodes);
let (client, num_clients) = get_multi_client(&nodes, &SocketAddrSpace::Unspecified);
info!("clients: {}", num_clients);
assert!(num_clients >= NUM_NODES);

View File

@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-bench-streamer"
version = "1.5.0"
version = "1.8.12"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@ -10,11 +10,11 @@ publish = false
[dependencies]
clap = "2.33.1"
solana-clap-utils = { path = "../clap-utils", version = "1.5.0" }
solana-streamer = { path = "../streamer", version = "1.5.0" }
solana-logger = { path = "../logger", version = "1.5.0" }
solana-net-utils = { path = "../net-utils", version = "1.5.0" }
solana-version = { path = "../version", version = "1.5.0" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.12" }
solana-streamer = { path = "../streamer", version = "=1.8.12" }
solana-logger = { path = "../logger", version = "=1.8.12" }
solana-net-utils = { path = "../net-utils", version = "=1.8.12" }
solana-version = { path = "../version", version = "=1.8.12" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -1,31 +1,38 @@
use clap::{crate_description, crate_name, App, Arg};
use solana_streamer::packet::{Packet, Packets, PacketsRecycler, PACKET_DATA_SIZE};
use solana_streamer::streamer::{receiver, PacketReceiver};
use std::cmp::max;
use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket};
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::mpsc::channel;
use std::sync::Arc;
use std::thread::sleep;
use std::thread::{spawn, JoinHandle, Result};
use std::time::Duration;
use std::time::SystemTime;
#![allow(clippy::integer_arithmetic)]
use {
clap::{crate_description, crate_name, App, Arg},
solana_streamer::{
packet::{Packet, PacketBatch, PacketBatchRecycler, PACKET_DATA_SIZE},
streamer::{receiver, PacketBatchReceiver},
},
std::{
cmp::max,
net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket},
sync::{
atomic::{AtomicBool, AtomicUsize, Ordering},
mpsc::channel,
Arc,
},
thread::{sleep, spawn, JoinHandle, Result},
time::{Duration, SystemTime},
},
};
fn producer(addr: &SocketAddr, exit: Arc<AtomicBool>) -> JoinHandle<()> {
let send = UdpSocket::bind("0.0.0.0:0").unwrap();
let mut msgs = Packets::default();
msgs.packets.resize(10, Packet::default());
for w in msgs.packets.iter_mut() {
let mut packet_batch = PacketBatch::default();
packet_batch.packets.resize(10, Packet::default());
for w in packet_batch.packets.iter_mut() {
w.meta.size = PACKET_DATA_SIZE;
w.meta.set_addr(&addr);
w.meta.set_addr(addr);
}
let msgs = Arc::new(msgs);
let packet_batch = Arc::new(packet_batch);
spawn(move || loop {
if exit.load(Ordering::Relaxed) {
return;
}
let mut num = 0;
for p in &msgs.packets {
for p in &packet_batch.packets {
let a = p.meta.addr();
assert!(p.meta.size <= PACKET_DATA_SIZE);
send.send_to(&p.data[..p.meta.size], &a).unwrap();
@ -35,14 +42,14 @@ fn producer(addr: &SocketAddr, exit: Arc<AtomicBool>) -> JoinHandle<()> {
})
}
fn sink(exit: Arc<AtomicBool>, rvs: Arc<AtomicUsize>, r: PacketReceiver) -> JoinHandle<()> {
fn sink(exit: Arc<AtomicBool>, rvs: Arc<AtomicUsize>, r: PacketBatchReceiver) -> JoinHandle<()> {
spawn(move || loop {
if exit.load(Ordering::Relaxed) {
return;
}
let timer = Duration::new(1, 0);
if let Ok(msgs) = r.recv_timeout(timer) {
rvs.fetch_add(msgs.packets.len(), Ordering::Relaxed);
if let Ok(packet_batch) = r.recv_timeout(timer) {
rvs.fetch_add(packet_batch.packets.len(), Ordering::Relaxed);
}
})
}
@ -74,7 +81,7 @@ fn main() -> Result<()> {
let mut read_channels = Vec::new();
let mut read_threads = Vec::new();
let recycler = PacketsRecycler::default();
let recycler = PacketBatchRecycler::default();
for _ in 0..num_sockets {
let read = solana_net_utils::bind_to(ip_addr, port, false).unwrap();
read.set_read_timeout(Some(Duration::new(1, 0))).unwrap();
@ -90,6 +97,8 @@ fn main() -> Result<()> {
s_reader,
recycler.clone(),
"bench-streamer-test",
1,
true,
));
}

View File

@ -2,7 +2,7 @@
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
edition = "2018"
name = "solana-bench-tps"
version = "1.5.0"
version = "1.8.12"
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
@ -12,26 +12,27 @@ publish = false
bincode = "1.3.1"
clap = "2.33.1"
log = "0.4.11"
rayon = "1.4.0"
rayon = "1.5.0"
serde_json = "1.0.56"
serde_yaml = "0.8.13"
solana-clap-utils = { path = "../clap-utils", version = "1.5.0" }
solana-core = { path = "../core", version = "1.5.0" }
solana-genesis = { path = "../genesis", version = "1.5.0" }
solana-client = { path = "../client", version = "1.5.0" }
solana-faucet = { path = "../faucet", version = "1.5.0" }
solana-logger = { path = "../logger", version = "1.5.0" }
solana-metrics = { path = "../metrics", version = "1.5.0" }
solana-measure = { path = "../measure", version = "1.5.0" }
solana-net-utils = { path = "../net-utils", version = "1.5.0" }
solana-runtime = { path = "../runtime", version = "1.5.0" }
solana-sdk = { path = "../sdk", version = "1.5.0" }
solana-version = { path = "../version", version = "1.5.0" }
solana-clap-utils = { path = "../clap-utils", version = "=1.8.12" }
solana-core = { path = "../core", version = "=1.8.12" }
solana-genesis = { path = "../genesis", version = "=1.8.12" }
solana-client = { path = "../client", version = "=1.8.12" }
solana-faucet = { path = "../faucet", version = "=1.8.12" }
solana-gossip = { path = "../gossip", version = "=1.8.12" }
solana-logger = { path = "../logger", version = "=1.8.12" }
solana-metrics = { path = "../metrics", version = "=1.8.12" }
solana-measure = { path = "../measure", version = "=1.8.12" }
solana-net-utils = { path = "../net-utils", version = "=1.8.12" }
solana-runtime = { path = "../runtime", version = "=1.8.12" }
solana-sdk = { path = "../sdk", version = "=1.8.12" }
solana-streamer = { path = "../streamer", version = "=1.8.12" }
solana-version = { path = "../version", version = "=1.8.12" }
[dev-dependencies]
serial_test = "0.4.0"
serial_test_derive = "0.4.0"
solana-local-cluster = { path = "../local-cluster", version = "1.5.0" }
solana-local-cluster = { path = "../local-cluster", version = "=1.8.12" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

View File

@ -1,39 +1,40 @@
use crate::cli::Config;
use log::*;
use rayon::prelude::*;
use solana_client::perf_utils::{sample_txs, SampleStats};
use solana_core::gen_keys::GenKeys;
use solana_faucet::faucet::request_airdrop_transaction;
use solana_measure::measure::Measure;
use solana_metrics::{self, datapoint_info};
use solana_sdk::{
client::Client,
clock::{DEFAULT_TICKS_PER_SECOND, DEFAULT_TICKS_PER_SLOT, MAX_PROCESSING_AGE},
commitment_config::CommitmentConfig,
fee_calculator::FeeCalculator,
hash::Hash,
message::Message,
pubkey::Pubkey,
signature::{Keypair, Signer},
system_instruction, system_transaction,
timing::{duration_as_ms, duration_as_s, duration_as_us, timestamp},
transaction::Transaction,
};
use std::{
collections::{HashSet, VecDeque},
net::SocketAddr,
process::exit,
sync::{
atomic::{AtomicBool, AtomicIsize, AtomicUsize, Ordering},
Arc, Mutex, RwLock,
use {
crate::cli::Config,
log::*,
rayon::prelude::*,
solana_client::perf_utils::{sample_txs, SampleStats},
solana_core::gen_keys::GenKeys,
solana_faucet::faucet::request_airdrop_transaction,
solana_measure::measure::Measure,
solana_metrics::{self, datapoint_info},
solana_sdk::{
client::Client,
clock::{DEFAULT_S_PER_SLOT, MAX_PROCESSING_AGE},
commitment_config::CommitmentConfig,
fee_calculator::FeeCalculator,
hash::Hash,
message::Message,
pubkey::Pubkey,
signature::{Keypair, Signer},
system_instruction, system_transaction,
timing::{duration_as_ms, duration_as_s, duration_as_us, timestamp},
transaction::Transaction,
},
std::{
collections::{HashSet, VecDeque},
net::SocketAddr,
process::exit,
sync::{
atomic::{AtomicBool, AtomicIsize, AtomicUsize, Ordering},
Arc, Mutex, RwLock,
},
thread::{sleep, Builder, JoinHandle},
time::{Duration, Instant},
},
thread::{sleep, Builder, JoinHandle},
time::{Duration, Instant},
};
// The point at which transactions become "too old", in seconds.
const MAX_TX_QUEUE_AGE: u64 =
MAX_PROCESSING_AGE as u64 * DEFAULT_TICKS_PER_SLOT / DEFAULT_TICKS_PER_SECOND;
const MAX_TX_QUEUE_AGE: u64 = (MAX_PROCESSING_AGE as f64 * DEFAULT_S_PER_SLOT) as u64;
pub const MAX_SPENDS_PER_TX: u64 = 4;
@ -48,7 +49,7 @@ pub type SharedTransactions = Arc<RwLock<VecDeque<Vec<(Transaction, u64)>>>>;
fn get_recent_blockhash<T: Client>(client: &T) -> (Hash, FeeCalculator) {
loop {
match client.get_recent_blockhash_with_commitment(CommitmentConfig::recent()) {
match client.get_recent_blockhash_with_commitment(CommitmentConfig::processed()) {
Ok((blockhash, fee_calculator, _last_valid_slot)) => {
return (blockhash, fee_calculator)
}
@ -497,7 +498,7 @@ fn do_tx_transfers<T: Client>(
fn verify_funding_transfer<T: Client>(client: &Arc<T>, tx: &Transaction, amount: u64) -> bool {
for a in &tx.message().account_keys[1..] {
match client.get_balance_with_commitment(a, CommitmentConfig::recent()) {
match client.get_balance_with_commitment(a, CommitmentConfig::processed()) {
Ok(balance) => return balance >= amount,
Err(err) => error!("failed to get balance {:?}", err),
}
@ -545,12 +546,12 @@ impl<'a> FundingTransactions<'a> for Vec<(&'a Keypair, Transaction)> {
// re-sign retained to_fund_txes with updated blockhash
self.sign(blockhash);
self.send(&client);
self.send(client);
// Sleep a few slots to allow transactions to process
sleep(Duration::from_secs(1));
self.verify(&client, to_lamports);
self.verify(client, to_lamports);
// retry anything that seems to have dropped through cracks
// again since these txs are all or nothing, they're fine to
@ -565,7 +566,7 @@ impl<'a> FundingTransactions<'a> for Vec<(&'a Keypair, Transaction)> {
let to_fund_txs: Vec<(&Keypair, Transaction)> = to_fund
.par_iter()
.map(|(k, t)| {
let instructions = system_instruction::transfer_many(&k.pubkey(), &t);
let instructions = system_instruction::transfer_many(&k.pubkey(), t);
let message = Message::new(&instructions, Some(&k.pubkey()));
(*k, Transaction::new_unsigned(message))
})
@ -618,7 +619,7 @@ impl<'a> FundingTransactions<'a> for Vec<(&'a Keypair, Transaction)> {
return None;
}
let verified = if verify_funding_transfer(&client, &tx, to_lamports) {
let verified = if verify_funding_transfer(&client, tx, to_lamports) {
verified_txs.fetch_add(1, Ordering::Relaxed);
Some(k.pubkey())
} else {
@ -734,7 +735,7 @@ pub fn airdrop_lamports<T: Client>(
);
let (blockhash, _fee_calculator) = get_recent_blockhash(client);
match request_airdrop_transaction(&faucet_addr, &id.pubkey(), airdrop_amount, blockhash) {
match request_airdrop_transaction(faucet_addr, &id.pubkey(), airdrop_amount, blockhash) {
Ok(transaction) => {
let mut tries = 0;
loop {
@ -762,7 +763,7 @@ pub fn airdrop_lamports<T: Client>(
};
let current_balance = client
.get_balance_with_commitment(&id.pubkey(), CommitmentConfig::recent())
.get_balance_with_commitment(&id.pubkey(), CommitmentConfig::processed())
.unwrap_or_else(|e| {
info!("airdrop error {}", e);
starting_balance
@ -925,12 +926,14 @@ pub fn generate_and_fund_keypairs<T: 'static + Client + Send + Sync>(
#[cfg(test)]
mod tests {
use super::*;
use solana_runtime::bank::Bank;
use solana_runtime::bank_client::BankClient;
use solana_sdk::client::SyncClient;
use solana_sdk::fee_calculator::FeeRateGovernor;
use solana_sdk::genesis_config::create_genesis_config;
use {
super::*,
solana_runtime::{bank::Bank, bank_client::BankClient},
solana_sdk::{
client::SyncClient, fee_calculator::FeeRateGovernor,
genesis_config::create_genesis_config,
},
};
#[test]
fn test_bench_tps_bank_client() {
@ -967,7 +970,7 @@ mod tests {
for kp in &keypairs {
assert_eq!(
client
.get_balance_with_commitment(&kp.pubkey(), CommitmentConfig::recent())
.get_balance_with_commitment(&kp.pubkey(), CommitmentConfig::processed())
.unwrap(),
lamports
);

View File

@ -1,11 +1,13 @@
use clap::{crate_description, crate_name, App, Arg, ArgMatches};
use solana_faucet::faucet::FAUCET_PORT;
use solana_sdk::fee_calculator::FeeRateGovernor;
use solana_sdk::{
pubkey::Pubkey,
signature::{read_keypair_file, Keypair},
use {
clap::{crate_description, crate_name, App, Arg, ArgMatches},
solana_faucet::faucet::FAUCET_PORT,
solana_sdk::{
fee_calculator::FeeRateGovernor,
pubkey::Pubkey,
signature::{read_keypair_file, Keypair},
},
std::{net::SocketAddr, process::exit, time::Duration},
};
use std::{net::SocketAddr, process::exit, time::Duration};
const NUM_LAMPORTS_PER_ACCOUNT_DEFAULT: u64 = solana_sdk::native_token::LAMPORTS_PER_SOL;

View File

@ -1,2 +1,3 @@
#![allow(clippy::integer_arithmetic)]
pub mod bench;
pub mod cli;

View File

@ -1,12 +1,20 @@
use log::*;
use solana_bench_tps::bench::{do_bench_tps, generate_and_fund_keypairs, generate_keypairs};
use solana_bench_tps::cli;
use solana_core::gossip_service::{discover_cluster, get_client, get_multi_client};
use solana_genesis::Base64Account;
use solana_sdk::fee_calculator::FeeRateGovernor;
use solana_sdk::signature::{Keypair, Signer};
use solana_sdk::system_program;
use std::{collections::HashMap, fs::File, io::prelude::*, path::Path, process::exit, sync::Arc};
#![allow(clippy::integer_arithmetic)]
use {
log::*,
solana_bench_tps::{
bench::{do_bench_tps, generate_and_fund_keypairs, generate_keypairs},
cli,
},
solana_genesis::Base64Account,
solana_gossip::gossip_service::{discover_cluster, get_client, get_multi_client},
solana_sdk::{
fee_calculator::FeeRateGovernor,
signature::{Keypair, Signer},
system_program,
},
solana_streamer::socket::SocketAddrSpace,
std::{collections::HashMap, fs::File, io::prelude::*, path::Path, process::exit, sync::Arc},
};
/// 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;
@ -38,7 +46,7 @@ fn main() {
let keypair_count = *tx_count * keypair_multiplier;
if *write_to_client_file {
info!("Generating {} keypairs", keypair_count);
let (keypairs, _) = generate_keypairs(&id, keypair_count as u64);
let (keypairs, _) = generate_keypairs(id, keypair_count as u64);
let num_accounts = keypairs.len() as u64;
let max_fee =
FeeRateGovernor::new(*target_lamports_per_signature, 0).max_lamports_per_signature;
@ -67,13 +75,14 @@ fn main() {
}
info!("Connecting to the cluster");
let nodes = discover_cluster(&entrypoint_addr, *num_nodes).unwrap_or_else(|err| {
eprintln!("Failed to discover {} nodes: {:?}", num_nodes, err);
exit(1);
});
let nodes = discover_cluster(entrypoint_addr, *num_nodes, SocketAddrSpace::Unspecified)
.unwrap_or_else(|err| {
eprintln!("Failed to discover {} nodes: {:?}", num_nodes, err);
exit(1);
});
let client = if *multi_client {
let (client, num_clients) = get_multi_client(&nodes);
let (client, num_clients) = get_multi_client(&nodes, &SocketAddrSpace::Unspecified);
if nodes.len() < num_clients {
eprintln!(
"Error: Insufficient nodes discovered. Expecting {} or more",
@ -87,7 +96,7 @@ fn main() {
let mut target_client = None;
for node in nodes {
if node.id == *target_node {
target_client = Some(Arc::new(get_client(&[node])));
target_client = Some(Arc::new(get_client(&[node], &SocketAddrSpace::Unspecified)));
break;
}
}
@ -96,7 +105,7 @@ fn main() {
exit(1);
})
} else {
Arc::new(get_client(&nodes))
Arc::new(get_client(&nodes, &SocketAddrSpace::Unspecified))
};
let keypairs = if *read_from_client_file {
@ -134,7 +143,7 @@ fn main() {
generate_and_fund_keypairs(
client.clone(),
Some(*faucet_addr),
&id,
id,
keypair_count,
*num_lamports_per_account,
)

View File

@ -1,27 +1,44 @@
use serial_test_derive::serial;
use solana_bench_tps::bench::{do_bench_tps, generate_and_fund_keypairs};
use solana_bench_tps::cli::Config;
use solana_client::thin_client::create_client;
use solana_core::cluster_info::VALIDATOR_PORT_RANGE;
use solana_core::validator::ValidatorConfig;
use solana_faucet::faucet::run_local_faucet;
use solana_local_cluster::local_cluster::{ClusterConfig, LocalCluster};
use solana_sdk::signature::{Keypair, Signer};
use std::sync::{mpsc::channel, Arc};
use std::time::Duration;
#![allow(clippy::integer_arithmetic)]
use {
serial_test::serial,
solana_bench_tps::{
bench::{do_bench_tps, generate_and_fund_keypairs},
cli::Config,
},
solana_client::thin_client::create_client,
solana_core::validator::ValidatorConfig,
solana_faucet::faucet::run_local_faucet_with_port,
solana_gossip::cluster_info::VALIDATOR_PORT_RANGE,
solana_local_cluster::{
local_cluster::{ClusterConfig, LocalCluster},
validator_configs::make_identical_validator_configs,
},
solana_sdk::signature::{Keypair, Signer},
solana_streamer::socket::SocketAddrSpace,
std::{
sync::{mpsc::channel, Arc},
time::Duration,
},
};
fn test_bench_tps_local_cluster(config: Config) {
let native_instruction_processors = vec![];
solana_logger::setup();
const NUM_NODES: usize = 1;
let cluster = LocalCluster::new(&mut ClusterConfig {
node_stakes: vec![999_990; NUM_NODES],
cluster_lamports: 200_000_000,
validator_configs: vec![ValidatorConfig::default(); NUM_NODES],
native_instruction_processors,
..ClusterConfig::default()
});
let cluster = LocalCluster::new(
&mut ClusterConfig {
node_stakes: vec![999_990; NUM_NODES],
cluster_lamports: 200_000_000,
validator_configs: make_identical_validator_configs(
&ValidatorConfig::default(),
NUM_NODES,
),
native_instruction_processors,
..ClusterConfig::default()
},
SocketAddrSpace::Unspecified,
);
let faucet_keypair = Keypair::new();
cluster.transfer(
@ -36,8 +53,11 @@ fn test_bench_tps_local_cluster(config: Config) {
));
let (addr_sender, addr_receiver) = channel();
run_local_faucet(faucet_keypair, addr_sender, None);
let faucet_addr = addr_receiver.recv_timeout(Duration::from_secs(2)).unwrap();
run_local_faucet_with_port(faucet_keypair, addr_sender, None, 0);
let faucet_addr = addr_receiver
.recv_timeout(Duration::from_secs(2))
.expect("run_local_faucet")
.expect("faucet_addr");
let lamports_per_account = 100;

9
cargo
View File

@ -3,25 +3,22 @@
# shellcheck source=ci/rust-version.sh
here=$(dirname "$0")
source "${here}"/ci/rust-version.sh all
toolchain=
case "$1" in
stable)
source "${here}"/ci/rust-version.sh stable
# shellcheck disable=SC2054 # rust_stable is sourced from rust-version.sh
toolchain="$rust_stable"
shift
;;
nightly)
source "${here}"/ci/rust-version.sh nightly
# shellcheck disable=SC2054 # rust_nightly is sourced from rust-version.sh
toolchain="$rust_nightly"
shift
;;
+*)
toolchain="${1#+}"
shift
;;
*)
source "${here}"/ci/rust-version.sh stable
# shellcheck disable=SC2054 # rust_stable is sourced from rust-version.sh
toolchain="$rust_stable"
;;

View File

@ -137,7 +137,7 @@ all_test_steps() {
^ci/test-coverage.sh \
^scripts/coverage.sh \
; then
command_step coverage ". ci/rust-version.sh; ci/docker-run.sh \$\$rust_nightly_docker_image ci/test-coverage.sh" 30
command_step coverage ". ci/rust-version.sh; ci/docker-run.sh \$\$rust_nightly_docker_image ci/test-coverage.sh" 40
wait_step
else
annotate --style info --context test-coverage \
@ -148,6 +148,33 @@ all_test_steps() {
command_step stable ". ci/rust-version.sh; ci/docker-run.sh \$\$rust_stable_docker_image ci/test-stable.sh" 60
wait_step
# BPF test suite
if affects \
.rs$ \
Cargo.lock$ \
Cargo.toml$ \
^ci/rust-version.sh \
^ci/test-stable-bpf.sh \
^ci/test-stable.sh \
^ci/test-local-cluster.sh \
^core/build.rs \
^fetch-perf-libs.sh \
^programs/ \
^sdk/ \
; then
cat >> "$output_file" <<"EOF"
- command: "ci/test-stable-bpf.sh"
name: "stable-bpf"
timeout_in_minutes: 20
artifact_paths: "bpf-dumps.tar.bz2"
agents:
- "queue=default"
EOF
else
annotate --style info \
"Stable-BPF skipped as no relevant files were modified"
fi
# Perf test suite
if affects \
.rs$ \
@ -165,7 +192,7 @@ all_test_steps() {
cat >> "$output_file" <<"EOF"
- command: "ci/test-stable-perf.sh"
name: "stable-perf"
timeout_in_minutes: 40
timeout_in_minutes: 20
artifact_paths: "log-*.txt"
agents:
- "queue=cuda"
@ -216,7 +243,15 @@ EOF
command_step "local-cluster" \
". ci/rust-version.sh; ci/docker-run.sh \$\$rust_stable_docker_image ci/test-local-cluster.sh" \
45
40
command_step "local-cluster-flakey" \
". ci/rust-version.sh; ci/docker-run.sh \$\$rust_stable_docker_image ci/test-local-cluster-flakey.sh" \
10
command_step "local-cluster-slow" \
". ci/rust-version.sh; ci/docker-run.sh \$\$rust_stable_docker_image ci/test-local-cluster-slow.sh" \
30
}
pull_or_push_steps() {

View File

@ -3,16 +3,24 @@
# Pull requests to not run these steps.
steps:
- command: "ci/publish-tarball.sh"
agents:
- "queue=release-build"
timeout_in_minutes: 60
name: "publish tarball"
- command: "ci/publish-bpf-sdk.sh"
timeout_in_minutes: 5
name: "publish bpf sdk"
- wait
- command: "sdk/docker-solana/build.sh"
agents:
- "queue=release-build"
timeout_in_minutes: 60
name: "publish docker"
- command: "ci/publish-crate.sh"
agents:
- "queue=release-build"
timeout_in_minutes: 240
name: "publish crate"
branches: "!master"
- command: "ci/publish-tarball.sh"
agents:
- "queue=release-build-aarch64-apple-darwin"
timeout_in_minutes: 60
name: "publish tarball (aarch64-apple-darwin)"

View File

@ -105,11 +105,18 @@ if [[ -z "$CHANNEL" ]]; then
fi
fi
if [[ $CHANNEL = beta ]]; then
CHANNEL_LATEST_TAG="$BETA_CHANNEL_LATEST_TAG"
elif [[ $CHANNEL = stable ]]; then
CHANNEL_LATEST_TAG="$STABLE_CHANNEL_LATEST_TAG"
fi
echo EDGE_CHANNEL="$EDGE_CHANNEL"
echo BETA_CHANNEL="$BETA_CHANNEL"
echo BETA_CHANNEL_LATEST_TAG="$BETA_CHANNEL_LATEST_TAG"
echo STABLE_CHANNEL="$STABLE_CHANNEL"
echo STABLE_CHANNEL_LATEST_TAG="$STABLE_CHANNEL_LATEST_TAG"
echo CHANNEL="$CHANNEL"
echo CHANNEL_LATEST_TAG="$CHANNEL_LATEST_TAG"
exit 0

56
ci/do-audit.sh Executable file
View File

@ -0,0 +1,56 @@
#!/usr/bin/env bash
set -e
here="$(dirname "$0")"
src_root="$(readlink -f "${here}/..")"
cd "${src_root}"
cargo_audit_ignores=(
# failure is officially deprecated/unmaintained
#
# Blocked on multiple upstream crates removing their `failure` dependency.
--ignore RUSTSEC-2020-0036
# `net2` crate has been deprecated; use `socket2` instead
#
# Blocked on https://github.com/paritytech/jsonrpc/issues/575
--ignore RUSTSEC-2020-0016
# stdweb is unmaintained
#
# Blocked on multiple upstream crates removing their `stdweb` dependency.
--ignore RUSTSEC-2020-0056
# Potential segfault in the time crate
#
# Blocked on multiple crates updating `time` to >= 0.2.23
--ignore RUSTSEC-2020-0071
# generic-array: arr! macro erases lifetimes
#
# Blocked on libsecp256k1 releasing with upgraded dependencies
# https://github.com/paritytech/libsecp256k1/issues/66
--ignore RUSTSEC-2020-0146
# hyper: Lenient `hyper` header parsing of `Content-Length` could allow request smuggling
#
# Blocked on jsonrpc removing dependency on unmaintained `websocket`
# https://github.com/paritytech/jsonrpc/issues/605
--ignore RUSTSEC-2021-0078
# hyper: Integer overflow in `hyper`'s parsing of the `Transfer-Encoding` header leads to data loss
#
# Blocked on jsonrpc removing dependency on unmaintained `websocket`
# https://github.com/paritytech/jsonrpc/issues/605
--ignore RUSTSEC-2021-0079
# chrono: Potential segfault in `localtime_r` invocations
#
# Blocked due to no safe upgrade
# https://github.com/chronotope/chrono/issues/499
--ignore RUSTSEC-2020-0159
)
scripts/cargo-for-all-lock-files.sh stable audit "${cargo_audit_ignores[@]}"

View File

@ -1,4 +1,4 @@
FROM solanalabs/rust:1.48.0
FROM solanalabs/rust:1.52.1
ARG date
RUN set -x \

View File

@ -1,6 +1,6 @@
# Note: when the rust version is changed also modify
# ci/rust-version.sh to pick up the new image tag
FROM rust:1.48.0
FROM rust:1.52.1
# Add Google Protocol Buffers for Libra's metrics library.
ENV PROTOC_VERSION 3.8.0

View File

@ -23,6 +23,9 @@ if [[ -n $CI ]]; then
elif [[ -n $BUILDKITE ]]; then
export CI_BRANCH=$BUILDKITE_BRANCH
export CI_BUILD_ID=$BUILDKITE_BUILD_ID
if [[ $BUILDKITE_COMMIT = HEAD ]]; then
BUILDKITE_COMMIT="$(git rev-parse HEAD)"
fi
export CI_COMMIT=$BUILDKITE_COMMIT
export CI_JOB_ID=$BUILDKITE_JOB_ID
# The standard BUILDKITE_PULL_REQUEST environment variable is always "false" due
@ -35,7 +38,18 @@ if [[ -n $CI ]]; then
export CI_BASE_BRANCH=$BUILDKITE_BRANCH
export CI_PULL_REQUEST=
fi
export CI_OS_NAME=linux
case "$(uname -s)" in
Linux)
export CI_OS_NAME=linux
;;
Darwin)
export CI_OS_NAME=osx
;;
*)
;;
esac
if [[ -n $BUILDKITE_TRIGGERED_FROM_BUILD_PIPELINE_SLUG ]]; then
# The solana-secondary pipeline should use the slug of the pipeline that
# triggered it
@ -74,10 +88,13 @@ else
export CI_BUILD_ID=
export CI_COMMIT=
export CI_JOB_ID=
export CI_OS_NAME=
export CI_PULL_REQUEST=
export CI_REPO_SLUG=
export CI_TAG=
# Don't override ci/run-local.sh
if [[ -z $CI_LOCAL_RUN ]]; then
export CI_OS_NAME=
fi
fi
cat <<EOF

View File

@ -70,7 +70,7 @@ done
source ci/upload-ci-artifact.sh
source scripts/configure-metrics.sh
source multinode-demo/common.sh
source multinode-demo/common.sh --prebuild
nodes=(
"multinode-demo/bootstrap-validator.sh \
@ -78,7 +78,6 @@ nodes=(
--init-complete-file init-complete-node0.log \
--dynamic-port-range 8000-8050"
"multinode-demo/validator.sh \
--enable-rpc-exit \
--no-restart \
--dynamic-port-range 8050-8100
--init-complete-file init-complete-node1.log \
@ -128,7 +127,7 @@ startNode() {
waitForNodeToInit() {
declare initCompleteFile=$1
while [[ ! -r $initCompleteFile ]]; do
if [[ $SECONDS -ge 240 ]]; then
if [[ $SECONDS -ge 300 ]]; then
echo "^^^ +++"
echo "Error: $initCompleteFile not found in $SECONDS seconds"
exit 1
@ -201,17 +200,10 @@ killNodes() {
[[ ${#pids[@]} -gt 0 ]] || return
# Try to use the RPC exit API to cleanly exit the first two nodes
# (dynamic nodes, -x, are just killed since their RPC port is not known)
# (dynamic nodes, -x, are just killed)
echo "--- RPC exit"
for port in 8899 18899; do
(
set -x
curl --retry 5 --retry-delay 2 --retry-connrefused \
-X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1, "method":"validatorExit"}' \
http://localhost:$port
)
done
$solana_validator --ledger "$SOLANA_CONFIG_DIR"/bootstrap-validator exit --force || true
$solana_validator --ledger "$SOLANA_CONFIG_DIR"/validator exit --force || true
# Give the nodes a splash of time to cleanly exit before killing them
sleep 2

View File

@ -19,6 +19,7 @@ declare prints=(
# Parts of the tree that are expected to be print free
declare print_free_tree=(
':core/src/**.rs'
':^core/src/validator.rs'
':faucet/src/**.rs'
':ledger/src/**.rs'
':metrics/src/**.rs'

View File

@ -12,10 +12,14 @@ import json
import subprocess
import sys;
real_file = os.path.realpath(__file__)
ci_path = os.path.dirname(real_file)
src_root = os.path.dirname(ci_path)
def load_metadata():
cmd = f'{src_root}/cargo metadata --no-deps --format-version=1'
return json.loads(subprocess.Popen(
'cargo metadata --no-deps --format-version=1',
shell=True, stdout=subprocess.PIPE).communicate()[0])
cmd, shell=True, stdout=subprocess.PIPE).communicate()[0])
def get_packages():
metadata = load_metadata()

View File

@ -1,27 +0,0 @@
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")/.."
eval "$(ci/channel-info.sh)"
if [[ -n "$CI_TAG" ]]; then
CHANNEL_OR_TAG=$CI_TAG
else
CHANNEL_OR_TAG=$CHANNEL
fi
(
set -x
sdk/bpf/scripts/package.sh
[[ -f bpf-sdk.tar.bz2 ]]
)
source ci/upload-ci-artifact.sh
echo --- AWS S3 Store
if [[ -z $CHANNEL_OR_TAG ]]; then
echo Skipped
else
upload-s3-artifact "/solana/bpf-sdk.tar.bz2" "s3://solana-sdk/$CHANNEL_OR_TAG/bpf-sdk.tar.bz2"
fi
exit 0

View File

@ -39,7 +39,11 @@ fi
case "$CI_OS_NAME" in
osx)
TARGET=x86_64-apple-darwin
_cputype="$(uname -m)"
if [[ $_cputype = arm64 ]]; then
_cputype=aarch64
fi
TARGET=${_cputype}-apple-darwin
;;
linux)
TARGET=x86_64-unknown-linux-gnu
@ -83,7 +87,7 @@ echo --- Creating release tarball
export CHANNEL
source ci/rust-version.sh stable
scripts/cargo-install-all.sh +"$rust_stable" "${RELEASE_BASENAME}"
scripts/cargo-install-all.sh stable "${RELEASE_BASENAME}"
tar cvf "${TARBALL_BASENAME}"-$TARGET.tar "${RELEASE_BASENAME}"
bzip2 "${TARBALL_BASENAME}"-$TARGET.tar

57
ci/run-local.sh Executable file
View File

@ -0,0 +1,57 @@
#!/usr/bin/env bash
cd "$(dirname "$0")/.."
export CI_LOCAL_RUN=true
set -e
case $(uname -o) in
*/Linux)
export CI_OS_NAME=linux
;;
*)
echo "local CI runs are only supported on Linux" 1>&2
exit 1
;;
esac
steps=()
steps+=(test-sanity)
steps+=(shellcheck)
steps+=(test-checks)
steps+=(test-coverage)
steps+=(test-stable)
steps+=(test-stable-bpf)
steps+=(test-stable-perf)
steps+=(test-downstream-builds)
steps+=(test-bench)
steps+=(test-local-cluster)
steps+=(test-local-cluster-flakey)
steps+=(test-local-cluster-slow)
step_index=0
if [[ -n "$1" ]]; then
start_step="$1"
while [[ $step_index -lt ${#steps[@]} ]]; do
step="${steps[$step_index]}"
if [[ "$step" = "$start_step" ]]; then
break
fi
step_index=$((step_index + 1))
done
if [[ $step_index -eq ${#steps[@]} ]]; then
echo "unexpected start step: \"$start_step\"" 1>&2
exit 1
else
echo "** starting at step: \"$start_step\" **"
echo
fi
fi
while [[ $step_index -lt ${#steps[@]} ]]; do
step="${steps[$step_index]}"
cmd="ci/${step}.sh"
$cmd
step_index=$((step_index + 1))
done

View File

@ -7,7 +7,7 @@ source multinode-demo/common.sh
rm -rf config/run/init-completed config/ledger config/snapshot-ledger
timeout 120 ./run.sh &
SOLANA_RUN_SH_VALIDATOR_ARGS="--snapshot-interval-slots 200" timeout 120 ./scripts/run.sh &
pid=$!
attempts=20
@ -16,16 +16,20 @@ while [[ ! -f config/run/init-completed ]]; do
if ((--attempts == 0)); then
echo "Error: validator failed to boot"
exit 1
else
echo "Checking init"
fi
done
snapshot_slot=1
# wait a bit longer than snapshot_slot
while [[ $($solana_cli --url http://localhost:8899 slot --commitment recent) -le $((snapshot_slot + 1)) ]]; do
while [[ $($solana_cli --url http://localhost:8899 slot --commitment processed) -le $((snapshot_slot + 1)) ]]; do
sleep 1
echo "Checking slot"
done
curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1, "method":"validatorExit"}' http://localhost:8899
$solana_validator --ledger config/ledger exit --force || true
wait $pid

View File

@ -18,13 +18,13 @@
if [[ -n $RUST_STABLE_VERSION ]]; then
stable_version="$RUST_STABLE_VERSION"
else
stable_version=1.48.0
stable_version=1.52.1
fi
if [[ -n $RUST_NIGHTLY_VERSION ]]; then
nightly_version="$RUST_NIGHTLY_VERSION"
else
nightly_version=2020-12-13
nightly_version=2021-05-18
fi

View File

@ -76,7 +76,7 @@ RestartForceExitStatus=SIGPIPE
TimeoutStartSec=10
TimeoutStopSec=0
KillMode=process
LimitNOFILE=500000
LimitNOFILE=1000000
[Install]
WantedBy=multi-user.target

View File

@ -8,5 +8,5 @@ source "$HERE"/utils.sh
ensure_env || exit 1
# Allow more files to be opened by a user
echo "* - nofile 500000" > /etc/security/limits.d/90-solana-nofiles.conf
echo "* - nofile 1000000" > /etc/security/limits.d/90-solana-nofiles.conf

View File

@ -23,7 +23,11 @@ fi
BENCH_FILE=bench_output.log
BENCH_ARTIFACT=current_bench_results.log
# Clear the C dependency files, if dependeny moves these files are not regenerated
# solana-keygen required when building C programs
_ "$cargo" build --manifest-path=keygen/Cargo.toml
export PATH="$PWD/target/debug":$PATH
# Clear the C dependency files, if dependency moves these files are not regenerated
test -d target/debug/bpf && find target/debug/bpf -name '*.d' -delete
test -d target/release/bpf && find target/release/bpf -name '*.d' -delete
@ -41,6 +45,14 @@ _ "$cargo" nightly bench --manifest-path sdk/Cargo.toml ${V:+--verbose} \
_ "$cargo" nightly bench --manifest-path runtime/Cargo.toml ${V:+--verbose} \
-- -Z unstable-options --format=json | tee -a "$BENCH_FILE"
# Run gossip benches
_ "$cargo" nightly bench --manifest-path gossip/Cargo.toml ${V:+--verbose} \
-- -Z unstable-options --format=json | tee -a "$BENCH_FILE"
# Run poh benches
_ "$cargo" nightly bench --manifest-path poh/Cargo.toml ${V:+--verbose} \
-- -Z unstable-options --format=json | tee -a "$BENCH_FILE"
# Run core benches
_ "$cargo" nightly bench --manifest-path core/Cargo.toml ${V:+--verbose} \
-- -Z unstable-options --format=json | tee -a "$BENCH_FILE"

View File

@ -12,6 +12,16 @@ cargo="$(readlink -f "./cargo")"
scripts/increment-cargo-version.sh check
# Disallow uncommitted Cargo.lock changes
(
_ scripts/cargo-for-all-lock-files.sh tree >/dev/null
set +e
if ! _ git diff --exit-code; then
echo -e "\nError: Uncommitted Cargo.lock changes" 1>&2
exit 1
fi
)
echo --- build environment
(
set -x
@ -25,8 +35,10 @@ echo --- build environment
"$cargo" stable clippy --version --verbose
"$cargo" nightly clippy --version --verbose
# audit is done only with stable
# audit is done only with "$cargo stable"
"$cargo" stable audit --version
grcov --version
)
export RUST_BACKTRACE=1
@ -35,7 +47,7 @@ export RUSTFLAGS="-D warnings -A incomplete_features"
# Only force up-to-date lock files on edge
if [[ $CI_BASE_BRANCH = "$EDGE_CHANNEL" ]]; then
# Exclude --benches as it's not available in rust stable yet
if _ scripts/cargo-for-all-lock-files.sh +"$rust_stable" check --locked --tests --bins --examples; then
if _ scripts/cargo-for-all-lock-files.sh stable check --locked --tests --bins --examples; then
true
else
check_status=$?
@ -46,56 +58,30 @@ if [[ $CI_BASE_BRANCH = "$EDGE_CHANNEL" ]]; then
fi
# Ensure nightly and --benches
_ scripts/cargo-for-all-lock-files.sh +"$rust_nightly" check --locked --all-targets
_ scripts/cargo-for-all-lock-files.sh nightly check --locked --all-targets
else
echo "Note: cargo-for-all-lock-files.sh skipped because $CI_BASE_BRANCH != $EDGE_CHANNEL"
fi
_ ci/order-crates-for-publishing.py
_ "$cargo" stable fmt --all -- --check
# -Z... is needed because of clippy bug: https://github.com/rust-lang/rust-clippy/issues/4612
# run nightly clippy for `sdk/` as there's a moderate amount of nightly-only code there
_ "$cargo" nightly clippy -Zunstable-options --workspace --all-targets -- --deny=warnings
_ "$cargo" nightly clippy -Zunstable-options --workspace --all-targets -- \
--deny=warnings --deny=clippy::integer_arithmetic --allow=clippy::inconsistent_struct_constructor
cargo_audit_ignores=(
# failure is officially deprecated/unmaintained
#
# Blocked on multiple upstream crates removing their `failure` dependency.
--ignore RUSTSEC-2020-0036
_ "$cargo" stable fmt --all -- --check
# `net2` crate has been deprecated; use `socket2` instead
#
# Blocked on https://github.com/paritytech/jsonrpc/issues/575
--ignore RUSTSEC-2020-0016
# stdweb is unmaintained
#
# Blocked on multiple upstream crates removing their `stdweb` dependency.
--ignore RUSTSEC-2020-0056
# Potential segfault in the time crate
#
# Blocked on multiple crates updating `time` to >= 0.2.23
--ignore RUSTSEC-2020-0071
# memmap crate is unmaintained
#
# Blocked on us releasing new solana crates
--ignore RUSTSEC-2020-0077
)
_ scripts/cargo-for-all-lock-files.sh +"$rust_stable" audit "${cargo_audit_ignores[@]}"
_ ci/do-audit.sh
{
cd programs/bpf
_ "$cargo" stable audit
for project in rust/*/ ; do
echo "+++ do_bpf_checks $project"
(
cd "$project"
_ "$cargo" stable fmt -- --check
_ "$cargo" nightly test
_ "$cargo" nightly clippy -- --deny=warnings --allow=clippy::missing_safety_doc
_ "$cargo" stable fmt -- --check
)
done
}

9
ci/test-downstream-builds.sh Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
cd "$(dirname "$0")/.."
export CI_LOCAL_RUN=true
set -ex
scripts/build-downstream-projects.sh

View File

@ -0,0 +1 @@
test-stable.sh

View File

@ -0,0 +1 @@
test-stable.sh

View File

@ -25,4 +25,29 @@ echo
_ ci/nits.sh
_ ci/check-ssh-keys.sh
# Ensure the current channel version is not equal ("greater") than
# the version of the latest tag
if [[ -z $CI_TAG ]]; then
echo "--- channel version check"
(
eval "$(ci/channel-info.sh)"
if [[ -n $CHANNEL_LATEST_TAG ]]; then
source scripts/read-cargo-variable.sh
version=$(readCargoVariable version "version/Cargo.toml")
echo "version: v$version"
echo "latest channel tag: $CHANNEL_LATEST_TAG"
if [[ $CHANNEL_LATEST_TAG = v$version ]]; then
echo "Error: please run ./scripts/increment-cargo-version.sh"
exit 1
fi
else
echo "Skipped. CHANNEL_LATEST_TAG (CHANNEL=$CHANNEL) unset"
fi
)
fi
echo --- ok

1
ci/test-stable-bpf.sh Symbolic link
View File

@ -0,0 +1 @@
test-stable.sh

View File

@ -21,13 +21,6 @@ export RUST_BACKTRACE=1
export RUSTFLAGS="-D warnings"
source scripts/ulimit-n.sh
# Clear the C dependency files, if dependency moves these files are not regenerated
test -d target/debug/bpf && find target/debug/bpf -name '*.d' -delete
test -d target/release/bpf && find target/release/bpf -name '*.d' -delete
# Clear the BPF sysroot files, they are not automatically rebuilt
rm -rf target/xargo # Issue #3105
# Limit compiler jobs to reduce memory usage
# on machines with 2gb/thread of memory
NPROC=$(nproc)
@ -38,21 +31,58 @@ case $testName in
test-stable)
_ "$cargo" stable test --jobs "$NPROC" --all --exclude solana-local-cluster ${V:+--verbose} -- --nocapture
;;
test-stable-perf)
# BPF solana-sdk legacy compile test
./cargo-build-bpf --manifest-path sdk/Cargo.toml
test-stable-bpf)
# Clear the C dependency files, if dependency moves these files are not regenerated
test -d target/debug/bpf && find target/debug/bpf -name '*.d' -delete
test -d target/release/bpf && find target/release/bpf -name '*.d' -delete
# BPF program tests
# rustfilt required for dumping BPF assembly listings
"$cargo" install rustfilt
# solana-keygen required when building C programs
_ "$cargo" build --manifest-path=keygen/Cargo.toml
export PATH="$PWD/target/debug":$PATH
cargo_build_bpf="$(realpath ./cargo-build-bpf)"
# BPF solana-sdk legacy compile test
"$cargo_build_bpf" --manifest-path sdk/Cargo.toml
# BPF Program unit tests
"$cargo" test --manifest-path programs/bpf/Cargo.toml
"$cargo_build_bpf" --manifest-path programs/bpf/Cargo.toml --bpf-sdk sdk/bpf
# BPF program system tests
_ make -C programs/bpf/c tests
_ "$cargo" stable test \
--manifest-path programs/bpf/Cargo.toml \
--no-default-features --features=bpf_c,bpf_rust -- --nocapture
# Dump BPF program assembly listings
for bpf_test in programs/bpf/rust/*; do
if pushd "$bpf_test"; then
"$cargo_build_bpf" --dump
popd
fi
done
# BPF program instruction count assertion
bpf_target_path=programs/bpf/target
_ "$cargo" stable test \
--manifest-path programs/bpf/Cargo.toml \
--no-default-features --features=bpf_c,bpf_rust assert_instruction_count \
-- --nocapture &> "${bpf_target_path}"/deploy/instuction_counts.txt
bpf_dump_archive="bpf-dumps.tar.bz2"
rm -f "$bpf_dump_archive"
tar cjvf "$bpf_dump_archive" "${bpf_target_path}"/{deploy/*.txt,bpfel-unknown-unknown/release/*.so}
exit 0
;;
test-stable-perf)
if [[ $(uname) = Linux ]]; then
# Enable persistence mode to keep the CUDA kernel driver loaded, avoiding a
# lengthy and unexpected delay the first time CUDA is involved when the driver
# is not yet loaded.
sudo --non-interactive ./net/scripts/enable-nvidia-persistence-mode.sh
sudo --non-interactive ./net/scripts/enable-nvidia-persistence-mode.sh || true
rm -rf target/perf-libs
./fetch-perf-libs.sh
@ -70,7 +100,17 @@ test-stable-perf)
;;
test-local-cluster)
_ "$cargo" stable build --release --bins ${V:+--verbose}
_ "$cargo" stable test --release --package solana-local-cluster ${V:+--verbose} -- --nocapture --test-threads=1
_ "$cargo" stable test --release --package solana-local-cluster --test local_cluster ${V:+--verbose} -- --nocapture --test-threads=1
exit 0
;;
test-local-cluster-flakey)
_ "$cargo" stable build --release --bins ${V:+--verbose}
_ "$cargo" stable test --release --package solana-local-cluster --test local_cluster_flakey ${V:+--verbose} -- --nocapture --test-threads=1
exit 0
;;
test-local-cluster-slow)
_ "$cargo" stable build --release --bins ${V:+--verbose}
_ "$cargo" stable test --release --package solana-local-cluster --test local_cluster_slow ${V:+--verbose} -- --nocapture --test-threads=1
exit 0
;;
*)

View File

@ -19,13 +19,24 @@ upload-ci-artifact() {
upload-s3-artifact() {
echo "--- artifact: $1 to $2"
(
set -x
docker run \
--rm \
--env AWS_ACCESS_KEY_ID \
--env AWS_SECRET_ACCESS_KEY \
--volume "$PWD:/solana" \
eremite/aws-cli:2018.12.18 \
args=(
--rm
--env AWS_ACCESS_KEY_ID
--env AWS_SECRET_ACCESS_KEY
--volume "$PWD:/solana"
)
if [[ $(uname -m) = arm64 ]]; then
# Ref: https://blog.jaimyn.dev/how-to-build-multi-architecture-docker-images-on-an-m1-mac/#tldr
args+=(
--platform linux/amd64
)
fi
args+=(
eremite/aws-cli:2018.12.18
/usr/bin/s3cmd --acl-public put "$1" "$2"
)
set -x
docker run "${args[@]}"
)
}

View File

@ -1,23 +1,29 @@
[package]
name = "solana-clap-utils"
version = "1.5.0"
version = "1.8.12"
description = "Solana utilities for the clap"
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
documentation = "https://docs.rs/solana-clap-utils"
edition = "2018"
[dependencies]
clap = "2.33.0"
rpassword = "4.0"
solana-remote-wallet = { path = "../remote-wallet", version = "1.5.0" }
solana-sdk = { path = "../sdk", version = "1.5.0" }
solana-perf = { path = "../perf", version = "=1.8.12" }
solana-remote-wallet = { path = "../remote-wallet", version = "=1.8.12" }
solana-sdk = { path = "../sdk", version = "=1.8.12" }
thiserror = "1.0.21"
tiny-bip39 = "0.7.0"
tiny-bip39 = "0.8.1"
uriparse = "0.6.3"
url = "2.1.0"
chrono = "0.4"
[dev-dependencies]
tempfile = "3.1.0"
[lib]
name = "solana_clap_utils"

View File

@ -1,22 +0,0 @@
use crate::ArgConstant;
use clap::Arg;
pub const COMMITMENT_ARG: ArgConstant<'static> = ArgConstant {
name: "commitment",
long: "commitment",
help: "Return information at the selected commitment level",
};
pub fn commitment_arg<'a, 'b>() -> Arg<'a, 'b> {
commitment_arg_with_default("recent")
}
pub fn commitment_arg_with_default<'a, 'b>(default_value: &'static str) -> Arg<'a, 'b> {
Arg::with_name(COMMITMENT_ARG.name)
.long(COMMITMENT_ARG.long)
.takes_value(true)
.possible_values(&["recent", "single", "singleGossip", "root", "max"])
.default_value(default_value)
.value_name("COMMITMENT_LEVEL")
.help(COMMITMENT_ARG.help)
}

View File

@ -1,5 +1,7 @@
use crate::{input_validators, ArgConstant};
use clap::Arg;
use {
crate::{input_validators, ArgConstant},
clap::Arg,
};
pub const FEE_PAYER_ARG: ArgConstant<'static> = ArgConstant {
name: "fee_payer",

View File

@ -1,19 +1,24 @@
use crate::keypair::{
keypair_from_seed_phrase, pubkey_from_path, resolve_signer_from_path, signer_from_path,
ASK_KEYWORD, SKIP_SEED_PHRASE_VALIDATION_ARG,
use {
crate::keypair::{
keypair_from_seed_phrase, pubkey_from_path, resolve_signer_from_path, signer_from_path,
ASK_KEYWORD, SKIP_SEED_PHRASE_VALIDATION_ARG,
},
chrono::DateTime,
clap::ArgMatches,
solana_remote_wallet::remote_wallet::RemoteWalletManager,
solana_sdk::{
clock::UnixTimestamp,
commitment_config::CommitmentConfig,
genesis_config::ClusterType,
native_token::sol_to_lamports,
pubkey::Pubkey,
signature::{read_keypair_file, Keypair, Signature, Signer},
},
std::{str::FromStr, sync::Arc},
};
use chrono::DateTime;
use clap::ArgMatches;
use solana_remote_wallet::remote_wallet::RemoteWalletManager;
use solana_sdk::{
clock::UnixTimestamp,
commitment_config::CommitmentConfig,
genesis_config::ClusterType,
native_token::sol_to_lamports,
pubkey::Pubkey,
signature::{read_keypair_file, Keypair, Signature, Signer},
};
use std::{str::FromStr, sync::Arc};
// Sentinel value used to indicate to write to screen instead of file
pub const STDOUT_OUTFILE_TOKEN: &str = "-";
// Return parsed values from matches at `name`
pub fn values_of<T>(matches: &ArgMatches<'_>, name: &str) -> Option<Vec<T>>
@ -55,7 +60,7 @@ pub fn keypair_of(matches: &ArgMatches<'_>, name: &str) -> Option<Keypair> {
if let Some(value) = matches.value_of(name) {
if value == ASK_KEYWORD {
let skip_validation = matches.is_present(SKIP_SEED_PHRASE_VALIDATION_ARG.name);
keypair_from_seed_phrase(name, skip_validation, true).ok()
keypair_from_seed_phrase(name, skip_validation, true, None, true).ok()
} else {
read_keypair_file(value).ok()
}
@ -70,7 +75,7 @@ pub fn keypairs_of(matches: &ArgMatches<'_>, name: &str) -> Option<Vec<Keypair>>
.filter_map(|value| {
if value == ASK_KEYWORD {
let skip_validation = matches.is_present(SKIP_SEED_PHRASE_VALIDATION_ARG.name);
keypair_from_seed_phrase(name, skip_validation, true).ok()
keypair_from_seed_phrase(name, skip_validation, true, None, true).ok()
} else {
read_keypair_file(value).ok()
}
@ -167,12 +172,12 @@ pub fn resolve_signer(
name: &str,
wallet_manager: &mut Option<Arc<RemoteWalletManager>>,
) -> Result<Option<String>, Box<dyn std::error::Error>> {
Ok(resolve_signer_from_path(
resolve_signer_from_path(
matches,
matches.value_of(name).unwrap(),
name,
wallet_manager,
)?)
)
}
pub fn lamports_of_sol(matches: &ArgMatches<'_>, name: &str) -> Option<u64> {
@ -184,22 +189,19 @@ pub fn cluster_type_of(matches: &ArgMatches<'_>, name: &str) -> Option<ClusterTy
}
pub fn commitment_of(matches: &ArgMatches<'_>, name: &str) -> Option<CommitmentConfig> {
matches.value_of(name).map(|value| match value {
"max" => CommitmentConfig::max(),
"recent" => CommitmentConfig::recent(),
"root" => CommitmentConfig::root(),
"single" => CommitmentConfig::single(),
"singleGossip" => CommitmentConfig::single_gossip(),
_ => CommitmentConfig::default(),
})
matches
.value_of(name)
.map(|value| CommitmentConfig::from_str(value).unwrap_or_default())
}
#[cfg(test)]
mod tests {
use super::*;
use clap::{App, Arg};
use solana_sdk::signature::write_keypair_file;
use std::fs;
use {
super::*,
clap::{App, Arg},
solana_sdk::signature::write_keypair_file,
std::fs,
};
fn app<'ab, 'v>() -> App<'ab, 'v> {
App::new("test")

View File

@ -1,13 +1,14 @@
use crate::keypair::{parse_keypair_path, KeypairUrl, ASK_KEYWORD};
use chrono::DateTime;
use solana_sdk::{
clock::Slot,
hash::Hash,
pubkey::Pubkey,
signature::{read_keypair_file, Signature},
use {
crate::keypair::{parse_signer_source, SignerSourceKind, ASK_KEYWORD},
chrono::DateTime,
solana_sdk::{
clock::{Epoch, Slot},
hash::Hash,
pubkey::{Pubkey, MAX_SEED_LEN},
signature::{read_keypair_file, Signature},
},
std::{fmt::Display, str::FromStr},
};
use std::fmt::Display;
use std::str::FromStr;
fn is_parsable_generic<U, T>(string: T) -> Result<(), String>
where
@ -32,6 +33,29 @@ where
is_parsable_generic::<T, String>(string)
}
// Return an error if string cannot be parsed as numeric type T, and value not within specified
// range
pub fn is_within_range<T>(string: String, range_min: T, range_max: T) -> Result<(), String>
where
T: FromStr + Copy + std::fmt::Debug + PartialOrd + std::ops::Add<Output = T> + From<usize>,
T::Err: Display,
{
match string.parse::<T>() {
Ok(input) => {
let range = range_min..range_max + 1.into();
if !range.contains(&input) {
Err(format!(
"input '{:?}' out of range ({:?}..{:?}]",
input, range_min, range_max
))
} else {
Ok(())
}
}
Err(err) => Err(format!("error parsing '{}': {}", string, err)),
}
}
// Return an error if a pubkey cannot be parsed.
pub fn is_pubkey<T>(string: T) -> Result<(), String>
where
@ -71,6 +95,26 @@ where
.map_err(|err| format!("{}", err))
}
// Return an error if a `SignerSourceKind::Prompt` cannot be parsed
pub fn is_prompt_signer_source<T>(string: T) -> Result<(), String>
where
T: AsRef<str> + Display,
{
if string.as_ref() == ASK_KEYWORD {
return Ok(());
}
match parse_signer_source(string.as_ref())
.map_err(|err| format!("{}", err))?
.kind
{
SignerSourceKind::Prompt => Ok(()),
_ => Err(format!(
"Unable to parse input as `prompt:` URI scheme or `ASK` keyword: {}",
string
)),
}
}
// Return an error if string cannot be parsed as pubkey string or keypair file location
pub fn is_pubkey_or_keypair<T>(string: T) -> Result<(), String>
where
@ -85,8 +129,11 @@ pub fn is_valid_pubkey<T>(string: T) -> Result<(), String>
where
T: AsRef<str> + Display,
{
match parse_keypair_path(string.as_ref()) {
KeypairUrl::Filepath(path) => is_keypair(path),
match parse_signer_source(string.as_ref())
.map_err(|err| format!("{}", err))?
.kind
{
SignerSourceKind::Filepath(path) => is_keypair(path),
_ => Ok(()),
}
}
@ -148,6 +195,40 @@ where
}
}
pub fn is_url_or_moniker<T>(string: T) -> Result<(), String>
where
T: AsRef<str> + Display,
{
match url::Url::parse(&normalize_to_url_if_moniker(string.as_ref())) {
Ok(url) => {
if url.has_host() {
Ok(())
} else {
Err("no host provided".to_string())
}
}
Err(err) => Err(format!("{}", err)),
}
}
pub fn normalize_to_url_if_moniker<T: AsRef<str>>(url_or_moniker: T) -> String {
match url_or_moniker.as_ref() {
"m" | "mainnet-beta" => "https://api.mainnet-beta.solana.com",
"t" | "testnet" => "https://api.testnet.solana.com",
"d" | "devnet" => "https://api.devnet.solana.com",
"l" | "localhost" => "http://localhost:8899",
url => url,
}
.to_string()
}
pub fn is_epoch<T>(epoch: T) -> Result<(), String>
where
T: AsRef<str> + Display,
{
is_parsable_generic::<Epoch, _>(epoch)
}
pub fn is_slot<T>(slot: T) -> Result<(), String>
where
T: AsRef<str> + Display,
@ -257,6 +338,42 @@ where
.map(|_| ())
}
pub fn is_derived_address_seed<T>(value: T) -> Result<(), String>
where
T: AsRef<str> + Display,
{
let value = value.as_ref();
if value.len() > MAX_SEED_LEN {
Err(format!(
"Address seed must not be longer than {} bytes",
MAX_SEED_LEN
))
} else {
Ok(())
}
}
pub fn is_niceness_adjustment_valid<T>(value: T) -> Result<(), String>
where
T: AsRef<str> + Display,
{
let adjustment = value.as_ref().parse::<i8>().map_err(|err| {
format!(
"error parsing niceness adjustment value '{}': {}",
value, err
)
})?;
if solana_perf::thread::is_renice_allowed(adjustment) {
Ok(())
} else {
Err(String::from(
"niceness adjustment supported only on Linux; negative adjustment \
(priority increase) requires root or CAP_SYS_NICE (see `man 7 capabilities` \
for details)",
))
}
}
#[cfg(test)]
mod tests {
use super::*;
@ -273,4 +390,11 @@ mod tests {
assert!(is_derivation("a/b").is_err());
assert!(is_derivation("0/4294967296").is_err());
}
#[test]
fn test_is_niceness_adjustment_valid() {
assert_eq!(is_niceness_adjustment_valid("0"), Ok(()));
assert!(is_niceness_adjustment_valid("128").is_err());
assert!(is_niceness_adjustment_valid("-129").is_err());
}
}

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