(Conditionally) Include resolved Datums & Scripts in responses. #139
Replies: 1 comment 1 reply
-
Hey, that's indeed something I've been discussing in the past with few people though so far but I have been missing a compelling use-case / argument for implement something like this.
Indeed, but why is that a problem? Those requests are almost instant. Plus, Kupo already streams responses down to client row-by-row so in principle, you can even start querying inner schemas while receiving the response. You do mention a "bottleneck" which suggests that this is somehow of a slow operation? (genuinely asking). It shouldn't be too complicated to add a conditional flag on queries to automatically include datums & scripts, at the cost of some extra processing time. |
Beta Was this translation helpful? Give feedback.
-
In plutus-ledger DecoratedTxOut is the main type to which all logic is tied. Accordingly, most of the requests to kupo in our application are to receive a single
DecoratedTxOut
or Map fromTxId
's toDecoratedTxOut
's.We (and many other users I suppose) use kupo as a lightweight alternative to plutus-chain-index. However, while plutus-chain-index can retrieve a map of any size with a single request, it may require up to three requests to get one
DecoratedTxOut
with kupo (to get match, to get datum from its hash, and, in case of ScriptDecoratedTxOut - to get validator from script address). And this situation gets even worse when requesting manyDecoratedTxOut
's - this easily can take several hundred requests. We managed to get rid of this bottleneck in some parts of our application, but in some places this cannot be done without rewriting a huge part of cardano librariesSo maybe it would be possible to add a new endpoint that will do all these requests to database at once.
Beta Was this translation helpful? Give feedback.
All reactions