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

Basic Alonzo support #2763

Merged
merged 10 commits into from
Jul 30, 2021
Merged

Basic Alonzo support #2763

merged 10 commits into from
Jul 30, 2021

Conversation

Anviking
Copy link
Member

@Anviking Anviking commented Jul 15, 2021

Issue Number

ADP-1025

Overview

  • Ensure the wallet can run in Alonzo
  • Get all integration tests green
  • Fix warnings
  • Cleanup
    • [ ]Test that addresses don't affect the min ada value Existing integration tests should be enough
    • Does it still work on testnet? -> The ledger function in question cannot know the current network, so would be highly surprising if it didn't work on testnet
    • Update MinUTxOValue properties to generate both ShelleyMA and Alonzo cases
    • Go through everything from start to finish
  • Run integration tests on both Mary and alonzo
    • Check that the Mary era is actually picked up, and it's not just running Alonzo twice
  • [ ] Using cardano-node 1.28.0 tag -> stack.yaml: Bump cardano-node to 1.28.0 tag #2778
  • [x] Cabal build also works -> Fix cabal build #2776

Comments

@@ -635,42 +683,49 @@ fromShelleyPParams eraInfo pp = W.ProtocolParameters
-- convert it into a percentage.
--
decentralizationLevelFromPParams
:: SLAPI.PParams era
:: HasField "_d" pparams SL.UnitInterval
Copy link
Member Author

Choose a reason for hiding this comment

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

If we were to use Cardano.Api we wouldn't need to do all of this juggling. But looking into it, it seems a bit all-or-nothing — we can't start using it for a single query only. Unless we ask them to expose a bunch of internal stuff.

@Anviking Anviking self-assigned this Jul 15, 2021
@Anviking Anviking force-pushed the anviking/ADP-952/alonzo branch 2 times, most recently from 4312c80 to 660812f Compare July 21, 2021 14:37
@Anviking Anviking force-pushed the anviking/ADP-952/alonzo branch from cfda01c to a5389d6 Compare July 22, 2021 15:24
@Anviking
Copy link
Member Author

bors try

iohk-bors bot added a commit that referenced this pull request Jul 22, 2021
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 22, 2021

try

Build failed:

@Anviking
Copy link
Member Author

bors try

iohk-bors bot added a commit that referenced this pull request Jul 22, 2021
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 22, 2021

try

Build failed:

@Anviking Anviking force-pushed the anviking/ADP-952/alonzo branch 2 times, most recently from d7c9db3 to 5108e25 Compare July 22, 2021 19:16
@Anviking
Copy link
Member Author

bors try

iohk-bors bot added a commit that referenced this pull request Jul 22, 2021
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 22, 2021

try

Build failed:

@Anviking
Copy link
Member Author

Not sure why there are Info-logs in the CI integration test output… 🤔

I don't see this locally.

@Anviking
Copy link
Member Author

bors try

iohk-bors bot added a commit that referenced this pull request Jul 23, 2021
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 23, 2021

try

Build succeeded:

@Anviking
Copy link
Member Author

bors try

iohk-bors bot added a commit that referenced this pull request Jul 23, 2021
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 23, 2021

try

Build failed:

@Anviking
Copy link
Member Author

bors try

iohk-bors bot added a commit that referenced this pull request Jul 26, 2021
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 26, 2021

try

Build failed:

@Anviking Anviking force-pushed the anviking/ADP-952/alonzo branch from 12d003f to 1ee610c Compare July 26, 2021 15:23
@rvl
Copy link
Contributor

rvl commented Jul 30, 2021

I made a ticket for the weeder failures: #2785.

@Anviking Anviking force-pushed the anviking/ADP-952/alonzo branch from 736d2cd to 55ec2a6 Compare July 30, 2021 09:10
@Anviking Anviking mentioned this pull request Jul 30, 2021
2 tasks
@Anviking
Copy link
Member Author

bors try

iohk-bors bot added a commit that referenced this pull request Jul 30, 2021
Copy link
Contributor

@rvl rvl left a comment

Choose a reason for hiding this comment

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

Great. There is just an outstanding todo item hese:

rodney@tethys:~/iohk/cw/alonzo % ./scripts/todo-list.sh lib -t ADP-952
+++ TODO list
267 source files [****************] 100%
lib/shelley/src/Cardano/Wallet/Shelley/Transaction.hs
  1273  We presumably need to provide the protocol params if our tx uses
        scripts? [ADP-952]

@@ -1,7 +1,7 @@
# Taken from https://hydra.iohk.io/build/6782523/download/1/index.html
# and not sanity-checked for appropriateness for when we turn on Alonzo
# in our test cluster.
adaPerUTxOWord: 0
adaPerUTxOWord: 34482
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the comment above still apply?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, forgot about it! Thanks, will remove.

Copy link
Member Author

Choose a reason for hiding this comment

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

214bc4b Plutus script parameters probably need to be sanity checked at some point, so kept a comment about that.

Comment on lines +2530 to +2531
let txConstraints = (view #constraints tl) pp
liftIO $ toApiNetworkParameters np txConstraints (interpretQuery ti . toApiEpochInfo)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we not involve TransactionLayer here?
It seems a bit roundabout to call a transaction layer thing that just references the protocol parameters.

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems a bit roundabout to call a transaction layer thing that just references the protocol parameters.

I fully agree. But to convert the Alonzo adaPerUTxOWord to our generic API minUTxOValue, we do need to call the cardano-wallet-specific (i.e not in -core) function computeMinimumAdaQuantityInternal

Alternatives could be:

  1. Pass in using some different record/function than the TransactionLayer — but we already have this one
  2. Convert MinUTxOValue to Coin already before storing it in theProtocolParameters record — sounds like a horrible idea
  3. Merge cardano-wallet and cardano-wallet-core

Aside from the merging the libraries, I don't see anything obvious.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, that's ... unfortunate. I have opened PR #2787 to fix this.

@Anviking Anviking force-pushed the anviking/ADP-952/alonzo branch from 6c40b62 to 214bc4b Compare July 30, 2021 10:08
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 30, 2021

try

Build failed:

Anviking and others added 4 commits July 30, 2021 13:03
- Set TestEnableDevelopmentNetworkProtocols
- Tweak alonzo genesis
- Fix SHELLEY_CREATE_MIGRATION_PLAN_04 to work in both Mary and Alonzo
Instead of just running on the latest era (Alonzo), this makes them also
run on Mary.
Since we run tests on two different eras now, we want buildkite to
upload artefacts from both eras. Hopefully this should do it.
@Anviking Anviking force-pushed the anviking/ADP-952/alonzo branch from 9f1606a to bf46b04 Compare July 30, 2021 11:03
@Anviking
Copy link
Member Author

bors r+

iohk-bors bot added a commit that referenced this pull request Jul 30, 2021
2763: Basic Alonzo support r=Anviking a=Anviking

# Issue Number

ADP-1025

# Overview

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

- [x] Ensure the wallet can run in Alonzo
- [x] Get all integration tests green
- [x] Fix warnings
- [x] Cleanup
    - <s>[ ]Test that addresses don't affect the min ada value</s> Existing integration tests should be enough
    - [x] <s>Does it still work on testnet? -> The ledger function in question cannot know the current network, so would be highly surprising if it didn't work on testnet </s>
    - [x] Update MinUTxOValue properties to generate both ShelleyMA and Alonzo cases
    - [ ] Go through everything from start to finish 
- [x] Run integration tests on both Mary and alonzo
    - [x] Check that the Mary era is actually picked up, and it's not just running Alonzo twice
- <s>[ ] Using cardano-node 1.28.0 tag</s> -> #2778
- <s>[x] Cabal build also works</s> -> #2776

# Comments

- [Hydra jobset](https://hydra.iohk.io/jobset/Cardano/cardano-wallet-pr-2763)
- [Cabal Nightly build](https://buildkite.com/input-output-hk/cardano-wallet-nightly/builds?branch=anviking%2FADP-952%2Falonzo) (use environment variable `step=cabal` when creating a new build)


Co-authored-by: Johannes Lund <[email protected]>
Co-authored-by: Rodney Lorrimar <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 30, 2021

Build failed:

#2785

@Anviking
Copy link
Member Author

Anviking commented Jul 30, 2021

@rvl I added c24bac083dab6f

Skärmavbild 2021-07-30 kl  14 10 37

@Anviking Anviking force-pushed the anviking/ADP-952/alonzo branch from c24bac0 to 83dab6f Compare July 30, 2021 12:18
@rvl
Copy link
Contributor

rvl commented Jul 30, 2021

Great. I will merge without bors because it was just a weeder false positive which failed.

@rvl rvl merged commit 38335a3 into master Jul 30, 2021
@rvl rvl deleted the anviking/ADP-952/alonzo branch July 30, 2021 12:21
iohk-bors bot added a commit that referenced this pull request Aug 2, 2021
2791: Negotiate NodeToClientVersion for non-breaking mainnet support r=Anviking a=Anviking

# Issue Number

ADP-1025

# Background

#2763 made the wallet demand NodeToClientV_9. With cardano-node 1.28.0, V_9 is only enabled if  `TestEnableDevelopmentNetworkProtocols` is set in the node config.

# Overview

- [x] Make the wallet support both `V_8` and `V_9`.
- [x] Ensure integration tests on Mary are run without `TestEnableDevelopmentNetworkProtocols: True`


# 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)
 ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
 ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages.
-->


Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this pull request Aug 2, 2021
2791: Negotiate NodeToClientVersion for non-breaking mainnet support r=Anviking a=Anviking

# Issue Number

ADP-1025

# Background

#2763 made the wallet demand NodeToClientV_9. With cardano-node 1.28.0, V_9 is only enabled if  `TestEnableDevelopmentNetworkProtocols` is set in the node config.

# Overview

- [x] Make the wallet support both `V_8` and `V_9`.
- [x] Ensure integration tests on Mary are run without `TestEnableDevelopmentNetworkProtocols: True`


# 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)
 ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
 ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages.
-->


Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this pull request Aug 2, 2021
2791: Negotiate NodeToClientVersion for non-breaking mainnet support r=Anviking a=Anviking

# Issue Number

ADP-1025

# Background

#2763 made the wallet demand NodeToClientV_9. With cardano-node 1.28.0, V_9 is only enabled if  `TestEnableDevelopmentNetworkProtocols` is set in the node config.

# Overview

- [x] Make the wallet support both `V_8` and `V_9`.
- [x] Ensure integration tests on Mary are run without `TestEnableDevelopmentNetworkProtocols: True`


# 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)
 ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
 ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages.
-->


Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this pull request Aug 2, 2021
2791: Negotiate NodeToClientVersion for non-breaking mainnet support r=Anviking a=Anviking

# Issue Number

ADP-1025

# Background

#2763 made the wallet demand NodeToClientV_9. With cardano-node 1.28.0, V_9 is only enabled if  `TestEnableDevelopmentNetworkProtocols` is set in the node config.

# Overview

- [x] Make the wallet support both `V_8` and `V_9`.
- [x] Ensure integration tests on Mary are run without `TestEnableDevelopmentNetworkProtocols: True`


# 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)
 ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
 ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages.
-->


Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this pull request Aug 2, 2021
2791: Negotiate NodeToClientVersion for non-breaking mainnet support r=Anviking a=Anviking

# Issue Number

ADP-1025

# Background

#2763 made the wallet demand NodeToClientV_9. With cardano-node 1.28.0, V_9 is only enabled if  `TestEnableDevelopmentNetworkProtocols` is set in the node config.

# Overview

- [x] Make the wallet support both `V_8` and `V_9`.
- [x] Ensure integration tests on Mary are run without `TestEnableDevelopmentNetworkProtocols: True`


# 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)
 ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
 ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages.
-->


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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants