filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.86k stars 1.27k forks source link

Filecoin Gas Profiling #11033

Open ZenGround0 opened 1 year ago

ZenGround0 commented 1 year ago

User Story

10884 but for gas visualization

I am a user who develops filecoin and client software for it. I want to understand how filecoin state computation is spending its time. I want to see: 1) a breakdown of how much gas is used in which actors and which methods, 2) if the gas is related to manipulating state or executing WASM instructions. I especially want to see this for cron execution. I can then use this to visualize changes in network dynamics and evaluate how new changes impact (i.e: fvm gas pricelist) the network.

Acceptance Criteria

I can run a small set of commands given a range of tipsets / filecoin epochs to get me a (1) json summary of gas used by different actors and methods (2) visualization of gas used by different actors and methods:

mainnetstate

Technical Breakdown

- [ ] write a lotus-shed tool that condenses existing gas traces output from `./lotus state compute-state` into a summary of gas used by actor type, actor method and gas category.  Along with json munging this will require a view of state to go from address to actor type.
- [ ] Tool should be able to take many gas traces as input and combine them all together, this way we can view a summary of arbitrary 
- [x] python visualization should not need any changes, can just use same path based format in our summary json and it will work out of the box
jennijuju commented 1 year ago

@arajasek @snissn, we are curious - were you two be able to work on this base on the information provided in the issue + this tutorial? If not, what's missing would be helpful?

arajasek commented 1 year ago

@jennijuju I haven't run the command yet, but the instructions definitely seem sufficient. I'll follow up if I run into something unexpected.