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

Client self-healing #63

Closed
r0wdy1 opened this issue Nov 28, 2022 · 1 comment
Closed

Client self-healing #63

r0wdy1 opened this issue Nov 28, 2022 · 1 comment
Assignees
Labels

Comments

@r0wdy1
Copy link

r0wdy1 commented Nov 28, 2022

Problem: client application's roots can diverge from relayer's, so that further sync leads to different values.
Example of error:

Nov 28 07:45:30 [relayer-mpv](https://my.papertrailapp.com/systems/relayer-mpv/events?focus=1533911951141924901&selected=1533911951141924901) [zk-zkbob-relayer-1/bac491289b8b](https://my.papertrailapp.com/events?q=program%3Azk-zkbob-relayer-1%2Fbac491289b8b&focus=1533911951141924901&selected=1533911951141924901)  #033[33mwarn#033[39m: Validation error: Incorrect root at index 938496: given 16487994424135461758197250592886238238853390102054304303685024917621785913544, expected 12288694896256461778204082089754840045221114890208831775726614887524104710954 {"timestamp":"2022-11-28T15:45:30.257Z"}

Client library should perform check current root against contract by current client's index ( it can be in the past, it doesn't matter).
If the roots are not equal, the self-healing sequence must be started:

  1. Apply binary search for equal roots ( make a big step back, compare, then make half a step further, compare etc )
  2. Rollback client state to the index where roots were equal
  3. Sync up to the current index
@EvgenKor
Copy link
Collaborator

EvgenKor commented Dec 9, 2022

PR #66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants