Skip to content

Gas should be charged for Next, rather than Key() and Value() #2017

Closed

Description

g.gasMeter.ConsumeGas(g.gasConfig.KeyCostFlat, "KeyFlat")

We should prob not be charging for each call of Key()/Value(), since they'd be cached once fetched anyways. I also don't think we need two separate key/value charges either.

I'd change our store gas system to charge a FlatRead upon iterator initialization, and a new FlatIterNext for calling Next, and no charge for Key or Value.

Maybe also a "UnsafeGetParent()" function that returns the parent so we can debug applications, and a TODO to add a conditional on Unsafe to only allow it when e.g. a "mode=develop" flag is set somewhere. I had to expose gasIterator to debug the 7003 crash... (see #1938)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions