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

[Execution] Add methods to allow simulating transactions against local execution state on edge nodes #4588

Open peterargue opened 1 year ago

peterargue commented 1 year ago

Problem Definition

Currently, archive nodes have some functionality that allows them to execute scripts against a local datastore: Archive Code: https://github.com/onflow/flow-archive/blob/a3113fce4d808b59b18841307259e234265ddc96/service/invoker/invoker.go

Supporting Execution Code: https://github.com/onflow/flow-go/blob/master/engine/execution/computation/query/executor.go

At some point in the future, this will likely be integrated into Access nodes, allowing local script execution. One other common feature for "full nodes", is the ability to simulate a transaction at a particular block. In ethereum's RPC, it's the call method.

The goal is to allow a user to simulate a transaction at a specific block height. The call should return the same results as if the transaction was executed at that height, except no state changes are made.

Proposed Solution

Add new methods/interfaces to support simulating transactions in a similar way to how it's done for script execution.

Definition of Done

There are new methods that allow Access and Observer nodes that have a local copy of execution state can simulate transactions against a specific block height.

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.