-
Notifications
You must be signed in to change notification settings - Fork 627
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
Migrate chunk state witness pre validation logic from orphan witness handler to partial witness actor #11193
Comments
@pugachAG @jancionear have previously worked on the validation side. |
Currently, both @pugachAG and @shreyan-gupta are listed as assignee of this task. Please update it accordingly as we start working on this- |
We need to do the following:
|
Adding arbitrary timeline for now. Please adjust with the correct estimation |
Notes from conversation Anton and I had offline
|
Quick comment on this, I think one good way of ensuring this would be to have a separate LRU cache just keeping track of "seen" or "observed" witnesses. Currently we have the I'm slightly concerned what would happen if this cache entry gets evicted and a malicious chunk producer sends over all the parts again. In such a case we would have no memory of having already processed this witness. A quick solution is to have a tiny LRU cache for all witnesses we have decoded and quickly check that once. |
Potential discussion points: Is it fine to have hard checks based on "distance from head". For example, can we safely say, "we should not be processing any state witnesses that are a distance 50 away from our current head"? Can there be issues with respect to skipped blocks etc.? |
After looking into think for quite some time now I think it makes sense to consolidate partial witness tracking with the orphan pool. All validation logic from the orphan pool is applicable when validating witness parts. This can be implemented by adding an actix message sent from the Client to the PartialWitnessActor notifying about the processed block. This way partial witness tracker doesn't immediately send the witness for processing when prev block is not present, but retains it until the corresponding block is received from the Client. |
The first contact a node had with the network layer to receive the chunk state witness is crucial to do proper validation.
Before the introduction of partial state witness, the first point of contact was
ChunkStateWitnessMessage
from network adapter, however after the introduction of partial witnesses, we would have to shift all the validation functionality to the partial_witness_actor.This mainly includes shifting validation defined in partially_validate_state_witness in Client and handle_orphan_state_witness in Client
The first part of this has already been implemented in validate_partial_encoded_state_witness but we need eyes on the rest of the validation.
Tasks
The text was updated successfully, but these errors were encountered: