flow
flow copied to clipboard
Accessing Execution state at different Block Statuses (Latest Finalized/Executed/Sealed)
Issue To Be Solved
Currently, when we query against the execution state (GetAccountAtLatestBlock, ExecuteScriptAtLatestBlock) we do so assuming we always want the latest Sealed block, but we want this query to be much more flexible.
While adding this flexibility, it may also be prudent to rethink the functions around state querying, and maybe if the ...ByHeight and ..ByBlockID functions should actually be consolidated. Example:
GetAccount(address, opts)
where opts would indicate if I want the account at a specific Block Height or ID, or i want latest sealed/executed state
(Optional): Suggest A Solution
Change the current GetAccountAtLatestBlock, ExecuteScriptAtLatestBlock functions to allow input argument to indicate if we want a specific state, e.g. LatestExecuted or LatestSealed
OR
Add new functions : GetAccountAtLatestExecutedBlock, ExecuteScriptAtLatestExecuteBlock
OR
Add new generic functions GetAccount, ExecuteScript that just take options as the last parameter that will describe in some way, which block to we want to execute against.
(Optional): Context
Not being able to query the execution state at an "Executed" block is currently blocking anyone using the Executed state in a meaningful way when they get it back from the access node when querying for transaction results