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

Use (TxIn, Address) as a unique input identifier within coin selection modules. #3149

Merged
merged 7 commits into from
Feb 24, 2022

Conversation

jonathanknowles
Copy link
Contributor

@jonathanknowles jonathanknowles commented Feb 22, 2022

Issue Number

ADP-1417

Background

We eventually want to change the internal coin selection library so that it:

  • does not depend on the following wallet-specific types:
    • TxIn
    • TxOut
    • Address
    • UTxO
  • produces selections of the form:
    data Selection input = Selection
        { inputs     = [(input, TokenBundle)]
        , collateral = [(input, Coin       )]
        , ...
        }
    (where input is a type parameter that uniquely identifies a selected input)

However, the wallet currently expects to manipulate selections of the following form:

data Selection = Selection
    { inputs =     [(TxIn, TxOut)]
    , collateral = [(TxIn, TxOut)]
    , ...
    }

Since (for the time being) we wish to avoid making major changes to the wallet codebase, we need a way to translate a Selection produced by the internal algorithm to a wallet-friendly Selection.

One way to achieve this is to instantiate type input as (TxIn, Address), so that our internal selection type is instantiated to:

data Selection = Selection
    { inputs     = [((TxIn, Address), TokenBundle)]
    , collateral = [((TxIn, Address), Coin       )]
    , ...
    }

With this substitution, it's trivial to convert from internal Selection values to wallet-friendly Selection values, because the choice of concrete type for input has all the context necessary to reconstruct a (TxIn, TxOut) pair.

This PR

This PR doesn't introduce any new type parameters, but instead makes an evolutionary step towards the goal outlined above.

This PR:

  • Introduces a (temporary) type synonym InputId = (TxIn, Address).
  • Amends core coin selection modules to use InputId as the unique identifier for inputs.
  • Amends core coin selection modules so that they no longer depend on the TxOut and UTxO types.
  • Amends the readWalletUTxOIndex function to perform the translation from UTxO (equivalent to Map TxIn TxOut) to Map InputId TokenBundle.
  • Amends the wallet-facing Cardano.Wallet.CoinSelection module to perform the reverse translation from (InputId, TokenBundle) pairs to (TxIn, TxOut) pairs.

Future Work

A future PR will replace the InputId type synonym with a type parameter on the following types:

  • Selection
  • SelectionParams
  • UTxOIndex
  • UTxOSelection

Performance Considerations

It's important that the translations stated above do not add any performance overhead.

  • The translation from (TxIn, TxOut) to (InputId, TokenBundle) within readWalletUTxOIndex does need to traverse the UTxO, but it only does so a single time. It was already necessary to traverse the UTxO in order to construct the UTxOIndex. When estimating a fee, the function readWalletUTxOIndex is only evaluated a single time.
  • The translation from (InputId, TokenBundle) to (TxIn, TxOut) is only applied to the inputs that are eventually selected.

@jonathanknowles jonathanknowles force-pushed the jonathanknowles/coin-selection-compound-input-id branch 3 times, most recently from 51bdf6d to bac063e Compare February 22, 2022 10:40
@jonathanknowles jonathanknowles changed the title WIP Use (TxIn, Address) as a unique input identifier within coin selection. Feb 22, 2022
@jonathanknowles jonathanknowles self-assigned this Feb 22, 2022
@jonathanknowles jonathanknowles marked this pull request as ready for review February 22, 2022 10:43
@jonathanknowles jonathanknowles force-pushed the jonathanknowles/coin-selection-compound-input-id branch from bac063e to 59c9fbe Compare February 22, 2022 11:06
@jonathanknowles jonathanknowles changed the title Use (TxIn, Address) as a unique input identifier within coin selection. Use (TxIn, Address) as a unique input identifier within coin selection modules. Feb 23, 2022
Copy link
Member

@Anviking Anviking left a comment

Choose a reason for hiding this comment

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

Can't quite see the full picture and wondering if we might not want some output parameters anyway down the line, but also LGTM.

-- ^ Selected inputs.
, collateral
:: ![(TxIn, Coin)]
:: ![(InputId, Coin)]
-- ^ Selected collateral inputs.
, outputs
:: ![(Address, TokenBundle)]
Copy link
Member

Choose a reason for hiding this comment

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

There are some remaining TxOut and Address types... Are you sure we won't end up needing a output type-parameter anyway? Maybe this interplays with the choices in this PR

Copy link
Contributor Author

@jonathanknowles jonathanknowles Feb 23, 2022

Choose a reason for hiding this comment

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

There are some remaining TxOut and Address types... Are you sure we won't end up needing a output type-parameter anyway? Maybe this interplays with the choices in this PR

I do eventually plan to remove all of the TxOut and Address usages, I promise! I haven't got there yet, as I'm currently trying to do these changes one area at a time, partly in order to limit the size and complexity of each PR. But all of them will go away!

As for the outputs field: I suspect this is one area where we might need to use an output type parameter, simply because it's helpful to the caller to be able to link the outputs they supplied to the outputs they eventually get back in the final selection.

User-specified outputs can be changed by the algorithm (if they didn't specify any ada, then we allow ourselves to add the minimum ada quantity).

But perhaps there's a way to avoid even this, in future, if we take the responsibility for "preparing outputs" away from coin selection.

--
-- Otherwise, returns 'False'.
--
isMember :: IsUTxOSelection s => TxIn -> s -> Bool
isMember :: IsUTxOSelection s => InputId -> s -> Bool
Copy link
Member

Choose a reason for hiding this comment

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

What I found strange initially was: how would UTxOIndex.isMember and UTxOIndex.lookup be useful if the caller would have to provide the TxIn and the Address as a key? You can't lookup a output given its input anymore...

However, it seems UTxOIndex is never used like that anyway, so I guess it's fine 🤷‍♂️

Copy link
Contributor Author

@jonathanknowles jonathanknowles Feb 23, 2022

Choose a reason for hiding this comment

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

What I found strange initially was: how would UTxOIndex.isMember and UTxOIndex.lookup be useful if the caller would have to provide the TxIn and the Address as a key?

UTxOIndex.lookup and UTxO.isMember can be used in one of two different contexts:

  • When the caller is coin selection: coin selection doesn't care about the shape of keys used within the UTxOIndex. Coin selection views keys as opaque unique identifiers.
  • When the caller is the wallet: the wallet knows the mapping between TxIn and Address values, so it can easily create the (TxIn, Address) key required for lookup.

However, it seems UTxOIndex is never used like that anyway, so I guess it's fine :man_shrugging

Yes, exactly.

Currently UTxOIndex is currently only used by coin selection. (It was written specifically to make coin selection easier to implement.) So we have the luxury of being able to limit its operations to just those required by coin selection.

…ion.

ADP-1448

We eventually want to change the internal coin selection library so that it:
- does not depend on the following wallet-specific types:
    - `TxIn`
    - `TxOut`
    - `Address`
    - `UTxO`
- produces selections of the form:
    ```haskell
    data Selection input = Selection
        { inputs     = [(input, TokenBundle)]
        , collateral = [(input, Coin       )]
        , ...
        }
    ```
    (here `input` is a **_type parameter_** that **_uniquely_** identifies a
    selected input)

However, the **_wallet_** currently expects to manipulate selections of the
following form:

```haskell
data Selection = Selection
    { inputs =     [(TxIn, TxOut)]
    , collateral = [(TxIn, TxOut)]
    , ...
    }
```

Since (for the time being) we wish to avoid making major changes to the wallet
codebase, we need a way to translate a `Selection` produced by the internal
algorithm to a wallet-friendly `Selection`.

One way to achieve this is to instantiate type `input` as `(TxIn, Address)`, so
that our internal selection type is instantiated to:

```haskell
data Selection = Selection
    { inputs     = [((TxIn, Address), TokenBundle)]
    , collateral = [((TxIn, Address), Coin       )]
    , ...
    }
```

With this substitution, it's trivial to convert from internal `Selection`
values to wallet-friendly `Selection` values, because the choice of concrete
type for `input` has all the context necessary to reconstruct a `(TxIn, TxOut)`
pair.

This commit **_doesn't_** introduce any new type parameters, but instead makes
an evolutionary step **_towards_** the goal outlined above.

This commit:

  - Introduces a (temporary) type synonym `InputId = (TxIn, Address)`.

  - Amends core coin selection modules to use `InputId` as the unique
    identifier for inputs.

  - Amends core coin selection modules so that they no longer depend on
    the `TxOut` and `UTxO` types.

  - Amends the `readWalletUTxOIndex` function to perform the translation
    from `UTxO` (equivalent to `Map TxIn TxOut`) to `Map InputId TokenBundle`.

  - Amends the wallet-facing `Cardano.Wallet.CoinSelection` module to
    perform the reverse translation from `(InputId, TokenBundle)` pairs
    to `(TxIn, TxOut)` pairs.

A **future commit** will replace the `InputId` type synonym with an `input`
type parameter on the following types:

  - `Selection`
  - `SelectionParams`
  - `UTxOIndex`
  - `UTxOSelection`

It's important that the translations stated above do not add any performance
overhead.

  - The translation from `(TxIn, TxOut)` to `(InputId, TokenBundle)` within
    function `readWalletUTxOIndex` does need to traverse the UTxO, but it only
    does so a single time. When estimating a fee, this function is only
    evaluated a single time.

  - The translation from `(InputId, TokenBundle)` to `(TxIn, TxOut)` is only
    applied to the inputs that are eventually selected.
@jonathanknowles jonathanknowles force-pushed the jonathanknowles/coin-selection-compound-input-id branch from 59c9fbe to a269694 Compare February 23, 2022 23:06
We use the following convention for identifier names:

  - `u` represents a unique identifier for an individual UTxO (unspent
        transaction output).
  - `b` represents a `TokenBundle` value.
  - `i` represents an index of type `UTxOIndex`.
The former field name was confusing because it overloaded the term "UTxO"
(used elsewhere in the module to refer to a single UTxO) with the complete
set of UTxOs in the index.
These names better reflect the types involved.
…e-parameter-for-utxo-identifier-in-utxo-index

Generalize UTxO identifier type within `UTxOIndex`.
@jonathanknowles
Copy link
Contributor Author

bors r+

iohk-bors bot added a commit that referenced this pull request Feb 23, 2022
3149: Use `(TxIn, Address)` as a unique input identifier within coin selection modules. r=jonathanknowles a=jonathanknowles

## Issue Number

ADP-1417

## Background

We eventually want to change the internal coin selection library so that it:
- does not depend on the following wallet-specific types:
    - `TxIn`
    - `TxOut`
    - `Address`
    - `UTxO`
- produces selections of the form:
    ```haskell
    data Selection input = Selection
        { inputs     = [(input, TokenBundle)]
        , collateral = [(input, Coin       )]
        , ...
        }
    ```
    (where `input` is a **_type parameter_** that **_uniquely_** identifies a selected input)

However, the **_wallet_** currently expects to manipulate selections of the following form:
```haskell
data Selection = Selection
    { inputs =     [(TxIn, TxOut)]
    , collateral = [(TxIn, TxOut)]
    , ...
    }
```

Since (for the time being) we wish to avoid making major changes to the wallet codebase, we need a way to translate a `Selection` produced by the internal algorithm to a wallet-friendly `Selection`.

One way to achieve this is to instantiate type `input` as `(TxIn, Address)`, so that our internal selection type is instantiated to:
```haskell
data Selection = Selection
    { inputs     = [((TxIn, Address), TokenBundle)]
    , collateral = [((TxIn, Address), Coin       )]
    , ...
    }
```

With this substitution, it's trivial to convert from internal `Selection` values to wallet-friendly `Selection` values, because the choice of concrete type for `input` has all the context necessary to reconstruct a `(TxIn, TxOut)` pair.

## This PR

This PR **_doesn't_** introduce any new type parameters, but instead makes an evolutionary step **_towards_** the goal outlined above.

This PR:
  - [x] Introduces a (temporary) type synonym `InputId = (TxIn, Address)`.
  - [x] Amends core coin selection modules to use `InputId` as the unique identifier for inputs.
  - [x] Amends core coin selection modules so that they no longer depend on the `TxOut` and `UTxO` types.
  - [x] Amends the `readWalletUTxOIndex` function to perform the translation from `UTxO` (equivalent to `Map TxIn TxOut`) to `Map InputId TokenBundle`.
  - [x] Amends the wallet-facing `Cardano.Wallet.CoinSelection` module to perform the reverse translation from `(InputId, TokenBundle)` pairs to `(TxIn, TxOut)` pairs.

## Future Work

A **future PR** will replace the `InputId` type synonym with a type parameter on the following types:
  - `Selection`
  - `SelectionParams`
  - `UTxOIndex`
  - `UTxOSelection`

## Performance Considerations

It's important that the translations stated above do not add any performance overhead. 
- The translation from `(TxIn, TxOut)` to `(InputId, TokenBundle)` within `readWalletUTxOIndex` does need to traverse the UTxO, but it only does so a single time. It was already necessary to traverse the UTxO in order to construct the `UTxOIndex`. When estimating a fee, the function `readWalletUTxOIndex` is only evaluated a single time.
- The translation from `(InputId, TokenBundle)` to `(TxIn, TxOut)` is only applied to the inputs that are eventually selected.

Co-authored-by: Jonathan Knowles <jonathan.knowles@iohk.io>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 24, 2022

Build failed:

Test timed out here:

  Sign transaction
    signTransaction adds reward account witness when necessary (AnyCardanoEra ByronEra)
      +++ OK, passed 100 tests (100% feature not supported in ByronEra.).
    signTransaction adds reward account witness when necessary (AnyCardanoEra ShelleyEra) (29562ms)
      +++ OK, passed 100 tests.
    signTransaction adds reward account witness when necessary (AnyCardanoEra AllegraEra) (29663ms)
      +++ OK, passed 100 tests.
    signTransaction adds reward account witness when necessary (AnyCardanoEra MaryEra) (29746ms)
      +++ OK, passed 100 tests.
    signTransaction adds reward account witness when necessary (AnyCardanoEra AlonzoEra) (29702ms)
      +++ OK, passed 100 tests.
    signTransaction adds extra key witness when necessary (AnyCardanoEra ByronEra)
      +++ OK, passed 100 tests (100% feature not supported in ByronEra.).
    signTransaction adds extra key witness when necessary (AnyCardanoEra ShelleyEra)
      +++ OK, passed 100 tests (100% feature not supported in ShelleyEra.).
    signTransaction adds extra key witness when necessary (AnyCardanoEra AllegraEra)
      +++ OK, passed 100 tests (100% feature not supported in AllegraEra.).
    signTransaction adds extra key witness when necessary (AnyCardanoEra MaryEra)
      +++ OK, passed 100 tests (100% feature not supported in MaryEra.).
    signTransaction adds extra key witness when necessary (AnyCardanoEra AlonzoEra) (69849ms)
      +++ OK, passed 100 tests.
    signTransaction adds tx in witnesses when necessary (AnyCardanoEra ByronEra) (1ms)
      +++ OK, passed 100 tests.
    signTransaction adds tx in witnesses when necessary (AnyCardanoEra ShelleyEra) (95213ms)
      +++ OK, passed 100 tests.
    signTransaction adds tx in witnesses when necessary (AnyCardanoEra AllegraEra) (95491ms)
      +++ OK, passed 100 tests.

@jonathanknowles
Copy link
Contributor Author

bors r+

iohk-bors bot added a commit that referenced this pull request Feb 24, 2022
3149: Use `(TxIn, Address)` as a unique input identifier within coin selection modules. r=jonathanknowles a=jonathanknowles

## Issue Number

ADP-1417

## Background

We eventually want to change the internal coin selection library so that it:
- does not depend on the following wallet-specific types:
    - `TxIn`
    - `TxOut`
    - `Address`
    - `UTxO`
- produces selections of the form:
    ```haskell
    data Selection input = Selection
        { inputs     = [(input, TokenBundle)]
        , collateral = [(input, Coin       )]
        , ...
        }
    ```
    (where `input` is a **_type parameter_** that **_uniquely_** identifies a selected input)

However, the **_wallet_** currently expects to manipulate selections of the following form:
```haskell
data Selection = Selection
    { inputs =     [(TxIn, TxOut)]
    , collateral = [(TxIn, TxOut)]
    , ...
    }
```

Since (for the time being) we wish to avoid making major changes to the wallet codebase, we need a way to translate a `Selection` produced by the internal algorithm to a wallet-friendly `Selection`.

One way to achieve this is to instantiate type `input` as `(TxIn, Address)`, so that our internal selection type is instantiated to:
```haskell
data Selection = Selection
    { inputs     = [((TxIn, Address), TokenBundle)]
    , collateral = [((TxIn, Address), Coin       )]
    , ...
    }
```

With this substitution, it's trivial to convert from internal `Selection` values to wallet-friendly `Selection` values, because the choice of concrete type for `input` has all the context necessary to reconstruct a `(TxIn, TxOut)` pair.

## This PR

This PR **_doesn't_** introduce any new type parameters, but instead makes an evolutionary step **_towards_** the goal outlined above.

This PR:
  - [x] Introduces a (temporary) type synonym `InputId = (TxIn, Address)`.
  - [x] Amends core coin selection modules to use `InputId` as the unique identifier for inputs.
  - [x] Amends core coin selection modules so that they no longer depend on the `TxOut` and `UTxO` types.
  - [x] Amends the `readWalletUTxOIndex` function to perform the translation from `UTxO` (equivalent to `Map TxIn TxOut`) to `Map InputId TokenBundle`.
  - [x] Amends the wallet-facing `Cardano.Wallet.CoinSelection` module to perform the reverse translation from `(InputId, TokenBundle)` pairs to `(TxIn, TxOut)` pairs.

## Future Work

A **future PR** will replace the `InputId` type synonym with a type parameter on the following types:
  - `Selection`
  - `SelectionParams`
  - `UTxOIndex`
  - `UTxOSelection`

## Performance Considerations

It's important that the translations stated above do not add any performance overhead. 
- The translation from `(TxIn, TxOut)` to `(InputId, TokenBundle)` within `readWalletUTxOIndex` does need to traverse the UTxO, but it only does so a single time. It was already necessary to traverse the UTxO in order to construct the `UTxOIndex`. When estimating a fee, the function `readWalletUTxOIndex` is only evaluated a single time.
- The translation from `(InputId, TokenBundle)` to `(TxIn, TxOut)` is only applied to the inputs that are eventually selected.

Co-authored-by: Jonathan Knowles <jonathan.knowles@iohk.io>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 24, 2022

Build failed:

Another timeout:

  Sign transaction
    signTransaction adds reward account witness when necessary (AnyCardanoEra ByronEra)
      +++ OK, passed 100 tests (100% feature not supported in ByronEra.).
    signTransaction adds reward account witness when necessary (AnyCardanoEra ShelleyEra) (29438ms)
      +++ OK, passed 100 tests.
    signTransaction adds reward account witness when necessary (AnyCardanoEra AllegraEra) (29539ms)
      +++ OK, passed 100 tests.
    signTransaction adds reward account witness when necessary (AnyCardanoEra MaryEra) (29601ms)
      +++ OK, passed 100 tests.
    signTransaction adds reward account witness when necessary (AnyCardanoEra AlonzoEra) (29572ms)
      +++ OK, passed 100 tests.
    signTransaction adds extra key witness when necessary (AnyCardanoEra ByronEra)
      +++ OK, passed 100 tests (100% feature not supported in ByronEra.).
    signTransaction adds extra key witness when necessary (AnyCardanoEra ShelleyEra)
      +++ OK, passed 100 tests (100% feature not supported in ShelleyEra.).
    signTransaction adds extra key witness when necessary (AnyCardanoEra AllegraEra)
      +++ OK, passed 100 tests (100% feature not supported in AllegraEra.).
    signTransaction adds extra key witness when necessary (AnyCardanoEra MaryEra)
      +++ OK, passed 100 tests (100% feature not supported in MaryEra.).

I actually watched this test while it was running in CI. The output stops at the above point, as if something has got stuck, and then test infrastructure times out much later on.

@jonathanknowles
Copy link
Contributor Author

jonathanknowles commented Feb 24, 2022

Time comparison of test that times out (cardano-wallet:test:unit --match "Sign transaction"), when run locally on an ordinary Linux machine, between this branch and master.

This branch (486.4921 seconds)
Finished in 486.4921 seconds, used 487.6973 seconds of CPU time            
35 examples, 0 failures                                                                    
                                                                                           
Slow spec items:                                                                           
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:388:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds collateral witnesses when necessary (AnyCardan
oEra AlonzoEra)/ (58960ms)                                                                                                                                                            
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:386:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds tx in witnesses when necessary (AnyCardanoEra 
ShelleyEra)/ (58924ms)                                                                     
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:386:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds tx in witnesses when necessary (AnyCardanoEra 
AlonzoEra)/ (58743ms)                                                                                                                                                                 
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:386:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds tx in witnesses when necessary (AnyCardanoEra 
AllegraEra)/ (58700ms)                                                                                                                                                                
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:386:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds tx in witnesses when necessary (AnyCardanoEra 
MaryEra)/ (58681ms)                                                                        
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:384:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds extra key witness when necessary (AnyCardanoEr
a AlonzoEra)/ (52162ms)
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:382:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds reward account witness when necessary (AnyCard
anoEra MaryEra)/ (21584ms)
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:382:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds reward account witness when necessary (AnyCard
anoEra AllegraEra)/ (21583ms)
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:382:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds reward account witness when necessary (AnyCard
anoEra AlonzoEra)/ (21551ms)
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:382:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds reward account witness when necessary (AnyCard
anoEra ShelleyEra)/ (21418ms)

cardano-wallet> Test suite unit passed
Master branch (547.6825 seconds)
Finished in 547.6825 seconds, used 549.0480 seconds of CPU time
35 examples, 0 failures

Slow spec items:
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:388:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds collateral witnesses when necessary (AnyCardanoEra AlonzoEra)/ (71508ms)
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:386:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds tx in witnesses when necessary (AnyCardanoEra AlonzoEra)/ (71326ms)
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:386:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds tx in witnesses when necessary (AnyCardanoEra MaryEra)/ (71251ms)
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:386:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds tx in witnesses when necessary (AnyCardanoEra ShelleyEra)/ (71217ms)
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:386:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds tx in witnesses when necessary (AnyCardanoEra AllegraEra)/ (71201ms)
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:384:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds extra key witness when necessary (AnyCardanoEra AlonzoEra)/ (49614ms)
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:382:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds reward account witness when necessary (AnyCardanoEra AlonzoEra)/ (21273ms)
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:382:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds reward account witness when necessary (AnyCardanoEra MaryEra)/ (21253ms)
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:382:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds reward account witness when necessary (AnyCardanoEra AllegraEra)/ (21241ms)
  test/unit/Cardano/Wallet/Shelley/TransactionSpec.hs:382:29: /Cardano.Wallet.Shelley.Transaction/Sign transaction/signTransaction adds reward account witness when necessary (AnyCardanoEra ShelleyEra)/ (21151ms)

cardano-wallet> Test suite unit passed

I've run this several times both on this branch, and on master, on a local machine. The total run time is consistently between 480 seconds and 550 seconds, with no obvious slowdown introduced by this branch.

Successful runs of this branch on CI:

@jonathanknowles
Copy link
Contributor Author

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 24, 2022

Build succeeded:

@iohk-bors iohk-bors bot merged commit 9bd6cfe into master Feb 24, 2022
@iohk-bors iohk-bors bot deleted the jonathanknowles/coin-selection-compound-input-id branch February 24, 2022 08:31
WilliamKingNoel-Bot pushed a commit that referenced this pull request Feb 24, 2022
iohk-bors bot added a commit that referenced this pull request Feb 24, 2022
3155: Generalize UTxO identifier type within `UTxOSelection`. r=jonathanknowles a=jonathanknowles

## Issue Number

ADP-1450

## Background

Within coin selection modules, we are steadily replacing all uses of `TxIn`, `Address`, `TxOut` with type parameters, so that the coin selection library does not depend on these concrete wallet types.

## Summary

This PR replaces all uses of `InputId` (a temporary type synonym introduced in #3149) with a type parameter within module `UTxOSelection`.

We use the following convention for type parameters and identifier names:
- `u` represents a unique identifier for an individual UTxO (unspent transaction output).
- `s` represents a selection of type `UTxOSelection`.
- `b` represents a `TokenBundle` value.
- `i` represents an index of type `UTxOIndex`.


Co-authored-by: Jonathan Knowles <jonathan.knowles@iohk.io>
iohk-bors bot added a commit that referenced this pull request Feb 24, 2022
3155: Generalize UTxO identifier type within `UTxOSelection`. r=Anviking a=jonathanknowles

## Issue Number

ADP-1450

## Background

Within coin selection modules, we are steadily replacing all uses of `TxIn`, `Address`, `TxOut` with type parameters, so that the coin selection library does not depend on these concrete wallet types.

## Summary

This PR replaces all uses of `InputId` (a temporary type synonym introduced in #3149) with a type parameter within module `UTxOSelection`.

We use the following convention for type parameters and identifier names:
- `u` represents a unique identifier for an individual UTxO (unspent transaction output).
- `s` represents a selection of type `UTxOSelection`.
- `b` represents a `TokenBundle` value.
- `i` represents an index of type `UTxOIndex`.


Co-authored-by: Jonathan Knowles <jonathan.knowles@iohk.io>
iohk-bors bot added a commit that referenced this pull request Feb 24, 2022
3155: Generalize UTxO identifier type within `UTxOSelection`. r=jonathanknowles a=jonathanknowles

## Issue Number

ADP-1450

## Background

Within coin selection modules, we are steadily replacing all uses of `TxIn`, `Address`, `TxOut` with type parameters, so that the coin selection library does not depend on these concrete wallet types.

## Summary

This PR replaces all uses of `InputId` (a temporary type synonym introduced in #3149) with a type parameter within module `UTxOSelection`.

We use the following convention for type parameters and identifier names:
- `u` represents a unique identifier for an individual UTxO (unspent transaction output).
- `s` represents a selection of type `UTxOSelection`.
- `b` represents a `TokenBundle` value.
- `i` represents an index of type `UTxOIndex`.


Co-authored-by: Jonathan Knowles <jonathan.knowles@iohk.io>
iohk-bors bot added a commit that referenced this pull request Feb 25, 2022
3155: Generalize UTxO identifier type within `UTxOSelection`. r=jonathanknowles a=jonathanknowles

## Issue Number

ADP-1450

## Background

Within coin selection modules, we are steadily replacing all uses of `TxIn`, `Address`, `TxOut` with type parameters, so that the coin selection library does not depend on these concrete wallet types.

## Summary

This PR replaces all uses of `InputId` (a temporary type synonym introduced in #3149) with a type parameter within module `UTxOSelection`.

We use the following convention for type parameters and identifier names:
- `u` represents a unique identifier for an individual UTxO (unspent transaction output).
- `s` represents a selection of type `UTxOSelection`.
- `b` represents a `TokenBundle` value.
- `i` represents an index of type `UTxOIndex`.


Co-authored-by: Jonathan Knowles <jonathan.knowles@iohk.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants