PR:
This pull request optimizes the handling of trusted keys by converting lists to sets. This change improves performance for membership checks, making them faster.
Tests
No new tests were added, as this is a refactor that does not change the business logic.