[Builtins] Make costing of 'equalsData' more accurate
This makes the user not pay for so the nodes that equalsData ends up not processing (when False is returned early, because two nodes don't match and there's no point in traversing the Data objects further).
The idea is simple: instead of computing the cost of equalsData d1 d2 as (pseudocode)
minCost (memoryUsage d1) (memoryUsage d2)
we compute it as
let common = minData d1 d2
in minCost (memoryUsage common) (memoryUsage common)
PR Preview Action v1.6.1 :---: |
:rocket: View preview athttps://IntersectMBO.github.io/plutus/pr-preview/pr-7138/
|
Built to branch gh-pages at 2025-06-11 03:26 UTC.
Preview will be ready when the GitHub Pages deployment is complete.
As demonstrated here, costing update here doesn't really benefit script evaluations in the node.
In short, this is because most validators when they use equalsData either use it on two data of same structure, like checking equality of TxOutRef. When they use equalsData on data of unknown structure, it's frequently comparing Redeemer or Datum which validators often expect equalsData to be true. So cases where new costing of equalsData actually being beneficial is very rare.