- description: |
Forbid incorrect values in parsers of many Int-like options. Previously those values would overflow and be turned into a random valid value. If this breaks your use case, this means your use case wasn't doing what you expected.
# uncomment types applicable to the change:
type:
# - feature # introduces a new feature
# - breaking # the API has changed in a breaking way
# - compatible # the API has changed but is non-breaking
# - optimisation # measurable performance improvements
# - refactoring # QoL changes
- bugfix # fixes a defect
# - test # fixes/modifies tests
# - maintenance # not directly related to the code
# - release # related to a new release preparation
# - documentation # change in code docs, haddocks...
Context
We use auto a lot in parsing. auto relies under the hood on Read instances which are known to have problems. Some instances accept wrong values and return out of thin air values. This PR fixes this.
[X] Try this PR with cardano-testnet: tested cabal test cardano-testnet-test with cardano-node at e9ab511272a7694196778007211991a9984557e8 and cardano-cli at 44ca6edd1b3064ddf8f3bc155a8203188758cf14
Run git grep auto "*.hs" and observe that all the remaining calls are in a byron file (I didn't change those)
Checklist
[x] Commit sequence broadly makes sense and commits have useful messages
[x] New tests are added if needed and existing tests are updated. See Running tests for more details
Given your last comment, I assume you're fine with me deploying this to many more code locations? (please don't approve though yet, because I'll extend this PR).
Changelog
Context
We use auto a lot in parsing.
auto
relies under the hood on Read instances which are known to have problems. Some instances accept wrong values and return out of thin air values. This PR fixes this.Fixes https://github.com/IntersectMBO/cardano-cli/issues/860
How to trust this PR
cardano-testnet
: testedcabal test cardano-testnet-test
withcardano-node
at e9ab511272a7694196778007211991a9984557e8 andcardano-cli
at 44ca6edd1b3064ddf8f3bc155a8203188758cf14git grep auto "*.hs"
and observe that all the remaining calls are in abyron
file (I didn't change those)Checklist