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

services/header: Refactor HeaderService to be responsible for broadcasting new ExtendedHeaders to the gossipsub network #327

Merged
merged 8 commits into from
Jan 10, 2022

Conversation

renaynay
Copy link
Member

@renaynay renaynay commented Jan 6, 2022

This PR contains the last component necessary for bridge nodes to be able to listen to core nodes for new block events and translate them to ExtendedHeaders.

A more comprehensive explanation can be found here.

Resolves second TODO in #251.
Resolves #214

@renaynay renaynay changed the title [ DRAFT ] Broadcaster services/header: Refactor HeaderService to be responsible for broadcasting new ExtendedHeaders to the gossipsub network Jan 6, 2022
@renaynay renaynay marked this pull request as ready for review January 6, 2022 12:06
Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

Change looks good

@Wondertan
Copy link
Member

Wondertan commented Jan 6, 2022

@renaynay, a tip: if you add changelogs to the top then there won't be any conflicts. Also, it makes the ordering nice where top changes are recent ones

renaynay and others added 5 commits January 7, 2022 17:44
remove todod
feat(service/header): make a helper to assemble ExtendedHeaders

refactor(service/header): make core exchange to rely on new helpers

refactor(service/header): make core listener to rely on new helpers

refactor(node/core): rework construction of core exchange

refactor(service): remove erasure as redudandant

chore: lint
liamsi
liamsi previously approved these changes Jan 7, 2022
Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

Looks good and straightforward.

* fix(core): wrap errors instead of logging them

* fix(service/header): fix lifecylces issues and make listener more minimal

* fix(service/header): core listener should stop if at least one error happens

* log(service/header): make annoying 'validation error' a warning
Wondertan
Wondertan previously approved these changes Jan 9, 2022
Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

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

Approving. My review was here(renaynay#4)

Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

Aaaand another one 💪🏼
Looks good!

@renaynay renaynay merged commit af0277b into celestiaorg:main Jan 10, 2022
@renaynay renaynay deleted the broadcaster branch January 10, 2022 11:39
Bidon15 pushed a commit to Bidon15/celestia-node that referenced this pull request Jan 11, 2022
…casting new `ExtendedHeader`s to the gossipsub network (celestiaorg#327)

* core listener

* set ctx and cancelfunc to nil after stopped service

* changelog

* changelog

remove todod

* feat(core): add GetBlockInfo to Fetcher (#3)

feat(service/header): make a helper to assemble ExtendedHeaders

refactor(service/header): make core exchange to rely on new helpers

refactor(service/header): make core listener to rely on new helpers

refactor(node/core): rework construction of core exchange

refactor(service): remove erasure as redudandant

chore: lint

* chore: lint

* Broadcaster code review + an alternative  (#4)

* fix(core): wrap errors instead of logging them

* fix(service/header): fix lifecylces issues and make listener more minimal

* fix(service/header): core listener should stop if at least one error happens

* log(service/header): make annoying 'validation error' a warning

* use commit height in GetBlockInfo

Co-authored-by: Hlib Kanunnikov <hlibwondertan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

service/header: change Broadcaster from interface to struct
4 participants