fix(validate): check reference scripts as source for minting policies#686
Conversation
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
Caution Review failedThe pull request is closed. WalkthroughThe minting validation flow is refactored to aggregate script witnesses from native scripts, Plutus v1/v2/v3 scripts, and reference-input scripts into a single collection, replacing separate per-script witness vectors. The Changes
Sequence DiagramsequenceDiagram
participant TxValidator
participant CheckMinting
participant WitnessSet as Witness Set
participant RefInputs as UTxOs (Reference Inputs)
participant AllScriptsWits as all_scripts_wits<br/>(Aggregated)
TxValidator->>CheckMinting: check_minting(tx_body, mtx, utxos)
CheckMinting->>WitnessSet: Extract native script hashes
WitnessSet-->>CheckMinting: native_script_hashes
CheckMinting->>WitnessSet: Extract Plutus v1/v2/v3 script hashes
WitnessSet-->>CheckMinting: plutus_script_hashes
CheckMinting->>RefInputs: get_script_hash_from_reference_input()
RefInputs-->>CheckMinting: reference_input_script_hashes
CheckMinting->>AllScriptsWits: Aggregate all hashes
rect rgb(220, 240, 255)
Note over CheckMinting,AllScriptsWits: Unified validation
CheckMinting->>AllScriptsWits: For each minted policy:<br/>contains(all_scripts_wits)?
alt Policy found
AllScriptsWits-->>CheckMinting: ✓ Valid
else Policy missing
AllScriptsWits-->>CheckMinting: ✗ MintingLacksPolicy(policy_hash)
end
end
CheckMinting-->>TxValidator: Result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Rationale: Changes span three files with interconnected logic and signature updates. The refactoring introduces new parameter threading ( Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
Breaking Changes
check_mintingmethod signature to accept additional UTxO data parameter.New Features
Improvements