Skip to content

Conversation

@djwhitt
Copy link
Collaborator

@djwhitt djwhitt commented Jul 17, 2025

Summary

This PR implements partition-based verification filtering to reduce verification workload while ensuring network-wide coverage of all data.

Changes

Configuration

  • Add VERIFICATION_PARTITION_COUNT (default: 64) - number of partitions to divide ID space
  • Add VERIFICATION_PARTITION_THRESHOLD (default: 70) - priority threshold for partition filtering

Partition Assignment

  • Each node is assigned to 1 of 64 partitions at startup
  • Assignment based on:
    • AR_IO_WALLET address (if configured) - deterministic
    • Random bytes (if no wallet) - random distribution
  • Partition assignment is logged at startup

Verification Filtering

  • IDs with priority < 70 are filtered by partition
  • High-priority data (priority ≥ 70) bypasses filtering and is verified by all nodes
  • Filtering happens in the data verification worker after retrieving verifiable IDs
  • Skipped IDs have their retry count incremented to ensure eventual verification

Implementation Details

  • Created src/lib/verification-partition.ts with partition calculation functions
  • Updated data verification worker to apply partition filtering
  • No database changes required - filtering happens at application level

Benefits

  • Reduces verification workload by ~98.4% (63/64) for low-priority data
  • Ensures high-priority ArNS data is still verified by all nodes
  • Deterministic partitioning for nodes with wallets
  • Fair distribution through retry count increments

Testing

  • Verify partition assignment at startup
  • Confirm high-priority data bypasses filtering
  • Check retry count increments for skipped IDs
  • Test with different partition counts
  • Verify deterministic behavior with wallets

Related

🤖 Generated with Claude Code

- Add VERIFICATION_PARTITION_COUNT (default: 64) and VERIFICATION_PARTITION_THRESHOLD (default: 70) config
- Create verification-partition.ts with partition calculation functions
- Assign each node to a partition based on wallet address or random seed
- Filter verification workload by partition for low-priority data
- High-priority data (>= 70) bypasses partition filtering
- Skipped IDs increment retry count to ensure eventual verification
- Log partition assignment and verification statistics

This reduces verification workload by ~98.4% for low-priority data while
ensuring high-priority ArNS data is still verified by all nodes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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.

2 participants