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

Buffer incoming live messages while catch up is active #241

Closed
cam-schultz opened this issue Mar 19, 2024 · 1 comment
Closed

Buffer incoming live messages while catch up is active #241

cam-schultz opened this issue Mar 19, 2024 · 1 comment
Labels
design idea Consider as a possible enhancement

Comments

@cam-schultz
Copy link
Collaborator

cam-schultz commented Mar 19, 2024

Context and scope
On startup, the relayer back-processes missed blocks since it last started up. It first opens a subscription to the source blockchain before back-processing in order to guarantee full block coverage. We currently write both live incoming messages as well as back-processed messages to the same processing queue. This implies that messages are not processed in order while back-processing is active. As a result, we currently have to be very careful about when we update the checkpoint in the database. Specifically, we must NOT write to the database if 1) we are actively back-processing and 2) the message is a live incoming message. This requires us to differentiate between live incoming messages and back-processed messages at the message level, which becomes unused metadata as soon as we are done catching up.

Discussion and alternatives
If instead we buffer live incoming messages until after the catch up mechanism is complete, then flush them to the main processing queue, we can guarantee ordering in the processing queue. When #31 is implemented, ordering will not be guaranteed after message processing is initiated, but being able to guarantee ordering ahead of message processing will

  1. make the overall application easier to reason about, and
  2. simplify Add periodic database write routine #234, which require some ordering guarantees

Note that ordering is guaranteed at the subscriber level, but providing those same guarantees in the main relayer processing loop would provide better logical separation among components, as both the subscriber and the database interfaces would interact only indirectly via the Relayer

@cam-schultz cam-schultz added the enhancement New feature or request label Mar 19, 2024
@cam-schultz cam-schultz added this to the Post-Durango fast follows milestone Mar 19, 2024
@cam-schultz cam-schultz added idea Consider as a possible enhancement design and removed enhancement New feature or request labels Mar 20, 2024
@cam-schultz
Copy link
Collaborator Author

Closing in favor of the Relax Ordering Requirement outlined in #234

@github-project-automation github-project-automation bot moved this from Backlog 🗄️ to Done ✅ in Platform Engineering Group Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design idea Consider as a possible enhancement
Projects
Archived in project
Development

No branches or pull requests

1 participant