IntersectMBO / IntersectMBO/formal-ledger-specifications

`scriptsNeeded` check in Dijkstra

Open
#806 5 comments 0 reactions 0 assignees View on GitHub
documentation era: dijkstra nested transactions
Dominant language
Agda
Stars
52
Forks
20
Avg merge
6d 14h
Merged PRs (30d)
7

Description

I'll leave this here for documentation purposes: We don't want to do an equivalent of `scriptsNeeded` on subtransactions because it restricts potential optimization use cases. E.g. if we have lots of subtransactions that need the same script, it's better to only include it at the top-level. This would be prevented by checking `scriptsNeeded` on subtransactions.

As a consequence, checking `allowedLanguages` at the subtransaction level is a lot more difficult, since we'd have to provide the missing scripts as context. We can't allow older Plutus scripts in subtransactions anyway (since they might rely on transaction balancing as part of their design) so for now it doesn't matter where we check `allowedLanguages`: if a transaction uses subtransactions, no script can be V3 or earlier. However, in the future it may or may not be useful to restrict languages locally.

This also highlights a potentially important issue for script authors. When writing a V4 script, you can a-priori not rely on transaction balancing for things like optimizations. A script that wants to rely on transaction balancing must first check that it isn't run as part of a subtransaction.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.