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

IF: Add deep-mind ACCEPTED_BLOCK_V2 #29

Merged
merged 6 commits into from
Apr 18, 2024
Merged

IF: Add deep-mind ACCEPTED_BLOCK_V2 #29

merged 6 commits into from
Apr 18, 2024

Conversation

heifner
Copy link
Member

@heifner heifner commented Apr 15, 2024

Add deep-mind ACCEPTED_BLOCK_V2 which will be exported for blocks after transition to Savanna.

ACCEPTED_BLOCK_V2

  • [block_num] [last-irreversible-block-num] [signed_block_packed_in_hex] [finality_data_packed_in_hex]
struct finality_data_t {
   uint32_t     major_version{light_header_protocol_version_major};
   uint32_t     minor_version{light_header_protocol_version_minor};
   uint32_t     active_finalizer_policy_generation{0};
   digest_type  action_mroot{};
   digest_type  base_digest{};
};

Changed DEEP_MIND_VERSION to spring 1 0.

Resolves #16

@heifner heifner requested a review from linh2931 April 15, 2024 14:34
@heifner heifner added the OCI Work exclusive to OCI team label Apr 15, 2024
@heifner heifner linked an issue Apr 15, 2024 that may be closed by this pull request
Copy link
Member

@linh2931 linh2931 left a 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.

@heifner
Copy link
Member Author

heifner commented Apr 15, 2024

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.

@linh2931
Copy link
Member

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.

@heifner
Copy link
Member Author

heifner commented Apr 15, 2024

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.

@heifner heifner requested a review from greg7mdp April 15, 2024 15:41
@linh2931
Copy link
Member

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.

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)>>) {
Copy link
Contributor

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.

Copy link
Member

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

@ericpassmore
Copy link
Contributor

Note:start
group: IF
category: INTERNALS
summary: Add deep-mind ACCEPTED_BLOCK_V2 which will be exported for blocks after transition to Savanna.
Note:end

@heifner heifner mentioned this pull request Apr 18, 2024
@heifner heifner requested review from linh2931 and greg7mdp April 18, 2024 18:56
@heifner heifner merged commit c3b5ed1 into savanna Apr 18, 2024
36 checks passed
@heifner heifner deleted the GH-16-deep-mind branch April 18, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deep-mind logging updates for 6.0 instant finality
5 participants