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

simplify babe genesis slot #1700

Merged
merged 19 commits into from
Aug 15, 2023
Merged

simplify babe genesis slot #1700

merged 19 commits into from
Aug 15, 2023

Conversation

turuslan
Copy link
Contributor

@turuslan turuslan commented Jul 17, 2023

Referenced issues

Description of the Change

  • simplify babe genesis slot
  • simplify babe
  • store BabeApi_next_epoch result in BabeIndexedValue after warp sync (no babe digest after warp sync)

Benefits

  • Don't need block 1 and blocks before last finalized.

Possible Drawbacks

Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@turuslan turuslan requested review from Harrm and iceseer July 17, 2023 13:52
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>

# Conflicts:
#	core/blockchain/block_tree.hpp
#	core/consensus/babe/impl/babe_config_repository_impl.cpp
#	core/consensus/babe/impl/babe_config_repository_impl.hpp
#	core/consensus/babe/impl/babe_impl.cpp
#	core/network/impl/synchronizer_impl.cpp
#	core/storage/predefined_keys.hpp
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>

# Conflicts:
#	core/storage/trie_pruner/impl/recover_pruner_state.cpp
#	test/core/storage/trie_pruner/trie_pruner_test.cpp
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>

# Conflicts:
#	core/consensus/babe/babe_util.hpp
#	core/consensus/babe/impl/babe_config_repository_impl.cpp
#	core/consensus/babe/impl/babe_config_repository_impl.hpp
#	core/consensus/babe/impl/babe_impl.cpp
#	core/consensus/babe/impl/block_appender_base.cpp
#	test/core/consensus/babe/babe_test.cpp
#	test/core/consensus/babe/block_executor_test.cpp
#	test/mock/core/consensus/babe/babe_util_mock.hpp
@kamilsa kamilsa requested review from xDimon and removed request for iceseer August 4, 2023 09:15
Signed-off-by: turuslan <turuslan.devbox@gmail.com>

# Conflicts:
#	core/primitives/babe_configuration.hpp
#	core/runtime/runtime_api/impl/babe_api.cpp
#	core/runtime/runtime_api/impl/babe_api.hpp
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
outcome::result<EpochNumber> slotToEpoch(
const primitives::BlockInfo &parent_info,
BabeSlotNumber slot_number) const {
OUTCOME_TRY(epoch, slotToEpochDescriptor(parent_info, slot_number));
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe for consistency and in case we want to mock this method, it makes sense to move implementation to babe_config_repository_impl?

@kamilsa kamilsa requested review from igor-egorov and removed request for Harrm and xDimon August 11, 2023 05:15
Copy link
Contributor

@igor-egorov igor-egorov left a comment

Choose a reason for hiding this comment

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

LGTM

Igor Egorov and others added 4 commits August 14, 2023 12:11
Signed-off-by: turuslan <turuslan.devbox@gmail.com>

# Conflicts:
#	core/consensus/babe/impl/babe_impl.cpp
#	core/network/impl/synchronizer_impl.cpp
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@turuslan turuslan merged commit 8b0ab0f into master Aug 15, 2023
4 of 14 checks passed
@turuslan turuslan deleted the babe/genesis-slot branch August 15, 2023 15:04
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