Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Rpc: add getLargestAccounts endpoint#9869

Merged
solana-grimes merged 7 commits into
solana-labs:masterfrom
CriesofCarrots:rpc-top-20
May 4, 2020
Merged

Rpc: add getLargestAccounts endpoint#9869
solana-grimes merged 7 commits into
solana-labs:masterfrom
CriesofCarrots:rpc-top-20

Conversation

@CriesofCarrots
Copy link
Copy Markdown
Contributor

Problem

People want an easy way to find the 🐳 accounts by JSON RPC.

Summary of Changes

  • Add getLargestAccounts rpc endpoint that returns the addresses and balances of the 20 accounts with the most lamports in them
  • Include plumbing to limit accounts to a provided list of pubkeys or to exclude a list of pubkeys, in order to support limiting to circulating or non-circulating accounts once Rpc: Add getCirculatingSupply endpoint #9541
  • Filter out Storage program RewardsPools that get initialized with u64::MAX lamports

Fixes #9811

Comment thread runtime/src/accounts.rs Outdated
Comment thread core/src/rpc.rs
@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2020

Codecov Report

Merging #9869 into master will increase coverage by 0.0%.
The diff coverage is 94.0%.

@@          Coverage Diff           @@
##           master   #9869   +/-   ##
======================================
  Coverage    80.4%   80.4%           
======================================
  Files         283     283           
  Lines       64845   64912   +67     
======================================
+ Hits        52158   52239   +81     
+ Misses      12687   12673   -14     

@CriesofCarrots
Copy link
Copy Markdown
Contributor Author

@mvines , ready for another look. I decided to wrap the rpc response with context, since balances are variable, and users will likely want to know when the response data was true.

mvines
mvines previously approved these changes May 4, 2020
Copy link
Copy Markdown
Contributor

@mvines mvines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐳

Comment thread client/src/rpc_response.rs Outdated
Comment thread core/src/rpc.rs Outdated
Comment thread docs/src/apps/jsonrpc-api.md Outdated
Comment thread docs/src/apps/jsonrpc-api.md Outdated
@mergify mergify Bot dismissed mvines’s stale review May 4, 2020 22:04

Pull request has been modified.

@CriesofCarrots CriesofCarrots added the automerge Merge this Pull Request automatically once CI passes label May 4, 2020
@solana-grimes solana-grimes merged commit f5b0d13 into solana-labs:master May 4, 2020
mergify Bot pushed a commit that referenced this pull request May 4, 2020
automerge

(cherry picked from commit f5b0d13)

# Conflicts:
#	core/src/rpc.rs
mergify Bot pushed a commit that referenced this pull request May 4, 2020
automerge

(cherry picked from commit f5b0d13)
CriesofCarrots added a commit that referenced this pull request May 5, 2020
automerge

(cherry picked from commit f5b0d13)
CriesofCarrots added a commit that referenced this pull request May 5, 2020
automerge

(cherry picked from commit f5b0d13)
solana-grimes pushed a commit that referenced this pull request May 5, 2020
solana-grimes pushed a commit that referenced this pull request May 5, 2020
@CriesofCarrots CriesofCarrots deleted the rpc-top-20 branch May 7, 2020 20:36
danpaul000 pushed a commit to danpaul000/solana that referenced this pull request Jul 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

automerge Merge this Pull Request automatically once CI passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "top 20 account list” JSON RPC API

3 participants