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

[FUN-877] persist data fetched from allowlist contract #11648

Merged

Conversation

agparadiso
Copy link
Contributor

@agparadiso agparadiso commented Dec 21, 2023

Description

This mr aims to persist data from the allowlist contract into the node's db in order to speed up the re-start of a node.

Changes implemented

Tos contract

  • implementation of getAllowedSendersCount() and getAllowedSendersInRange to iterate in batches over the allowed senders
  • implementation of getBlockedSendersCount() and getBlockedSendersInRange to iterate in batches over the blocked senders
  • change the s_blockedSenders type to EnumerableSet.AddressSet to be able to iterate.

Gateway handler

  • Small refactor in which allowlist and subscriptions have their own pkg
  • ORM layer for allowlist that will persist the list of allowed senders in batches of a configurable size
  • This ORM has a DeleteAllowedSenders method that will be invoked in order to delete from the functions_allowlist table every address that has been blocked onchain.
  • Feature flag for this feature that will enable us to deploy this while still being backwards compatible with previous versions of the contract that do not includes the methods introduced here. If the feature is disabled, we are not storing the allowlist given that we would not be able to sync with the blocked list.

Outside of scope

We are not taking into account the methods necessary to migrate existing blocked senders. this will be taken into account in a separate pr

How was this tested

The feature has been covered by unit and integration tests + validated on DB by starting a local node.
Further testing on staging will be done after merging

Copy link
Contributor

I see that you haven't updated any README files. Would it make sense to do so?

Copy link
Contributor

Go solidity wrappers are out-of-date, regenerate them via the make wrappers-all command

@agparadiso agparadiso force-pushed the feature/FUN-877_persist_data_fetched_from_contracts_allowlist branch from 51825c3 to cb72f42 Compare December 21, 2023 17:48
@agparadiso agparadiso self-assigned this Dec 21, 2023
@agparadiso agparadiso force-pushed the feature/FUN-877_persist_data_fetched_from_contracts_allowlist branch from cb72f42 to 2cca949 Compare January 5, 2024 17:24
Copy link
Contributor

github-actions bot commented Jan 8, 2024

Go solidity wrappers are out-of-date, regenerate them via the make wrappers-all command

@agparadiso agparadiso force-pushed the feature/FUN-877_persist_data_fetched_from_contracts_allowlist branch 2 times, most recently from c00b6e5 to 24aa8f2 Compare January 8, 2024 17:16
@agparadiso agparadiso marked this pull request as ready for review January 8, 2024 18:03
@agparadiso agparadiso requested review from a team, samsondav and jmank88 as code owners January 8, 2024 18:03
@agparadiso agparadiso force-pushed the feature/FUN-877_persist_data_fetched_from_contracts_allowlist branch 3 times, most recently from 5da05be to e9c4eff Compare January 11, 2024 13:49
@agparadiso agparadiso force-pushed the feature/FUN-877_persist_data_fetched_from_contracts_allowlist branch from 4ee343a to e338964 Compare January 24, 2024 14:28
@agparadiso agparadiso enabled auto-merge January 24, 2024 15:26
@cl-sonarqube-production
Copy link

@agparadiso agparadiso added this pull request to the merge queue Jan 24, 2024
Merged via the queue into develop with commit 1022aa0 Jan 24, 2024
104 checks passed
@agparadiso agparadiso deleted the feature/FUN-877_persist_data_fetched_from_contracts_allowlist branch January 24, 2024 17: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.

4 participants