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

Fix dagvote equal depth bug , and other test infra #9

Open
kelemeno opened this issue Sep 15, 2024 · 1 comment
Open

Fix dagvote equal depth bug , and other test infra #9

kelemeno opened this issue Sep 15, 2024 · 1 comment

Comments

@kelemeno
Copy link
Owner

kelemeno commented Sep 15, 2024

cast call 0xe42923350EF3a534f84bb101453D9B442d42Bf0c "readSentTreeVote(address)(address)" 0xFb60921A1Dc09bFEDa73e26CB217B0fc76c41461 0 0 0 --rpc-url "https://sepolia.era.zksync.dev"
returns: 0x7921F9F70B754A014922Aca94947e23F1A424164 i.e. Zach, and Fb60.. is Marcin, but they are on the same depth.
image

I looked at the smart contract, I found a bug in it. I'm not sure it was the correct ones.
The bug in was in findDistances here: b24246c .
This function was not called in the last Marcin -> Zach tx, so there might be another bug. However, this bug might have been called earlier.

I also created a way to save the DAG from a chain.
Next to dos:
Remote debug process:

  • Prepare tx replaying tool: use the dag saving tool to clone the graph + rerun previous txs (use cast to listen to previous txs), apply consistency checker
  • Use same tools for previous wrong contract. Should be easy to debug. Check what broke, and that we actually caught the bug. ( copy old contract from gh ). The general process is:
    • replay, catch a bug, fix the bug, repeat until no bug is found, or until possible.

Based on debug process, knowing what wrong we can add more tests.

  • write test that catches the bug in the old contract. (always write more tests).
@kelemeno kelemeno changed the title Fix bug: Fix dagvote equal depth bug Sep 15, 2024
@kelemeno kelemeno changed the title Fix dagvote equal depth bug Fix dagvote equal depth bug , and other test infra Sep 16, 2024
@kelemeno
Copy link
Owner Author

Update:

  • have save graph tool, replay tx tool. It will be useful also for other use cases.
  • even the currently changed graph cannot replay all the txs, so we already caught at least some of the issues.
  • there was an issue in dagconsistency checker, now even normal tests fail. (still need to be debugged). But the issue is the same, same height Dag votes, so I think it will solve the issue.

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