Fixed TTL extension thresholds risk archival/fund-inaccessibility for long-lived escrows and pools
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
Background / Context
All three contracts call extend_ttl (escrow/src/lib.rs:266-268, milestones/src/lib.rs:284-286, maintenance-pool/src/lib.rs:175-177), each identically: env.storage().persistent().extend_ttl(key, 100_000, 500_000) — a hardcoded threshold and extend-to value in ledger count, applied uniformly regardless of the entry's actual expected lifetime. The escrow's own doc comment says these values are "conservative defaults suitable for a multi-month bounty lifecycle," but maintenance pools are explicitly designed to be open-ended/long-lived ("it never 'finishes'" per the README), and milestones can plausibly span longer release cycles too.
Problem Statement
Soroban archives (evicts) persistent entries whose TTL expires, and restoring an archived entry requires an explicit (and non-trivial) restoration transaction — if even possible depending on how long past expiry it is and network policy. extend_ttl is only called on the "active" write paths (fund, release, refund, allocate, release_issue, deposit, withdraw) — meaning an escrow/pool/milestone that receives no writes for longer than the TTL window (e.g., a maintenance pool for a quiet repo that goes a year without a maintainer draw-down, or an escrow whose deadline is far in the future and nobody touches it) can have its TTL lapse and its entry archived with no explicit warning or contract-level safeguard, potentially requiring off-chain intervention (a restore transaction) before funds become accessible again, or in the worst case (if restoration policy/tooling isn't in place) creating genuinely stuck funds.
Requirements
- Research Soroban's exact TTL/archival/restoration mechanics: what happens on a call against an archived entry, what's required to restore it, whether restoration requires the original writer or can be done permissionlessly, and what the actual eviction/rent-bump costs look like at current network parameters.
- Compute, for each contract, the real-world time window
100_000/500_000ledgers corresponds to (ledger close time is roughly, but not exactly, constant — pin down the current approximate figure and note it can change) and compare it against the stated multi-month/open-ended lifecycle expectations. - Implement a fix appropriate to each contract's lifecycle: for maintenance pools specifically, consider whether any interaction (even a permissionless "ping"/
extend_ttl-only view-adjacent call, or a longer default threshold) should be exposed so a pool can be kept alive without requiring a deposit/withdrawal; for escrow/milestones, consider whether the threshold should scale with the storeddeadline/milestone duration rather than being a fixed constant. - Add tests simulating ledger-sequence advancement past the TTL threshold (Soroban's
testutils::Ledgersupports manipulating ledger sequence) to prove the fix actually prevents archival within realistic usage patterns.
Acceptance Criteria
- Written research on Soroban TTL/archival/restoration mechanics and current network parameters
- Quantified real-world time-window analysis per contract
- Implemented fix (dynamic threshold, permissionless keep-alive call, or equivalent) per contract as warranted
- Tests using
testutils::Ledgersequence manipulation proving entries survive realistic long-idle periods post-fix - No unnecessary cost increase for the common case (active escrows/pools)
Technical Notes / Hints
soroban_sdk::testutils::Ledgertrait exposes ledger sequence manipulation for tests — use it to simulate long idle periods without waiting in real time.- Consider especially the maintenance-pool contract, whose entire premise ("never finishes," "recurring") is in the most direct tension with a fixed-TTL model designed around bounded bounty lifecycles.
Difficulty Justification
Requires specialized knowledge of Soroban's state-expiration/archival system (a Stellar-specific mechanism with no direct EVM analog), careful time-window arithmetic tied to network-specific ledger-close-time assumptions that themselves can shift, and a fix that must be tailored differently per contract given their genuinely different lifecycle models rather than a single uniform patch.
- 主要言語
- Rust
- スター
- 1
- フォーク
- 102
- 平均マージ
- 4時間 12分
- マージ済み PR(30日)
- 30
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MergeFi/contracts のほかの issue
-
allocations map retains released issues — phantom ledger drift再び着手できるかも @PINYOPATTANAWASANPORN が 12 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
MergeFi/contracts#608 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
escrow::contribute and milestones::contribute accept new funds after deadline + GRACE_PERIOD, when anyone can already refund or cancel対応中かも @urielit1313-creator が 29 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
MergeFi/contracts#568 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Makefile deploy targets deploy the unoptimised .wasm — `stellar contract optimize` writes *.optimized.wasm対応中かも @urielit1313-creator が 29 日前に担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
MergeFi/contracts#567 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
keep_alive never refreshes instance storage, so a contract kept alive only via keep_alive can still archive Admin/Oracle/Treasury対応中かも @urielit1313-creator が 29 日前に担当しました。 オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
MergeFi/contracts#566 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
[Regression on closed #254] milestones::deallocate still has no test asserting admin authorization対応中かも @urielit1313-creator が 29 日前に担当しました。 オープンsecurity testing
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
MergeFi/contracts#565 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
MergeFi/contracts の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
aws/aws-emulator#30 · コメント 1 件 ·
-
tormach-plasma refusal text with no machine reads "no machine is not declared a plasma machine"オープンarea:post bug effort:low P2 source:agent
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
Chat images never show without ImageMagick: ffprobe fallback uses an option string ffprobe 9 rejectsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
eliasstravik/herdr-projects#1011 ·
-
design-data-spec
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
adobe/spectrum-design-data#1744 ·
メンテナーはふだん 1 日以内に返信