feat: add `full-branch-updates` feature flag for storing all branch nodes
Makes the behavior of storing branch nodes with only leaf children opt-in
via the `full-branch-updates` feature flag. This addresses feedback that the
change would introduce unnecessary write I/O overhead for reth.
Without this feature (default): branch nodes with only leaf children are
omitted from `updated_branch_nodes` as an optimization to reduce disk writes.
With this feature: all branch nodes referenced by hash are stored, which is
required for complete incremental trie sync where consumers need the full
set of nodes to reconstruct the trie.
The feature uses compile-time `#[cfg]` checks, so there is zero runtime
overhead for the default path.
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019bfb37-3ca2-7078-8ab0-776518763f83