Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.

[WIP] State Manager Gas Consumption Script#71

Merged
ben-chain merged 1 commit intomasterfrom
feat/22/state-manager-gas
Nov 20, 2020
Merged

[WIP] State Manager Gas Consumption Script#71
ben-chain merged 1 commit intomasterfrom
feat/22/state-manager-gas

Conversation

@ben-chain
Copy link
Collaborator

@ben-chain ben-chain commented Nov 19, 2020

Description

This PR adds a little script which meters and prints the gas consumption of the OVM_StateManager methods under various conditions.

Questions

Any cases I missed?

Metadata

Fixes

  • Fixes roadmap # 22

Contributing Agreement

@ben-chain ben-chain changed the title [WIP] [WIP] State Manager Gas Consumption Script Nov 19, 2020
Comment on lines +24 to +26
gasBefore := gas()
success := call(gas(), _target, 0, calldataStart, calldataLength, 0, 0)
gasAfter := gas()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure exactly how this overhead works, but presumably will need to subtract at minimum the cost of GAS + CALL`, and possibly more, to get this to be the value we consume in geth.

@smartcontracts
Copy link
Collaborator

First pass looks good to me. Will do a more thorough review of all the test cases tomorrow just to double check that the paths are covered. 👍

I'll think on the figuring out how to get the exact gas cost. Maybe we can just debug and look at the opcodes between the gas recording points.

})

describe('getContractStorage', () => {
// confirm with kelvin that this covers all cases
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep LGTM

Copy link
Collaborator

@smartcontracts smartcontracts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think this covers everything.

@ben-chain ben-chain merged commit 945b12a into master Nov 20, 2020
@ben-chain ben-chain deleted the feat/22/state-manager-gas branch November 20, 2020 17:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants