IntersectMBO / cardano-ledger

The ledger implementation and specifications of the Cardano blockchain.
Apache License 2.0
256 stars 158 forks source link

Tx refscript size check #4453

Closed lehins closed 3 months ago

lehins commented 3 months ago

Description

This PR does two things:

Checklist

lehins commented 3 months ago

The only thing that I wonder about this is is: how come this check is in Ledger

I didn't really think too much which rule this check should go into, but since you bring it up, I believe LEDGER is a good home for it, because it doesn't check any individual reference script, but rather their total size. In other words MalformedReferenceScripts or OutputTooBigUTxO check validity of individual components of a transaction, while ConwayTxRefScritpsSizeTooBig is a check on a transaction level.

In general location of this type of checks is very subjective. I am not sure why, for example ConwayWdrlNotDelegatedToDRep and ConwayTreasuryValueMismatch are defined in LEDGER either :shrug: Probably has to do with parts of the state they need to access, rather than with anything else.