erigon
erigon copied to clipboard
[draft] remove pointless file protection during merge
relates to #10733 Subset files are protected until being integrated into Domains. One case when files must be protected - during ComputeCommitment and even though it's usage is disputable.
File protection is used in 3 places:
- During
ComputeCommitmentto make sure commitment reads consistent data from commitment/accounts/storage.DomainRoTxcopies pointer to visible files ofDomain, but there are three different domains included, easier just prohibit subset removals while computing - during
mergeFiles. Here files kind of protected by being not included into visibleFiles untilintegrateMergedFilesis called. There is no other actor which is able to remove sub-range files therefore seems pointless, crash situation is covered by next point - inside
NewAggregator: what if we just started after crash and accounts already merged while commitment is not. In that case, three domains will return differentLatestMergeRangeand we need to persist old sub-ranges to make sure we can decode existing referenced keys inside commitment branches.
done