Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
4db536c
fix recovery (validators <= discovery_keys)
turuslan Aug 6, 2024
cc3c7b5
Merge remote-tracking branch 'origin/fix/recovery'
iceseer Aug 7, 2024
8e599f2
backing init fixup
iceseer Aug 8, 2024
d85691f
kusama fixup
iceseer Aug 8, 2024
f50664b
ref
iceseer Aug 19, 2024
09797a0
candidate storage
iceseer Aug 19, 2024
65cc445
candidate storage complete
iceseer Aug 19, 2024
385c8e8
candidate storage tests
iceseer Aug 22, 2024
e0dc892
fragment
iceseer Aug 27, 2024
0f0154f
constraints
iceseer Aug 27, 2024
8d63246
formatting
iceseer Aug 27, 2024
cdf198c
backed chain
iceseer Aug 28, 2024
479d52e
scope
iceseer Aug 29, 2024
e85a11b
fragment node
iceseer Aug 29, 2024
ffd4671
ref
iceseer Aug 29, 2024
05fe09e
fragment chain
iceseer Aug 30, 2024
7cef526
fragment chain
iceseer Sep 1, 2024
220b53b
fragment chain
iceseer Sep 4, 2024
f53e1f3
builded
iceseer Sep 4, 2024
6bf6efe
scope tests
iceseer Sep 4, 2024
365d7c6
fragment chain test
iceseer Sep 4, 2024
1dc5b03
fragment chain test
iceseer Sep 4, 2024
b7e04b9
fragment chain test
iceseer Sep 4, 2024
4e73833
tests
iceseer Sep 5, 2024
eac0d1f
tests
iceseer Sep 5, 2024
7d0314e
tests
iceseer Sep 5, 2024
9c7b335
tests
iceseer Sep 5, 2024
7fc4165
tests
iceseer Sep 5, 2024
c673f58
tests
iceseer Sep 5, 2024
c372629
tests
iceseer Sep 5, 2024
77ba15c
tests
iceseer Sep 5, 2024
acee5f7
fixup
iceseer Sep 5, 2024
377238a
tests
iceseer Sep 5, 2024
c74766a
tests
iceseer Sep 5, 2024
f83aab5
tests
iceseer Sep 5, 2024
9c1ea28
tests
iceseer Sep 5, 2024
57078fb
tests
iceseer Sep 5, 2024
99dbbe7
tests
iceseer Sep 5, 2024
87b41fa
tests
iceseer Sep 5, 2024
52ba114
tests
iceseer Sep 5, 2024
33ee5c9
tests
iceseer Sep 6, 2024
eaacb16
fixup
iceseer Sep 6, 2024
03528f7
tests complete
iceseer Sep 6, 2024
eee7796
ref
iceseer Sep 6, 2024
682551a
backing implicit view fixup
iceseer Sep 6, 2024
1953a2e
prospective parachains
iceseer Sep 6, 2024
aa0a161
formatting
iceseer Sep 6, 2024
7df31b2
backing implicit view reqork
iceseer Sep 9, 2024
8abeecb
prospective parachains
iceseer Sep 11, 2024
5f372af
formatting
iceseer Sep 11, 2024
518c60b
prospective parachains
iceseer Sep 11, 2024
7ff66fe
parachain core
iceseer Sep 12, 2024
d9e5ba0
building
iceseer Sep 12, 2024
66c98d8
builded
iceseer Sep 12, 2024
0d24db2
formatted
iceseer Sep 12, 2024
819041e
fragment chain errors
iceseer Sep 12, 2024
29a6413
fragment chain errors
iceseer Sep 12, 2024
e157875
remove fragment tree
iceseer Sep 12, 2024
ae28fc0
errors ref
iceseer Sep 12, 2024
9b732a6
remove redundant logs
iceseer Sep 13, 2024
6893269
Merge remote-tracking branch 'origin/master' into feature/fragment_chain
iceseer Sep 13, 2024
f8bb703
test logs
iceseer Sep 16, 2024
80e988c
print logs
iceseer Sep 18, 2024
7bb1cfb
PATCH FOR APPROVAL
iceseer Sep 20, 2024
237cdba
tests
iceseer Sep 23, 2024
f5d5dca
fixups
iceseer Sep 28, 2024
906ce50
Revert "PATCH FOR APPROVAL"
iceseer Sep 28, 2024
5b14c9f
Merge remote-tracking branch 'origin/master' into feature/fragment_chain
iceseer Sep 28, 2024
5fd40a4
Merge branch 'master' into feature/fragment_chain
iceseer Sep 30, 2024
7d42520
clang-tidy fixes
iceseer Oct 1, 2024
d8a3475
Merge remote-tracking branch 'origin/master' into feature/fragment_chain
iceseer Oct 2, 2024
4d331a2
fixup
iceseer Oct 3, 2024
8b8f297
Merge branch 'master' into feature/fragment_chain
iceseer Oct 6, 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
1 change: 1 addition & 0 deletions core/log/configurator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ namespace kagome::log {
- name: parachain
children:
- name: pvf_executor
- name: fragment_chain
- name: dispute
- name: runtime
children:
Expand Down
11 changes: 7 additions & 4 deletions core/network/peer_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "consensus/grandpa/common.hpp"
#include "network/types/collator_messages_vstaging.hpp"
#include "network/types/roles.hpp"
#include "outcome/outcome.hpp"
#include "parachain/validator/backing_implicit_view.hpp"
#include "primitives/common.hpp"
Expand Down Expand Up @@ -70,8 +71,11 @@ namespace kagome::network {
const View &new_view, const parachain::ImplicitView &local_implicit) {
std::unordered_set<common::Hash256> next_implicit;
for (const auto &x : new_view.heads_) {
auto t = local_implicit.knownAllowedRelayParentsUnder(x, std::nullopt);
next_implicit.insert(t.begin(), t.end());
auto t =
local_implicit.known_allowed_relay_parents_under(x, std::nullopt);
if (t) {
next_implicit.insert(t->begin(), t->end());
}
}

std::vector<common::Hash256> fresh_implicit;
Expand Down Expand Up @@ -156,8 +160,7 @@ namespace kagome::network {

template <>
struct std::hash<kagome::network::FetchedCollation> {
size_t operator()(
const kagome::network::FetchedCollation &value) const {
size_t operator()(const kagome::network::FetchedCollation &value) const {
using CollatorId = kagome::parachain::CollatorId;
using CandidateHash = kagome::parachain::CandidateHash;
using RelayHash = kagome::parachain::RelayHash;
Expand Down
4 changes: 3 additions & 1 deletion core/parachain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# SPDX-License-Identifier: Apache-2.0
#

add_subdirectory(validator/prospective_parachains)

add_library(grid_tracker
backing/grid_tracker.cpp
)
Expand Down Expand Up @@ -38,7 +40,6 @@ add_library(validator_parachain
approval/approval.cpp
backing/store_impl.cpp
backing/cluster.cpp
validator/impl/fragment_tree.cpp
validator/backing_implicit_view.cpp
)

Expand All @@ -52,6 +53,7 @@ target_link_libraries(validator_parachain
waitable_timer
kagome_pvf_worker
runtime_common
prospective_parachains
)

add_library(kagome_pvf_worker
Expand Down
24 changes: 15 additions & 9 deletions core/parachain/backing/grid_tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@
OUTCOME_CPP_DEFINE_CATEGORY(kagome::parachain::grid, GridTracker::Error, e) {
using E = kagome::parachain::grid::GridTracker::Error;
switch (e) {
case E::DISALLOWED:
return "Manifest disallowed";
case E::MALFORMED:
return "Malformed";
case E::DISALLOWED_GROUP_INDEX:
return "Manifest disallowed group index";
case E::DISALLOWED_DIRECTION:
return "Manifest disallowed direction";
case E::MALFORMED_BACKING_THRESHOLD:
return "Malformed backing threshold";
case E::MALFORMED_REMOTE_KNOWLEDGE_LEN:
return "Malformed remote knowledge len";
case E::MALFORMED_HAS_SECONDED:
return "Malformed has seconded";
case E::INSUFFICIENT:
return "Insufficient";
case E::CONFLICTING:
Expand Down Expand Up @@ -115,7 +121,7 @@ namespace kagome::parachain::grid {
ValidatorIndex sender) {
const auto claimed_group_index = manifest.claimed_group_index;
if (claimed_group_index >= session_topology.size()) {
return Error::DISALLOWED;
return Error::DISALLOWED_GROUP_INDEX;
}

const auto &group_topology = session_topology[manifest.claimed_group_index];
Expand All @@ -131,22 +137,22 @@ namespace kagome::parachain::grid {
&& it->second.has_sent_manifest_to(sender);
}
if (!manifest_allowed) {
return Error::DISALLOWED;
return Error::DISALLOWED_DIRECTION;
}

auto group_size_backing_threshold =
groups.get_size_and_backing_threshold(manifest.claimed_group_index);
if (!group_size_backing_threshold) {
return Error::MALFORMED;
return Error::MALFORMED_BACKING_THRESHOLD;
}

const auto [group_size, backing_threshold] = *group_size_backing_threshold;
auto remote_knowledge = manifest.statement_knowledge;
if (!remote_knowledge.has_len(group_size)) {
return Error::MALFORMED;
return Error::MALFORMED_REMOTE_KNOWLEDGE_LEN;
}
if (!remote_knowledge.has_seconded()) {
return Error::MALFORMED;
return Error::MALFORMED_HAS_SECONDED;
}

const auto votes = remote_knowledge.backing_validators();
Expand Down
7 changes: 5 additions & 2 deletions core/parachain/backing/grid_tracker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,11 @@ namespace kagome::parachain::grid {
/// relay-parent.
struct GridTracker {
enum class Error {
DISALLOWED = 1,
MALFORMED,
DISALLOWED_GROUP_INDEX = 1,
DISALLOWED_DIRECTION,
MALFORMED_BACKING_THRESHOLD,
MALFORMED_REMOTE_KNOWLEDGE_LEN,
MALFORMED_HAS_SECONDED,
INSUFFICIENT,
CONFLICTING,
SECONDING_OVERFLOW
Expand Down
15 changes: 10 additions & 5 deletions core/parachain/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ namespace kagome::network {
struct OutboundHorizontal {
SCALE_TIE(2);

parachain::ParachainId para_id; /// Parachain Id is recepient id
parachain::UpwardMessage
upward_msg; /// upward message for parallel parachain
/// The para that will get this message in its downward message queue.
parachain::ParachainId recipient;

/// The message payload.
common::Buffer data;
};

struct InboundDownwardMessage {
Expand Down Expand Up @@ -324,10 +326,11 @@ namespace kagome::parachain::fragment {
std::optional<std::pair<BlockNumber, ValidationCodeHash>>
future_validation_code;

outcome::result<Constraints> applyModifications(
outcome::result<Constraints> apply_modifications(
const ConstraintModifications &modifications) const;

bool checkModifications(const ConstraintModifications &modifications) const;
outcome::result<void> check_modifications(
const ConstraintModifications &modifications) const;
};

struct BackingState {
Expand Down Expand Up @@ -357,3 +360,5 @@ namespace kagome::parachain::fragment {
};

} // namespace kagome::parachain::fragment

OUTCOME_HPP_DECLARE_ERROR(kagome::parachain::fragment, Constraints::Error);
Loading