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

feat: Enhance ERC registry update with efficient merge and deduplication #1136

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

quiet-node
Copy link
Member

Description:
This PR introduces a mechanism to properly insert new, previously unrecognized ERC contract IDs into a sorted registry, ensuring that they are placed in the correct position based on their contract ID order. This change ensures that the registry remains correctly ordered, even when contracts missed by the tool are added manually.

Key Changes

  1. Enhanced mergeAndSort Method

    • The mergeAndSort function ensures that new contract entries, including previously unrecognized contracts, are inserted into the appropriate position in the registry while maintaining the ascending order of contract IDs.
    • Contracts are merged and duplicates are removed automatically.
  2. Improved updateRegistry Method

    • The method reads the existing sorted registry, merges it with newly identified contracts (including missed ERCs), and ensures the registry is correctly sorted by contract ID.
    • If new contracts are identified that should be inserted in a particular position, the method places them in the right place in the sequence, preserving the order.
  3. Handling Missed Contracts

    • New contracts (previously unrecognized or missed by the tool) are now handled seamlessly, ensuring that contract IDs are inserted in their correct position without disrupting the existing sequence.

Fixes #1130

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@quiet-node quiet-node added the enhancement New feature or request label Dec 24, 2024
@quiet-node quiet-node added this to the 0.12.0 milestone Dec 24, 2024
@quiet-node quiet-node self-assigned this Dec 24, 2024
@quiet-node quiet-node requested review from a team as code owners December 24, 2024 23:59
@quiet-node quiet-node changed the title feat: Enhance registry update with efficient merge and deduplication feat: Enhance ERC registry update with efficient merge and deduplication Dec 25, 2024
Copy link

github-actions bot commented Dec 25, 2024

Test Results

 16 files  ±0   83 suites  ±0   12m 26s ⏱️ +14s
294 tests ±0  288 ✅ +1  6 💤 ±0  0 ❌  - 1 
303 runs  ±0  296 ✅ +1  7 💤 ±0  0 ❌  - 1 

Results for commit 98ebe35. ± Comparison against base commit ae65209.

♻️ This comment has been updated with latest results.

@quiet-node quiet-node force-pushed the 1130-erc-registry-phase-3-implement-a-sorting-mechanism-to-sort-the-erc-records-to-allow-back-filling branch from f446964 to 98ebe35 Compare December 25, 2024 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ERC Registry] Phase 3: Implement a sorting mechanism to sort the ERC records to allow back filling
1 participant