Skip to content

mergefi_common::extend_ttl's threshold/extend-to constants (100_000, 500_000) have no derivation comment #112

Description

@chonilius

In contracts/common/src/lib.rs, extend_ttl_for_target has an extensive doc comment (30+ lines) explaining exactly where its numbers come from, including a reference to APPROX_SECONDS_PER_LEDGER and the specific issue (#56) that motivated it. The simpler extend_ttl function right above it — the one actually used on the overwhelming majority of storage writes across all three contracts — has zero explanatory comment for its own magic numbers (env.storage().persistent().extend_ttl(key, 100_000, 500_000)). README.md does explain the derivation elsewhere ("~29 days... 500_000 × 5 ÷ 86,400"), but that context isn't linked from the function itself, so a reader going straight to the source has no way to know these aren't arbitrary.

Add a short comment on extend_ttl (or a doc link to the README section) explaining the 100_000/500_000 derivation, matching the standard extend_ttl_for_target already sets in the same file.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingdocumentationImprovements or additions to documentationgood first issueGood for newcomershelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions