Skip to content
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

[ETHEREUM-CONTRACTS] [WIP] cheaper balance checks & more #2040

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft

Conversation

d10r
Copy link
Collaborator

@d10r d10r commented Dec 5, 2024

cheaper balance checks

When doing a transfer or starting a stream, we check if the sender has enough balance.
Instead of calculating the exact balance, it's enough to check if there's enough balance.
That can often be done much more cheaply, that is when a sender account has a lot of GDA pools connected.
Since the connected pools can only increase the balance, we can stop iterating as soon as the required balance threshold is met.

The current implementation violates the agreement abstraction because it needs to leave the GDA balance last.
This is made with the IDA deprecation already in mind (for this optimization to work well, we can have only 1 agreement with non-constant balance calculation cost).

This status is to be considered a PoC in order to test and show the idea, more attention should be paid to naming, avoidance of code reduncancy, testing, etc.

SuperTokenV1Library

  • added flowWithCtx and flowFromWithCtx

Copy link

github-actions bot commented Dec 5, 2024

Changelog Reminder

Reminder to update the CHANGELOG.md for any of the modified packages in this PR.

  • CHANGELOG.md modified
  • Double check before merge

@d10r d10r changed the title WIP Dev next [ETHEREUM-CONTRACTS] [WIP] cheaper balance checks Dec 6, 2024
@d10r d10r changed the title [ETHEREUM-CONTRACTS] [WIP] cheaper balance checks [ETHEREUM-CONTRACTS] [WIP] cheaper balance checks & more Dec 6, 2024
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.

1 participant