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

Byron-Rewrite node's integration #1303

Merged
merged 17 commits into from
Jan 29, 2020
Merged

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented Jan 24, 2020

Issue Number

Overview

  • efe7fcd
    Initial NetworkLayer implementation for Byron

  • 53b074e
    rename 'networkTip' to 'currentNodeTip' in NetworkLayer
    This name was misleading. What 'networkTip' actually returns is the tip of the local
    chain of the underlying node. The network tip can be known statically from the blockchain
    start date.

  • 6f2aee6
    remove 'findIntersection' from top-level NetworkLayer interface
    And move it only to tests, where it's used

  • 0d0a62e
    make 'send' timeout when no response is given in a timely manner
    This avoids blocking potentially indefinitely if the Network Client
    somehow dies at the other end and the connection isn't cleaned up
    correctly.

  • baa4106
    Support multiple node connections through the network layer

  • fbab14e
    add note about retrying in the chain follower

  • 574c3a5
    remove unused 'TxWitness' data-type

  • 67028cd
    re-implement base of transaction layer for Byron

  • fa55bab
    remove unused 'dummyAddress' and 'dummyKey'

  • 1ae2759
    disable shelley-specific endpoint in Byron server
    Until the address format is stabilized on the Haskell side, we will keep this one off

  • 5bd164a
    re-generate nix machinery

Comments

@Anviking So, this is mostly "complete" now. We will need to re-introduce the transaction submission in the legacy API (potentially?) and also, enable / resurrect integration tests and actually all other tests regarding the byron stuff. Will do in some other PR(s).

I've cleaned up a few things along the way, some remainders of the http-bridge era.

@KtorZ KtorZ requested a review from Anviking January 24, 2020 00:44
@KtorZ KtorZ self-assigned this Jan 24, 2020
Left e -> throw e
Right intersection -> pure $ Cursor intersection

_nextBlocks _ = do
Copy link
Member

Choose a reason for hiding this comment

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

The _ would mean:

  • nextBlocks t >> nextBlocks t doesn't work as you'd expect
  • RetryImmediately :: FollowAction will silently not work as expected when passed to follow

🤷‍♂

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 am not sure to follow you on this ?

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, yes. The protocol is stateful now indeed. So using the same cursor twice will have an unexpected behavior. I'll see if we can handle that properly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a note.

Copy link
Member

@Anviking Anviking Jan 28, 2020

Choose a reason for hiding this comment

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

It feels much better to me now when you put the queue inside the Cursor 👍

One can look at the cursor, see that there is some kind of state there, and not be surprised.

Also, initCursor will always create a new node-connection & cursor. This is neat. Had the state been in the NetworkLayer, we could have accidentally messed up an ongoing chain-sync by calling initCursor in the middle of it (which would have changed the node's notion of where the wallet's tip). I imagine at least.

@KtorZ KtorZ force-pushed the KtorZ/byron-rewrite-integration branch from b2f287f to b61ea6e Compare January 24, 2020 10:57
@KtorZ KtorZ force-pushed the KtorZ/byron-rewrite-integration branch 3 times, most recently from 3354c12 to 5bd164a Compare January 24, 2020 17:40
@KtorZ
Copy link
Member Author

KtorZ commented Jan 24, 2020

bors try

iohk-bors bot added a commit that referenced this pull request Jan 24, 2020
@KtorZ KtorZ marked this pull request as ready for review January 24, 2020 17:44
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 24, 2020

try

Build failed

@Anviking
Copy link
Member

bors try

iohk-bors bot added a commit that referenced this pull request Jan 29, 2020
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 29, 2020

try

Build failed

KtorZ and others added 13 commits January 29, 2020 12:01
This name was misleading. What 'networkTip' actually returns is the tip of the local
chain of the underlying node. The network tip can be known statically from the blockchain
start date.
And move it only to tests, where it's used
This avoids blocking potentially indefinitely if the Network Client
somehow dies at the other end and the connection isn't cleaned up
correctly.
Until the address format is stabilized on the Haskell side, we will keep this one off
Cabal v2-build was failing with:

    Resolving dependencies...
    cabal: Could not resolve dependencies:
    [__0] trying: cardano-wallet-byron-2020.1.21 (user goal)
    [__1] unknown package: typed-protocols-cbor (dependency of
    cardano-wallet-byron)
    [__1] fail (backjumping, conflict set: cardano-wallet-byron,
    typed-protocols-cbor)
    After searching the rest of the dependency tree exhaustively, these were the
    goals I've had most trouble fulfilling: cardano-wallet-byron,
    typed-protocols-cbor

This dependency needs to be added to cabal.project. However it's
easier to use stack.yaml as the single source of truth rather than
keeping both files in sync.

Cabal v2-configure can be run inside nix-shell, which will provide to
Cabal the exact dependencies defined by stack.yaml.
iohk-bors bot added a commit that referenced this pull request Jan 29, 2020
1303: Byron-Rewrite node's integration r=Anviking a=KtorZ

# Issue Number

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


# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->
- efe7fcd
  Initial NetworkLayer implementation for Byron
  
- 53b074e
  rename 'networkTip' to 'currentNodeTip' in NetworkLayer
  This name was misleading. What 'networkTip' actually returns is the tip of the local
chain of the underlying node. The network tip can be known statically from the blockchain
start date.

- 6f2aee6
  remove 'findIntersection' from top-level NetworkLayer interface
  And move it only to tests, where it's used

- 0d0a62e
  make 'send' timeout when no response is given in a timely manner
  This avoids blocking potentially indefinitely if the Network Client
somehow dies at the other end and the connection isn't cleaned up
correctly.

- baa4106
  Support multiple node connections through the network layer
  
- fbab14e
  add note about retrying in the chain follower
  
- 574c3a5
  remove unused 'TxWitness' data-type
  
- 67028cd
  re-implement base of transaction layer for Byron
  
- fa55bab
  remove unused 'dummyAddress' and 'dummyKey'
  
- 1ae2759
  disable shelley-specific endpoint in Byron server
  Until the address format is stabilized on the Haskell side, we will keep this one off

- 5bd164a
  re-generate nix machinery

# Comments

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

@Anviking So, this is mostly "complete" now. We will need to re-introduce the transaction submission in the legacy API (potentially?) and also, enable / resurrect integration tests and actually all other tests regarding the byron stuff. Will do in some other PR(s). 

I've cleaned up a few things along the way, some remainders of the http-bridge era. 

<!-- 
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: Rodney Lorrimar <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 29, 2020

Build failed

src/Test/Integration/Framework/DSL.hs:319:16:
--
  | 1) API Specifications TRANS_CREATE_02 - Multiple Output Tx to single wallet
  | expected: Quantity {getQuantity = 800000000000}
  | but got: Quantity {getQuantity = 999999999966}
  |  
  | To rerun use: --match "/API Specifications/TRANS_CREATE_02 - Multiple Output Tx to single wallet/"

Randomized with seed 339388683

@Anviking
Copy link
Member

I was not able to reproduce locally. I thought this was a flaky test. But it is here failing reliably 🤔

@Anviking
Copy link
Member

bors try

iohk-bors bot added a commit that referenced this pull request Jan 29, 2020
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 29, 2020

try

Build failed

  src/Test/Integration/Framework/DSL.hs:319:16: 
  1) API Specifications TRANS_DELETE_01 - Shelley: Can forget pending transaction
       expected: Quantity {getQuantity = 1000000000000}
        but got: Quantity {getQuantity = 999999999976}

  To rerun use: --match "/API Specifications/TRANS_DELETE_01 - Shelley: Can forget pending transaction/"

Randomized with seed 833445295

To get more info on integration failures
@Anviking
Copy link
Member

bors try

iohk-bors bot added a commit that referenced this pull request Jan 29, 2020
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 29, 2020

try

Build succeeded

@Anviking
Copy link
Member

bors try

iohk-bors bot added a commit that referenced this pull request Jan 29, 2020
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 29, 2020

try

Build succeeded

@Anviking
Copy link
Member

bors r+

iohk-bors bot added a commit that referenced this pull request Jan 29, 2020
1303: Byron-Rewrite node's integration r=Anviking a=KtorZ

# Issue Number

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


# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->
- efe7fcd
  Initial NetworkLayer implementation for Byron
  
- 53b074e
  rename 'networkTip' to 'currentNodeTip' in NetworkLayer
  This name was misleading. What 'networkTip' actually returns is the tip of the local
chain of the underlying node. The network tip can be known statically from the blockchain
start date.

- 6f2aee6
  remove 'findIntersection' from top-level NetworkLayer interface
  And move it only to tests, where it's used

- 0d0a62e
  make 'send' timeout when no response is given in a timely manner
  This avoids blocking potentially indefinitely if the Network Client
somehow dies at the other end and the connection isn't cleaned up
correctly.

- baa4106
  Support multiple node connections through the network layer
  
- fbab14e
  add note about retrying in the chain follower
  
- 574c3a5
  remove unused 'TxWitness' data-type
  
- 67028cd
  re-implement base of transaction layer for Byron
  
- fa55bab
  remove unused 'dummyAddress' and 'dummyKey'
  
- 1ae2759
  disable shelley-specific endpoint in Byron server
  Until the address format is stabilized on the Haskell side, we will keep this one off

- 5bd164a
  re-generate nix machinery

# Comments

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

@Anviking So, this is mostly "complete" now. We will need to re-introduce the transaction submission in the legacy API (potentially?) and also, enable / resurrect integration tests and actually all other tests regarding the byron stuff. Will do in some other PR(s). 

I've cleaned up a few things along the way, some remainders of the http-bridge era. 

<!-- 
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: Rodney Lorrimar <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 29, 2020

Build succeeded

@iohk-bors iohk-bors bot merged commit aaa0534 into master Jan 29, 2020
@Anviking Anviking deleted the KtorZ/byron-rewrite-integration branch January 30, 2020 10:34
hasufell pushed a commit to hasufell/cardano-wallet that referenced this pull request Aug 11, 2020
The process to create these files is roughly:

1. run `stack2cabal`
2. work around cabal bugs (see haskell/cabal#5444)
3. disable tests to avoid build failures with --enable-tests from
   unrelated packages (cabal considers all packages defined via
   source-repository-package as *local* and will try to build its tests)
4. fix package constraints in cabal.project.freeze, where stackage
   constraings were overwritten in stack.yaml files (usually raising
   a version number)

Rationale:

1. good to support all available tools as options for interested users
2. cabal allows easier managing of package bounds (and testing against
   latest package versiont)
3. cardano-foundation#1303 is an excellent workaround for nix users, but requires nix.
   This should be the go-to fallback in case cabal project files
   get out of sync for too long.
hasufell pushed a commit to hasufell/cardano-wallet that referenced this pull request Aug 11, 2020
The process to create these files is roughly:

1. run `stack2cabal`
2. work around cabal bugs (see haskell/cabal#5444)
3. disable tests to avoid build failures with --enable-tests from
   unrelated packages (cabal considers all packages defined via
   source-repository-package as *local* and will try to build its tests)
4. fix package constraints in cabal.project.freeze, where stackage
   constraings were overwritten in stack.yaml files (usually raising
   a version number)

Rationale:

1. good to support all available tools as options for interested users
2. cabal allows easier managing of package bounds (and testing against
   latest package versions)
3. cardano-foundation#1303 is an excellent workaround for nix users, but requires nix.
   This should be the go-to fallback in case cabal project files
   get out of sync for too long.
hasufell pushed a commit to hasufell/cardano-wallet that referenced this pull request Aug 14, 2020
The process to create these files is roughly:

1. run `stack2cabal`
2. work around cabal bugs (see haskell/cabal#5444)
3. disable tests to avoid build failures with --enable-tests from
   unrelated packages (cabal considers all packages defined via
   source-repository-package as *local* and will try to build its tests)
4. fix package constraints in cabal.project.freeze, where stackage
   constraings were overwritten in stack.yaml files (usually raising
   a version number)

Rationale:

1. good to support all available tools as options for interested users
2. cabal allows easier managing of package bounds (and testing against
   latest package versions)
3. cardano-foundation#1303 is an excellent workaround for nix users, but requires nix.
   This should be the go-to fallback in case cabal project files
   get out of sync for too long.
hasufell pushed a commit to hasufell/cardano-wallet that referenced this pull request Aug 14, 2020
The process to create these files is roughly:

1. run `stack2cabal`
2. work around cabal bugs (see haskell/cabal#5444)
3. disable tests to avoid build failures with --enable-tests from
   unrelated packages (cabal considers all packages defined via
   source-repository-package as *local* and will try to build its tests)
4. fix package constraints in cabal.project.freeze, where stackage
   constraings were overwritten in stack.yaml files (usually raising
   a version number)

Rationale:

1. good to support all available tools as options for interested users
2. cabal allows easier managing of package bounds (and testing against
   latest package versions)
3. cardano-foundation#1303 is an excellent workaround for nix users, but requires nix.
   This should be the go-to fallback in case cabal project files
   get out of sync for too long.
hasufell pushed a commit to hasufell/cardano-wallet that referenced this pull request Aug 21, 2020
The process to create these files is roughly:

1. run `stack2cabal`
2. work around cabal bugs (see haskell/cabal#5444)
3. disable tests to avoid build failures with --enable-tests from
   unrelated packages (cabal considers all packages defined via
   source-repository-package as *local* and will try to build its tests)
4. fix package constraints in cabal.project.freeze, where stackage
   constraings were overwritten in stack.yaml files (usually raising
   a version number)

Rationale:

1. good to support all available tools as options for interested users
2. cabal allows easier managing of package bounds (and testing against
   latest package versions)
3. cardano-foundation#1303 is an excellent workaround for nix users, but requires nix.
   This should be the go-to fallback in case cabal project files
   get out of sync for too long.
hasufell pushed a commit to hasufell/cardano-wallet that referenced this pull request Aug 21, 2020
The process to create these files is roughly:

1. run `stack2cabal`
2. work around cabal bugs (see haskell/cabal#5444)
3. disable tests to avoid build failures with --enable-tests from
   unrelated packages (cabal considers all packages defined via
   source-repository-package as *local* and will try to build its tests)
4. fix package constraints in cabal.project.freeze, where stackage
   constraings were overwritten in stack.yaml files (usually raising
   a version number)

Rationale:

1. good to support all available tools as options for interested users
2. cabal allows easier managing of package bounds (and testing against
   latest package versions)
3. cardano-foundation#1303 is an excellent workaround for nix users, but requires nix.
   This should be the go-to fallback in case cabal project files
   get out of sync for too long.
hasufell pushed a commit to hasufell/cardano-wallet that referenced this pull request Aug 24, 2020
The process to create these files is roughly:

1. run `stack2cabal`
2. work around cabal bugs (see haskell/cabal#5444)
3. disable tests to avoid build failures with --enable-tests from
   unrelated packages (cabal considers all packages defined via
   source-repository-package as *local* and will try to build its tests)
4. fix package constraints in cabal.project.freeze, where stackage
   constraings were overwritten in stack.yaml files (usually raising
   a version number)

Rationale:

1. good to support all available tools as options for interested users
2. cabal allows easier managing of package bounds (and testing against
   latest package versions)
3. cardano-foundation#1303 is an excellent workaround for nix users, but requires nix.
   This should be the go-to fallback in case cabal project files
   get out of sync for too long.
hasufell pushed a commit to hasufell/cardano-wallet that referenced this pull request Aug 27, 2020
The process to create these files is roughly:

1. run `stack2cabal`
2. work around cabal bugs (see haskell/cabal#5444)
   with a script
3. disable tests to avoid build failures with --enable-tests from
   unrelated packages (cabal considers all packages defined via
   source-repository-package as *local* and will try to build its tests)
4. fix package constraints in cabal.project.freeze, where stackage
   constraings were overwritten in stack.yaml files (usually raising
   a version number)

Rationale:

1. good to support all available tools as options for interested users
2. cabal allows easier managing of package bounds (and testing against
   latest package versions)
3. cardano-foundation#1303 is an excellent workaround for nix users, but requires nix.
   This should be the go-to fallback in case cabal project files
   get out of sync for too long.
iohk-bors bot added a commit that referenced this pull request Sep 30, 2020
2027: Allow to build with cabal r=rvl a=hasufell

The process to create these files is roughly:

1. run `stack2cabal`
2. work around cabal bugs (see haskell/cabal#5444)
3. disable tests to avoid build failures with --enable-tests from
   unrelated packages (cabal considers all packages defined via
   source-repository-package as *local* and will try to build its tests)
4. fix package constraints in cabal.project.freeze, where stackage
   constraints were overwritten in stack.yaml files (usually raising
   a version number)

Rationale:

1. good to support all available tools as options for interested users
2. cabal allows easier managing of package bounds (and testing against
   latest package versions)
3. #1303 is an excellent workaround for nix users, but requires nix.
   This should be the go-to fallback in case cabal project files
   get out of sync for too long.


Co-authored-by: Julian Ospald <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Rodney Lorrimar <[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.

4 participants