-
Notifications
You must be signed in to change notification settings - Fork 39
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: digest tracker #1370
Feature: digest tracker #1370
Conversation
fd7d08f
to
fde8929
Compare
Codecov Report
@@ Coverage Diff @@
## master #1370 +/- ##
==========================================
- Coverage 24.85% 24.43% -0.42%
==========================================
Files 629 633 +4
Lines 23794 24035 +241
Branches 12314 12470 +156
==========================================
- Hits 5915 5874 -41
- Misses 12603 12906 +303
+ Partials 5276 5255 -21
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
903134e
to
bec874a
Compare
a4e1a7b
to
8a7be9f
Compare
2ed3ee0
to
2e5a0f0
Compare
2e5a0f0
to
a5cd511
Compare
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
refactor: epoch descriptor storage moved to babe config repository refactor: babe util implementation moved to babe config repository 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>
…error Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
…not in fast-sync) 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: safinsaf <safinsaft@gmail.com>
c40ced6
to
a641045
Compare
|
||
prune(block_info); | ||
|
||
if (block_info.number % (kSavepointEachSuchBlock / 10) == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему в 10 раз чаще?
и тогда нужно поставить static_assert(kSavepointEachSuchBlock >= 10).
ходим с периодом kSavepointEachSuchBlock в цикле выше
// Save state on finalized part of blockchain | ||
if (need_to_save) { | ||
if (auto save_res = save(); save_res.has_error()) { | ||
SL_WARN(logger_, "Can't re-save state: {}", save_res.error()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мы должны продолжить работу если стейт не сохранился?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Насколько понимаю, мы будем продолжать пытаться сохранить стейт в этот чекпоинт пока находимся внутри этого периода, но как только перешагнем через границу kSavepointEachSuchBlock, будем сохранять уже следующий...насколько критичен пропуск если не удалось сделать сейвпоинт в пределах одного периода?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it not problem. It can be succeed next time. Anyway at the next start it can be recovered from last savepoint
BOOST_ASSERT(last_saved_state_block_ <= finalized_block.number); | ||
|
||
auto saving_state_node = getNode(finalized_block); | ||
BOOST_ASSERT_MSG(saving_state_node != nullptr, | ||
"Finalized block must have associated node"); | ||
const auto saving_state_block = saving_state_node->block; | ||
|
||
// Does not need to save | ||
if (last_saved_state_block_ >= saving_state_block.number) { | ||
return outcome::success(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мне кажется Ассерт и выражение под if противоречат друг другу. Если ситуация (last_saved_state_block_ > finalized_block.number) является нормальной и обрабатывается, то возможно ассерт лишний.
const auto last_savepoint = | ||
(last_saved_state_block_ / kSavepointEachSuchBlock) | ||
* kSavepointEachSuchBlock; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
округление до кратного периоду встречается несколько раз, возможно имеет смысл вынести в отдельный метод.
Referenced issues
Resolves #1363
Description of the Change
Observe digest and call special observer for each digest type
Move epoch descriptor mechanism to babe config repository
Move babe util implementation to babe config repository
Mode dispatch of finalisation event from block tree to babe
Benefits
Handling next epoch data
Conditional (by babe state) using runtime