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

Metrics of implicit, explicit and missed parachain votes #2385

Merged
merged 22 commits into from
Mar 27, 2025

Conversation

ErakhtinB
Copy link
Contributor

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:

  1. Code is formatted: Have you run your code through clang-format to ensure it adheres to the project's coding standards? [Yes|No]
  2. Code is documented: Have you added comments and documentation to your code according to the guidelines in the project's contributing guidelines? [Yes|No]
  3. Self-review: Have you reviewed your own code to ensure it is free of typos, syntax errors, logical errors, and unresolved TODOs or FIXME without linking to an issue? [Yes|No]
  4. Zombienet Tests: Have you ensured that the zombienet tests are passing? Zombienet is a network simulation and testing tool used in this project. It's important to ensure that these tests pass to maintain the stability and reliability of the project. [Yes|No]

@ErakhtinB ErakhtinB requested review from kamilsa and iceseer February 20, 2025 15:54
Comment on lines 3390 to 3395
struct CleanupGuard {
std::function<void()> cleanup;
~CleanupGuard() {
cleanup();
}
} cleanup_guard{[this, &block_hash] {
Copy link
Contributor

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);
            }
        );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 3433 to 3435
const auto availability_cores_res =
parachain_host_->availability_cores(block_hash);
if (not availability_cores_res) {
Copy link
Contributor

Choose a reason for hiding this comment

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

it->availability_cores

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@ErakhtinB ErakhtinB force-pushed the feature/missing_votes_metric branch from 5c57799 to 44d89fb Compare February 21, 2025 08:28
@ErakhtinB ErakhtinB requested a review from iceseer February 21, 2025 08:40
@kamilsa kamilsa force-pushed the feature/missing_votes_metric branch from a1ab879 to f4e0eee Compare March 21, 2025 11:32
@ErakhtinB ErakhtinB force-pushed the feature/missing_votes_metric branch from f4e0eee to 6ea2a13 Compare March 21, 2025 11:36
Copy link
Contributor

@kamilsa kamilsa left a 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);
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

Copy link
Contributor Author

@ErakhtinB ErakhtinB Mar 21, 2025

Choose a reason for hiding this comment

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

Removed

Comment on lines 3345 to 3355
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) {
Copy link
Contributor

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, и блоки будут не учтены

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, initialized with 1

Comment on lines 3402 to 3404
new int, [this, &block_hash](void *) {
state_by_relay_parent_to_check_.erase(block_hash);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

(void*)1, в текущем варианте тут утекает память

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor Author

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.

Comment on lines 3529 to 3531
std::vector<uint8_t> buffer(extrinsic.data.begin() + 3,
extrinsic.data.end());
auto decode_res = scale::decode<parachain::ParachainInherentData>(buffer);
Copy link
Contributor

Choose a reason for hiding this comment

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

vector -> span

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@ErakhtinB ErakhtinB force-pushed the feature/missing_votes_metric branch from e6f57d6 to a9c47fb Compare March 25, 2025 15:55
@ErakhtinB ErakhtinB enabled auto-merge (squash) March 26, 2025 11:16
@igor-egorov igor-egorov disabled auto-merge March 26, 2025 11:58
@igor-egorov
Copy link
Contributor

Temporarily disabled auto merge until local checks passed

@ErakhtinB ErakhtinB requested a review from iceseer March 26, 2025 12:26
@igor-egorov
Copy link
Contributor

Everything seems to work ok now, no need to hold the merge anymore

@ErakhtinB ErakhtinB enabled auto-merge (squash) March 26, 2025 12:52
@igor-egorov igor-egorov disabled auto-merge March 27, 2025 08:37
@ErakhtinB ErakhtinB enabled auto-merge (squash) March 27, 2025 16:31
@ErakhtinB ErakhtinB merged commit 0da887e into master Mar 27, 2025
13 checks passed
@ErakhtinB ErakhtinB deleted the feature/missing_votes_metric branch March 27, 2025 18:54
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.

4 participants