Skip to content

feat(Grants): paginate storage and remove max grant limit#52

Merged
aliXsed merged 1 commit intomainfrom
aliX/grants-extra-sec
Sep 3, 2024
Merged

feat(Grants): paginate storage and remove max grant limit#52
aliXsed merged 1 commit intomainfrom
aliX/grants-extra-sec

Conversation

@aliXsed
Copy link
Collaborator

@aliXsed aliXsed commented Aug 29, 2024

Rmove the maximum grants limit which could create undesired consequences when an address is spammed. However we need to paginate the storage to keep the cost of iterating over all the grants for functions like claim, cancel and renounce limited and predictable. For convenience of the contract users we assume startPage == endPage == 0 means iterate over all the pages (which could make sense if the user already knows this wouldn't be too expensive.

NOTE: we are not defragmenting the storage when some schedules are removed from a page. This means the number of items in every page would be variable but always less than or equal the pageLimit.

@aliXsed aliXsed marked this pull request as ready for review August 29, 2024 02:33
@aliXsed aliXsed requested a review from ETeissonniere August 29, 2024 02:33
@aliXsed aliXsed merged commit a76f669 into main Sep 3, 2024
@aliXsed aliXsed deleted the aliX/grants-extra-sec branch September 3, 2024 02:53
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