Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ledger-tool: Store rewards when using --enable_rpc_transaction_history #3872

Merged
merged 5 commits into from
Dec 3, 2024

Conversation

steviez
Copy link

@steviez steviez commented Dec 2, 2024

Problem

agave-ledger-tool will currently store transaction status if the user passes --enable-rpc-transaction-history. This flag is meant to calculate the data that an RPC node with the same flag would store. However, ledger-tool does not currently spin up the additional RewardsRecorderService that writes rewards into the Blockstore.

Summary of Changes

Same as validator, spin up RewardsRecorderService if --enable-rpc-transaction-history is passed

Testing

To test the change, I ran the following command observed no Reward data present:

$ agave-ledger-tool verify --ledger ~/ledger --enable-rpc-transaction-history --block-verification-method blockstore-processor
$ agave-ledger-tool slot 301196257 --ledger ~/ledger -vv | grep "Reward" | wc -l
0

Then, I re-ran the first command with my branch and observed populated reward data:

$ agave-ledger-tool slot 301196257 --ledger ~/ledger -vv | grep "Reward" -A 2
Rewards:
  Address                                            Type        Amount           New Balance           Percent Change  Commission
  2AFeCYUKDpc7rciQPKHdi591fpPCMWqNjBEh6N4awWTZ      staking      ◎0.006681290     ◎2.306014042            0.290575168%         10%
--
Total Rewards: ◎467.960345615
Entry 0 - num_hashes: 62500, hash: DWu4bYhXAbH6yhmbaGMw6tHpUCLb9VHKSZtvFK62NnZD, transactions: 0, starting_transaction_index: 0
Entry 1 - num_hashes: 62500, hash: 2A2x48avKFHyPxy4gWvXWsagCYtPryV7eL4gsDa7ZUcF, transactions: 0, starting_transaction_index: 0

These types need to be used by blockstore_processor without having a
dependency on solana-core. This is similar to what we do with the types
used by TransactionStatusService
This will avoid duplicate logic
@steviez steviez changed the title ledger-tool: Store rewards along with tx status ledger-tool: Store rewards when using --enable_rpc_transaction_history Dec 2, 2024
@steviez steviez merged commit f4644d6 into anza-xyz:master Dec 3, 2024
40 checks passed
@steviez steviez deleted the lt_store_rewards branch December 3, 2024 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants