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

Make the protocol resistant to large ChunkStateWitnesses #11546

Open
Tracked by #103
jancionear opened this issue Jun 11, 2024 · 1 comment
Open
Tracked by #103

Make the protocol resistant to large ChunkStateWitnesses #11546

jancionear opened this issue Jun 11, 2024 · 1 comment
Labels
A-stateless-validation Area: stateless validation

Comments

@jancionear
Copy link
Contributor

jancionear commented Jun 11, 2024

Currently when the ChunkStateWitness gets really large, a shard can stall.
If the witness get so big that distributing it takes more time than one block production time, then the chunk validators will never receive the witness in time to endorse it, and the chunk will never get included.

It would look like this:

  • Chunk producer sends out a witness for chunk at height 10, shard 0
  • Validators for this chunk start receiving the witness, but it takes a while
  • Block producer does not receive the chunk endorsements for this chunk in time, and it doesn't include the chunk
  • Validators finally receive the witness and send out the chunk endorsements, but it's too late
  • The same repeats at height 11, the witness contains the same transacitons, incoming receipts, etc, so it's still large.
  • Rinse and repeat
  • The shard doesn't make progress and can't recover

There are a number of witness size limits to prevent this from happening, but it would be nice to make the protocol resistant to issues like this. If the witness ever gets too large because of a bug/unforseen corner case/etc we don't want the shard to stall.

Recently there was a fix for a similar problem that could occur when processing a chunk takes too long: #11344
The purpose of this issue is to figure out how solve the problem when distributing the witness takes too long.

@jancionear jancionear added the A-stateless-validation Area: stateless validation label Jun 11, 2024
@jancionear
Copy link
Contributor Author

One approach could be to split the ChunkStateWitness into two parts:

  1. The part that proves the execution of previous chunk
  2. The part that contains information specific to the new chunk - new_transactions etc

Currently the chunk producer has to distribute both 1) and 2) for every new chunk, but 1) is the same every time, so there's really no need to resend it every time.
The validators could cache 1) and receive only 2) from the chunk producer. 2) is small, so it can be distributed quickly and the chunk would be endorsed in time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stateless-validation Area: stateless validation
Projects
None yet
Development

No branches or pull requests

1 participant