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

Partial witness validation: track already observed witnesses #11302

Closed
Tracked by #11193
pugachAG opened this issue May 14, 2024 · 0 comments · Fixed by #11464
Closed
Tracked by #11193

Partial witness validation: track already observed witnesses #11302

pugachAG opened this issue May 14, 2024 · 0 comments · Fixed by #11464
Assignees

Comments

@pugachAG
Copy link
Contributor

pugachAG commented May 14, 2024

Part of #11193

We want to have a separate LRU cache to keep track of already decoded state witnesses. This is needed to prevent attacks on chunk validators by sending the same witness multiple times and making it apply chunks which can be resource-intensive.

Similar to #11111
Also see #11193 (comment)

@pugachAG pugachAG self-assigned this Jun 3, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 5, 2024
This PR introduces a separate LRU cache to keep track already processes
state witnesses. Note that malformed witness (that couldn't be decoded
or decompressed) is also considered processed because we want to avoid
processing more parts for that chunk.
When we have enough witness parts the entry is removed from
`parts_cache` and added to `processed_witnesses`. This makes
`is_decoded` field in `CacheEntry` redundant since now `parts_cache`
only stores not-yet-decoded witnesses, so the field was removed.
This PR also includes a bit of refactoring such as getting rid of
`CacheEntry` `shard_id` field and removing/renaming metrics.

Closes #11302.
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

Successfully merging a pull request may close this issue.

1 participant