You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we can't gather information from multiple elements in Execution atomically (eg. addresses and datastore values).
Also, get_op_exec_status is extremely heavy as it scans through all executed operations (10k/second !).
Solution
Create a single endpoint query(input: ExecutionQueryRequest) -> ExecutionQueryResponse method in the execution controller that allows to atomically (same slot guaranteed) query a well-defined list of things:
pubstructExecutionQueryRequest{requests:Vec<ExecutionQueryRequestItem>,}pubstructExecutionQueryResponse{responses:Vec<Result<ExecutionQueryResponseItem,Error>>,final_cursor:Slot,candidate_cursor:Slot}pubenumExecutionQueryRequestItem{AddressExistsCandidate(Address),AddressExistsFinal(Address),AddressBalanceCandidate(Address),AddressBalanceFinal(Address),AddressBytecodeCandidate(Address),AddressBytecodeFinal(Address),AddressRollsCandidate(Address),AddressRollsFinal(Address),AddressDeferredCreditsCandidate(Address),AddressDeferredCreditsFinal(Address),AddressCycleInfos(Address),AddressDatastoreKeysCandidate{addr:Address,prefix:Vec<u8>,},AddressDatastoreKeysFinal{addr:Address,prefix:Vec<u8>,},AddressDatastoreValueCandidate{addr:Address,key:Vec<u8>,},AddressDatastoreValueFinal{addr:Address,key:Vec<u8>,},OpExecutionStatusCandidate(OperationId),OpExecutionStatusFinal(OperationId),DenunciationExecutionStatusCandidate(DenunciationIndex),DenunciationExecutionStatusFinal(DenunciationIndex),}pubenumExecutionQueryResponseItem{AddressExists(bool),AddressBalance(Amount),AddressBytecode(Vec<u8>),AddressRolls(u64),AddressDeferredCredits(BTreeMap<Slot,Amount>),AddressCycleInfos(Vec<ExecutionAddressCycleInfo>),AddressDatastoreKeys(BTreeSet<Vec<u8>>),AddressDatastoreValue(Vec<u8>),OpExecutionStatus(bool),// TODO as a followup more info, eg when it was executed, in which block, error output, ledger changes (?)DenunciationExecutionStatus(bool),// TODO as a followup more info, eg when it was executed, in which block, error output, ledger changes (?)}
Note that errors are properly managed: if we ask for the bytecode of an address that does not exist, it should give a NotFound error for that query.
This also opens the door to atomic batched GRPC queries in the API @aoudiamoncef.
The text was updated successfully, but these errors were encountered:
Problem
Currently, we can't gather information from multiple elements in Execution atomically (eg. addresses and datastore values).
Also,
get_op_exec_status
is extremely heavy as it scans through all executed operations (10k/second !).Solution
Create a single endpoint
query(input: ExecutionQueryRequest) -> ExecutionQueryResponse
method in the execution controller that allows to atomically (same slot guaranteed) query a well-defined list of things:Note that errors are properly managed: if we ask for the bytecode of an address that does not exist, it should give a NotFound error for that query.
This also opens the door to atomic batched GRPC queries in the API @aoudiamoncef.
The text was updated successfully, but these errors were encountered: