-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support storing voting snapshots in the database #63
Comments
I am not sure about the context of what you've been discussing. To match the types in the API, I have to create this: But having this tracked internally instead would be useful |
I'm referring to the way voting snapshot state is constructed. Right now, when the client starts up we must traverse the chain backwards to the last epoch in order rebuild the voting snapshot state: https://github.com/goerli/parity-goerli/blob/master/ethcore/src/engines/clique/mod.rs#L266-L299 Geth stores voting snapshots on disk to avoid this. We can do the same. |
yes, this is a problem for the REST API, because I need to access them by index or hash |
if this is refactored, it would be amazing if:
Otherwise, searching/wrapping/converting on each REST call will be inefficient. |
The voting snapshot is only restored during client startup so there should be no overhead for the RPC API AFAIK |
I haven't had time to review the RPC API changes yet so I could be wrong. |
Yes, I have just started. I will be working on this in the next few days. It is much better now that things got merged and are a bit more stable. I assume then that snapshots are accessible here:
I may need a way to get them by index. I need to review the code a bit more. |
Cool. Looking forward to seeing what you come up with :) |
My inclination is that this issue is nice to have but the implementation should be merged separately from the main clique PR in order to avoid more review overhead from the Parity side. |
would it be possible to make this public?
|
Yes. I think so. |
Hey @jleni looks like this might be easy to add via the "block metadata feature" (see the related comment on the PR above). I'm going to look into this. |
Otherwise, we have to trace back through the chain and rebuild the voting snapshot on startup (which can be very slow depending on where we are in the epoch).
The text was updated successfully, but these errors were encountered: