Context
In src/rpc/methods/chain.rs, the get_ec_finality_threshold_depth_and_tipset function
(introduced in #6811) uses a locally-defined constant:
const FINALITY_CHAIN_EXTRA_EPOCHS: usize = 5;
During review, it was raised that there is no explanation for why this value is 5,
why extra epochs are needed at all, and what impact choosing a different value (e.g. 10) would have.
Task
Add inline documentation/comments to explain:
Why extra epochs are needed (e.g. to ensure the bisection algorithm has enough history beyond the finality threshold).
Why the value is 5 (rationale for this specific choice vs. a larger or smaller buffer).
Reference to the original Lotus implementation if applicable.
References
PR: #6811
Review comment: #6811 (comment)
Context
In
src/rpc/methods/chain.rs, theget_ec_finality_threshold_depth_and_tipsetfunction(introduced in
#6811) uses a locally-defined constant:During review, it was raised that there is no explanation for why this value is 5,
why extra epochs are needed at all, and what impact choosing a different value (e.g. 10) would have.
Task
Add inline documentation/comments to explain:
Why extra epochs are needed (e.g. to ensure the bisection algorithm has enough history beyond the finality threshold).
Why the value is 5 (rationale for this specific choice vs. a larger or smaller buffer).
Reference to the original Lotus implementation if applicable.
References
PR: #6811
Review comment: #6811 (comment)