Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Add gas accounting to scenario test VM #1266

Closed
anorth opened this issue Oct 19, 2020 · 3 comments · Fixed by #1408
Closed

Add gas accounting to scenario test VM #1266

anorth opened this issue Oct 19, 2020 · 3 comments · Fixed by #1408
Assignees
Labels
P1 High priority, required for basic network functionality and growth scale Related to chain state or throughput scalability testing Related to test coverage, quality, and tools

Comments

@anorth
Copy link
Member

anorth commented Oct 19, 2020

Gas is mostly a thing that happens outside the direct control of the actor code, in the VM, so the gas table etc are not part of actor code. However, gas usage is the critical resource that actor code execution consumes, so we should have good tooling to inspect, benchmark, and profile it. We expect to be putting quite significant effort into improving and optimising gas performance in the near term, so should be able to quantify our changes.

To this end, let's add gas tracking to the VM used for scenario tests so that we can replicate and analyse gas usage traces.

Scenario tests might then include an assertion about total gas usage, forcing explicit recognition and review of any changes.

@anorth anorth added P2 Medium priority, beneficial for network functionality and growth scale Related to chain state or throughput scalability testing Related to test coverage, quality, and tools labels Oct 19, 2020
@ZenGround0 ZenGround0 added this to the 🧡 v3 milestone Oct 28, 2020
@anorth
Copy link
Member Author

anorth commented Dec 3, 2020

The scenario VM now has accounting for puts, gets, and bytes written/read, from which the storage-related parts of gas cost can be computed. It would still be good to go all the way, but we have a good part of the benefit already now.

@anorth anorth closed this as completed Dec 17, 2020
@ZenGround0 ZenGround0 reopened this Mar 17, 2021
@ZenGround0
Copy link
Contributor

We are mostly there but will need to go all the way to unlock test vector generation and conformance testing

@ZenGround0 ZenGround0 modified the milestones: 🧡 v3 , v4 Mar 17, 2021
@ZenGround0 ZenGround0 added P1 High priority, required for basic network functionality and growth and removed P2 Medium priority, beneficial for network functionality and growth labels Mar 17, 2021
@ZenGround0 ZenGround0 mentioned this issue Apr 8, 2021
28 tasks
@BigLep
Copy link
Member

BigLep commented May 3, 2021

@ZenGround0 : when we pick this work up, I assume we'll update it with the work plan. This is what we captured last week:

Generation side (what we share with implementation)

  1. Modify reference VM to deal with gas. (5 days)
  • Need the gas costs for all of the operations.
  • This is a module in Lotus that needs to be extracted (at least the constants)
  1. Generate test vectors from the spec actors VM. Add a new call to the VM and modify the internals to include the before/after of the state. Needs to include runtime like the epoch (5 days)
  2. Test flags variable which would would cause VM to generate these.
  3. Modify existing tests to call in the special way. (2 days)
  4. Every time generate and store the hash. This is hooked into CI. (1 days)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1 High priority, required for basic network functionality and growth scale Related to chain state or throughput scalability testing Related to test coverage, quality, and tools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants