Skip to content

Commit

Permalink
[research] logs for local_knowledge
Browse files Browse the repository at this point in the history
Signed-off-by: iceseer <iceseer@gmail.com>
  • Loading branch information
iceseer committed Nov 5, 2024
1 parent 4fc15fd commit f5fd043
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
22 changes: 20 additions & 2 deletions core/parachain/backing/grid_tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,30 @@ namespace kagome::parachain::grid {
manifest_allowed = sending_to && it != confirmed_backed.end()
&& it->second.has_sent_manifest_to(sender);
SL_TRACE(logger,
"Manifest acknowledgement allowed. (sending_to={}, "
"Manifest acknowledgement allowed. (sender={}, "
"candidate_hash={}, sending_to={}, "
"has_confirmed_back={}, has_sent_manifest_to={})",
sender,
candidate_hash,
sending_to ? "[yes]" : "[no]",
(it != confirmed_backed.end()) ? "[yes]" : "[no]",
(it != confirmed_backed.end()
&& it->second.has_sent_manifest_to(sender))
? "[yes]"
: "[no]");
if (it != confirmed_backed.end()) {
auto a = it->second.mutual_knowledge.find(sender);
SL_TRACE(
logger,
"Local knowledge. (has_mutual_knowledge={}, local_knowledge={})",
(a != it->second.mutual_knowledge.end()) ? "[yes]" : "[no]",
(a != it->second.mutual_knowledge.end()) && a->second.local_knowledge
? "[yes]"
: "[no]");
}
}
if (!manifest_allowed) {
//return Error::DISALLOWED_DIRECTION;
return Error::DISALLOWED_DIRECTION;
}

auto group_size_backing_threshold =
Expand Down Expand Up @@ -278,6 +291,11 @@ namespace kagome::parachain::grid {
const StatementFilter &local_knowledge) {
auto confirmed = confirmed_backed.find(candidate_hash);
if (confirmed != confirmed_backed.end()) {
SL_TRACE(logger,
"Manifest sent to. (validator_index={}, candidate_hash={}, "
"local_knowledge=[yes])",
validator_index,
candidate_hash);
confirmed->second.manifest_sent_to(validator_index, local_knowledge);
auto ps = confirmed->second.pending_statements(validator_index);
if (ps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,11 @@ namespace kagome::parachain::statement_distribution {
} break;
}

SL_TRACE(
logger,
"Mark message sent to for RP. (relay_parent={}, candidate_hash={})",
relay_parent,
candidate_hash);
local_validator.grid_tracker.manifest_sent_to(
relay_parent_state.per_session_state->value().groups,
v,
Expand Down

0 comments on commit f5fd043

Please sign in to comment.