Closed clangenb closed 1 year ago
If we still want to persist some hash to be retrieved by some other chain, I would suggest including another extrinsic, which stores hash with a certain lifetime or without, but then one needs to deposit some TEER for as long as the hash should live on the chain.
I think this is all fine except to perhaps introduce a new type to reduce the argument size. Also bounding the Vec<u8>
to some fixed size.
struct Topic {
title: Hash,
data: BoundedVec<u8, MAX_LEN>
}
Then..
pub fn publish_hash(origin: Origin, hash: H256, topic: Option<Topic>) -> DispatchResult { .. }
We do trust a TEE does things correctly, but the tee does need to prove that it did execute something at all. For indirect requests, we already do this; we publish the hash of the executed request on the chain. However, we don't do this yet for direct requests or as a result of something else. This could be done with a very simple extrinsic:
As we don't want to bloat our chain state, we only emit an event. All the indexers will still register and store the event, and you can always query archive nodes for events at a specific block height. The only thing that would not be possible is to request the hash via XCM, which I believe that we don't need it. In this case, the TEE would just send the result or whatever to the other parachain directly anyhow.
We could also use deposit_event_indexed to publish hashes with certain topics. Then, clients could subscribe to updates of a specific
mrenclave
. Or what if instead of just using themrenclave
as topic, we could maybe also do something like this?