onflow / flow-go

A fast, secure, and developer-friendly blockchain built to support the next generation of games, apps, and the digital assets that power them.
GNU Affero General Public License v3.0
531 stars 175 forks source link

Enable caching interpreter shared state #4670

Closed janezpodhostnik closed 1 month ago

janezpodhostnik commented 1 year ago

Problem Definition

A while ago Cadence added the ability to cache interpreter shared state https://github.com/onflow/cadence/issues/2048 for optimisation purposes.

The original estimate for speedup was 15%. Because of changes done since then:

The estimate should be greater now.

Proposed Solution

Implement the interpreter state reuse functions

func (env *facadeEnvironment) SetInterpreterSharedState(state *interpreter.SharedState) {
    // NO-OP
}

func (env *facadeEnvironment) GetInterpreterSharedState() *interpreter.SharedState {
    return nil
}

But there is a twist! When I did that in the past tests started failing and I never figured out why: https://github.com/onflow/flow-go/pull/3942

Definition of Done

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.