Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterize CLB configuration with validation options #24

Open
7 tasks
uhbif19 opened this issue Mar 24, 2024 · 10 comments
Open
7 tasks

Parameterize CLB configuration with validation options #24

uhbif19 opened this issue Mar 24, 2024 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@uhbif19
Copy link
Contributor

uhbif19 commented Mar 24, 2024

TODO:

  • Changing protocolVersion (some changes in Plutus (and ledger?) behavior is linked to it, for example this bug fix)
  • Zeroing fees and collateral (like Hydra ledger does)
  • Support disabling ledger Predicates Parameterize CLB configuration with validation options #24 (comment)
  • Not enforcing fee and transaction size bounds
  • Not validating scripts at all
  • Not validating specific script (idea: validate Tx, see if only ignored script failed, reapply with validating scripts disabled)
  • Add tests
@uhbif19 uhbif19 added the enhancement New feature or request label Mar 24, 2024
@euonymos
Copy link
Member

Also - don't use cryptography (if it's possible).

@uhbif19
Copy link
Contributor Author

uhbif19 commented Mar 28, 2024

@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.

@uhbif19 uhbif19 self-assigned this Mar 28, 2024
@uhbif19
Copy link
Contributor Author

uhbif19 commented Mar 28, 2024

@euonymos Updated TODO list.

Also - don't use cryptography (if it's possible).

You mean in cabal? Or I do not understand.

@euonymos
Copy link
Member

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.
`

@euonymos
Copy link
Member

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.

@euonymos
Copy link
Member

There is config to disable validation for any ledger rules.

Do you mean this?

@uhbif19
Copy link
Contributor Author

uhbif19 commented Mar 29, 2024

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 Labels 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.

@euonymos
Copy link
Member

euonymos commented Apr 3, 2024

ValidationPolicy

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.

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).

@uhbif19
Copy link
Contributor Author

uhbif19 commented Apr 14, 2024

@euonymos

Sure. That is why we need to inline it: https://github.com/mlabs-haskell/clb/pull/33/commits

@uhbif19
Copy link
Contributor Author

uhbif19 commented Jul 4, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants