-
Notifications
You must be signed in to change notification settings - Fork 214
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
Conversation
Left e -> throw e | ||
Right intersection -> pure $ Cursor intersection | ||
|
||
_nextBlocks _ = do |
There was a problem hiding this comment.
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 expectRetryImmediately :: FollowAction
will silently not work as expected when passed tofollow
🤷♂
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a note.
There was a problem hiding this comment.
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.
b2f287f
to
b61ea6e
Compare
3354c12
to
5bd164a
Compare
bors try |
tryBuild failed |
3e10d66
to
d83459f
Compare
bors try |
tryBuild failed |
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.
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]>
Build failed
|
I was not able to reproduce locally. I thought this was a flaky test. But it is here failing reliably 🤔 |
bors try |
tryBuild failed
|
To get more info on integration failures
bors try |
tryBuild succeeded |
bors try |
tryBuild succeeded |
bors r+ |
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]>
Build succeeded |
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.
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.
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.
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.
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.
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.
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.
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.
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]>
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.