Skip to content

test(pulse-scheduler): add gas benchmark #2596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

tejasbadadare
Copy link
Contributor

Summary

  • Create a gas benchmark test for PulseScheduler. Covers the most common usage patterns:
    • Updating a subscription's feeds, and then querying the prices. Will be done frequently by users and keepers.
      • For 1, 2, 8, 10, 20 feeds.
    • Querying current set of active subscriptions. Will be done frequently by keepers.
      • For 10, 100, 1000 subscriptions, where half of them are active.
  • Refactor common test helpers out into PulseSchedulerTestUtils.t.sol

Benchmarks should be run with -vv to see the gas usage of the operations under test, excluding the setup costs.
See results here: https://app.warp.dev/block/Hs5rmQjIUKvq1X6Sdxl6nw

Rationale

Need it to be able to profile the current and future gas usage of the contract.

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

Copy link

vercel bot commented Apr 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Apr 18, 2025 9:48pm
component-library ⬜️ Ignored (Inspect) Apr 18, 2025 9:48pm
entropy-debugger ⬜️ Ignored (Inspect) Apr 18, 2025 9:48pm
insights ⬜️ Ignored (Inspect) Apr 18, 2025 9:48pm
proposals ⬜️ Ignored (Inspect) Apr 18, 2025 9:48pm
staking ⬜️ Ignored (Inspect) Apr 18, 2025 9:48pm

@tejasbadadare tejasbadadare changed the title test(pulse-scheduler): add gas benchmark, refactor common helpers into util test(pulse-scheduler): add gas benchmark Apr 18, 2025
@tejasbadadare tejasbadadare merged commit b98f257 into tb/pulse-scheduler/better-subparams-validation Apr 21, 2025
10 checks passed
@tejasbadadare tejasbadadare deleted the tb/pulse-scheduler/gas-benchmark branch April 21, 2025 18:17
tejasbadadare added a commit that referenced this pull request Apr 21, 2025
* feat: add permanent subscriptions, clean up tests

* refactor: extract out subscription parameter validation and improve error handling

* test(pulse-scheduler): add gas benchmark (#2596)

* test(pulse-scheduler): add gas benchmark, refactor common helpers into util

* doc: test comment

* fix: import

* fix: overflow, DRY

* doc: comment

* fix: remove unused constants

* fix: merge
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.

2 participants