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

reduce computational complexity of assign and issue in ceremony pallet #29

Closed
brenzi opened this issue Feb 27, 2021 · 1 comment
Closed

Comments

@brenzi
Copy link
Member

brenzi commented Feb 27, 2021

The ceremony pallet has two expensive functions:

  • assigning meetups for all cid
  • issue rewards for all cid

These functions are triggered by block timestamps, not extrinsics, so their complexity can't be abused for an attack. Still, substrate enforces block times and for parachains it seems that the computation time per block is even more restrictive. relaychain validators will probably just refuse to check block validity if it takes too long.

approach 1: split by cid

We could assign one cid per block only, but that doesn't guarantee much. Maybe one cid has a million participants.
👎

approach 2a: offchain workers (substrate)

We could use offchain workers to do the computation. In order to ensure integrity, we'd need some threshold consensus. In order to ensure liveness, we may have to just wait for the first few offchain workers to send their identical results.
Assignment has to be deterministic!

approach 2b: offchain TEE

We could use SubstraTEE to compute the assignment and issuance in a TEE and the result will be sent to the chain via one or several extrinsics.

The TEE guarantees integrity and random assignment. for availability, we'd need redundancy
No need for deterministic assignment

@brenzi
Copy link
Member Author

brenzi commented Nov 21, 2021

done in #68

@brenzi brenzi closed this as completed Nov 21, 2021
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

1 participant