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

feat: add key block hash to activities #1098

Merged
merged 2 commits into from Jan 4, 2023
Merged

Conversation

sborrazas
Copy link
Contributor

No description provided.

@sborrazas sborrazas self-assigned this Dec 23, 2022
Comment on lines 177 to 181
Enum.map_reduce(activities_locators_data, {nil, nil}, fn
{{height, _txi, _local_idx}, _data} = locator, {height, enc_kb_hash} = kb_info ->
{{enc_kb_hash, locator}, kb_info}

{{height, _txi, _local_idx}, _data} = locator, _kb_info ->
Copy link
Member

Choose a reason for hiding this comment

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

If the accumulator won't be used it can be simplified with a Enum.map

Copy link
Member

Choose a reason for hiding this comment

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

Could you double check the intention here? kb_info is always a tuple of 2 elements and the locator has the same format for both clauses matching always with the first one.

Copy link
Member

Choose a reason for hiding this comment

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

solved by microblock inclusion


%{
height: height,
key_block_hash: key_block_hash,
Copy link
Member

Choose a reason for hiding this comment

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

Depending on the requirement for key block information, instead of key_block_hash, or additionally to it, could be the block_hash with the micro block like /txs, to indicate the exact its location.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a good idea, I'm going to implement it this way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@sborrazas sborrazas requested a review from jyeshe January 4, 2023 10:09
@sborrazas sborrazas merged commit f743612 into master Jan 4, 2023
@sborrazas sborrazas deleted the activities-kb-hash branch January 4, 2023 11:21
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.

None yet

3 participants