Module forest_filecoin::chain_sync::tipset_syncer

source ยท

Structsยง

  • TipsetGroup ๐Ÿ”’
  • TipsetProcessor ๐Ÿ”’
    The TipsetProcessor receives and prioritizes a stream of Tipsets for syncing from the ChainMuxer and the SyncSubmitBlock API before syncing. Each unique Tipset, by epoch and parents, is mapped into a Tipset range which will be synced into the Chain Store.
  • TipsetRangeSyncer ๐Ÿ”’

Enumsยง

Constantsยง

Functionsยง

  • Checks optional values in header.
  • Check the clock drift.
  • Validate messages in a full block, relative to the parent tipset.
  • fetch_batch ๐Ÿ”’
    Ask peers for the Messages that these Tipsets should contain. Requests covering too many tipsets may be rejected. As of 2023-07-13, requesting for 8 tipsets works fine but requesting for 64 is flaky.
  • fetch_batch_inner ๐Ÿ”’
  • Download headers between the proposed head and the current one available locally. If they turn out to be on different forks, download more headers up to a certain limit to try to find a common ancestor.
  • Going forward along the tipsets, try to load the messages in them from the BlockStore, or download them from the network, then validate the full tipset on each epoch.
  • sync_tipset ๐Ÿ”’
  • sync_tipset_range ๐Ÿ”’
    Sync headers backwards from the proposed head to the current one, requesting missing tipsets from the network. Once headers are available, download messages going forward on the chain and validate each extension. Finally set the proposed head as the heaviest tipset.
  • validate_block ๐Ÿ”’
    Validate the block according to the rules specific to the consensus being used, and the common rules that pertain to the assumptions of the ChainSync protocol.
  • validate_tipset ๐Ÿ”’
    Validates full blocks in the tipset in parallel (since the messages are not executed), adding the successful ones to the tipset tracker, and the failed ones to the bad block cache, depending on strategy. Any bad block fails validation.
  • Check if any CID in tipset is a known bad block. If so, add all their descendants to the bad block cache and return an error.