-
Notifications
You must be signed in to change notification settings - Fork 156
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
Introduce accurate min fee calculation function: calcMinFeeTx
#3976
Conversation
ecb8445
to
c296fd9
Compare
c296fd9
to
38e80f1
Compare
libs/cardano-ledger-api/test/Test/Cardano/Ledger/Api/Tx/Body.hs
Outdated
Show resolved
Hide resolved
eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/Imp/EpochSpec.hs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, tons of improvements packed in this PR 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall.
I have bit of mixed feelings about losing the ShelleyEraTxBody
superclass, since it makes the system of typeclasses less uniform. Sure, we can get rid of some ProtVerAtMost
constraints, but we also have to add an explicit ShelleyEraTxBody
constraint to some functions that didn't need it before. Then again it's nice to not have to implement ShelleyEraTxBody
with a bunch of dummy methods from Conway onwards.
It allows us to deprecate a lot of functionality in bulk. Starting with the next era that follows Conway we'll do the same thing for
We can replace one for another. That's all that has happend in this PR.
Yeah for all of the eras that will follow. I think it makes the deprecation process much cleaner when we can deprecate a class as a whole. |
Those functions can be useful in testing as well as for downstream users, therefore it makes sense to start a new module where we can collect functionality of this sorts.
…on 9. This is a nice cleanup that allows us removing `ShelleyEraTxBody` instance for `ConwayEra` onwards. This commit also fixes a bunch of overconstraint functions and removes some redundant constraints
This allows us to deprecate the horribly named and useless `txup` function. Also it simplifies the implementation a little bit by avoiding redundant conversion
Using `getAlonzoWitsVKeyNeeded` for Alonzo and Babbage is safe, because it will check `reqSignerHashes` twice, but it allows us to rely on `getWitsVKeyNeeded` to produce all of the required witnesses, aside from the ones that are used in native scripts. This also makes implementation match the spec. #3972 tracks the removal of `MissingRequiredSigners`
5320a8b
to
f491d56
Compare
* And `getShelleyGenesisKeyHashCountTxBody`
* Deprecate `txin` * Add `txIdTx` and `txIdTxBody` * Organize `submitTx` functions in ImpTest
We can now remove the duplicated check for `reqSignerHashes`, however we still need to keep around the predicate failure for NodeToClient comunication.
f491d56
to
8149bd6
Compare
Description
Addition of
calcMinFeeTx
function is a better alternative toestimateMinFeeTx
introduced in #3962In order to implement this function it was necessary to:
genesisKeyHashCount
, that counts up how many genesis key transaction will addgetWitsVKeyNeeded
to also includereqSignerHashes
as it was designed in the spec.This last change is important, because that is the only change in this PR that actually affects the rules. Currently for Babbage and Alonzo it introduces a redundant check. It is not a problem since checking presence of a few extra hashes from
reqSignerHashes
in a map of provided hashes is not expensive at all. However this complete functionality ofgetWitsVKeyNeeded
according to the spec and allows us to use it for fee calculation. Also when we enter Conway, we'l be able to get rid of the redundant check, see #3972Moreover, this new function
calcMinFeeTx
was utilized in the ImpTest in order to take care fixing up the fee during creation of test transactions. Fixes #3767Some extra cleanup was also added:
txid
in favor of better namedtxIdTxBody
andtxIdTx
txup
function and switching ofPPUP
rule signal fromMaybe Update
toStrinctMaybe Update
in order to reduce unnecessary conversionsProtVerAtMost era 8
as a superclass constraint toShelleyEraTxBody
effectively disabling the type class from Conway onwards. This resulted in a cleanup of redundant constraints and fixup of over-constrained functionsestimateMinFeeTx
functionality that was introduced in AddestimateMinFeeTx
#3962 was moved to a new moduleCardano.Ledger.Tools
in order to make it accessible to the test suiteChecklist
.cabal
andCHANGELOG.md
files according to theversioning process.
.cabal
files for all affected packages are updated. If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)CHANGELOG.md
for the affected packages. New section is never added with the code changes. (See RELEASING.md)fourmolu
(usescripts/fourmolize.sh
)scripts/cabal-format.sh
)hie.yaml
has been updated (usescripts/gen-hie.sh
)