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

Fix the HTTP-bridge chain-producer #138

Closed
wants to merge 1 commit into from
Closed

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented Apr 1, 2019

Issue Number

Overview

  • I have fixed the http-bridge chain producer

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.

@KtorZ KtorZ self-assigned this Apr 1, 2019
@KtorZ KtorZ requested a review from rvl April 1, 2019 17:57
Copy link
Contributor

@rvl rvl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I apply this patch it does fix the listen function.

But wouldn't it have been easier to just use the slotting functions?
We could rip them out once we no longer need HttpBridge.

@KtorZ
Copy link
Member Author

KtorZ commented Apr 2, 2019

I am afraid that if we start using the slotting arithmetic, we get into thinking that we can. As long as we can avoid them, we remove a big burden from our business logic (not the slotting arithmetic so-to-speak, but the tracking of various protocol parameters related to this) :/

@KtorZ
Copy link
Member Author

KtorZ commented Apr 2, 2019

included in #137

@KtorZ KtorZ closed this Apr 2, 2019
@KtorZ KtorZ deleted the KtorZ/fix-chain-producer branch April 2, 2019 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants