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

Feature: systematic chunks recovery #2177

Merged
merged 39 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
dae7d6c
fix: clang-19 warns
xDimon Aug 5, 2024
316335a
format: remove semicolon
xDimon Aug 6, 2024
9d7229c
format: adjust by clang-format-16
xDimon Aug 6, 2024
8ceb1e9
refactor: warpsync to router
xDimon Aug 9, 2024
efbfd4d
refactor: keep discovered address longer
xDimon Aug 16, 2024
94c6a94
refactor: use only peer_id in protocols
xDimon Aug 16, 2024
0f035a7
refactor: separate RequestResponseProtocol to interface and implement…
xDimon Aug 9, 2024
e6e0963
refactor: separate some protocols' classes to interface and implement…
xDimon Aug 16, 2024
518d22f
feature: protocols' mocks
xDimon Aug 16, 2024
cb41745
feature: convenient router mock
xDimon Aug 16, 2024
62c37aa
update: erasure coding with systematic chunks reconstruction support
xDimon Aug 7, 2024
b9157cb
feature: systematic chunks recovery
xDimon Aug 1, 2024
0aec64e
retrieve core index
iceseer Aug 16, 2024
c2bb7da
feature: obtaining backing_group for recovery in disputes
xDimon Aug 16, 2024
f0f1829
feature: recovery test
xDimon Aug 9, 2024
3f2cd3c
fix: review issues
xDimon Aug 16, 2024
c272d60
fix: self-review issues
xDimon Aug 16, 2024
3980710
fix: self-review issues
xDimon Aug 16, 2024
168bbb1
fix: self-review issues
xDimon Aug 16, 2024
6e125b3
fix: CI issues
xDimon Aug 16, 2024
a0ebf9e
Fix recovery test
igor-egorov Aug 16, 2024
66b7d86
fix: clang-tidy issues
xDimon Aug 19, 2024
fcaf88a
fix: clang-tidy issues
xDimon Aug 19, 2024
04de4fd
fix: remove deprecated clang-tidy rule
xDimon Aug 19, 2024
3214e0c
fix: clang-tidy issues
xDimon Aug 19, 2024
9ad1219
feature: logs for recovery strategies
xDimon Aug 19, 2024
6a34cb2
feature: logs for recovery strategies
xDimon Aug 19, 2024
1dcc81d
hotfixe: clang-tidy
xDimon Aug 20, 2024
c6ca980
fix: clang-tidy issues
xDimon Aug 20, 2024
91a7e1e
update clang version in dockerfile
qdrvm-ci Aug 21, 2024
1b89aa3
ci - change container for clang tidy step
qdrvm-ci Aug 21, 2024
92c45e0
test new tidy workflow
qdrvm-ci Aug 21, 2024
7797060
llvm 19
qdrvm-ci Aug 21, 2024
458241d
Merge branch 'master' into feature/systematic_chunks_recovery
xDimon Aug 21, 2024
bcbe209
refactor: add some nolint suppression
xDimon Aug 21, 2024
d1fb9db
fix: clang-tidy issues
xDimon Aug 21, 2024
eb4c800
fix: clang-tidy issues
xDimon Aug 22, 2024
1295582
Merge branch 'master' into feature/systematic_chunks_recovery
xDimon Aug 22, 2024
ee502a3
ClangTidy - new build workflow updated
qdrvm-ci Aug 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/network/impl/peer_manager_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace {
std::shared_ptr<kagome::network::StreamEngine> &stream_engine,
const std::shared_ptr<P> &protocol,
const kagome::network::PeerManager::PeerInfo &peer_info,
F &&func) {
F &&func) { // NOLINT(cppcoreguidelines-missing-std-forward)
BOOST_ASSERT(stream_engine);
BOOST_ASSERT(protocol);

Expand Down
23 changes: 11 additions & 12 deletions core/network/impl/protocols/protocol_req_pov.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ namespace kagome::network {
const blockchain::GenesisBlockHash &genesis_hash,
std::shared_ptr<ReqPovObserver> observer)
: RequestResponseProtocolImpl<
RequestPov,
ResponsePov,
ScaleMessageReadWriter>{kReqPovProtocolName,
host,
make_protocols(kReqPovProtocol,
genesis_hash,
kProtocolPrefixPolkadot),
log::createLogger(kReqPovProtocolName,
"req_pov_protocol")},
RequestPov,
ResponsePov,
ScaleMessageReadWriter>{kReqPovProtocolName,
host,
make_protocols(kReqPovProtocol,
genesis_hash,
kProtocolPrefixPolkadot),
log::createLogger(kReqPovProtocolName,
"req_pov_protocol")},
observer_{std::move(observer)} {}

protected:
Expand Down Expand Up @@ -72,7 +72,7 @@ namespace kagome::network {
const blockchain::GenesisBlockHash &genesis_hash,
std::shared_ptr<ReqPovObserver> observer)
: impl_{std::make_shared<ReqPovProtocolImpl>(
host, chain_spec, genesis_hash, std::move(observer))} {}
host, chain_spec, genesis_hash, std::move(observer))} {}

const Protocol &ReqPovProtocol::protocolName() const {
BOOST_ASSERT(impl_ && !!"ReqPovProtocolImpl must be initialized!");
Expand All @@ -99,8 +99,7 @@ namespace kagome::network {
RequestPov request,
std::function<void(outcome::result<ResponsePov>)> &&response_handler) {
BOOST_ASSERT(impl_ && !!"ReqPovProtocolImpl must be initialized!");
return impl_->doRequest(
peer_id, std::move(request), std::move(response_handler));
return impl_->doRequest(peer_id, request, std::move(response_handler));
}

} // namespace kagome::network
5 changes: 3 additions & 2 deletions core/parachain/availability/recovery/recovery_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ namespace {

const std::array<std::string, 3> results = {"success", "failure", "invalid"};

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define incFullRecoveriesFinished(strategy, result) \
do { \
[&] { \
Copy link
Contributor

Choose a reason for hiding this comment

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

do { ... } while (false) was used for correct semicolon after statement.
https://gcc.gnu.org/onlinedocs/cpp/Swallowing-the-Semicolon.html

Copy link
Member Author

@xDimon xDimon Aug 22, 2024

Choose a reason for hiding this comment

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

Temporary-lambda call does the same, but pass clang-tidy rule cppcoreguidelines-avoid-do-while

BOOST_ASSERT_MSG( \
std::ranges::find(strategy_types, strategy) != strategy_types.end(), \
"Unknown strategy type"); \
BOOST_ASSERT_MSG(std::ranges::find(results, result) != results.end(), \
"Unknown result type"); \
full_recoveries_finished_.at(strategy).at(result)->inc(); \
} while (false)
}()

} // namespace

Expand Down
Loading