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

Integration test cluster for Byron;Shelley #1924

Merged
merged 20 commits into from
Jul 23, 2020

Conversation

Anviking
Copy link
Member

@Anviking Anviking commented Jul 17, 2020

Issue Number

#1920

Overview

  • Add support for Byron;Shelley integration test cluster
  • Adjusted configs to work with the new version of cardano-node
  • withCluster now takes three actions:
    - onByron
    - onFork (when in shelley. We can send money to the shelley faucets here)
    - onClusterStart (when the stake pools have fully started)
  • CLI faucets are now byron facuets, and are generated automatically. This is both easier and more elegant.
  • The underlying logic of withCluster was kept somewhat flexible for easier experimentation.
  • Todo: For the Shelley integration tests to work, we need to send funds to the shelley faucet addresses, as initialFunds doesn't work when entering shelley through a hard-fork.
  • Todo clean up faucet config/code, and make sure special wallets are included

Comments

$ stack test cardano-wallet-shelley:integration

@Anviking Anviking self-assigned this Jul 17, 2020
@rvl rvl mentioned this pull request Jul 18, 2020
@Anviking Anviking force-pushed the anviking/1920/fork-cluster branch 6 times, most recently from cbba7eb to 6fb19d6 Compare July 19, 2020 04:27
@Anviking Anviking force-pushed the anviking/1920/fork-cluster branch from 6be9ba9 to 1b73bf7 Compare July 19, 2020 13:24
@rvl rvl changed the base branch from master to rvl/1870/bump-deps July 21, 2020 02:00
@Anviking Anviking force-pushed the anviking/1920/fork-cluster branch from ff92299 to df89bbb Compare July 21, 2020 11:36
@KtorZ KtorZ force-pushed the rvl/1870/bump-deps branch 2 times, most recently from 0add156 to e91d4b5 Compare July 21, 2020 17:05
@Anviking Anviking force-pushed the anviking/1920/fork-cluster branch 3 times, most recently from 49d1f94 to d6d15db Compare July 21, 2020 20:08
@Anviking
Copy link
Member Author

Anviking commented Jul 21, 2020

@rvl @KtorZ I have rebased this, and the integration tests are starting, and some passing.

I'll ping/tag for review when the the final todo is done, unless you think there will be merge conflicts and we should merge this.

@Anviking Anviking changed the title WIP: Integration test cluster for Byron;Shelley Integration test cluster for Byron;Shelley Jul 21, 2020
@Anviking Anviking force-pushed the anviking/1920/fork-cluster branch from 00eb494 to 6ffe092 Compare July 22, 2020 09:38
@KtorZ KtorZ force-pushed the rvl/1870/bump-deps branch from 59535f5 to 1db42f9 Compare July 22, 2020 12:07
Anviking added 4 commits July 22, 2020 14:16
- Adjusted configs to work with the new version of cardano-node
- withCluster now takes three actions:
  - onByron
  - onFork (when in shelley)
  - onClusterStart (when the stake pools have fully started)
- CLI faucets are now byron facuets, and are generated automatically.
This is both easier and more elegant.
- The underlying logic of withCluster was kept abstract for easier
experimentation.

Contains a few squashed commits from Rodney.
@KtorZ KtorZ force-pushed the anviking/1920/fork-cluster branch from 6ffe092 to fff475a Compare July 22, 2020 12:17
@Anviking
Copy link
Member Author

I'll want to squash appropriately at some point, but not yet.

afterFork dir _ = do
let encodeAddr = T.unpack . encodeAddress @'Mainnet
let addresses = map (first encodeAddr) shelleyIntegrationTestFunds
sendFaucetFundsTo stdoutTextTracer dir addresses
Copy link
Member Author

Choose a reason for hiding this comment

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

The setup is sprinkled across integration/Main.hs, Faucet.hs, and Launch.hs, which feels a bit weird. Maybe we can resolve that sometime.

# b) the `systemStart` is hard-coded here to please the parser but is replaced dynamically
# by the same code generating the final node configuration for integration.
#
# c) initialFunds are defined as a list of singleton, and not as a key-value map like in the
Copy link
Member Author

@Anviking Anviking Jul 22, 2020

Choose a reason for hiding this comment

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

Hm.🤔 We don't really control the order when we fill the shelley faucets now. Maybe this might cause some failures @KtorZ .

Maybe we have to make sure to always keep funds for a sequential wallet in a single tx (but we may have as many as 200 addresses to fill for a single wallet).

Copy link
Member

Choose a reason for hiding this comment

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

This will be a problem for big wallets only, which might explain why the scenario is currently failing. I thought initial funds in the shelley genesis were ignored though?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought initial funds in the shelley genesis were ignored though?

Yes.

(I came to think about it when reading the outdated documentation comment. Now updated.)

Anviking and others added 7 commits July 22, 2020 20:48
…stant

And in particular, fix the inconsistency between fixture wallets and
empty wallets that have different passphrases!
  indeed, for the size estimation, we generate dummy change outputs that necessary are shelley addresses. Yet, Byron addresses have different sizes, and in particular, Byron are longer than shelley addresses (Icarus are however shorter). So, we apply a correction after the whole size calculation for each change output because generating dummy Byron addresses would be a real pain in the a**
  This has been heavily reliable and is actually duplicating logic compared to the API. So instead, we query directly the API for fee estimation within the scenario and rely on a single implementation of fee estimation. This commits break every test in Shelley that are using the fee estimator, they'll be updated in subsequent commits
… calls

  I also removed some scenarios that were completely redundant with others (testing that the fee estimation endpoint works correctly is intrinsically done in other scenarios now that are calling it for pretty much every transactions).
The lifting was not really done wrong. We shouldn't return 'Nothing' if one of the given bound is 'Nothing'.
@KtorZ KtorZ force-pushed the anviking/1920/fork-cluster branch from 0b645dc to afd1e73 Compare July 23, 2020 07:26
@rvl rvl added ADDING FEATURE Mark a PR as adding a new feature, for auto-generated CHANGELOG IMPROVEMENT Mark a PR as an improvement, for auto-generated CHANGELOG and removed ADDING FEATURE Mark a PR as adding a new feature, for auto-generated CHANGELOG labels Jul 23, 2020
@rvl rvl marked this pull request as ready for review July 23, 2020 07:51
@rvl
Copy link
Contributor

rvl commented Jul 23, 2020

I'm going to merge into #1909 and we can continue there...

@rvl rvl merged commit f8399ea into rvl/1870/bump-deps Jul 23, 2020
@rvl rvl deleted the anviking/1920/fork-cluster branch July 23, 2020 07:52
iohk-bors bot added a commit that referenced this pull request Jul 24, 2020
1909: Cardano.Api -> Cardano.Api.Typed and HardForkBlock r=KtorZ a=rvl

### Issue Number

Relates to #1870.

### Overview

- Updates cardano-node to latest master version.
- Updates libraries to version from cardano-node master.
- Cardano.Api → Cardano.Api.Typed changes.
- Change `ShelleyBlock` → `CardanoBlock sc` in "Compatibility" module
- Change `ShelleyBlock` → `CardanoBlock sc` in network module
- Add in byron implementations of conversion functions for two-era mode.
- Add CLI support for two-era mode.
- Use LocalStateQuery to get the history Interpreter from the node.
- Update shelley transaction layer to use new extended keys support in Cardano.Api.Typed.

### Comments

- [x] Fix all the type errors in packages other than cardano-wallet-shelley.
- [x] Transaction layer works during shelley era
- [ ] Transaction layer works during byron era
- [x] Manual testing against [mainnet_candidate](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) which is in byron era -- can sync and restore empty wallet
- [x] Manual testing against [shelley_qa](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) which is in shelley era -- can sync and restore empty wallet
- [ ] Unit tests passing
- [x] Merge integration test cluster setup from #1924, and fix.


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this pull request Jul 24, 2020
1909: Cardano.Api -> Cardano.Api.Typed and HardForkBlock r=KtorZ a=rvl

### Issue Number

Relates to #1870.

### Overview

- Updates cardano-node to latest master version.
- Updates libraries to version from cardano-node master.
- Cardano.Api → Cardano.Api.Typed changes.
- Change `ShelleyBlock` → `CardanoBlock sc` in "Compatibility" module
- Change `ShelleyBlock` → `CardanoBlock sc` in network module
- Add in byron implementations of conversion functions for two-era mode.
- Add CLI support for two-era mode.
- Use LocalStateQuery to get the history Interpreter from the node.
- Update shelley transaction layer to use new extended keys support in Cardano.Api.Typed.

### Comments

- [x] Fix all the type errors in packages other than cardano-wallet-shelley.
- [x] Transaction layer works during shelley era
- [ ] Transaction layer works during byron era
- [x] Manual testing against [mainnet_candidate](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) which is in byron era -- can sync and restore empty wallet
- [x] Manual testing against [shelley_qa](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) which is in shelley era -- can sync and restore empty wallet
- [ ] Unit tests passing
- [x] Merge integration test cluster setup from #1924, and fix.


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this pull request Jul 24, 2020
1909: Cardano.Api -> Cardano.Api.Typed and HardForkBlock r=KtorZ a=rvl

### Issue Number

Relates to #1870.

### Overview

- Updates cardano-node to latest master version.
- Updates libraries to version from cardano-node master.
- Cardano.Api → Cardano.Api.Typed changes.
- Change `ShelleyBlock` → `CardanoBlock sc` in "Compatibility" module
- Change `ShelleyBlock` → `CardanoBlock sc` in network module
- Add in byron implementations of conversion functions for two-era mode.
- Add CLI support for two-era mode.
- Use LocalStateQuery to get the history Interpreter from the node.
- Update shelley transaction layer to use new extended keys support in Cardano.Api.Typed.

### Comments

- [x] Fix all the type errors in packages other than cardano-wallet-shelley.
- [x] Transaction layer works during shelley era
- [ ] Transaction layer works during byron era
- [x] Manual testing against [mainnet_candidate](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) which is in byron era -- can sync and restore empty wallet
- [x] Manual testing against [shelley_qa](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) which is in shelley era -- can sync and restore empty wallet
- [ ] Unit tests passing
- [x] Merge integration test cluster setup from #1924, and fix.


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this pull request Jul 25, 2020
1909: Cardano.Api -> Cardano.Api.Typed and HardForkBlock r=KtorZ a=rvl

### Issue Number

Relates to #1870.

### Overview

- Updates cardano-node to latest master version.
- Updates libraries to version from cardano-node master.
- Cardano.Api → Cardano.Api.Typed changes.
- Change `ShelleyBlock` → `CardanoBlock sc` in "Compatibility" module
- Change `ShelleyBlock` → `CardanoBlock sc` in network module
- Add in byron implementations of conversion functions for two-era mode.
- Add CLI support for two-era mode.
- Use LocalStateQuery to get the history Interpreter from the node.
- Update shelley transaction layer to use new extended keys support in Cardano.Api.Typed.

### Comments

- [x] Fix all the type errors in packages other than cardano-wallet-shelley.
- [x] Transaction layer works during shelley era
- [ ] Transaction layer works during byron era
- [x] Manual testing against [mainnet_candidate](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) which is in byron era -- can sync and restore empty wallet
- [x] Manual testing against [shelley_qa](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) which is in shelley era -- can sync and restore empty wallet
- [ ] Unit tests passing
- [x] Merge integration test cluster setup from #1924, and fix.


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this pull request Jul 25, 2020
1909: Cardano.Api -> Cardano.Api.Typed and HardForkBlock r=KtorZ a=rvl

### Issue Number

Relates to #1870.

### Overview

- Updates cardano-node to latest master version.
- Updates libraries to version from cardano-node master.
- Cardano.Api → Cardano.Api.Typed changes.
- Change `ShelleyBlock` → `CardanoBlock sc` in "Compatibility" module
- Change `ShelleyBlock` → `CardanoBlock sc` in network module
- Add in byron implementations of conversion functions for two-era mode.
- Add CLI support for two-era mode.
- Use LocalStateQuery to get the history Interpreter from the node.
- Update shelley transaction layer to use new extended keys support in Cardano.Api.Typed.

### Comments

- [x] Fix all the type errors in packages other than cardano-wallet-shelley.
- [x] Transaction layer works during shelley era
- [ ] Transaction layer works during byron era
- [x] Manual testing against [mainnet_candidate](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) which is in byron era -- can sync and restore empty wallet
- [x] Manual testing against [shelley_qa](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) which is in shelley era -- can sync and restore empty wallet
- [ ] Unit tests passing
- [x] Merge integration test cluster setup from #1924, and fix.


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this pull request Jul 25, 2020
1909: Cardano.Api -> Cardano.Api.Typed and HardForkBlock r=KtorZ a=rvl

### Issue Number

Relates to #1870.

### Overview

- Updates cardano-node to latest master version.
- Updates libraries to version from cardano-node master.
- Cardano.Api → Cardano.Api.Typed changes.
- Change `ShelleyBlock` → `CardanoBlock sc` in "Compatibility" module
- Change `ShelleyBlock` → `CardanoBlock sc` in network module
- Add in byron implementations of conversion functions for two-era mode.
- Add CLI support for two-era mode.
- Use LocalStateQuery to get the history Interpreter from the node.
- Update shelley transaction layer to use new extended keys support in Cardano.Api.Typed.

### Comments

- [x] Fix all the type errors in packages other than cardano-wallet-shelley.
- [x] Transaction layer works during shelley era
- [ ] Transaction layer works during byron era
- [x] Manual testing against [mainnet_candidate](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) which is in byron era -- can sync and restore empty wallet
- [x] Manual testing against [shelley_qa](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) which is in shelley era -- can sync and restore empty wallet
- [ ] Unit tests passing
- [x] Merge integration test cluster setup from #1924, and fix.


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this pull request Jul 25, 2020
1909: Cardano.Api -> Cardano.Api.Typed and HardForkBlock r=KtorZ a=rvl

### Issue Number

Relates to #1870.

### Overview

- Updates cardano-node to latest master version.
- Updates libraries to version from cardano-node master.
- Cardano.Api → Cardano.Api.Typed changes.
- Change `ShelleyBlock` → `CardanoBlock sc` in "Compatibility" module
- Change `ShelleyBlock` → `CardanoBlock sc` in network module
- Add in byron implementations of conversion functions for two-era mode.
- Add CLI support for two-era mode.
- Use LocalStateQuery to get the history Interpreter from the node.
- Update shelley transaction layer to use new extended keys support in Cardano.Api.Typed.

### Comments

- [x] Fix all the type errors in packages other than cardano-wallet-shelley.
- [x] Transaction layer works during shelley era
- [ ] Transaction layer works during byron era
- [x] Manual testing against [mainnet_candidate](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) which is in byron era -- can sync and restore empty wallet
- [x] Manual testing against [shelley_qa](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html) which is in shelley era -- can sync and restore empty wallet
- [ ] Unit tests passing
- [x] Merge integration test cluster setup from #1924, and fix.


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IMPROVEMENT Mark a PR as an improvement, for auto-generated CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants