Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

hardcoded simple-priority queue as the only message queue#308

Merged
pompon0 merged 51 commits intomainfrom
gprusak-refactor3c
Sep 3, 2025
Merged

hardcoded simple-priority queue as the only message queue#308
pompon0 merged 51 commits intomainfrom
gprusak-refactor3c

Conversation

@pompon0
Copy link
Contributor

@pompon0 pompon0 commented Aug 27, 2025

There were multiple queue type options that you could select in the seid config.
It is known that the only simple-priority queue works reasonably and it should have been an implementation detail of the seid node anyway, so I've removed the other options removing the abstraction.
The additional benefit is that the unit tests are using the real thing instead of FIFO

Additionally:

  • fixed tests which were broken by the change from FIFO to simple-priority
  • refactored simple-queue so that send and recv always takes O(log n) (instead of O(n log n) when queue is full)
  • removed the simple-queue's background task, because unit tests were not prepared to handle that (and it would be a shit ton of work to make them handle it)
  • made simple-queue Send() explicitly non-blocking
  • adjusted router to the changes
  • limited the blast radius of "size * size" quirk by moving it from simple-queue to router (it would be hard to drop it entirely without semantic changes)
  • added metric for dropped messages
  • refactored listener code and connection management, so that connections don't get dropped for no reason
  • replaced net.IP with netip.Addr, for easier handling (for example, netip.Addr can be used as map key)
  • partially fixed race condition when 2 nodes try to connect to each other simultaneously (there are still conditions under which both will fail, but fixing that requires a more intrusive change)

@pompon0 pompon0 changed the base branch from main to gprusak-refactor2 August 27, 2025 08:01
@pompon0 pompon0 requested a review from udpatil September 2, 2025 14:23
@pompon0 pompon0 merged commit 72558f1 into main Sep 3, 2025
25 checks passed
@pompon0 pompon0 deleted the gprusak-refactor3c branch September 3, 2025 16:11
philipsu522 added a commit that referenced this pull request Oct 7, 2025
pompon0 added a commit that referenced this pull request Oct 16, 2025
#308 has accidentally
changed the semantics of ParseAddressString from resolving the tcp
address to parsing tcp address. As a side effect, support for DNS names
in the config has been removed.

This PR reverts to the original semantics to support DNS names again.
Also renamed the functions to better describe what they do.
pdrobnjak pushed a commit to sei-protocol/sei-chain that referenced this pull request Oct 17, 2025
sei-protocol/sei-tendermint#308 has accidentally
changed the semantics of ParseAddressString from resolving the tcp
address to parsing tcp address. As a side effect, support for DNS names
in the config has been removed.

This PR reverts to the original semantics to support DNS names again.
Also renamed the functions to better describe what they do.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants