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

[BUG] - valid values for Tx validity range are not checked by build/build-raw #4863

Closed
mkoura opened this issue Feb 3, 2023 · 1 comment · Fixed by #4919
Closed

[BUG] - valid values for Tx validity range are not checked by build/build-raw #4863

mkoura opened this issue Feb 3, 2023 · 1 comment · Fixed by #4919
Labels
CLI comp: cardano-cli type: bug Something is not working user type: internal Created by an IOG employee

Comments

@mkoura
Copy link
Contributor

mkoura commented Feb 3, 2023

Internal

Area
Other Any other topic (Delegation, Ranking, ...).

Summary
Valid values for --invalid-before and --invalid-hereafter are apparently 0 - MAX_INT64. However values from outside of the valid range are accepted with no error by build/build-raw commands.

Also integer overflow happens when either negative values or values > MAX_UINT64 are provided.

Transaction submit for Tx with values > MAX_INT64 fails as expected.

E.g.

  • MAX_UINT64 + 5 becomes 5
  • -5 becomes MAX_UINT64 - 5

Steps to reproduce
Steps to reproduce the behavior:

  1. Build transaction with --invalid-before -5
  2. Try to submit the transaction
  3. See error
Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraBabbage
(ApplyTxError [UtxowFailure (UtxoFailure (AlonzoInBabbageUtxoPredFailure (OutsideValidityIntervalUTxO (ValidityInterval
{invalidBefore = SJust (SlotNo 18446744073709551611), invalidHereafter = SNothing}) (SlotNo 29267))))])

Expected behavior
Error message is printed out by the build/build-raw command when invalid values are used.

System info:

@mkoura mkoura added type: bug Something is not working CLI user type: internal Created by an IOG employee comp: cardano-cli labels Feb 3, 2023
mkoura added a commit to IntersectMBO/cardano-node-tests that referenced this issue Feb 3, 2023
iohk-bors bot added a commit that referenced this issue Mar 1, 2023
4797: Bump future from 0.18.2 to 0.18.3 in /doc/.sphinx r=newhoggy a=dependabot[bot]

Bumps [future](https://github.com/PythonCharmers/python-future) from 0.18.2 to 0.18.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/PythonCharmers/python-future/releases">future's releases</a>.</em></p>
<blockquote>
<h2>v0.18.3</h2>
<p>This is a minor bug-fix release containing a number of fixes:</p>
<ul>
<li>Backport fix for bpo-38804 (c91d70b)</li>
<li>Fix bug in fix_print.py fixer (dffc579)</li>
<li>Fix bug in fix_raise.py fixer (3401099)</li>
<li>Fix newint bool in py3 (fe645ba)</li>
<li>Fix bug in super() with metaclasses (6e27aac)</li>
<li>docs: fix simple typo, reqest -&gt; request (974eb1f)</li>
<li>Correct <strong>eq</strong> (c780bf5)</li>
<li>Pass if lint fails (2abe00d)</li>
<li>Update docker image and parcel out to constant variable.  Add comment to update version constant (45cf382)</li>
<li>fix order (f96a219)</li>
<li>Add flake8 to image (046ff18)</li>
<li>Make lint.sh executable (58cc984)</li>
<li>Add docker push to optimize CI (01e8440)</li>
<li>Build System (42b3025)</li>
<li>Add docs build status badge to README.md (3f40bd7)</li>
<li>Use same docs requirements in tox (18ecc5a)</li>
<li>Add docs/requirements.txt (5f9893f)</li>
<li>Add PY37_PLUS, PY38_PLUS, and PY39_PLUS (bee0247)</li>
<li>fix 2.6 test, better comment (ddedcb9)</li>
<li>fix 2.6 test (3f1ff7e)</li>
<li>remove nan test (4dbded1)</li>
<li>include list test values (e3f1a12)</li>
<li>fix other python2 test issues (c051026)</li>
<li>fix missing subTest (f006cad)</li>
<li>import from old imp library on older python versions (fc84fa8)</li>
<li>replace fstrings with format for python 3.4,3.5 (4a687ea)</li>
<li>minor style/spelling fixes (8302d8c)</li>
<li>improve cmp function, add unittest (0d95a40)</li>
<li>Pin typing==3.7.4.1 for Python 3.3 compatiblity (1a48f1b)</li>
<li>Fix various py26 unit test failures (9ca5a14)</li>
<li>Add initial contributing guide with docs build instruction (e55f915)</li>
<li>Add docs building to tox.ini (3ee9e7f)</li>
<li>Support NumPy's specialized int types in builtins.round (b4b54f0)</li>
<li>Added r&quot;&quot;&quot; to the docstring to avoid warnings in python3 (5f94572)</li>
<li>Add <strong>subclasscheck</strong> for past.types.basestring (c9bc0ff)</li>
<li>Correct example in README (681e78c)</li>
<li>Add simple documentation (6c6e3ae)</li>
<li>Add pre-commit hooks (a9c6a37)</li>
<li>Handling of <strong>next</strong> and next by future.utils.get_next was reversed (52b0ff9)</li>
<li>Add a test for our fix (461d77e)</li>
<li>Compare headers to correct definition of str (3eaa8fd)</li>
<li><a href="https://github-redirect.dependabot.com/PythonCharmers/python-future/issues/322">#322</a> Add support for negative ndigits in round; additionally, fixing a bug so that it handles passing in Decimal properly (a4911b9)</li>
<li>Add tkFileDialog to future.movers.tkinter (f6a6549)</li>
<li>Sort before comparing dicts in TestChainMap (6126997)</li>
<li>Fix typo (4dfa099)</li>
<li>Fix formatting in &quot;What's new&quot; (1663dfa)</li>
<li>Fix typo (4236061)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/PythonCharmers/python-future/commit/af1db970b0879b59e7aeb798c27a623144561cff"><code>af1db97</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/PythonCharmers/python-future/issues/613">#613</a> from PythonCharmers/lwan/0.18.3-release</li>
<li><a href="https://github.com/PythonCharmers/python-future/commit/079ee9b75441d36447cec9981fa1b0032862f64d"><code>079ee9b</code></a> Prepare for 0.18.3 release</li>
<li><a href="https://github.com/PythonCharmers/python-future/commit/02f7a8143d5b68f50a1cca44d8f5a58c1925a515"><code>02f7a81</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/PythonCharmers/python-future/issues/610">#610</a> from wshanks/wshanks-patch-1</li>
<li><a href="https://github.com/PythonCharmers/python-future/commit/c91d70b34ef0402aef3e9d04364ba98509dca76f"><code>c91d70b</code></a> Backport fix for bpo-38804</li>
<li><a href="https://github.com/PythonCharmers/python-future/commit/80523f383fbba1c6de0551e19d0277e73e69573c"><code>80523f3</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/PythonCharmers/python-future/issues/569">#569</a> from jmadler/master</li>
<li><a href="https://github.com/PythonCharmers/python-future/commit/5e5af71549c7a7fa0e28f881046e081e231e455d"><code>5e5af71</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/PythonCharmers/python-future/issues/582">#582</a> from r3m0t/patch-6</li>
<li><a href="https://github.com/PythonCharmers/python-future/commit/17e4bbd7c676a9a8efd20601e51675c95f74b330"><code>17e4bbd</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/PythonCharmers/python-future/issues/596">#596</a> from abjonnes/fix-print-trailing-comma</li>
<li><a href="https://github.com/PythonCharmers/python-future/commit/1b427ba70191927706282840835e31ae0733ee7e"><code>1b427ba</code></a> Merge branch 'xZise-official-count' into master</li>
<li><a href="https://github.com/PythonCharmers/python-future/commit/c8eb497336c76d300c6753b47c7f5de505660d7a"><code>c8eb497</code></a> Merge branch 'official-count' of <a href="https://github.com/xZise/python-future">https://github.com/xZise/python-future</a> into ...</li>
<li><a href="https://github.com/PythonCharmers/python-future/commit/dffc579dbb7c882fc01fa0c0dfa6b59acef7827d"><code>dffc579</code></a> Fix bug in fix_print.py fixer</li>
<li>Additional commits viewable in <a href="https://github.com/PythonCharmers/python-future/compare/v0.18.2...v0.18.3">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=future&package-manager=pip&previous-version=0.18.2&new-version=0.18.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` use these labels` will set the current labels as the default for future PRs for this repo and language
- ``@dependabot` use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- ``@dependabot` use these assignees` will set the current assignees as the default for future PRs for this repo and language
- ``@dependabot` use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/input-output-hk/cardano-node/network/alerts).

</details>

4918: Fix key non extended key for StakeExtendedVerificationKeyShelley_ed25519_bip32 envelope r=newhoggy a=newhoggy

* Fix key non extended key for `StakeExtendedVerificationKeyShelley_ed25519_bip32` envelope
* Add ability to generate golden files from test using `CREATE_GOLDEN_FILES=1`
* New `diffFileVsGoldenFile` function

Resolves #4914

4919: Check CLI argument bounds r=newhoggy a=newhoggy

The bounds of many CLI arguments are now checked.

```
$ cardano-cli transaction build \
  --alonzo-era \
  --testnet-magic 42 \
  --change-address 'addr_test1vztpl4gth92fpxh3zth7w6v7mm7wewt89edae2hq3rptu5qa7ahzt' \
  --tx-in 'dee44d80c8b9da8cf20d1fae78a79a03b70b8abf76bfda88fe3651efcb0ab0cd#0' \
  --tx-out 'addr_test1vztpl4gth92fpxh3zth7w6v7mm7wewt89edae2hq3rptu5qa7ahzt+1000000' \
  --out-file tx.body --invalid-before -1

option --invalid-before: SLOT must not be less than 0
...
```

Resolves #4863

4922: Deploy Haddock for merge to master only r=newhoggy a=newhoggy

To merge changes from this PR #3012

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: John Ky <[email protected]>
Co-authored-by: James Browning <[email protected]>
iohk-bors bot added a commit that referenced this issue Mar 2, 2023
4919: Check CLI argument bounds r=newhoggy a=newhoggy

The bounds of many CLI arguments are now checked.

```
$ cardano-cli transaction build \
  --alonzo-era \
  --testnet-magic 42 \
  --change-address 'addr_test1vztpl4gth92fpxh3zth7w6v7mm7wewt89edae2hq3rptu5qa7ahzt' \
  --tx-in 'dee44d80c8b9da8cf20d1fae78a79a03b70b8abf76bfda88fe3651efcb0ab0cd#0' \
  --tx-out 'addr_test1vztpl4gth92fpxh3zth7w6v7mm7wewt89edae2hq3rptu5qa7ahzt+1000000' \
  --out-file tx.body --invalid-before -1

option --invalid-before: SLOT must not be less than 0
...
```

Resolves #4863

Co-authored-by: John Ky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI comp: cardano-cli type: bug Something is not working user type: internal Created by an IOG employee
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
@mkoura and others