Chain_validator: a bit less notify branch
Context
Tezos P2P protocol offers 2 ways for a node to inform its neighbors that its head changed:
- Sending only this new head assuming the neighbor should know about its predecessor
- Sending a "locator" a sparse description of the full chain history in order for the 2 nodes to agree on a common known ancestor and sync a full branch from it launching a "bootstrap pipeline".
This MR improve 2 situations:
- When you receive a "locator" but actually you know all the blocks up to the predecessor of the head, it's useless to launch a bootstrap pipeline, applying the block is enough
- When you switch head to a block of same level (but higher round), your neighbors should also know about the new head predecessor so it's enough to send the new head.
Manually testing the MR
Launch a node in verbose mode on a network with some history and check your logs
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR