tree
Package tree
import "github.com/luxfi/node/vms/proposervm/tree"Types
Tree
Tree handles the propagation of block acceptance and rejection to inner blocks.
The Tree is needed because:
- The consensus engine guarantees that for each verified block, either Accept() or Reject() are eventually called, and they are called only once. The proposervm must maintain these invariants for the wrapped VM.
- A given inner block may be wrapped into multiple different proposervm blocks (e.g. same inner block generated by two validators).
The Tree prevents Accept() and Reject() from being called multiple times on the same inner block by:
- tracking inner blocks in a tree-like structure, to be able to easily spot siblings
- rejecting an inner block only when one of the siblings is accepted. Rejection of a proposervm block does not imply its inner block rejection (it may be held by a different proposervm block).
func New() Tree