Add resource-budget regression tests for every contract entrypoint

オープン
#147 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust

調査の方向性

Start in contracts/invoice/src/test.rs to see how existing tests call fund_invoice and get_invoice_history, then confirm which cost-estimation utilities soroban-sdk 27 exposes. Record a budget for each entrypoint, add a case that creates many invoices to show how history reads scale, and set generous thresholds. Done when every entrypoint has a budget assertion, the scaling test passes, and contracts/invoice/README.md explains how to update the thresholds.

索引モデルが issue の本文から書いたものです。

説明

contract difficulty: advanced help wanted performance testing

Difficulty: Advanced

Problem

The contract has no tests that measure CPU instructions, memory or ledger reads and writes per call, so a change that makes fund_invoice or get_invoice_history much more expensive would go unnoticed until it fails on-chain.

Why it matters

Soroban transactions have hard resource limits, and fees depend on them.

Scope of work

Use the SDK's cost-estimation test utilities to record per-entrypoint budgets (including get_invoice_history with many invoices) and assert generous thresholds. Document how to update them.

Expected outcome

CI fails when an entrypoint's resource use grows beyond an agreed threshold.

Acceptance criteria

  • Each entrypoint has a budget assertion.
  • A test shows how history reads scale with invoice count.
  • The README explains how to adjust thresholds.

Relevant files

  • contracts/invoice/src/test.rs, contracts/invoice/README.md

Dependencies

Confirm the available API in soroban-sdk 27 first.

Maintainer discussion needed?

No.

主要言語
TypeScript
スター
0
フォーク
4
平均マージ
54分
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Yormee-103/PayLoop のほかの issue

Yormee-103/PayLoop の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。