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

Document parachain processor #2029

Merged
merged 12 commits into from
May 2, 2024
Merged

Document parachain processor #2029

merged 12 commits into from
May 2, 2024

Conversation

kamilsa
Copy link
Contributor

@kamilsa kamilsa commented Apr 5, 2024

Referenced issues

Related to https://github.com/qdrvm/KAGOME-audit/issues/30

Description of the Change

Adds documentation for the parachain processor class

Possible Drawbacks

Mostly auto-generated and updated

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
  2. Code is documented: Have you added comments and documentation to your code according to the guidelines in the project's contributing guidelines? Yes
  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
  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. No

Comment on lines 122 to 123
// Call the `handshakeAndReadMessages` function with the `on_handshake`
// and `on_message` functions as arguments.
Copy link
Contributor

Choose a reason for hiding this comment

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

мне кажется это понятно из кода

Comment on lines 194 to 197
* @brief Handles the handshake with the peer.
*
* @param peer The peer to handshake with.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

возможно, что на приватные методы можно не добавлять описание

Comment on lines +158 to 161
/// The relay-parent of the candidate.
RelayHash relay_parent;
/// The hash of the candidate.
CandidateHash candidate_hash;
Copy link
Contributor

Choose a reason for hiding this comment

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

в полькадоте так добавляют комменты, но по сути это просто дублирование объявления

@@ -2244,13 +2292,18 @@ namespace kagome::parachain {
return {};
}

// If the relay parent state has a prospective parachains mode
Copy link
Contributor

Choose a reason for hiding this comment

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

дублирование того что написано в коде

Comment on lines +2298 to 2300

// Iterate over the availability cores of the relay parent state
for (size_t core_idx = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

дублирование того что написано в коде

Copy link
Contributor Author

Choose a reason for hiding this comment

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

но читать вроде немного проще чем сам код, если не мешает, то оставил бы

@@ -2292,6 +2345,7 @@ namespace kagome::parachain {
continue;
}

// If the attested candidate is found, add it to the backed vector
Copy link
Contributor

Choose a reason for hiding this comment

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

дублирование того что написано в коде

Copy link
Contributor Author

Choose a reason for hiding this comment

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

немного помогает при чтении кода

@@ -3363,6 +3418,7 @@ namespace kagome::parachain {
auto need_to_process =
our_current_state_.active_leaves.count(relay_parent) != 0ull;

// If not needed, skip the validation and return
Copy link
Contributor

Choose a reason for hiding this comment

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

дублирование того что написано в коде

Copy link
Contributor Author

Choose a reason for hiding this comment

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

тоже немного помогает, если не принципиально то оставил бы

Comment on lines 3433 to 3434

// Validate the candidate, if validation fails, log the error and return
Copy link
Contributor

Choose a reason for hiding this comment

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

дублирование того что написано в коде

kamilsa added 3 commits April 9, 2024 16:52
…arachains

# Conflicts:
#	core/parachain/validator/impl/parachain_processor.cpp
#	core/parachain/validator/parachain_processor.hpp
@kamilsa kamilsa marked this pull request as ready for review April 27, 2024 07:13
@kamilsa kamilsa requested a review from turuslan April 27, 2024 07:13
core/dispute_coordinator/dispute_coordinator.hpp Outdated Show resolved Hide resolved
core/network/impl/protocols/parachain_protocol.hpp Outdated Show resolved Hide resolved
core/network/types/collator_messages_vstaging.hpp Outdated Show resolved Hide resolved
kamilsa and others added 6 commits May 2, 2024 16:02
…arachains

# Conflicts:
#	core/network/peer_manager.hpp
#	core/parachain/validator/impl/parachain_processor.cpp
#	core/parachain/validator/parachain_processor.hpp
Co-authored-by: Ruslan Tushov <turuslan@users.noreply.github.com>
Co-authored-by: Ruslan Tushov <turuslan@users.noreply.github.com>
Co-authored-by: Ruslan Tushov <turuslan@users.noreply.github.com>
@kamilsa kamilsa merged commit 65163a5 into master May 2, 2024
11 of 12 checks passed
@kamilsa kamilsa deleted the docs/parachains branch May 2, 2024 18:25
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.

3 participants