Skip to content

Optimize OnPersist #3145

@shargon

Description

@shargon

Developing the rpc storage in test engine (neo-project/neo-devpack-dotnet#904) I have realized how "expensive" it is to calculate the gas per block.

Currently, we store a history of gas changes, which is necessary for calculating the reward of accounts when they call claim, but it is not necessary for the OnPersist of the block. However, we iterate backwards to calculate it in the same way during the block's persist, something completely unnecessary.

It can be optimized by avoiding iterating over the storage, we have 2 options.

Opinions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BacklogBacklog issues and PRsDiscussionInitial issue state - proposed but not yet accepted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions