massa
massa copied to clipboard
rpc call `execute_read_only_call` to be extended with an optional json payload for returning final state
Smart contracts might often have code like this:
export function getSomeData(address: string): string {
const data = Storage.get("KEY");
generateEvent(data);
return data;
}
If this read-only method is being called using execute_read_only_call
, as discussed with Damir, the state reading will be based on a simulated execution at the time of call giving us a transient state.
Since transient states are subject to change, we need to have an rpc call execute_read_only_call
targeting final states and thus returning finality state data. I suggest adding a new param to the json rpc payload to force the rpc call to return only final slot storage data, if not set, same as now, transient.
@damip I tried to understand this issue, but I need more details to implement it.
Basically add a parameter to the execute read only api to request readonly execution at the latest final slot instead of the latest speculative slot. Changes are needed on the Execution side as well to add this feature
This PR can be grouped with https://github.com/massalabs/massa/issues/2951 to solve both at the same time
Done in https://github.com/massalabs/massa/pull/3405