Commit Graph

13819 Commits

Author SHA1 Message Date
fae0a6307d docs: add hackathon banner 2021-05-13 05:03:15 +00:00
9753f1a6ca Add bip32 support to solana-keygen recover (#17180) (#17189)
* 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

(cherry picked from commit b437b0a49d)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-12 20:48:53 +00:00
8ad1554bc9 Update devnet and testnet endpoints (#17188) (#17191)
(cherry picked from commit 597373f5fa)

Co-authored-by: joeaba <77398477+joeaba@users.noreply.github.com>
2021-05-12 20:25:05 +00:00
2367f561dc include/exclude keys on account secondary index (backport #17110) (#17179)
* 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

(cherry picked from commit 7d96f78821)

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

* resolve merge conflicts

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
2021-05-12 15:09:46 +00:00
21d41b976b Move Signer types out of the signature module (backport #17099) (#17177)
* sdk: Move `Signer` trait to own module

(cherry picked from commit af6f3d776e)

* sdk: Move `Keypair` to `signer` module

(cherry picked from commit 0eba6eb401)

* sdk: Move `Presigner` to `signer` module

(cherry picked from commit 12bf6c06c3)

* sdk: Move `NullSigner` to `signer` module

(cherry picked from commit b71e4bdc61)

* sdk: Move `signers` module into `signer` module

(cherry picked from commit 967840aed6)

* sdk: keypair - drop superfluous iter()

(cherry picked from commit dbac38702a)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-05-11 20:44:54 +00:00
3303ead54d Add Keccak256 syscall and sdk support (backport #16498) (#17157)
* Add Keccak256 syscall and sdk support (#16498)

(cherry picked from commit 8eb05d6ed4)

# Conflicts:
#	Cargo.lock
#	programs/bpf/Cargo.lock
#	programs/bpf/rust/sha/Cargo.toml
#	programs/bpf/tests/programs.rs
#	programs/bpf_loader/Cargo.toml
#	sdk/program/Cargo.toml
#	sdk/program/src/lib.rs
#	sdk/src/feature_set.rs

* resolve conflicts

Co-authored-by: Jack May <jack@solana.com>
2021-05-11 09:31:16 +00:00
f91d7da5a4 sdk: Add get_instance_packed_len for variable-size types (#17092) (#17153)
* sdk: Add get_instance_packed_len for variable-size types

* Add comment for get_packed_len

* Add more tests

(cherry picked from commit 4b60b2863e)

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-05-11 09:16:14 +00:00
b2dad84d05 Update web-wallet.md to add phantom with fixed link (#17161) (#17163)
* 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>
(cherry picked from commit 4625231e30)

Co-authored-by: chaseeb <chaseeb@gmail.com>
2021-05-11 04:46:41 +00:00
a7b2939bc8 SignerSource: rename input scheme to prompt, default to bip44 solana base key (#17154) (#17159)
* 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

(cherry picked from commit a5ec3a0547)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-11 02:43:49 +00:00
ea3b783b63 fix c program deploy help (#17152) (#17156)
(cherry picked from commit 82fb6712e7)

Co-authored-by: Jack May <jack@solana.com>
2021-05-10 23:36:16 +00:00
733ef4b0b8 type AccountSecondaryIndexes = HashSet (backport #17108) (#17149)
* type AccountSecondaryIndexes = HashSet (#17108)

(cherry picked from commit f39dda00e0)

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

* resolve merge errors

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
2021-05-10 20:55:33 +00:00
0cf83887c6 Move block-time caching earlier (#17109) (#17150)
* 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

(cherry picked from commit 6e9deaf1bd)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-10 20:31:56 +00:00
094271be7d indexes crds values by their insert order (backport #16809) (#17132)
* indexes crds values by their insert order

(cherry picked from commit dfa3e7a61c)

* 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

(cherry picked from commit 22c02b917e)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-10 00:00:00 +00:00
efc3c0d65f Add a make target to run the readelf utility on a compiled program (#17131)
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.

(cherry picked from commit ff95e2aaa6)

Co-authored-by: Christian Machacek <39452430+machacekch@users.noreply.github.com>
2021-05-09 02:46:49 +00:00
0300eea0d6 Fix syscalls in the C SDK failing at runtime when compiled as C++ (#17124) (#17126)
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_)".

(cherry picked from commit 6927d0c77e)

Co-authored-by: Christian Machacek <39452430+machacekch@users.noreply.github.com>
2021-05-08 17:27:56 +00:00
b03186e3c6 Add chinese translations to docs (#17125) (#17127)
* import zh translations

* Fix broken links

* fix whitespace

(cherry picked from commit a1df57a4ea)

Co-authored-by: Justin Starry <justin@solana.com>
2021-05-08 17:09:51 +00:00
65e1b881f9 Bump version to v1.6.9 2021-05-08 06:28:08 +00:00
28b9e5b572 getBlockProduction now correctly reports block production (#17116)
(cherry picked from commit d6c076f1b6)

Co-authored-by: Michael Vines <mvines@gmail.com>
v1.6.8
2021-05-08 04:19:39 +00:00
072e884c24 solana-validator exit now uses process::exit() to ensure prompt termination (#17107)
(cherry picked from commit ec2b06d81d)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-07 18:49:36 +00:00
dc95663de7 Add ledger-tool for restoring roots to the Roots CF (#17045) (#17091)
* 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

(cherry picked from commit ddfbae260f)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-06 21:28:28 +00:00
a73303be22 Fixing a broken link in the docs (#16975) (#17085)
(cherry picked from commit 40c31f87e0)

Co-authored-by: Jordan Sexton <jordan@jordansexton.com>
2021-05-06 16:05:37 +00:00
330f42c375 implements cursor for gossip crds table queries (#16952) (#17084)
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.

(cherry picked from commit fa86a335b0)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-06 15:23:01 +00:00
5d088c7d06 Dump rent_collector/inflation with ledger-tool cap (#17069) (#17081)
(cherry picked from commit d19526e6c2)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-05-06 11:48:21 +00:00
5c9495f955 CLI: Print gossip nodes with cli-output crate (#17072)
(cherry picked from commit cb5e000615)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-05-06 09:07:36 +00:00
fb163187b5 RpcClient now respects the retry-after server response header when getting rate limited
(cherry picked from commit 7d1637d89a)
2021-05-05 19:34:18 -07:00
970bba495f Add --tower argument to specify where tower files are persisted (#17060)
(cherry picked from commit 9ba2c53b85)

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-05-05 20:37:36 +00:00
9761af201b Don't recognize temp snapshots as possible snapshots to open
(cherry picked from commit 3e0fed48e7)
2021-05-05 09:32:54 -07:00
7600be946a SDK: Factor out pubkey on-curve test to a helper (#16935)
(cherry picked from commit cfc1cb1aee)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-05-05 06:19:19 +00:00
524b380a71 Bump version to 1.6.8 2021-05-04 12:46:57 -07:00
ebb5fc1285 chore: conflate use statement
(cherry picked from commit 6d11d5dd9f)
v1.6.7
2021-05-04 10:28:45 -07:00
4cfb3dcc7b fix: add bpf_loader_upgradeable to ProgramTest default builtins
(cherry picked from commit 4ede5117f9)
2021-05-04 10:28:45 -07:00
e8fff4561e Document that Transaction::sign might panic (#17026)
(cherry picked from commit 9abfa65920)
2021-05-04 09:06:36 -07:00
b56e66310d Revert "reclaims unref accounts from index (#16838) (#17005)"
This reverts commit 3e43b042eb.
2021-05-04 08:48:13 -07:00
bda3bd1557 Correct days/year (#17024) (#17033)
(cherry picked from commit 46d2755205)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-04 11:22:26 +00:00
7723673038 test-validator: Plumb --limit-ledger-size (#17027)
(cherry picked from commit f17b80236f)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-05-04 10:09:53 +00:00
c69e667f5e Update web3.js import sample (#17022)
(cherry picked from commit 9ff17a1c18)

Co-authored-by: Colin Gray <colin@cgray.dev>
2021-05-04 06:49:20 +00:00
6157860c0a Implement Bip32 for seed-phrase/passphrase signing (backport #16942) (#17018)
* 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

(cherry picked from commit 694c674aa6)

# Conflicts:
#	programs/bpf/Cargo.lock

* Fix conflict

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-05-04 03:58:23 +00:00
32fc4e3d0f Add keys (backport #17014) (#17015)
* Rotate keys

(cherry picked from commit b2778f34f5)

* Key rotation

(cherry picked from commit b948a18841)

* Add keys

(cherry picked from commit 6318705607)

Co-authored-by: publish-docs.sh <maintainers@solana.com>
2021-05-04 01:34:53 +00:00
ee0c0c4a59 Add ALL support to withdraw-stake subcommand
(cherry picked from commit cf779c63c5)
2021-05-03 13:55:35 -07:00
356117819c Add hackathon banner (#17010) 2021-05-03 19:47:34 +00:00
834c96a374 validates gossip addresses before sending pull-requests (backport #16748) (#17009)
* uses Mutex instead of RwLock for ping_cache

(cherry picked from commit 2231017b35)

* 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.

(cherry picked from commit 7cea2c4466)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-03 19:40:02 +00:00
2195d980a2 patches local pending push messages processing (#16833) (#17007)
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.

(cherry picked from commit a698e34744)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
2021-05-03 17:27:38 +00:00
3e43b042eb reclaims unref accounts from index (#16838) (#17005)
(cherry picked from commit 6381ee38eb)

Co-authored-by: Jeff Washington (jwash) <75863576+jeffwashington@users.noreply.github.com>
2021-05-03 17:10:09 +00:00
851742e5d9 Update sysvars.md (#16998) (#16999)
a typo

(cherry picked from commit 43ccaf14b0)

Co-authored-by: Max Block <40041609+max-block@users.noreply.github.com>
2021-05-03 09:58:20 +00:00
c6c7feb0c2 Retry latest vote if expired (#16735) (#16927)
(cherry picked from commit b5d30846d6)

Co-authored-by: carllin <carl@solana.com>
2021-05-03 05:13:29 +00:00
1fde69ef48 Docs cleanup (#16997) 2021-05-03 02:59:03 +00:00
894bedcae7 Remove errant backslash (#16994) (#16995)
(cherry picked from commit d7166c5778)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-05-02 20:20:30 +00:00
47f15eaa03 Corrected typo in calling between programs document (backport #16991) (#16993)
* 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>
(cherry picked from commit c003f8e93c)

# Conflicts:
#	docs/src/developing/programming-model/calling-between-programs.md

* Fix conflict

Co-authored-by: srinivas valekar <srinivas.valekar@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-05-02 18:40:41 +00:00
b0c0739db9 Allow SetUpgradeAuthority instruction in CPI calls (backport #16676) (#16954)
* 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

(cherry picked from commit 1a658c7f31)

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

* chore: fixe merge conflicts

Co-authored-by: Sebastian Bor <Sebastian_Bor@hotmail.com>
2021-04-30 20:47:38 +00:00
c3dc23e84a docs: fix copy-pasta breaking typo in getRecentBlockhash example (#16962)
(cherry picked from commit 3d98321b38)

Co-authored-by: Trent Nelson <trent@solana.com>
2021-04-30 04:24:40 +00:00