Home / Input Output / jormungandr
163 commits this week Dec 06, 2019 - Dec 13, 2019

Rework chain pull to be concurrency-friendly

Now that multiple chain pull tasks can pull the same or mostly the same header chain, and in the mean time between arriving headers some blocks in the chain may be received and applied, CandidateForest needs to account for this concurrency. Do this by only retiring candidate entries on GC, setting the state to Applied when the block is committed to storage. When asynchronous ChainAdvance processing sees such an entry at the current block’s parent, it knows to drop the hashes it collected to fetch and re-land the chain from the current hash.