-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[API] [PFNs] improve observability of view function and simulate usage #11696
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #11696 +/- ##
=======================================
Coverage 70.9% 70.9%
=======================================
Files 791 791
Lines 180312 180406 +94
=======================================
+ Hits 127990 128067 +77
- Misses 52322 52339 +17 ☔ View full report in Codecov by Sentry. |
89ce918
to
9102ca2
Compare
aptos-move/aptos-vm/src/aptos_vm.rs
Outdated
) -> Result<Vec<Vec<u8>>> { | ||
) -> Result<(Vec<Vec<u8>>, u64)> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, it would be preferred to be a struct, so the outputs are known names. That way it won't require someone to read the code at the end of the function to determine it's the gas used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, we can have something similar to TransactionOutput
or VMOutput
structs
api/src/transactions.rs
Outdated
entry_function.module(), | ||
&entry_function.function().into(), | ||
), | ||
TransactionPayload::Multisig(_) => "MultiSig".to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MultiSig has an entry function tied to it, so I would probably add that here as well. It's in the inner type.
api/src/transactions.rs
Outdated
@@ -1220,6 +1220,19 @@ impl TransactionsApi { | |||
_ => ExecutionStatus::MiscellaneousError(None), | |||
}; | |||
|
|||
let stats_key = match txn.payload() { | |||
TransactionPayload::Script(_) => "Script".to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could add the script hash here
002ce11
to
20eab1c
Compare
@gregnazario @georgemitenkov thanks! Ready for a new review -- I've added a proper struct, also making changes so view functions that fail will still get gas usage logged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me -- unblocking 😄
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
… can have used gas
…peration's gas spikes (and then can dig into logs which function to attribute to)
20eab1c
to
0758558
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
#11696) ### Description On PFNs, periodically (every minute) log the top-9 gas-using view functions and simulate transactions. This gives observability to the PFNs usage. Utilizes a small cache that is reset every minute. Alternatively, such high-cardinality data would not work with prometheus. Requires minimal changes to propagate gas usage. ### Test Plan Deploy PFN locally, observe log messages.
#11696) ### Description On PFNs, periodically (every minute) log the top-9 gas-using view functions and simulate transactions. This gives observability to the PFNs usage. Utilizes a small cache that is reset every minute. Alternatively, such high-cardinality data would not work with prometheus. Requires minimal changes to propagate gas usage. ### Test Plan Deploy PFN locally, observe log messages.
#11696) (#11791) ### Description On PFNs, periodically (every minute) log the top-9 gas-using view functions and simulate transactions. This gives observability to the PFNs usage. Utilizes a small cache that is reset every minute. Alternatively, such high-cardinality data would not work with prometheus. Requires minimal changes to propagate gas usage. ### Test Plan Deploy PFN locally, observe log messages.
Description
On PFNs, periodically (every minute) log the top-9 gas-using view functions and simulate transactions. This gives observability to the PFNs usage.
Utilizes a small cache that is reset every minute. Alternatively, such high-cardinality data would not work with prometheus.
Requires minimal changes to propagate gas usage.
Test Plan
Deploy PFN locally, observe log messages.