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

Parachains. PeerView implementation. #1397

Merged
merged 4 commits into from
Nov 18, 2022
Merged

Parachains. PeerView implementation. #1397

merged 4 commits into from
Nov 18, 2022

Conversation

iceseer
Copy link
Contributor

@iceseer iceseer commented Nov 8, 2022

Signed-off-by: iceseer iceseer@gmail.com

  1. Added PeerView implementation to track NewHeads and provide set of leaves.

Signed-off-by: iceseer <iceseer@gmail.com>

# Conflicts:
#	core/blockchain/impl/block_tree_impl.cpp
#	core/injector/application_injector.cpp
@iceseer iceseer changed the title Parachains. PeerView implementation. 1. Parachains. PeerView implementation. Nov 8, 2022
@iceseer iceseer changed the title 1. Parachains. PeerView implementation. Parachains. PeerView implementation. Nov 8, 2022
@codecov
Copy link

codecov bot commented Nov 8, 2022

Codecov Report

Merging #1397 (3802c5f) into master (90fb3cd) will decrease coverage by 0.03%.
The diff coverage is 9.09%.

@@            Coverage Diff             @@
##           master    #1397      +/-   ##
==========================================
- Coverage   24.47%   24.43%   -0.04%     
==========================================
  Files         638      641       +3     
  Lines       24085    24148      +63     
  Branches    12492    12520      +28     
==========================================
+ Hits         5895     5901       +6     
- Misses      12928    12981      +53     
- Partials     5262     5266       +4     
Impacted Files Coverage Δ
core/blockchain/impl/block_tree_impl.hpp 100.00% <ø> (ø)
core/common/visitor.hpp 58.33% <0.00%> (-19.45%) ⬇️
core/injector/application_injector.cpp 39.88% <ø> (ø)
core/network/types/collator_messages.hpp 0.00% <0.00%> (ø)
core/primitives/math.hpp 100.00% <ø> (ø)
core/network/impl/peer_view.cpp 3.63% <3.63%> (ø)
core/blockchain/impl/block_tree_impl.cpp 19.80% <50.00%> (+0.32%) ⬆️
core/network/impl/peer_manager_impl.cpp 3.26% <50.00%> (+0.21%) ⬆️
core/network/peer_view.hpp 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

core/injector/application_injector.cpp Outdated Show resolved Hide resolved
core/injector/application_injector.cpp Outdated Show resolved Hide resolved
core/network/peer_view.hpp Outdated Show resolved Hide resolved
core/blockchain/impl/block_tree_impl.hpp Show resolved Hide resolved
core/network/peer_view.hpp Show resolved Hide resolved
}
}

void PeerView::updateRemoteView(const PeerId &peer_id, network::View &&view) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it sort like updateMyView?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

По спеке сказано, что эти данные должны быть отсортированы уже. Полагаю, наличие/отсутствие сортировки влияет на понижение рейтинга. Т.е. либо они отсортированы и мы с ними работаем, либо скипаем.

self->updateMyView(
View{.heads_ = self->block_tree_->getLeaves(),
.finalized_number_ =
self->block_tree_->getLastFinalized().number});
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self->block_tree_->getLastFinalized().number});
self->block_tree_->getLastFinalized().number,
});

Copy link
Member

@xDimon xDimon Nov 16, 2022

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

clang-format

Copy link
Contributor Author

Choose a reason for hiding this comment

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

это что ?

@iceseer iceseer requested a review from xDimon November 15, 2022 07:05
core/blockchain/impl/block_tree_impl.cpp Show resolved Hide resolved
core/network/peer_view.hpp Outdated Show resolved Hide resolved
core/network/peer_view.hpp Outdated Show resolved Hide resolved
core/network/types/collator_messages.hpp Outdated Show resolved Hide resolved
self->updateMyView(
View{.heads_ = self->block_tree_->getLeaves(),
.finalized_number_ =
self->block_tree_->getLastFinalized().number});
Copy link
Member

@xDimon xDimon Nov 16, 2022

Choose a reason for hiding this comment

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

core/injector/application_injector.cpp Outdated Show resolved Hide resolved
@iceseer iceseer force-pushed the feature/peer_view_impl branch 2 times, most recently from a8b35b0 to c12b4bd Compare November 17, 2022 07:53
Signed-off-by: iceseer <iceseer@gmail.com>
@iceseer iceseer force-pushed the feature/peer_view_impl branch from c12b4bd to 3042256 Compare November 17, 2022 08:04
@iceseer iceseer merged commit 96ab3f7 into master Nov 18, 2022
@iceseer iceseer deleted the feature/peer_view_impl branch November 18, 2022 06:21
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.

3 participants