Add resource-budget regression tests for every contract entrypoint

Đang mở
#147 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
blockchain, testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
0
Fork
4
Merge trung bình
54 phút
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Yormee-103/PayLoop

Tất cả issue của Yormee-103/PayLoop

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.