Skip to content

doc: add comments explaining FINALITY_CHAIN_EXTRA_EPOCHS in ChainGetTipSetFinalityStatus #6866

Description

@hanabi1224

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: TaskDiscrete task to implement

Type

No type

Fields

Priority

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions