HomePhabricator

Prepare block connection logic for headers-first.
75f51f2a63e0Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Prepare block connection logic for headers-first.

This changes the block processing logic from "try to atomically switch
to a new block" to a continuous "(dis)connect a block, aiming for the
assumed best chain".

This means the smallest atomic operations on the chainstate become
individual block connections or disconnections, instead of entire
reorganizations. It may mean that we try to reorganize to one block,
fail, and rereorganize again to the old block. This is slower, but
doesn't require unbounded RAM.

It also means that a ConnectBlock which fails may be no longer called
from the ProcessBlock which knows which node sent it. To deal with that,
a mapBlockSource is kept, and invalid blocks cause asynchronous "reject"
messages and banning (if necessary).

Details

Provenance
Pieter Wuille <pieter.wuille@gmail.com>Authored on Nov 16 2013, 18:28
deadalnixPushed on May 14 2017, 22:04
Parents
rABC0ec16f35d6b8: Move only: extract WriteChainState and UpdatedTip from SetBestChain.
Branches
Unknown
Tags
Unknown

Event Timeline

Pieter Wuille <pieter.wuille@gmail.com> committed rABC75f51f2a63e0: Prepare block connection logic for headers-first. (authored by Pieter Wuille <pieter.wuille@gmail.com>).Jan 27 2014, 20:20