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

store: HeightSub should be able to notify callers of *any* new height written to the Store #202

Open
renaynay opened this issue Jun 24, 2024 · 1 comment
Assignees
Labels

Comments

@renaynay
Copy link
Member

renaynay commented Jun 24, 2024

Currently, heightSub keeps track of height which essentially the highest height written to the Store. Since Store now allows non-adjacent Appends, that height field is rendered useless (at least in the case of heightSub) as it is not guaranteed that the highest header written to the store means that everything below is also written to the store.

Requested changes

  • remove height field from HeightSub as it is no longer valuable

  • store.GetByHeight should first do a .Has on the store to see if that height is already there, and then return the header if it exists in store -- and only if it does NOT yet exist, then subscribe to it via heightSub.

  • heightSub should be able to "see" the height of every successful Append that happens on the store -- store should instead "Publish" to heightSub and heightSub notifs all of the callers of that height that it is now available.

@renaynay
Copy link
Member Author

Maybe #197 contains valuable code for this implementation too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants