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

Feature: authority manager checkpoints #1410

Merged
merged 47 commits into from
Nov 25, 2022
Merged

Conversation

xDimon
Copy link
Member

@xDimon xDimon commented Nov 14, 2022

Referenced issues

Resolves #1396

Description of the Change

All content of authority namespace was moved to consensus::grandpa.
Implemented formatter for outcome to use them directly: SL_DEBUG(log, "Error: {}", res.error()); (without .message()).
AuthorityManager switched to process digests over DigestTracker.
Implemented mechanism of checkpoints in AuthorityManager.
Fixed applying of postponed justification.
Fixed making on new grandpa round.
Removed outdated mechanism of recovery AuthorityManager state.
Fixed procession of commit message in grandpa.
Many improvements of logging with various parts of project.
Babe things moved to consensus::babe namespace.
Import was replaced by forward declarations (only in /core/consensus directory).

Benefits

Stable working.
Fast recovery.

Usage Examples or Tests

Adapted

refactor: authority namespace renamed to consensus::grandpa
refactor: authority code moved to grandpa

Signed-off-by: safinsaf <safinsaft@gmail.com>
Signed-off-by: safinsaf <safinsaft@gmail.com>
refactor: receive digest by auth manager over digest tracker

Signed-off-by: safinsaf <safinsaft@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
@xDimon xDimon force-pushed the feature/authmngr_checkpoints branch from b85aee6 to 2c7bd8b Compare November 15, 2022 05:42
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
@xDimon xDimon requested a review from Harrm November 15, 2022 09:01
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
@xDimon xDimon requested review from kamilsa, Harrm and turuslan November 25, 2022 06:16
core/primitives/block_data.hpp Outdated Show resolved Hide resolved
const auto &header = context.header.value().get();
block.emplace(header.number - 1, header.parent_hash);
} else {
block.emplace(context.block);
Copy link
Contributor

Choose a reason for hiding this comment

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

Under what circumstances does this occur?

Copy link
Member Author

Choose a reason for hiding this comment

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

When block is not in a tree, we should use parent block to check direct chain existing. In other case (block is already in tree) we can use block info of block for that (ex. while digests reapplying at start).

Copy link
Contributor

Choose a reason for hiding this comment

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

So when context.header has value that means the block is not in the tree?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it doesn't.

Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
@xDimon xDimon requested a review from Harrm November 25, 2022 11:37
core/primitives/block_data.hpp Show resolved Hide resolved
core/primitives/block_data.hpp Outdated Show resolved Hide resolved
const auto &header = context.header.value().get();
block.emplace(header.number - 1, header.parent_hash);
} else {
block.emplace(context.block);
Copy link
Contributor

Choose a reason for hiding this comment

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

So when context.header has value that means the block is not in the tree?

Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
@xDimon xDimon requested a review from Harrm November 25, 2022 12:11
@xDimon xDimon enabled auto-merge (squash) November 25, 2022 13:37
@xDimon xDimon merged commit 62e3d3f into master Nov 25, 2022
@xDimon xDimon deleted the feature/authmngr_checkpoints branch November 25, 2022 13:38
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.

Checkpoint for authority manager
5 participants