Skip to content

test: add gas benchmarks for insurance scheduler workloads#420

Open
Mosas2000 wants to merge 1 commit intoRemitwise-Org:mainfrom
Mosas2000:test/insurance-scheduler-gas-workloads
Open

test: add gas benchmarks for insurance scheduler workloads#420
Mosas2000 wants to merge 1 commit intoRemitwise-Org:mainfrom
Mosas2000:test/insurance-scheduler-gas-workloads

Conversation

@Mosas2000
Copy link
Copy Markdown
Contributor

Adds 17 gas benchmarks for insurance premium schedule operations covering create, modify, cancel, execute, and query paths under heavy workloads.

Benchmarks include:

Schedule lifecycle with 50-100 existing entries
Execute due schedules (single, partial, all due, missed periods)
Query performance with owner isolation validation
Run with: RUST_TEST_THREADS=1 cargo test -p insurance --test gas_bench -- --nocapture

Closes #286

Add comprehensive gas benchmarks for insurance premium schedule operations:

- Create schedule: single and with 50 existing schedules
- Modify schedule: single and middle of 100 schedules
- Cancel schedule: single and middle of 50 schedules
- Execute due schedules: single, 10 of 50, all 50, with missed periods
- Query schedules: empty, 50, 100 worst-case, owner isolation
- Policy aggregation: get_total_monthly_premium with 100 policies

Benchmark implementation:
- Add PremiumSchedule type with id, policy_id, owner, next_due, interval,
  active, and missed_count fields
- Implement schedule lifecycle functions in the contract
- Add TTL extension to prevent storage archival during time-advancing tests
- Use high min_temp_entry_ttl and min_persistent_entry_ttl in test environment

Update benchmarks/README.md with documentation for:
- Running insurance benchmarks
- All benchmark scenarios covered
- JSON output format

Remove broken stress_tests.rs (pre-existing incompatible API usage)
@Baskarayelu
Copy link
Copy Markdown
Contributor

Please resolve the conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add gas benchmarks for insurance schedule heavy workloads

2 participants