-
Notifications
You must be signed in to change notification settings - Fork 327
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
chore: Creating a unified mechanism to generate blocklists for ckBTC and ckETH #3401
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @THLO for making this script! Some minor comments and python newbie questions.
Co-authored-by: gregorydemay <[email protected]>
# Remove duplicates. | ||
addresses = list(set(addresses)) | ||
# Sort the addresses. | ||
addresses.sort() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a problem with the sorting for ETH addresses. To reproduce:
- Update ETH blocklist
python rs/cross-chain/scripts/generate_blocklist.py ETH ./SDN.XML rs/ethereum/cketh/minter/src/blocklist.rs
- Run the unit tests
bazel test //rs/ethereum/cketh/minter:lib_tests
The test check_blocklist_is_sorted
fails. This is because the sorting of the ETH blocklist is based on the 20-bytes corresponding to an address and not on its textual representation so we probably need here a different sorting algorithm for the EthereumBlocklistHandler
that first does hex decoding of its elements before sorting.
Co-authored-by: Louis Pahlavi <[email protected]>
…process' into tl/unify_blocklist_process
This PR adds a Python script to generate blocklists for ckBTC and ckETH based on the OFAC SDN list.
There are some differences in the produced blocklist files compared to the current files:
Differences to the current ckBTC blocklist file:
Differences to the current ckETH blocklist file:
from_address
in the functionis_blocked
has been changed toaddress
to make it consistent with the corresponding function for ckBTC.Corresponding ticket: https://dfinity.atlassian.net/browse/XC-250