[PR #97] [MERGED] refactor(dns): unified record set for DNSRecordStore #466

Closed
opened 2026-04-25 02:00:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fosrl/olm/pull/97
Author: @LaurenceJJones
Created: 2/26/2026
Status: Merged
Merged: 3/7/2026
Merged by: @oschwartz10612

Base: devHead: refactor/dns-record-store-trie


📝 Commits (3)

  • 041a8f8 refactor(dns): trie + unified record set for DNSRecordStore
  • c8a53e0 refactor(dns): simplify DNSRecordStore from trie to map
  • 61e0f15 test(dns): add dns test cases for nodata

📊 Changes

4 files changed (+355 additions, -188 deletions)

View changed files

📝 dns/dns_proxy.go (+8 -6)
dns/dns_proxy_test.go (+178 -0)
📝 dns/dns_records.go (+127 -164)
📝 dns/dns_records_test.go (+42 -18)

📄 Description

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

fix: github.com/orgs/fosrl/discussions/2533

Logic in #96 wasnt the best we should really store records in a single map that means we dont store A/AAAA records in two maps, this will simplify the lookup logic and return an exists boolean.

  • Replace four maps (aRecords, aaaaRecords, aWildcards, aaaaWildcards) with a single exact map and wildcards map
  • Store one recordSet (A + AAAA) per domain/pattern instead of separate A and AAAA maps
  • Exact lookups O(1); PTR unchanged (map); API updated to return exists boolean

How to test?

WIP untested in production, go tests are passing.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fosrl/olm/pull/97 **Author:** [@LaurenceJJones](https://github.com/LaurenceJJones) **Created:** 2/26/2026 **Status:** ✅ Merged **Merged:** 3/7/2026 **Merged by:** [@oschwartz10612](https://github.com/oschwartz10612) **Base:** `dev` ← **Head:** `refactor/dns-record-store-trie` --- ### 📝 Commits (3) - [`041a8f8`](https://github.com/fosrl/olm/commit/041a8f8be18b586b271954682d1823ca5b4a50ed) refactor(dns): trie + unified record set for DNSRecordStore - [`c8a53e0`](https://github.com/fosrl/olm/commit/c8a53e0a9a23050873627243f10ef59cc3b4141d) refactor(dns): simplify DNSRecordStore from trie to map - [`61e0f15`](https://github.com/fosrl/olm/commit/61e0f158026c03688492789e394dfe8bcbc493e7) test(dns): add dns test cases for nodata ### 📊 Changes **4 files changed** (+355 additions, -188 deletions) <details> <summary>View changed files</summary> 📝 `dns/dns_proxy.go` (+8 -6) ➕ `dns/dns_proxy_test.go` (+178 -0) 📝 `dns/dns_records.go` (+127 -164) 📝 `dns/dns_records_test.go` (+42 -18) </details> ### 📄 Description ## Community Contribution License Agreement By creating this pull request, I grant the project maintainers an unlimited, perpetual license to use, modify, and redistribute these contributions under any terms they choose, including both the AGPLv3 and the Fossorial Commercial license terms. I represent that I have the right to grant this license for all contributed content. ## Description fix: [github.com/orgs/fosrl/discussions/2533](https://github.com/orgs/fosrl/discussions/2533) Logic in #96 wasnt the best we should really store records in a single map that means we dont store A/AAAA records in two maps, this will simplify the lookup logic and return an exists boolean. - Replace four maps (aRecords, aaaaRecords, aWildcards, aaaaWildcards) with a single exact map and wildcards map - Store one recordSet (A + AAAA) per domain/pattern instead of separate A and AAAA maps - Exact lookups O(1); PTR unchanged (map); API updated to return exists boolean ## How to test? WIP untested in production, go tests are passing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 02:00:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/olm#466