Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

[V2.0] HDF Update and TopicHash Introduction #273

Merged
merged 7 commits into from
Sep 20, 2022

Conversation

DyrellC
Copy link
Contributor

@DyrellC DyrellC commented Aug 5, 2022

Description of change

Addresses #260 and #256. Adds a MAC to the HDF for additional verification as well as adding the new TopicHash struct. CursorStore now maps branches by TopicHash instead of Topic, and HDF's now contain the Topic as TopicHash format instead of plaintext.

Type of change

  • Enhancement (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How the change has been tested

  • Previous examples continue to work
  • Tests all continue to pass
  • fmt/clippy

@DyrellC
Copy link
Contributor Author

DyrellC commented Aug 5, 2022

Originally the plan was to include #259 in this PR as well, but what I have found is that there is no reasonable automated scenario that a user that would need to read the Keyload would be able to sequence to and see that Keyload without having known the Topic of the branch first, thus defeating the purpose of carrying the Topic through the Keyload @arnauorriols

@DyrellC
Copy link
Contributor Author

DyrellC commented Aug 5, 2022

As a consequence of the above stated, it brings into question the need to store cursors by TopicHash at all, as the reason for that was to accomodate behavior brought forward by #259.

@DyrellC DyrellC force-pushed the v2.0/signature-in-hdf branch from d0d268b to 3b43db8 Compare August 23, 2022 00:05
Copy link
Contributor

@kwek20 kwek20 left a comment

Choose a reason for hiding this comment

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

Small change and then good to go!

self.state.topics.iter()
}

pub(crate) fn topic_by_hash(&self, hash: &TopicHash) -> Option<Topic> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the code, this didnt need to be cloned really. a reference is enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we use a reference we need to clone each time anyways to set the latest link for the branch each time a message is handled

@kwek20 kwek20 merged commit c8d2e30 into iotaledger:v2.0-dev Sep 20, 2022
@DyrellC DyrellC deleted the v2.0/signature-in-hdf branch March 13, 2023 23:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants