-
Notifications
You must be signed in to change notification settings - Fork 7
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
IF: Add deep-mind ACCEPTED_BLOCK_V2 #29
Conversation
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.
No need to save the deep mind log file for tests? You might add a test for this new version or create an issue for it.
Could add transition to the deep mind test. But I wonder if there is any point. That test is a pain to maintain and not sure it would add any benefit to add a much larger amount of logs to update when it changes. I can add it if we think it adds value. |
Agreed. No need to add transition to the test. Just a test of v2 in Savanna mode. |
Not sure what you mean by this. My point is that the only deep-mind test we have is difficult to maintain and provides little to any benefit in my opinion. I would hate to add another that also requires blindly updating anytime we touch something that changes the format of traces. |
I think the value of the existing deepmind test is not the format checking but to make sure basic deepmind logging is still working after some big changes in other parts of the code base. No need to add a new one if too much effort is required for creating and maintaining. |
libraries/chain/controller.cpp
Outdated
apply<void>(chain_head, [&](const auto& head) { | ||
if (auto* dm_logger = get_deep_mind_logger(false)) { | ||
auto fd = head_finality_data(); | ||
if constexpr (std::is_same_v<block_state_legacy_ptr, typename std::decay_t<decltype(head)>>) { |
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.
Why not have two lambdas instead of this if constexpr
? The if (auto* dm_logger = get_deep_mind_logger(false)) {
could be before the apply
call.
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.
You might be able to use a single "overloaded lambda" here? I settled on that being the most attractive pattern personally, for example,
https://github.com/AntelopeIO/leap/blob/0dd9c26896ec27850bafadbd65839bbd41455d35/libraries/chain/controller.cpp#L1068
Note:start |
Add deep-mind
ACCEPTED_BLOCK_V2
which will be exported for blocks after transition to Savanna.ACCEPTED_BLOCK_V2
Changed
DEEP_MIND_VERSION
tospring 1 0
.Resolves #16