Skip to content

fix(contracts): subscriptions count in payment service addSubscriptions#2241

Merged
JuArce merged 3 commits intostagingfrom
fixcontracts/-active-subscriptions-counter-agg-mode-payment-service-addSubscriptions
Jan 13, 2026
Merged

fix(contracts): subscriptions count in payment service addSubscriptions#2241
JuArce merged 3 commits intostagingfrom
fixcontracts/-active-subscriptions-counter-agg-mode-payment-service-addSubscriptions

Conversation

@maximopalopoli
Copy link
Contributor

@maximopalopoli maximopalopoli commented Jan 12, 2026

Description

This PR modifies the addSubscriptions behavior to only add to the active subscriptions counter when the address was not already subscribed.

How to test

Start the anvil node and deploy the anvil contracts with:

make ethereum_package_start

To fetch the current value of the active subscriptions counter:

cast call 0x922D6956C99E12DFeB3224DEA977D0939758A1Fe "activeSubscriptionsAmount()(uint256)"

To call the addSubscriptions method:

cast send 0x922D6956C99E12DFeB3224DEA977D0939758A1Fe \                                     
  "addSubscriptions(address[],uint256)" \
  "[0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266,0x70997970C51812dc3A010C7d01b50e0d17dc79C8,0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC]" \
 <UTC_SECONDS_TIMESTAMP> \
  --private-key 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97

The array of addresses can be changed.

The thing to test is that the counter does not change when the addresses are already subscribed.

Type of change

Please delete options that are not relevant.

  • New feature
  • Bug fix
  • Optimization
  • Refactor

Checklist

  • “Hotfix” to testnet, everything else to staging
  • Linked to Github Issue
  • This change depends on code or research by an external entity
    • Acknowledgements were updated to give credit
  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run
  • Has a known issue
  • If your PR changes the Operator compatibility (Ex: Upgrade prover versions)
    • This PR adds compatibility for operator for both versions and do not change crates/docs/examples
    • This PR updates batcher and docs/examples to the newer version. This requires the operator are already updated to be compatible

@maximopalopoli maximopalopoli self-assigned this Jan 12, 2026
@maximopalopoli maximopalopoli marked this pull request as ready for review January 12, 2026 18:48
@JuArce JuArce added this pull request to the merge queue Jan 13, 2026
Merged via the queue into staging with commit ed9667c Jan 13, 2026
4 checks passed
@JuArce JuArce deleted the fixcontracts/-active-subscriptions-counter-agg-mode-payment-service-addSubscriptions branch January 13, 2026 15:54
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