Add resource-budget regression tests for every contract entrypoint

Aperta
#147 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
0
Fork
4
Merge medio
54m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Yormee-103/PayLoop

Tutte le issue di Yormee-103/PayLoop

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.