Open mrBliss opened 4 years ago
There's a few aspects to this:
Predicate
clauses. This can be closely modelled on applySTSIndifferently
(https://github.com/input-output-hk/cardano-ledger-specs/blob/master/semantics/executable-spec/src/Control/State/Transition/Extended.hs#L185). Then this needs to be wired upwards (variant on applySTS
etc)transitionRules
in an STS. We need to make sure that these do run, so probably the correct solution will be to add an additional constructor for them in Clause
(https://github.com/input-output-hk/cardano-ledger-specs/blob/master/semantics/executable-spec/src/Control/State/Transition/Extended.hs#L115)applyTxs
, but call the new, non-validating interpreter.https://github.com/input-output-hk/cardano-ledger-specs/pull/1610 gives us part 1. Part 2 is easy to change, but at the moment we don't have any control flow predicates, so I've left it for the moment. Part 3 will come today
Actually, that's a lie. I hadn't read the comment about still needing to check for e.g. double spending - I thought this was reapplying a transaction to the very same ledger state.
We don't currently distinguish between "expensive" checks and others, so that would also be needed to do this.
Consensus has two ways to "apply a transaction":
applyTx
: apply a transaction to the ledger, validating the transaction and returning the updated ledger.reapplyTx
:It would be great if the Shelley ledger provided something we could use to implement
reapplyTx
.As this is an optimisation, this is not strictly need for the Shelley testnet, but it would be good to have for mainnet.