335 Core: Add Merkle Tree generation to the /analyze endpoint payload#354
Open
Chigybillionz wants to merge 1 commit into
Open
335 Core: Add Merkle Tree generation to the /analyze endpoint payload#354Chigybillionz wants to merge 1 commit into
Chigybillionz wants to merge 1 commit into
Conversation
|
@Chigybillionz Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #335
Summary
This PR implements Merkle tree root generation for the
/analyzeendpoint, enabling clients to optionally request cryptographic commitments of the simulated ledger state. This feature provides a verifiable representation of the contract's state snapshot for advanced auditing and verification use cases.Root Cause
The
/analyzeendpoint was missing the capability to generate Merkle tree commitments from simulated ledger state. Additionally, the existingmerkle_tree.rsmodule had syntactical errors and incomplete implementation, preventing its use.Solution Implemented
1. Fixed merkle_tree.rs Implementation
MerkleTreestruct with a clean, production-ready design2. Extended AnalyzeRequest
include_merkle_tree: Option<bool>fieldfalsefor zero overhead on existing clients3. Enhanced ResourceReport Response
merkle_tree_root: Option<String>field4. Implemented Merkle Tree Generation Logic
/analyzeendpoint handler:state_snapshotKey Changes I Made
core/src/merkle_tree.rscore/src/main.rs- AnalyzeRequestinclude_merkle_treefieldcore/src/main.rs- ResourceReportmerkle_tree_rootfieldcore/src/main.rs- analyze()core/src/main.rs- to_report()Trade-offs and Considerations
state_snapshotto be available (optional field in simulation result). If unavailable, the feature gracefully returnsNoneBackward Compatibility
✅ Fully backward compatible:
false)Testing Steps
1. Test Basic Merkle Tree Generation