-
Notifications
You must be signed in to change notification settings - Fork 379
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
RPC: Report Better Transaction/Block Cost Information #4815
Comments
My current thoughts on how we should proceed:
|
Thanks Steve for putting that together! I think our preference, from a limited bit of experience as a consumer, is the following:
I would also soft-deprecate the existing field as part of this PR, and then have a schedule to hard deprecate it at some point in future. |
Thanks for the response @mmcgee-jump.
Given our previous conversations, I'm fairly confident that I'll be telling you information you already know. But for the sake of leaving a nice paper trail, let me give some context ... Shred are indexed by
As you can see,
Storing a cost with each individual transaction will support use case 2. However, for use case 1., calling Unfortunately, historical storage (BigTable) requires fetching the full block. This fetch is a little different than blockstore, but TLDR is we have to fetch the full thing even if we only care about cost. Unfortunate, but if people are printing real-time-ish dashboards, they should be hitting local storage on RPC nodes (and not BigTable). As a final note, |
Problem
Among other transaction metadata, RPC nodes currently store a field called
compute_units_consumed
for each transaction:agave/transaction-status-client-types/src/lib.rs
Line 277 in 1bc1320
The value is recorded in the
Blockstore
(and eventually BigTable) if the node is running with--enable-rpc-transaction-history
.TransactionStatusService
is the thread that populates the metadata structure and inserts into theBlockstore
:agave/rpc/src/transaction_status_service.rs
Line 200 in 1bc1320
The
executed_units
field originally comes fromBank
(several functions down the callstack):agave/runtime/src/bank.rs
Line 3790 in 8e8bbd5
The issue is that executed units do not paint the full picture in regards to the block CU limit. This distinction is not widely known and furthermore, there is no other easy manner to direct query the "total cost" for each transaction.
Furthermore, while the more accurate number per transaction is desired, some aggregate block data might be of interest as well. Here are the fields that we currently report in a metric if we're a leader:
agave/cost-model/src/cost_tracker.rs
Lines 228 to 265 in a3be625
Some of these fields are obviously redundant and could be easily derived from examining all individual transactions. Something like the
costliest_account_cost
orallocated_accounts_data_size
could be of interest but harder to derive from the tx's.Proposed Solution
Several steps here:
getTransaction
andgetBlock
ORgetBlockCost
ORcost
totransactionDetails
to limit output to cost ORTransactionStatusMeta
Blockstore
, we might be do a "partial" decoding to avoid reading the entire block +TransactionMeta
for each columngetBlockTime
in that data is stored in an individual column and can be queried directly (ie we might addgetBlockCost
)The text was updated successfully, but these errors were encountered: