Inside a FRAME runtime I want to check whether a specific storage item was already read in the current block. Reason is to determine the impact of storage accesses across the extrinsics of a block rather than only per extrinsic.
Basically, for every read I want to know if either one of those statements is true:
- The storage item already been read in the current block.
- The storage item has already been written in the current block.
In both cases the item wouldn't be included in the witness:
- The witness does not contain duplicate keys.
- If the key was written it can be pulled from the overlay and doesn't need to be in the witness.