Skip to content

refactor(task-registry): replace sponsors Vec with per-address persis… - #15

Merged
cybermax4200 merged 1 commit into
ecotask-network:mainfrom
devOgazi:refactor/sponsor-set-storage-v2
Jul 13, 2026
Merged

refactor(task-registry): replace sponsors Vec with per-address persis…#15
cybermax4200 merged 1 commit into
ecotask-network:mainfrom
devOgazi:refactor/sponsor-set-storage-v2

Conversation

@devOgazi

Copy link
Copy Markdown
Contributor

Closes #4

…tent storage

Replace the O(n) linear-scan sponsor list (Vec<Address> under DataKey::Sponsors)
with a Set-style pattern using per-address boolean flags (DataKey::Sponsor(Address)).

- add_sponsor: set(Sponsor(addr), true) instead of Vec push + rewrite
- remove_sponsor: remove(Sponsor(addr)) instead of filter-clone entire Vec
- is_sponsor: has(Sponsor(addr)) instead of Vec::contains scan
- Switched from instance() to persistent() storage for sponsor durability
- Added **/test_snapshots/ to .gitignore to prevent merge conflicts
@cybermax4200
cybermax4200 merged commit dfd668f into ecotask-network:main Jul 13, 2026
2 checks passed
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.

task-registry: Sponsor list uses linear scan — replace with a Set-style storage pattern

2 participants