Fix the HTTP-bridge chain-producer #138
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Number
Overview
Comments
The
listen
function now entirely relies on the previous block hash to fetch next blocks (in order to avoid having to do any sort of slotting arithmetic). So in practice, we always wait for at least two blocks, consume all of them but the last one, and use the last one as a starting point. However, in the current implementation, we only get remaining blocks of an epoch from a starting point, so, if we hold and give the last block of an epoch, we never cross it to the next epoch.I've added a little change so that, we always try to fetch some arbitrary batch size (here 1k) and fetch the next epoch this way. This is probably not 100% ideal since we'll be fetching two epochs pretty much all the time but, probably good-enough for the http-bridge.