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

Minor MAST module cleanup #1407

Merged
merged 4 commits into from
Jul 22, 2024
Merged

Minor MAST module cleanup #1407

merged 4 commits into from
Jul 22, 2024

Conversation

bobbinth
Copy link
Contributor

This PR contains some minor cleanup of MAST-related modules in the core create. The main changes are:

  1. Removed MerkleTreeNode trait as it doesn't seem like we use this abstraction anywhere.
  2. Added comments to all MAST nodes and also added section separators in various modules.
  3. Split out OpBatch-related code into a separate file.
  4. Removed Serializable and Deserializable implementations from MastNodeId and fixed a potential panic during deserialization of MastForest.

@bobbinth bobbinth added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Jul 21, 2024
@bobbinth bobbinth requested a review from plafer July 21, 2024 00:39
@bobbinth bobbinth changed the title Bobbin mast cleanup Minor MAST module cleanup Jul 21, 2024
Copy link
Contributor

@plafer plafer left a comment

Choose a reason for hiding this comment

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

LGTM - just one nit about docs

core/src/mast/node/call_node.rs Outdated Show resolved Hide resolved
@@ -128,6 +126,8 @@ impl Deserializable for MastForest {
}

for root in roots {
// make sure the root is valid in the context of the MAST forest
let root = MastNodeId::from_u32_safe(root, &mast_forest)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

good catch

@bobbinth bobbinth merged commit b10567b into next Jul 22, 2024
9 checks passed
@bobbinth bobbinth deleted the bobbin-mast-cleanup branch July 22, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog This PR does not require an entry in the `CHANGELOG.md` file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants