-
Notifications
You must be signed in to change notification settings - Fork 53
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
Build a back-end mechanism to save the off-chain Merkle roots #34
Comments
Thinking about an efficient way When Once called, set the 'Timeout' to execute the task after 1 minute. (I think we need to find the right time at the production level.) Stores off-chain roots of addedMember groups when executing tasks. Suggestion |
Hey,
It makes sense! From what I understood, using that
Yes, we need to do it, but 1 min is ok for now imo
I think the most efficient way is to mark the roots to be saved in a temporary key-value array (key: group id, which can be the hash of the group name, value: root hash), and then save just those roots.
What would be the advantage? I feel like it could become more complex for no specific reason. |
Yes right! It's like waking up when an actual roots change should happen. We can also accommodate many requests in a short period of time without wasting gas. Only 1 minute now, but it should not keep users waiting for a long time.
Makes sense! Temporary array would be good way. I will try this. Thanks!
I thought it would make sense to update the db when an off-chain root update actually occurs on-chain. But db is only used to show group information, and it seems that there is no advantage because the merkle proof generation for generating the actual semaphore proof will use cachedGroup. I agree. I will withdraw this! |
Yea, I'd say there is also another important point. Devs can decide to verify proofs off-chain, without using any contract. Those devs shouldn't wait for on-chain stuff. |
No description provided.
The text was updated successfully, but these errors were encountered: