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

Add utxoCostPerByte protocol parameter #4141

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger
tag: 0913292b13963ae4b60136eddb8d18b137f96a21
--sha256: 19rrnvvplvg8v989bcv6vpjwvblfa0m65izxkcp8dclf0a914qq3
tag: 65292694de72f137e6b90c5f361ae7646b48775f
--sha256: 05m1c7v8a2797675gkagpzl6bcjnj7w6lnx5x7hf90847ap88b05
subdir:
eras/alonzo/impl
eras/alonzo/test-suite
Expand Down
2 changes: 2 additions & 0 deletions cardano-api/gen/Gen/Cardano/Api/Typed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ genProtocolParameters =
<*> Gen.maybe genNat
<*> Gen.maybe genNat
<*> Gen.maybe genNat
<*> Gen.maybe genLovelace

genProtocolParametersUpdate :: Gen ProtocolParametersUpdate
genProtocolParametersUpdate = do
Expand Down Expand Up @@ -795,6 +796,7 @@ genProtocolParametersUpdate = do
protocolUpdateMaxValueSize <- Gen.maybe genNat
protocolUpdateCollateralPercent <- Gen.maybe genNat
protocolUpdateMaxCollateralInputs <- Gen.maybe genNat
protocolUpdateUTxOCostPerByte <- Gen.maybe genLovelace
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to generate both the protocolUpdateUTxOCostPerWord and the protocolUpdateUTxOCostPerByte in the same update?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now yeah

pure ProtocolParametersUpdate{..}


Expand Down
11 changes: 0 additions & 11 deletions cardano-api/src/Cardano/Api/Fees.hs
Original file line number Diff line number Diff line change
Expand Up @@ -793,10 +793,6 @@ data TxBodyErrorAutoBalance =
-- parameter, for eras that use this parameter.
| TxBodyErrorMissingParamMinUTxO

-- | The 'ProtocolParameters' must provide the value for the cost per
-- word parameter, for eras that use this parameter.
| TxBodyErrorMissingParamCostPerWord

-- | The transaction validity interval is too far into the future.
-- See 'TransactionValidityIntervalError' for details.
| TxBodyErrorValidityInterval TransactionValidityError
Expand Down Expand Up @@ -856,9 +852,6 @@ instance Error TxBodyErrorAutoBalance where
displayError TxBodyErrorMissingParamMinUTxO =
"The minUTxOValue protocol parameter is required but missing"

displayError TxBodyErrorMissingParamCostPerWord =
"The utxoCostPerWord protocol parameter is required but missing"

displayError (TxBodyErrorValidityInterval err) =
displayError err

Expand Down Expand Up @@ -1259,13 +1252,9 @@ calculateMinimumUTxO era txout@(TxOut _ v _ _) pparams' =

data MinimumUTxOError =
PParamsMinUTxOMissing
| PParamsUTxOCostPerWordMissing
deriving Show

instance Error MinimumUTxOError where
displayError PParamsMinUTxOMissing =
"\"minUtxoValue\" field not present in protocol parameters when \
\trying to calculate minimum UTxO value."
displayError PParamsUTxOCostPerWordMissing =
"\"utxoCostPerWord\" field not present in protocol parameters when \
\trying to calculate minimum UTxO value."
Loading