-
Notifications
You must be signed in to change notification settings - Fork 40
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
Metrics of implicit, explicit and missed parachain votes #2385
Conversation
struct CleanupGuard { | ||
std::function<void()> cleanup; | ||
~CleanupGuard() { | ||
cleanup(); | ||
} | ||
} cleanup_guard{[this, &block_hash] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto guard = std::unique_ptr<void, std::function<void(void*)>>(
(void*)1,
[&](void*) {
state_by_relay_parent_to_check_.erase(block_hash);
}
);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
const auto availability_cores_res = | ||
parachain_host_->availability_cores(block_hash); | ||
if (not availability_cores_res) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it->availability_cores
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
5c57799
to
44d89fb
Compare
a1ab879
to
f4e0eee
Compare
f4e0eee
to
6ea2a13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add more comments
} | ||
our_current_state_.state_by_relay_parent.erase(it); | ||
} | ||
std::cout << fmt::format("---> PRUNED {}\n", removed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
if (not previous_last_finalized_block) { | ||
previous_last_finalized_block = last_finalized_block; | ||
if (last_finalized_block == 0) { | ||
return; | ||
} | ||
} else { | ||
current_block_number = previous_last_finalized_block.value() + 1; | ||
} | ||
for (auto i = current_block_number - 1; i < last_finalized_block; ++i) { | ||
const auto block_hash_res = block_tree_->getBlockHash(i); | ||
if (not block_hash_res) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if !previous_last_finalized_block && last_finalized_block != 0 -> current_block_number = 0
цикл начнется с (uint64_t)(-1), что сильно больше last_finalized_block, и блоки будут не учтены
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, initialized with 1
new int, [this, &block_hash](void *) { | ||
state_by_relay_parent_to_check_.erase(block_hash); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(void*)1, в текущем варианте тут утекает память
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately had to go back to scope guard in the end because of clang-tidy errors.
std::vector<uint8_t> buffer(extrinsic.data.begin() + 3, | ||
extrinsic.data.end()); | ||
auto decode_res = scale::decode<parachain::ParachainInherentData>(buffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vector -> span
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
e6f57d6
to
a9c47fb
Compare
Temporarily disabled auto merge until local checks passed |
Everything seems to work ok now, no need to hold the merge anymore |
Referenced issues
Description of the Change
Possible Drawbacks
Checklist Before Opening a PR
Before you open a Pull Request (PR), please make sure you've completed the following steps and confirm by answering 'Yes' to each item: