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

Accounting Style Renaming: proper manual migration #2263

Merged
merged 2 commits into from
Oct 22, 2020

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented Oct 22, 2020

Issue Number

ADP-523

Overview

  • 016f60c
    📍 reproduce deserialization issue with regards to account style change
    I originally added a 'backward-compatible' function step to the deserialization function of value of type 'AccountingStyle'. The problem is that it only concerns objects that are being deserialized. Any 'AccountingStyle' value that is queried will inevitably fail because columns in an existing database would still be using the old serialization format. As a consequence, fetching all addresses of an existing sequential wallet returns an empty set, regardless of what is in the database.

  • 0a6c36c
    📍 use a proper manual database migration for renaming AccountingStyle instead of the hacky in-place adjustment in the deserializer.

Comments

Whoops...

  I originally added a 'backward-compatible' function step to the deserialization function of value of type 'AccountingStyle'. The problem is that it only concerns objects that are being deserialized. Any 'AccountingStyle' value that is queried will inevitably fail because columns in an existing database would still be using the old serialization format. As a consequence, fetching all addresses of an existing sequential wallet returns an empty set, regardless of what is in the database.
@KtorZ KtorZ added the RESOLVING ISSUE Mark a PR as resolving issues, for auto-generated CHANGELOG label Oct 22, 2020
@KtorZ KtorZ self-assigned this Oct 22, 2020
@KtorZ KtorZ force-pushed the KtorZ/ADP-523/accounting-style-renaming branch from 0a6c36c to a74532d Compare October 22, 2020 13:08
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.

lgtm.

Works on testnet!

@@ -262,6 +263,10 @@ spec = do
, minBound
)

it "'migrate' db with old text serialization for 'AccountingStyle'" $
testMigrationAccountingStyle @ShelleyKey
"shelleyAccountingStyle-v2020-10-13.sqlite"
Copy link
Contributor

Choose a reason for hiding this comment

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

🥇

@piotr-iohk
Copy link
Contributor

Actually creating new wallet here results in:

[cardano-wallet.api-server:Info:156] [2020-10-22 13:49:42.22 UTC] [RequestId 1] [POST] /v2/wallets
[cardano-wallet.wallet-engine:Error:157] [2020-10-22 13:49:42.24 UTC] Worker has exited unexpectedly: SQLite3 returned ErrorError while attempting to perform prepare "UPDATE seq_state_address SET accounting_style = \"utxo_internal\" WHERE accounting_style = \"u_tx_o_internal\"": no such table: seq_state_address
[cardano-wallet.api-server:Error:156] [2020-10-22 13:49:42.24 UTC] [RequestId 1] 500 Internal Server Error in 0.019850024s

(Seems that tests complain about that also)

@KtorZ KtorZ force-pushed the KtorZ/ADP-523/accounting-style-renaming branch from a74532d to 7257a4c Compare October 22, 2020 14:02
@KtorZ
Copy link
Member Author

KtorZ commented Oct 22, 2020

@piotr-iohk yes, and same for random wallet, see the last change here: https://github.com/input-output-hk/cardano-wallet/compare/a74532de74f0c0e25e3b45ba73b89d1e3eaf0a7f..7257a4cee4d363f67671adfb11698d7049a5d115

We need to control that the table exists first 😅 ...

@KtorZ
Copy link
Member Author

KtorZ commented Oct 22, 2020

bors merge

iohk-bors bot added a commit that referenced this pull request Oct 22, 2020
2263: Accounting Style Renaming: proper manual migration r=KtorZ a=KtorZ

# Issue Number

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

ADP-523

# Overview

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

- 016f60c
  📍 **reproduce deserialization issue with regards to account style change**
    I originally added a 'backward-compatible' function step to the deserialization function of value of type 'AccountingStyle'. The problem is that it only concerns objects that are being deserialized. Any 'AccountingStyle' value that is queried will inevitably fail because columns in an existing database would still be using the old serialization format. As a consequence, fetching all addresses of an existing sequential wallet returns an empty set, regardless of what is in the database.

- 0a6c36c
  📍 **use a proper manual database migration for renaming AccountingStyle   instead of the hacky in-place adjustment in the deserializer.**

# Comments

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

Whoops...

<!-- 
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]>
@KtorZ KtorZ force-pushed the KtorZ/ADP-523/accounting-style-renaming branch from 7257a4c to 41c092b Compare October 22, 2020 15:43
@KtorZ
Copy link
Member Author

KtorZ commented Oct 22, 2020

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Oct 22, 2020

Canceled.

iohk-bors bot added a commit that referenced this pull request Oct 22, 2020
2263: Accounting Style Renaming: proper manual migration r=KtorZ a=KtorZ

# Issue Number

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

ADP-523

# Overview

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

- 016f60c
  📍 **reproduce deserialization issue with regards to account style change**
    I originally added a 'backward-compatible' function step to the deserialization function of value of type 'AccountingStyle'. The problem is that it only concerns objects that are being deserialized. Any 'AccountingStyle' value that is queried will inevitably fail because columns in an existing database would still be using the old serialization format. As a consequence, fetching all addresses of an existing sequential wallet returns an empty set, regardless of what is in the database.

- 0a6c36c
  📍 **use a proper manual database migration for renaming AccountingStyle   instead of the hacky in-place adjustment in the deserializer.**

# Comments

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

Whoops...

<!-- 
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]>
  instead of the hacky in-place adjustment in the deserializer.
@KtorZ KtorZ force-pushed the KtorZ/ADP-523/accounting-style-renaming branch from 41c092b to 8629a66 Compare October 22, 2020 16:14
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Oct 22, 2020

Canceled.

@KtorZ
Copy link
Member Author

KtorZ commented Oct 22, 2020

bors merge

@KtorZ
Copy link
Member Author

KtorZ commented Oct 22, 2020

bors r-

iohk-bors bot added a commit that referenced this pull request Oct 22, 2020
2229: add verification key endpoint r=KtorZ a=paweljakubas

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->
https://jira.iohk.io/browse/ADP-474

# Overview

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

- [x] I have added endpoint plus basic types and instances
- [x] I have extended swagger
- [x] I have updated core unit tests
- [x] I have added impl and switched on impl in Shelley
- [x] I have extended Api.Link and core-integration's DSL
- [x] I have added illustrative integration test
- [x] I have added golden tests for explicit mnemonic and picked indices based on cardano-addresses

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


2263: Accounting Style Renaming: proper manual migration r=KtorZ a=KtorZ

# Issue Number

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

ADP-523

# Overview

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

- 016f60c
  📍 **reproduce deserialization issue with regards to account style change**
    I originally added a 'backward-compatible' function step to the deserialization function of value of type 'AccountingStyle'. The problem is that it only concerns objects that are being deserialized. Any 'AccountingStyle' value that is queried will inevitably fail because columns in an existing database would still be using the old serialization format. As a consequence, fetching all addresses of an existing sequential wallet returns an empty set, regardless of what is in the database.

- 0a6c36c
  📍 **use a proper manual database migration for renaming AccountingStyle   instead of the hacky in-place adjustment in the deserializer.**

# Comments

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

Whoops...

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


2264: Fix error message on bad query param filtering addresses in Jormungandr tests r=piotr-iohk a=piotr-iohk


# Issue Number

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


# Overview

- 67ef8fb
  Fix error message on bad query param filtering addresses in Jormungandr tests


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


Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Pawel Jakubas <[email protected]>
Co-authored-by: IOHK <[email protected]>
Co-authored-by: Piotr Stachyra <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Oct 22, 2020

This PR was included in a batch that was canceled, it will be automatically retried

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Oct 22, 2020

Canceled.

@KtorZ
Copy link
Member Author

KtorZ commented Oct 22, 2020

bors merge

iohk-bors bot added a commit that referenced this pull request Oct 22, 2020
2229: add verification key endpoint r=KtorZ a=paweljakubas

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->
https://jira.iohk.io/browse/ADP-474

# Overview

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

- [x] I have added endpoint plus basic types and instances
- [x] I have extended swagger
- [x] I have updated core unit tests
- [x] I have added impl and switched on impl in Shelley
- [x] I have extended Api.Link and core-integration's DSL
- [x] I have added illustrative integration test
- [x] I have added golden tests for explicit mnemonic and picked indices based on cardano-addresses

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


2263: Accounting Style Renaming: proper manual migration r=KtorZ a=KtorZ

# Issue Number

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

ADP-523

# Overview

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

- 016f60c
  📍 **reproduce deserialization issue with regards to account style change**
    I originally added a 'backward-compatible' function step to the deserialization function of value of type 'AccountingStyle'. The problem is that it only concerns objects that are being deserialized. Any 'AccountingStyle' value that is queried will inevitably fail because columns in an existing database would still be using the old serialization format. As a consequence, fetching all addresses of an existing sequential wallet returns an empty set, regardless of what is in the database.

- 0a6c36c
  📍 **use a proper manual database migration for renaming AccountingStyle   instead of the hacky in-place adjustment in the deserializer.**

# Comments

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

Whoops...

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


2264: Fix error message on bad query param filtering addresses in Jormungandr tests r=KtorZ a=piotr-iohk


# Issue Number

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


# Overview

- 67ef8fb
  Fix error message on bad query param filtering addresses in Jormungandr tests


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


Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Pawel Jakubas <[email protected]>
Co-authored-by: IOHK <[email protected]>
Co-authored-by: Piotr Stachyra <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Oct 22, 2020

This PR was included in a batch that timed out, it will be automatically retried

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Oct 22, 2020

Build succeeded:

@iohk-bors iohk-bors bot merged commit 2b8e6d3 into master Oct 22, 2020
@iohk-bors iohk-bors bot deleted the KtorZ/ADP-523/accounting-style-renaming branch October 22, 2020 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RESOLVING ISSUE Mark a PR as resolving issues, for auto-generated CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants