Open uhbif19 opened 6 months ago
Also - don't use cryptography (if it's possible).
@euonymos
More info on options.
There is config to disable validation for any ledger rules. But to use it we need to go deeper than applyTx
.
As for feature of fee disabling discussed on last meeting: seems like there is at least two ways to do it, this one, and making fees zero.
Also there are some "events" some of which may cover some of our needs.
@euonymos Updated TODO list.
Also - don't use cryptography (if it's possible).
You mean in cabal? Or I do not understand.
No, we use an instance of Cardano.Ledger.Crypto.Crypto
, which is StandardCrypto
. By using mock hashes we can probably speed everything up a bit. Take a look here.
`
Disabling ledger predicates might be an issue. Adding any instrumentation to the ledger is not an option (and we don't want to maintain our fork). AFAIK there is no way to "turn off" any rules, we have to find ways to circumvent them in other ways, like using parameters.
I mean ValidateSuchThat ([Label] -> Bool)
constructor for ValidationPolicy
. It is passed inside applyTx
, so we can use any. It seems like exactly what we need, if works correctly.
There are two Label
s in this file so I am not sure which one :D Second is just string, so I assumed only rule as whole can be disabled.
ValidationPolicy
I mean
ValidateSuchThat ([Label] -> Bool)
constructor forValidationPolicy
. It is passed insideapplyTx
, so we can use any. It seems like exactly what we need, if works correctly.
Sorry, I see it's passed for applyBlock
and applyTMiick
, but not for applyTx
. (Cannot check the latest ledger's code though right now, using what I have locally).
@euonymos
Sure. That is why we need to inline it: https://github.com/mlabs-haskell/clb/pull/33/commits
My initial approach did not work, using ValidateSuchThat
did not seem to change behavior.
So I tried to parse L.ApplyTxError
to get kind of error and retry sendTx
in that case, but I failed to win its pattern matching, all its entries look like LS.UtxowFailure (LB.UtxoFailure (LB.AlonzoInBabbageUtxoPredFailure (LA.UtxosFailure (LS.ExpiredUTxO {}))))
(where LS
/LB
... are different versions of ledgers).
TODO:
protocolVersion
(some changes in Plutus (and ledger?) behavior is linked to it, for example this bug fix)