Skip to content

Conversation

@tejasbadadare
Copy link
Contributor

@tejasbadadare tejasbadadare commented Apr 15, 2025

Summary and Rationale

Various improvements from PR and design doc review.

  • Address PR review comments from pulse-scheduler: init ethereum contracts, subscriptions, updating prices #2572

    • Paginate getActiveSubscriptions
    • Make addSubscription payable to allow for atomic addFunds + addSubscription
  • Match IPyth signatures for the read prices functions (e.g. getPricesUnsafe) to make migration easier for users

  • Make deactivateSubscription a special case of updateSubscription

    • Expanding updateSubscription to handle activating and deactivating subscriptions makes it possible to reactivate a subscription. This is better UX, since the user may want to pause and resume a subscription without modifying its balance or params.
  • Enforce a minimum balance for active subscriptions

    • We now enforce a minimum balance for a subscription when withdrawing funds from an active subscription, and when adding/reactivating a subscription. This helps guard against bad actors flooding the system with subscriptions, which could cause the keepers to become overwhelmed. it also encourages users maintain enough balance to weather high gas environments. The actual balance is a placeholder value right now.
    • An effect of this is that isActive has moved from SubscriptionStatus to SubscriptionParams
  • Remove the onlyPusher modifier since we will allow anyone to push updates.

  • Update GasConfig to expose maxGasMultiplierCapPct and maxFeeMultiplierCapPct controls to the user. Set defaults to be very high, since most users would rather land txs at a higher cost than not land them due to limits set too low.

How has this been tested?

  • Current tests cover my changes
    • Augment current tests to verify the above changes
  • Added new tests
    • Verify minimum balance is enforced
    • Positive/negative tests for whitelist
    • Verify removed feeds are cleared
  • Manually tested the code

- Updated price feed parsing to allow for a timestamp range of [-10s, now].
- Introduced validation for update conditions, including checks for heartbeat and price deviation.
- Added new error handling for outdated timestamps and unmet update conditions.
- Refactored subscription status to use a uint256 for last updated timestamp.
- Expanded test coverage for update conditions and validation scenarios.
@vercel
Copy link

vercel bot commented Apr 15, 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) Visit Preview Apr 16, 2025 6:23pm
component-library ⬜️ Ignored (Inspect) Visit Preview Apr 16, 2025 6:23pm
entropy-debugger ⬜️ Ignored (Inspect) Visit Preview Apr 16, 2025 6:23pm
insights ⬜️ Ignored (Inspect) Visit Preview Apr 16, 2025 6:23pm
proposals ⬜️ Ignored (Inspect) Visit Preview Apr 16, 2025 6:23pm
staking ⬜️ Ignored (Inspect) Visit Preview Apr 16, 2025 6:23pm

Base automatically changed from tb/pulse-scheduler/init to main April 15, 2025 16:37
@tejasbadadare tejasbadadare merged commit 2440b38 into main Apr 16, 2025
10 checks passed
@tejasbadadare tejasbadadare deleted the tb/pulse-scheduler/sub-mgmt-and-min-bal branch April 16, 2025 18:27
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.

3 participants