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

do not enforce non-empty outputs for unsigned tx #2255

Merged
merged 2 commits into from
Oct 19, 2020

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented Oct 19, 2020

Issue Number

#2200

Overview

  • c60c5a6
    📍 do not enforce non-empty outputs for unsigned tx
    Actually, there are many use-cases for empty outputs. This occurs in
    particular often when performing a selection for delegation: in this
    scenario, there are typically no outputs at all and, depending on the
    size of the selected input(s), there might be no change at all
    (because of the minUTxO value).

Comments

Should fix:

Thanks @piotr-iohk 🙏

@KtorZ KtorZ added the ADDING FEATURE Mark a PR as adding a new feature, for auto-generated CHANGELOG label Oct 19, 2020
@KtorZ KtorZ requested review from hasufell and piotr-iohk October 19, 2020 08:36
@KtorZ KtorZ self-assigned this Oct 19, 2020
@@ -970,7 +970,7 @@ data UnsignedTx input = UnsignedTx
{ unsignedInputs
:: NonEmpty input
, unsignedOutputs
:: NonEmpty TxOut
:: [TxOut]
Copy link
Contributor

@hasufell hasufell Oct 19, 2020

Choose a reason for hiding this comment

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

Should add a comment here why we don't want NonEmpty. Will bite someone later, maybe.

Copy link
Member Author

Choose a reason for hiding this comment

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

  Actually, there are many use-cases for empty outputs. This occurs in
  particular often when performing a selection for delegation: in this
  scenario, there are typically no outputs at all and, depending on the
  size of the selected input(s), there might be no change at all
  (because of the minUTxO value).
@KtorZ KtorZ force-pushed the KtorZ/2200/non-empty-outputs branch from c60c5a6 to 2bdbb29 Compare October 19, 2020 08:59
@KtorZ
Copy link
Member Author

KtorZ commented Oct 19, 2020

bors merge

iohk-bors bot added a commit that referenced this pull request Oct 19, 2020
2255: do not enforce non-empty outputs for unsigned tx r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#2200 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- c60c5a6
  📍 **do not enforce non-empty outputs for unsigned tx**
    Actually, there are many use-cases for empty outputs. This occurs in
  particular often when performing a selection for delegation: in this
  scenario, there are typically no outputs at all and, depending on the
  size of the selected input(s), there might be no change at all
  (because of the minUTxO value).


# Comments

<!-- Additional comments or screenshots to attach if any -->

Should fix: 

- #2213 (comment)
- #2213 (comment)

Thanks @piotr-iohk 🙏 


<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Assign the PR to a corresponding milestone
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: KtorZ <[email protected]>
Copy link
Contributor

@piotr-iohk piotr-iohk left a comment

Choose a reason for hiding this comment

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

🎉

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Oct 19, 2020

Build failed:


trace: Using index-state: 2020-10-02T22:25:53Z for haskell-language-server
waiting for locks or build slots...
building '/nix/store/cd3n0bwmg2g515f2h7w3lcrn1369f55g-dot-cabal-hackage.haskell.org-at-2020-10-03T000000Z.drv'...
Downloading the latest package list from
hackage.haskell.org-at-2020-10-03T000000Z
Verification loop. Errors in order:
  Invalid hash for <repo>/01-index.tar.gz
  Invalid hash for <repo>/01-index.tar.gz
  Invalid hash for <repo>/01-index.tar.gz
  Invalid hash for <repo>/01-index.tar.gz
  Invalid hash for <repo>/01-index.tar.gz

builder for '/nix/store/cd3n0bwmg2g515f2h7w3lcrn1369f55g-dot-cabal-hackage.haskell.org-at-2020-10-03T000000Z.drv' failed with exit code 1
cannot build derivation '/nix/store/p4qz6gfr3z9dn743m64lv6s4dmrr8qar-haskell-language-server-plan-to-nix-pkgs.drv': 1 dependencies couldn't be built
�[31;1merror:�[0m while evaluating the attribute 'buildInputs' of the derivation 'cardano-wallet-shell' at �[1m/nix/store/jz6cidj122c3gzvqf6paz4mkhxl0smgv-haskell.nix-src/builder/shell-for.nix�[0m:118:5:
while evaluating 'getOutput' at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/attrsets.nix�[0m:464:23, called from undefined position:
while evaluating anonymous function at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/pkgs/stdenv/generic/make-derivation.nix�[0m:142:17, called from undefined position:
while evaluating 'mkAttrOverridable' at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/customisation.nix�[0m:133:33, called from undefined position:
while evaluating 'makeOverridable' at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/customisation.nix�[0m:67:24, called from �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/customisation.nix�[0m:133:36:
while evaluating anonymous function at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/customisation.nix�[0m:133:53, called from �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/customisation.nix�[0m:69:16:
while evaluating the attribute 'haskell-language-server' at �[1m/var/lib/buildkite-agent/builds/packet-ipxe-2-ci2-4/input-output-hk/cardano-wallet/nix/hls.nix�[0m:30:62:
while evaluating 'cabalProject' at �[1m/nix/store/jz6cidj122c3gzvqf6paz4mkhxl0smgv-haskell.nix-src/overlays/haskell.nix�[0m:535:13, called from �[1m/var/lib/buildkite-agent/builds/packet-ipxe-2-ci2-4/input-output-hk/cardano-wallet/nix/hls.nix�[0m:4:13:
while evaluating the attribute 'hsPkgs' at �[1m/nix/store/jz6cidj122c3gzvqf6paz4mkhxl0smgv-haskell.nix-src/overlays/haskell.nix�[0m:505:15:
while evaluating the attribute 'hsPkgs' at �[1m/nix/store/jz6cidj122c3gzvqf6paz4mkhxl0smgv-haskell.nix-src/overlays/haskell.nix�[0m:487:43:
while evaluating the attribute 'config' at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:96:25:
while evaluating 'yieldConfig' at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:83:29, called from �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:82:16:
while evaluating 'mergeModules' at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:233:26, called from �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:73:17:
while evaluating 'mergeModules'' at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:237:36, called from �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:234:5:
while evaluating 'flip' at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/trivial.nix�[0m:138:16, called from �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:280:6:
while evaluating 'byName' at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:260:25, called from �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:268:21:
while evaluating 'reverseList' at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/lists.nix�[0m:393:17, called from �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:73:38:
while evaluating anonymous function at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:167:37, called from �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:68:19:
while evaluating 'filterModules' at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:157:36, called from �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:168:7:
while evaluating 'imap1' at �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/lists.nix�[0m:116:14, called from �[1m/nix/store/kf3adfr28xj77rmqbzy98qil86380zgv-nixpkgs-src/lib/modules.nix�[0m:142:73:
while evaluating anonymous function at �[1m/nix/store/jz6cidj122c3gzvqf6paz4mkhxl0smgv-haskell.nix-src/lib/import-and-filter-project.nix�[0m:5:1, called from �[1m/nix/store/jz6cidj122c3gzvqf6paz4mkhxl0smgv-haskell.nix-src/overlays/haskell.nix�[0m:474:31:
build of '/nix/store/p4qz6gfr3z9dn743m64lv6s4dmrr8qar-haskell-language-server-plan-to-nix-pkgs.drv' failed
~~~ Running global pre-exit hook
�[90m$�[0m /nix/store/i42glba5vjzdsyfgicji807k4blchykk-buildkite-agent-hooks/pre-exit

Same as: #2249 (comment)

@KtorZ
Copy link
Member Author

KtorZ commented Oct 19, 2020

What the heck o.O

@KtorZ
Copy link
Member Author

KtorZ commented Oct 19, 2020

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Oct 19, 2020

Build succeeded:

@iohk-bors iohk-bors bot merged commit 66df475 into master Oct 19, 2020
@iohk-bors iohk-bors bot deleted the KtorZ/2200/non-empty-outputs branch October 19, 2020 13:16
iohk-bors bot added a commit that referenced this pull request Oct 26, 2020
2268: Remove outdated comments about empty output lists in transactions. r=KtorZ a=jonathanknowles

# Issue Number

Cleanup after #2247, #2255, and other related PRs.

# Overview

This PR:

* removes a couple of outdated comments about disallowing empty lists of outputs in transactions. It's been established that having an empty list of outputs is perfectly reasonable in certain circumstances (such as a transaction that includes just a delegation certificate).
* updates the `Arbitrary ApiTransaction` instance to generate possibly-empty lists of outputs.

Co-authored-by: Jonathan Knowles <[email protected]>
iohk-bors bot added a commit that referenced this pull request Oct 26, 2020
2268: Remove outdated comments about empty output lists in transactions. r=KtorZ a=jonathanknowles

# Issue Number

Cleanup after #2247, #2255, and other related PRs.

# Overview

This PR:

* removes a couple of outdated comments about disallowing empty lists of outputs in transactions. It's been established that having an empty list of outputs is perfectly reasonable in certain circumstances (such as a transaction that includes just a delegation certificate).
* updates the `Arbitrary ApiTransaction` instance to generate possibly-empty lists of outputs.

Co-authored-by: Jonathan Knowles <[email protected]>
iohk-bors bot added a commit that referenced this pull request Oct 26, 2020
2268: Remove outdated comments about empty output lists in transactions. r=jonathanknowles a=jonathanknowles

# Issue Number

Cleanup after #2247, #2255, and other related PRs.

# Overview

This PR:

* removes a couple of outdated comments about disallowing empty lists of outputs in transactions. It's been established that having an empty list of outputs is perfectly reasonable in certain circumstances (such as a transaction that includes just a delegation certificate).
* updates the `Arbitrary ApiTransaction` instance to generate possibly-empty lists of outputs.

Co-authored-by: Jonathan Knowles <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADDING FEATURE Mark a PR as adding a new feature, for auto-generated CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants