-
Notifications
You must be signed in to change notification settings - Fork 8
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
Obsolete 0dns MongoDB #9
Conversation
[Bug] when fetching magic block from sharders, we were fetching from last sharder, instead of the one which got max consensus. [Code Quality] when we are starting a worker, we were starting a go routine inside a go routine, which is not required
Thanks for a well written issue. Anyway, I think we need to consider a few things before finalizing linked PR. Right now, 0dns is not implemented in a way to fully fulfill it's purpose. For example, it's supposed responsibility is to make available the Just as all stateful clients maintain valid magic block chain history, 0dns also needs to do it because we need to ensure 0dns is fault-tolerant. In practice, there will likely be multiple 0dns nodes to provide such tolerance. But when one specific node goes down and comes back after a while, it will interact with other 0dns nodes to get latest magic block, and verify magic-block chain history by tracing back the magic-block chain up until the latest one it has in it's own database before it went down. If we remove the database, the verification would require it to trace back to genesis magic block. So it may make sense to keep track of magic blocks that are already fetched and trusted. In case storing full blocks is redundant, we can instead choose to store only the magic-block headers (number, hash, prevhash, etc). To summarize, we can either remove or keep the persistent db. Both choices have some advantage. If I had to choose I'd go for keeping trusted chain of historical MB headers, but it's not absolutely necessary and we can do the verification instead by fetching full chain from sharders. @NoSkillGuy, @guruhubb please share your thoughts. |
✌🏻. I will create a v1 version of GitHub pull request template and let's observe and evolve with time
Completely agree on this part
How I understood 0dns is, it should have the latest MB. The way we are ensuring that we have the latest MB is, we fetch it from sharders. Since we are using consensus to determine the MB, It should be valid and fault-tolerant. 0dns stores the MB in memory and tries to update the MB every 5 seconds. [Scope for Improvement]: I think we should come up with an approach to actually get the latest MB in near real-time than depending on the 5-second retry
If one specific node goes down, when it comes back, all it needs is to fetch the latest MB from sharders right? That makes 0dns stateful.
Having the history of all the block has its own advantages and disadvantages, But I think maintaining the history of blocks is not the responsibility of 0dns. We can release We can still create a side project, something like |
@bbist let me know your thoughts on this! |
Looks good. |
[Cleanup] removing MongoDB since it's not required.
Why are we using MongoDB?
Are we using the stored Blocks in MongoDB?
Philosophy :
Pitfalls :
[Bug] when fetching magic block from shaders, we were fetching the block returned by the last sharder instead we should return the block which got max consensus.
[Code Quality] when we are starting a worker, we were starting a goroutine inside a goroutine, which is not required