Skip to content

Design Property-Based Test Suite for Soroban Contract Dry-Run Fee Estimation Accuracy and Determinism #826

Description

@temma02

Description

packages/stellar/src/soroban.dryrun.test.ts tests dry-run execution but does not have property tests verifying that fee estimation is deterministic across identical inputs and that estimated fees always exceed actual fees by the configured buffer margin.

Requirements and Context

  • Property: identical contract call inputs always produce the same fee estimate
  • Property: estimated fee ≥ actual fee × (1 + buffer margin)
  • Test against fast-check generated ScVal argument lists of varying complexity
  • No live RPC calls — use mocked simulation responses with realistic resource values

Suggested Execution

Branch: test/soroban-dryrun-fee-estimation-accuracy-property

Implement Changes

  • Add soroban.dryrun.property.test.ts in packages/stellar/src/
  • Use fast-check to generate varied argument lists and assert fee determinism
  • Mock simulation response with generated resource values and assert buffer margin
  • Test edge case: zero-resource invocation returns minimum base fee

Test and Commit

Run FC_NUM_RUNS=1000 pnpm test --filter=stellar -- soroban.dryrun.property and confirm determinism and buffer margin properties hold.

Example Commit Message

test(soroban): add property tests for dry-run fee estimation accuracy and determinism

Co-authored-by: <your-name>

Guidelines

  • Branch off main, keep PRs focused on one issue
  • All new code must include unit or integration tests
  • Ensure pnpm lint and pnpm typecheck pass before review
  • Link this issue in your PR description
  • Request review from at least one maintainer before merging

Metadata

Metadata

Assignees

No one assigned

    Labels

    sorobanSoroban smart contract issuestestingTesting related issues

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions