Open clangenb opened 1 year ago
Attempting a design for this. please review broad concept @clangenb:
Questions:
Attempting a solution sketch:
send_extrinsic(call)
Queue
and use it for CallQueue
with minimal modifications?invoke
events, but also to all events with the enclave account involvedCallbacks
would be hard-coded by call type, no dynamic closures possible
Examples:
Before I read the solutions, I have thought about your Questions:
CallQueue?
Shard & Persisted:
Callbacks?
I will now look at the proposed solution.
It is a bit hard to judge the proposal without looking at the code. I think having the call queue somewhere in the light validation code makes sense, but I think the callback queue should be in the STF as this is call specific handling, and it makes sense to do this here too. The other things that I did not comment on, I think are fine as they are on first sight. While thinking about this, two other points popped up in my head though:
I think we already agree that the timeout case definitely needs to be handled in case an extrinsic gets lost somewhere on the way. Hence, we have to move away from immortality so that we can be absolutely sure that an extrinsic will never make it into a block before we revert state in layer 2.
Lastly, I am a bit unsure if listening for events should be avoided and we instead only look for successful calls of certain extrinsics, and maybe don't really use events in any other way, I fear that we run into the issue that we accidentally act twice on the same extrinsic if we go the mixed way. I am not sure how relevant this thought is, will think about it some more.
1455 has removed the pending xt inclusion check because the implementation did not work. The complete removal of the that feature was motivation because it should never have been in the light-client in the first place. We have to re-introduce this check elsewhere because there needs to be an additional check that the corresponding extrinsic was successful.