near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.31k stars 605 forks source link

Implement delayed chunks application for Stateless Validation #9982

Open pugachAG opened 9 months ago

pugachAG commented 9 months ago

See the doc for more context.

This includes delaying applying block chunks until the next block is processed or a new chunk is needed to be produced.

Longarithm commented 9 months ago

It seemed to me that I can achieve all three sub-goals from Miro board for #9679 if I apply right modifications to get_apply_chunk_job_new_chunk. Unfortunately, all my attempts ended up with couple of integration-tests failing due to different reasons, including

So I decided to come back to previous non-async approach and iterate from it slower. Pair of fixes already helped to bring number of nayduck failures "just" to 60. I plan to reduce it further and then apply chunks asynchronously again.

Longarithm commented 8 months ago

Latest update: https://near.zulipchat.com/#narrow/stream/407237-pagoda.2Fcore.2Fstateless-validation/topic/delaying.20chunk.20execution/near/401389927

Longarithm commented 5 months ago

Quick update: we are not fully doing this anymore in scope of SV mainnet release. Main reason is that applying of old chunks is more problematic than we thought. We still want to do it, but the fix must include, together:

IIRC this is valuable as we won't have to apply receipts to make just a state sync and protocol logic becomes MUCH more consistent.