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

bug(merklesync-updater): tries to poll new_root before it has finished syncing all messages #108

Closed
luketchang opened this issue Apr 18, 2022 · 0 comments
Labels
bug Something isn't working fix

Comments

@luketchang
Copy link
Collaborator

luketchang commented Apr 18, 2022

TL;DR the bug in the updater that failed all dev homes is as follows:

  • Updater tries produce new_roots from a local merkle tree which is built from all the emitted messages for that home (same process as the processor)
  • The updater has until now never synced/indexed messages
  • The updater started syncing messages but before that has finished, it picks the current root of the local tree and uses that as its new_root
  • This update of last_committed-->new_root is invalid (the new_root is actually a really old root)
  • The improper update is submitted and the home is failed (for each updater)

Solution:

  • Have the syncing merkle tree keep track of the current committed_root corresponding to its current root
  • I.e. Each time the syncing tree stores a new leaf, it will get the Dispatch.committed_root field and update its current committed_root field
  • The updater will only use tree.root() if tree.current_committed() == old_root
@luketchang luketchang added bug Something isn't working fix labels Apr 18, 2022
@luketchang luketchang changed the title bug(updater): tries to poll new_root before it has finished syncing all messages bug(merklesync-updater): tries to poll new_root before it has finished syncing all messages Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix
Projects
None yet
Development

No branches or pull requests

1 participant