264 Commits

Author SHA1 Message Date
Michael Vines
757e147b3b Rework UiAccountData encode/decode such that it works from Rust 2020-08-17 17:26:29 -07:00
Tyera Eulberg
6c5b8f324a
Rpc: Add until parameter for getConfirmedSignaturesForAddress2 (#11644)
* Refactor bigtable apis to accept start and end keys

* Make helper fn to deserialize cell data

* Refactor get_confirmed_signatures_for_address to use get_row_data range

* Add until param to get_confirmed_signatures_for_address

* Add until param to blockstore api

* Plumb until through client/cli

* Simplify client params
2020-08-15 10:42:17 -06:00
Greg Fitzgerald
574c356863
Add CommitmentSlots::new_from_slot() (#11600) 2020-08-13 03:51:15 +00:00
Tyera Eulberg
b1e452f876
Return blockstore signatures-for-address despite bigtable error (#11594) 2020-08-12 17:57:05 -06:00
Tyera Eulberg
88ca04dbdb
Add config param to specify offset/length for single and program account info (#11515)
* Add config param to specify dataSlice for account info and program accounts

* Use match instead of if
2020-08-10 22:35:29 +00:00
Tyera Eulberg
da210ddd51
Fix parsing of spl-token Mint (#11512)
* Add failing test

* Fix jsonParsed mint
2020-08-10 20:35:36 +00:00
Tyera Eulberg
a9f76862fb
Decode native-program and sysvar accounts (#11463)
* Pass pubkey in to account-decoder for sysvars

* Decode sysvar accounts

* Decode config accounts; move validator-info lower

* Decode stake accounts

* Review comments

* Stringify any account lamports and epochs that can be set to u64::MAX
2020-08-09 07:50:45 +00:00
sakridge
068d23f298
Add Binary64 option for account data (#11474)
* Add Binary64 option for account data

* Decode into binary64

* Reword docs
2020-08-08 22:40:13 -07:00
Tyera Eulberg
b7c2681903
Token Accounts: return ui_amount, decimals with decoded account (#11407)
* Return ui_amount, decimals from token client methods

* Return ui_amount, decimals in RPC jsonParsed token accounts

* Fixup docs

* Return ui_amount, decimals in pubsub jsonParsed token accounts

* Remove unnecessary duplicate struct

* StringAmount rename
2020-08-07 11:37:39 -06:00
Michael Vines
4222932e08 Plug getConfirmedSignaturesForAddress2 into bigtable storage 2020-08-05 23:04:16 -07:00
Michael Vines
02c0981ecf Rename startAfter to before 2020-08-05 14:33:14 -07:00
Michael Vines
087fd32ce3 Reimplement transaction-history command with getConfirmedSignaturesForAddress2 2020-08-05 14:33:14 -07:00
Michael Vines
1b2276520b Add getConfirmedSignaturesForAddress2 RPC method 2020-08-05 14:33:14 -07:00
Michael Vines
dfae9a9864 Plumb Bigtable ledger storage into the RPC subsystem 2020-08-05 14:27:12 -07:00
Michael Vines
0e02740565 Setup a tokio 0.2 runtime for RPC usage 2020-08-05 14:27:12 -07:00
Tyera Eulberg
86e3f96f16
Return token amounts as floats (#11370)
* Return token amounts as floats

* Floating-point equality

* Return float and raw token amounts

* Fix decimals and token rpcs for native-mint tokens

* Fixup docs and review comments
2020-08-05 06:48:09 +00:00
Trent Nelson
14339dec0a Harden RPC preflight test inputs 2020-08-05 06:06:57 +00:00
Trent Nelson
e25846e1ad Add failing test for unsane tx in RPC preflight 2020-08-05 06:06:57 +00:00
Tyera Eulberg
d0144ce382
Fix token rpc-client methods (#11361)
* Convert None to error in parse_keyed_accounts

* Allow encoding configuration in getTokenAccounts methods
2020-08-04 11:11:30 -06:00
Tyera Eulberg
0bc9bcc8b9
Fix bad rebase 2020-08-02 12:09:06 -06:00
Tyera Eulberg
d1b2e6cdf2
Add getTokenLargestAccounts endpoint (#11322) 2020-08-02 10:23:44 -06:00
Michael Vines
ffbd859c42 Update spl-token and spl-memo 2020-08-02 07:53:42 -07:00
Tyera Eulberg
9bcfc51df1
Add token rpc endpoints to rpc-client (#11315) 2020-07-31 20:53:49 +00:00
Michael Vines
c78e12a262 Avoid spl-sdk dependency, which inhibits crate publishing 2020-07-30 23:47:26 +00:00
Greg Fitzgerald
1d2426ddbc
Move simulate_transaction from rpc to bank (#11294) 2020-07-30 19:15:45 +00:00
Trent Nelson
a888f2f516 Reject TXs sent via RPC with no signatures 2020-07-30 00:07:33 -06:00
Trent Nelson
a7079e4dde Dereplicode send_transaction and request_airdrop RPC handlers 2020-07-30 00:07:33 -06:00
Trent Nelson
b962b2ce2d Add failing test for TX sent via RPC with no signatures 2020-07-30 00:07:33 -06:00
Tyera Eulberg
b45ac5d4db
Add SPL Token-specific rpc endpoints (#11231)
* Simplify account-decoder program ids + spl_token helper

* Spl program namespace version

* Add getTokenAccountBalance endpoint

* Remove token program id from getTokenAccountBalance request

* Add getTokenSupply endpoint

* Remove token program id from getTokenSupply request

* Add getTokenAccountsByOwner/Delegate endpoints

* Remove token program id from getTokenAccountsByOwner/Delegate requests

* Named parameter
2020-07-28 23:00:48 -06:00
Trent Nelson
678f94903b Fill out missing RPC request received debug logging 2020-07-29 01:51:20 +00:00
carllin
6578ad7d08
Speed up local cluster partitioning tests (#11177)
* Fix long local cluster partition tests by skipping slot warmup

Co-authored-by: Carl <carl@solana.com>
2020-07-23 18:50:42 -07:00
Greg Fitzgerald
7484202282
Return root when bank not found (#11188)
* Return root when bank not found

* Apply suggestions from code review

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

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2020-07-24 00:57:15 +00:00
Greg Fitzgerald
23c2e55cbf
Use BlockCommitmentCache for RPC slots, take 2 (#11137)
* Use BlockCommitmentCache for RPC slots (#11103)

* Add BankForks::highest_descendant(slot)

* Update debug messages

* Update core/src/rpc.rs

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

* cargo fmt

* Remove highest_descendant

* Fix test

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

* Fix crossed-in-flight compilation error

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2020-07-20 23:03:40 +00:00
Michael Vines
d19cd3a18a
Revert "Use BlockCommitmentCache for RPC slots (#11103)" (#11122)
This reverts commit 815b0f31b43ceb9dea6d9e196e52cfd3142baef7.
2020-07-18 16:39:12 -07:00
Greg Fitzgerald
815b0f31b4
Use BlockCommitmentCache for RPC slots (#11103)
* Add BankForks::highest_descendant(slot)

* Update debug messages

* Update core/src/rpc.rs

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

* cargo fmt

* Remove highest_descendant

* Fix test

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2020-07-17 16:22:27 -06:00
Tyera Eulberg
a255b0fc86
Rename CacheSlotInfo to CommitmentSlots (#11111) 2020-07-17 17:54:49 +00:00
Tyera Eulberg
fdff681bcc
Simplify BlockCommitmentCache slot info (#11106)
* Refactor BlockCommitmentCache, store a CacheSlotInfo

* Comma
2020-07-17 09:24:51 -06:00
Greg Fitzgerald
145906123a
Simplify use of SendTransactionService (#10999)
* Send transaction upon recv

This will allow us to move the channel to the public interface

* Use a channel, not a method, to communicate

* Pipeline the services

* Ignore unused return values

* Fix clippy warning
2020-07-11 01:14:41 +00:00
Michael Vines
25ca99cdcf largest -> highest 2020-07-10 12:57:32 -07:00
Michael Vines
aef6bf272e getConfirmedBlocks now has an upper limit on slot range 2020-07-10 12:18:31 -07:00
Greg Fitzgerald
16eeea4f82
Move SendTransactionService to solana_runtime (#10972) 2020-07-09 18:28:26 +00:00
Greg Fitzgerald
17a8cc862b
Remove core dependencies from SendTransactionService (#10965)
* Remove core dependencies from SendTransactionService

* Fix clippy warnings
2020-07-08 19:13:42 -06:00
Greg Fitzgerald
ebadbce920
Drop bank from BlockCommitmentCache (#10959)
* Remove bank reference from BlockCommitmentCache

* Don't use a Bank to create BlockCommitmentCache

* Rename recent_slot to slot
2020-07-09 00:50:13 +00:00
dependabot-preview[bot]
841ecfd927
chore(deps): bump bincode from 1.2.1 to 1.3.1 (#10867)
* chore(deps): bump bincode from 1.2.1 to 1.3.1

Bumps [bincode](https://github.com/servo/bincode) from 1.2.1 to 1.3.1.
- [Release notes](https://github.com/servo/bincode/releases)
- [Commits](https://github.com/servo/bincode/commits)

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

* [auto-commit] Update all Cargo lock files

* Switch from deprecated method

* Add options to maintain behavior with bincode::options()

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2020-07-09 00:08:05 +00:00
Tyera Eulberg
1a6bbd2867
Limited Deserialize isn't limiting anything (#10952)
* Add failing test

* Use deserialize_from to enable limit
2020-07-08 15:54:42 -06:00
Greg Fitzgerald
930162a079
Drop dependency on BlockCommitmentCache bank (#10946)
* Drop dependency on BlockCommitmentCache bank

* cargo fmt
2020-07-07 20:13:30 -06:00
Greg Fitzgerald
2fdbb97244
Rename largest_confirmed_root to highest_confirmed_root (#10947) 2020-07-07 23:59:46 +00:00
Tyera Eulberg
4de0713aa3
Rpc: Add getStakeActivation endpoint (#10902)
* Add getStakeActivation endpoint

* Add docs

* Update docs/src/apps/jsonrpc-api.md

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

* Rework return type

* Update docs

* Rebase

Co-authored-by: Michael Vines <mvines@gmail.com>
2020-07-06 13:28:40 -06:00
Greg Fitzgerald
2922494b4f
Cleanup rpc (#10910)
* Remove unreachable error case

* Inline Ok

* Hoist Ok
2020-07-03 17:39:14 -06:00
Tyera Eulberg
8d951776ab
Rpc: add filter to getProgramAccounts (#10888)
* Add RpcFilterType, and implement CompareBytes for getProgramAccounts

* Accept bytes in bs58

* Rename to memcmp

* Add Memcmp optional encoding field

* Add dataSize filter

* Update docs

* Clippy

* Simplify tests that don't need to test account contents; add multiple-filter tests
2020-07-03 07:46:29 +00:00