Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2066: Bump cardano-addresses r=rvl a=Anviking

# Issue Number

Release.


# Overview

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

- [x] Bump cardano-addresses


# Comments

- I believe this purely affects CLI usage of the cardano-addresses binary that will get included in the wallet release

```
Bump includes:
- [Increase default mnemonic phrase length](IntersectMBO/cardano-addresses#53)
- [Allow to inspect reward accounts wrt #46](IntersectMBO/cardano-addresses#56)
- [Allow to generate stake addresses #58](IntersectMBO/cardano-addresses#58)
- [Make 'payment' subcommand generate testnet hrp, wrt #55](IntersectMBO/cardano-addresses#59)
```

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

<!-- 
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
-->


2071: Minor nix cleanups r=rvl a=rvl

### Issue Number

#2046 #2054

### Overview

- Minor cleanups of nix code for migration tests and latency benchmark.

### Comments

Tested with:
```
nix-build -A benchmarks.cardano-wallet.latency
nix-build nix/migration-tests.nix
```


2080: Also trace the times of stake distribution LSQ queries r=rvl a=Anviking

# Issue Number

#2005 / new issue

# Overview

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

- [x] Also measure and trace the times of the LSQ queries in the `stakeDistribution` function


# Comments

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

<!-- 
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
-->


2087: Transaction metadata in swagger API spec r=rvl a=rvl

### Issue Number

ADP-307 / #2073 / #2074 

### Overview

Updates the swagger spec for the new metadata field when:
- listing transactions (metadata field is always present but may be null)
- posting a transaction (metadata field is optional)
- estimating fee (as above)

### Comments

[Rendered spec](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/input-output-hk/cardano-wallet/rvl/2073/swagger/specifications/api/swagger.yaml)


Co-authored-by: Johannes Lund <johannes.lund@iohk.io>
Co-authored-by: IOHK <devops+stack-project@iohk.io>
Co-authored-by: Rodney Lorrimar <rodney.lorrimar@iohk.io>
Co-authored-by: KtorZ <matthias.benkort@gmail.com>
  • Loading branch information
5 people committed Aug 28, 2020
5 parents 7ddb43c + f6690c6 + 363aed8 + 9220846 + 2ffe45e commit 5eb1c6f
Show file tree
Hide file tree
Showing 13 changed files with 193 additions and 77 deletions.
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ let
inherit (haskellPackages.ouroboros-consensus-byron.components.exes) db-converter;
# adrestia tool belt
inherit (haskellPackages.bech32.components.exes) bech32;
inherit (haskellPackages.cardano-addresses.components.exes) cardano-address;
inherit (haskellPackages.cardano-addresses-cli.components.exes) cardano-address;
inherit (haskellPackages.cardano-transactions.components.exes) cardano-tx;

cardano-wallet-jormungandr = import ./nix/package-jormungandr.nix {
Expand Down
1 change: 1 addition & 0 deletions lib/cli/cardano-wallet-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ library
, base
, bytestring
, cardano-addresses
, cardano-addresses-cli
, cardano-wallet-core
, contra-tracer
, directory
Expand Down
2 changes: 1 addition & 1 deletion lib/cli/test/unit/Cardano/CLISpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ spec = do
, "Available options:"
, " -h,--help Show this help text"
, " --size INT Number of mnemonic words to generate."
, " Must be a multiple of 3. (default: 15)"
, " Must be a multiple of 3. (default: 24)"
]

["wallet", "--help"] `shouldShowUsage`
Expand Down
2 changes: 1 addition & 1 deletion lib/core-integration/src/Test/Integration/Framework/DSL.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,7 @@ pubKeyFromMnemonics mnemonics =
T.decodeUtf8 $ serializeXPub $ publicKey
$ deriveAccountPrivateKey mempty rootXPrv minBound
where
(Right seed) = mkSomeMnemonic @'[15] mnemonics
seed = either (error . show) id $ mkSomeMnemonic @'[15,24] mnemonics
rootXPrv = generateKeyFromSeed (seed, Nothing) mempty

--
Expand Down
6 changes: 3 additions & 3 deletions lib/shelley/src/Cardano/Wallet/Shelley/Network.hs
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,13 @@ withNetworkLayer tr np addrInfo versionData action = do

_stakeDistribution queue bh coin = do
let pt = toPoint getGenesisBlockHash bh
stakeMap <- handleQueryFailure
stakeMap <- handleQueryFailure $ timeQryAndLog "GetStakeDistribution" tr
(queue `send` CmdQueryLocalState pt (QueryIfCurrentShelley Shelley.GetStakeDistribution))
let toStake = Set.singleton $ Left $ toShelleyCoin coin
liftIO $ traceWith tr $ MsgWillQueryRewardsForStake coin
rewardsPerAccount <- handleQueryFailure
rewardsPerAccount <- handleQueryFailure $ timeQryAndLog "GetNonMyopicMemberRewards" tr
(queue `send` CmdQueryLocalState pt (QueryIfCurrentShelley (Shelley.GetNonMyopicMemberRewards toStake)))
pparams <- handleQueryFailure
pparams <- handleQueryFailure $ timeQryAndLog "GetCurrentPParams" tr
(queue `send` CmdQueryLocalState pt (QueryIfCurrentShelley Shelley.GetCurrentPParams))

let fromJustRewards = fromMaybe (error "stakeDistribution: requested rewards not included in response")
Expand Down
89 changes: 89 additions & 0 deletions nix/.stack.nix/cardano-addresses-cli.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 3 additions & 22 deletions nix/.stack.nix/cardano-addresses.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nix/.stack.nix/cardano-wallet-cli.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nix/.stack.nix/default.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 6 additions & 18 deletions nix/haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,9 @@ let
unit.build-tools = [ jmPkgs.jormungandr ];
};

# Add jormungandr to the PATH of the latency benchmark
packages.cardano-wallet-jormungandr.components.benchmarks.latency = wrapBench jmPkgs.jormungandr;
packages.cardano-wallet.components.benchmarks.latency =
lib.optionalAttrs (!stdenv.hostPlatform.isWindows) {
build-tools = [ pkgs.makeWrapper ];
postInstall = ''
wrapProgram $out/bin/* \
--run "cd $src" \
--prefix PATH : ${pkgs.cardano-node}/bin
wrapProgram $out/bin/* \
--run "cd $src" \
--prefix PATH : ${pkgs.cardano-cli}/bin
'';
};
# Add node backend to the PATH of the latency benchmarks
packages.cardano-wallet-jormungandr.components.benchmarks.latency = wrapBench [ jmPkgs.jormungandr ];
packages.cardano-wallet.components.benchmarks.latency = wrapBench [ pkgs.cardano-node pkgs.cardano-cli ];

# Add cardano-node to the PATH of the byroon restore benchmark.
# cardano-node will want to write logs to a subdirectory of the working directory.
Expand All @@ -148,7 +136,7 @@ let
# Add shell completions for tools.
packages.cardano-node.components.exes.cardano-cli.postInstall = optparseCompletionPostInstall + libSodiumPostInstall;
packages.cardano-node.components.exes.cardano-node.postInstall = optparseCompletionPostInstall + libSodiumPostInstall;
packages.cardano-addresses.components.exes.cardano-address.postInstall = optparseCompletionPostInstall;
packages.cardano-addresses-cli.components.exes.cardano-address.postInstall = optparseCompletionPostInstall;
packages.cardano-transactions.components.exes.cardano-tx.postInstall = optparseCompletionPostInstall;
packages.bech32.components.exes.bech32.postInstall = optparseCompletionPostInstall;
}
Expand Down Expand Up @@ -270,13 +258,13 @@ let
# Add component options to wrap a benchmark exe, so that it has the
# backend executable on its path, and the source tree as its working
# directory.
wrapBench = backend:
wrapBench = progs:
lib.optionalAttrs (!stdenv.hostPlatform.isWindows) {
build-tools = [ pkgs.makeWrapper ];
postInstall = ''
wrapProgram $out/bin/* \
--run "cd $src" \
--prefix PATH : ${backend}/bin
--prefix PATH : ${lib.makeBinPath progs}
'';
};

Expand Down
41 changes: 11 additions & 30 deletions nix/migration-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,44 +34,28 @@ with pkgs.lib;

let

# From nixpkgs 19.09 onwards we use `x86_64-w64-mingw32` instead of
# the legacy `x86_64-pc-mingw32` that nixpkgs incorrectly used. Thus
# to test migration paths for releases that have been build with nixpkgs
# prior to 19.09, we'll need to rewrite the crossSystem.config.
# This is controlled by the `needsRewrite` flags int he releases.
rewriteCrossSystem = crossSystem: if crossSystem != null && crossSystem.config == "x86_64-w64-mingw32" then crossSystem // { config = "x86_64-pc-mingw32"; } else crossSystem;
# List of git revisions to test against.
releases = [
{ rev = "v2020-03-11";
sha256 = "05ijr9nbc9qngw2xsgmwdacnlq70mjgr4innkaw2d4c3sa29x3ai";
needsRewrite = true; }
sha256 = "05ijr9nbc9qngw2xsgmwdacnlq70mjgr4innkaw2d4c3sa29x3ai"; }
{ rev = "v2020-03-16";
sha256 = "15gbghal6s1b9jdns117fllhz81ahz7hjhikp6lr09zim8jsisjc";
needsRewrite = true; }
sha256 = "15gbghal6s1b9jdns117fllhz81ahz7hjhikp6lr09zim8jsisjc"; }
{ rev = "v2020-04-01";
sha256 = "0hjdz4bbhq7g9cc1hfxpnwypd42n3rx0ci91n8i7ahnjhv93bhhy";
needsRewrite = true; }
sha256 = "0hjdz4bbhq7g9cc1hfxpnwypd42n3rx0ci91n8i7ahnjhv93bhhy"; }
{ rev = "v2020-04-07";
sha256 = "10m91l6r4ghhqddk5c0a4ffjl0z3h4nmk7cjhz2b0jhxdkmz6qg5";
needsRewrite = true; }
sha256 = "10m91l6r4ghhqddk5c0a4ffjl0z3h4nmk7cjhz2b0jhxdkmz6qg5"; }
{ rev = "v2020-04-28";
sha256 = "0iw5gn3d2i1f99mx293zn8l72i7lidmdlrfyzblhdvx6f358iyki";
needsRewrite = true; }
sha256 = "0iw5gn3d2i1f99mx293zn8l72i7lidmdlrfyzblhdvx6f358iyki"; }
{ rev = "v2020-05-06";
sha256 = "1ksy2i7a19zb45bxznkgbbmrammqjmg3xprcdnvfl3vfinil9xb3";
needsRewrite = true; }
sha256 = "1ksy2i7a19zb45bxznkgbbmrammqjmg3xprcdnvfl3vfinil9xb3"; }
{ rev = "v2020-06-05";
sha256 = "062l3i61074vlak44335mffr3xzpbs9nhsiis0rwlrn4w4wiwzx3";
needsRewrite = true; }
sha256 = "062l3i61074vlak44335mffr3xzpbs9nhsiis0rwlrn4w4wiwzx3"; }
{ rev = "v2020-07-06";
sha256 = "1pl1vqmdyjx8ly3vy48j211hh59w7ikksmzv7r4y1cpjyi0ajjsa";
needsRewrite = true; }
sha256 = "1pl1vqmdyjx8ly3vy48j211hh59w7ikksmzv7r4y1cpjyi0ajjsa"; }
{ rev = "v2020-07-28";
sha256 = "1mnnlg1x3y9cf3sqmxpqjdiwlay58pdci4cjxfvlwlyqqlsy5d1i";
needsRewrite = true; }
sha256 = "1mnnlg1x3y9cf3sqmxpqjdiwlay58pdci4cjxfvlwlyqqlsy5d1i"; }
{ rev = "v2020-08-03";
sha256 = "1bh6mwlzc77x7ka2kihfbdgg1lwvrdb26280kvdznwxcf4nbjgmk";
needsRewrite = true; }
sha256 = "1bh6mwlzc77x7ka2kihfbdgg1lwvrdb26280kvdznwxcf4nbjgmk"; }
];

# Download the sources for a release.
Expand All @@ -88,11 +72,8 @@ let
if rel == null
then import ../default.nix { inherit system crossSystem config; }
else let src = fetchRelease rel; in import src {
inherit system config;
inherit system crossSystem config;
gitrev = src.rev;
crossSystem = if rel.needsRewrite
then rewriteCrossSystem crossSystem
else crossSystem;
};

# Grab the migration test from the current version.
Expand Down
Loading

0 comments on commit 5eb1c6f

Please sign in to comment.