Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listen to parentchain events #1238

Closed
brenzi opened this issue Mar 28, 2023 · 3 comments
Closed

listen to parentchain events #1238

brenzi opened this issue Mar 28, 2023 · 3 comments
Assignees

Comments

@brenzi
Copy link
Collaborator

brenzi commented Mar 28, 2023

  • Feed in all events from one block into enclave
  • Validate storage proof for system pallet events
  • Allow subscription for particular event
@clangenb
Copy link
Contributor

Connected to: #1208

@coax1d
Copy link
Contributor

coax1d commented Apr 5, 2023

For bullet point 3 in this issue there is really a couple approaches and it is worth discussing an approach.

For now regarding bullet points 1 & 2 simply query the ParentChain for both the events and the events_storage_proof pass those into the enclave when syncing the ParentChain blocks and validate the proof.

Now once we have the validated events we can do the simplest approach and least robust approach that would solve #1208 and #970 which is:
Pass the validated events along with the blocks to the import dispatcher

import_dispatcher.dispatch_import(blocks_to_sync)?;

However this is not really achieving being able to subscribe to a particular event that is mentioned in bullet point 3.

A solution to achieve this may be to have some temporary storage of events in the enclave which can be indexed by a particular block hash. This way we can allow someone to query the validated events for a particular block and then search those events for what they are looking for i.e. (Extrinsic success, or Extrinsic Failed, Certain Pallet events etc.) Or to even subscribe to a particular validated event and just listen for when it occurs given the current ParentChain block.

This is the solution I am leaning towards which would allow for subscription.

Open to any feedback.

@coax1d
Copy link
Contributor

coax1d commented May 23, 2023

Closed by #1272

@coax1d coax1d closed this as completed May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants