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

Fetch and store blocks between last grandpa and last beefy finalized #2202

Merged

Conversation

ErakhtinB
Copy link
Contributor

@ErakhtinB ErakhtinB commented Sep 2, 2024

Referenced issues

Closes #2193
Closes #1917

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 a review from turuslan September 2, 2024 03:47
@ErakhtinB ErakhtinB linked an issue Sep 2, 2024 that may be closed by this pull request
@ErakhtinB ErakhtinB force-pushed the 2193-feature-request-sync-missing-beefy-block-headers branch from c11e8ad to 64076a8 Compare September 2, 2024 04:33
@ErakhtinB ErakhtinB force-pushed the 2193-feature-request-sync-missing-beefy-block-headers branch from 7b05c57 to d854bed Compare September 3, 2024 11:38
@ErakhtinB ErakhtinB force-pushed the 2193-feature-request-sync-missing-beefy-block-headers branch from aa6237c to 8c729bb Compare September 10, 2024 06:11
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 docs and clang-format

@@ -161,6 +163,7 @@ namespace kagome::network {
primitives::events::ChainSub chain_sub_;

std::optional<primitives::BlockNumber> beefy_genesis_;
std::optional<primitives::BlockInfo> fetching_headers_;
Copy link
Contributor

Choose a reason for hiding this comment

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

not clear why field with plural name has optional type. Probably worth leaving a comment explaining the meaning

@@ -132,6 +134,7 @@ namespace kagome::network {
outcome::result<void> apply(
consensus::beefy::SignedCommitment justification, bool broadcast);
outcome::result<void> update();
void fetchHeaders();
Copy link
Contributor

Choose a reason for hiding this comment

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

Function does not seem to be trivial inside. Please leave a comment explaining what it is doing and how

@@ -153,6 +156,9 @@ namespace kagome::network {
bool fetchJustificationRange(primitives::BlockNumber min,
FetchJustificationRangeCb cb) override;

bool fetchHeadersBack(const primitives::BlockInfo& max, primitives::BlockNumber min, bool isFinalized,
Copy link
Contributor

Choose a reason for hiding this comment

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

document function

@ErakhtinB ErakhtinB force-pushed the 2193-feature-request-sync-missing-beefy-block-headers branch from fa931df to 2dfe877 Compare September 12, 2024 02:56
@ErakhtinB ErakhtinB merged commit e6d02f6 into master Sep 12, 2024
19 of 22 checks passed
@ErakhtinB ErakhtinB deleted the 2193-feature-request-sync-missing-beefy-block-headers branch September 12, 2024 06:27
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.

[Feature Request]: Sync missing beefy block headers BEEFY wait headers after Warp Sync
3 participants