703: Explicitly drop database connection acquired during application setup r=klochowicz a=klochowicz
The dirty shutdown we observed were caused by the sqlite pool patiently waiting
until we close the connection we've opened in the application setup.
This is turn was eventually triggering Rocket timeout (which is by default
configured to wait 5s for cleanup).
When loading cfds gets moved into the projection actor, the connection can be
moved to a tighter scope (only for the housekeeping functions).
Resolves#477
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
The dirty shutdown we observed were caused by the sqlite pool patiently waiting
until we close the connection we've opened in the application setup.
This is turn was eventually triggering Rocket timeout (which is by default
configured to wait 5s for cleanup).
Tighten the scope of connections needed during application startup only to the
necessary minimum (housekeeping & loading cfds at startup)
1. "Components" refers to React components. "Types" and "HttpError"
are not React components and should thus be moved out.
2. Only components use JSX syntax, other files can/should have a regular
.ts extension.
3. If a file only exports one thing, make it a default export.
699: Bump ndarray from 0.15.3 to 0.15.4 r=thomaseizinger a=dependabot[bot]
Bumps [ndarray](https://github.com/rust-ndarray/ndarray) from 0.15.3 to 0.15.4.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/rust-ndarray/ndarray/blob/master/RELEASES.md">ndarray's changelog</a>.</em></p>
<blockquote>
<h1>Version 0.15.4 (2021-11-23)</h1>
<p>The Dr. Turner release 🚀</p>
<h2>New features</h2>
<ul>
<li>
<p>Complex matrix multiplication now uses BLAS <code>cgemm</code>/<code>zgemm</code> when
enabled (and matrix layout allows), by [<a href="https://github.com/ethanhs"><code>`@ethanhs</code></a>].</p>`
<p><a href="https://github-redirect.dependabot.com/rust-ndarray/ndarray/pull/1106">rust-ndarray/ndarray#1106</a></p>
</li>
<li>
<p>Use <code>matrixmultiply</code> as fallback for complex matrix multiplication
when BLAS is not available or the matrix layout requires it by [<a href="https://github.com/bluss"><code>`@bluss</code></a>]</p>`
<p><a href="https://github-redirect.dependabot.com/rust-ndarray/ndarray/pull/1118">rust-ndarray/ndarray#1118</a></p>
</li>
<li>
<p>Add <code>into/to_slice_memory_order</code> methods for views, lifetime-preserving
versions of existing similar methods by [<a href="https://github.com/jturner314"><code>`@jturner314</code></a>]</p>`
<p><a href="https://github-redirect.dependabot.com/rust-ndarray/ndarray/pull/1015">rust-ndarray/ndarray#1015</a></p>
</li>
<li>
<p><code>kron</code> function for Kronecker product by [<a href="https://github.com/ethanhs"><code>`@ethanhs</code></a>].</p>`
<p><a href="https://github-redirect.dependabot.com/rust-ndarray/ndarray/pull/1105">rust-ndarray/ndarray#1105</a></p>
</li>
<li>
<p><code>split_complex</code> method for splitting complex arrays into separate
real and imag view parts by [<a href="https://github.com/jturner314"><code>`@jturner314</code></a>]` and [<a href="https://github.com/ethanhs"><code>`@ethanhs</code></a>].</p>`
<p><a href="https://github-redirect.dependabot.com/rust-ndarray/ndarray/pull/1107">rust-ndarray/ndarray#1107</a></p>
</li>
<li>
<p>New method <code>try_into_owned_nocopy</code> by [<a href="https://github.com/jturner314"><code>`@jturner314</code></a>]</p>`
<p><a href="https://github-redirect.dependabot.com/rust-ndarray/ndarray/pull/1022">rust-ndarray/ndarray#1022</a></p>
</li>
<li>
<p>New producer and iterable <code>axis_windows</code> by [<a href="https://github.com/VasanthakumarV"><code>`@VasanthakumarV</code></a>]`
and [<a href="https://github.com/jturner314"><code>`@jturner314</code></a>].</p>`
<p><a href="https://github-redirect.dependabot.com/rust-ndarray/ndarray/pull/1022">rust-ndarray/ndarray#1022</a></p>
</li>
<li>
<p>New method <code>Zip::par_fold</code> by [<a href="https://github.com/adamreichold"><code>`@adamreichold</code></a>]</p>`
<p><a href="https://github-redirect.dependabot.com/rust-ndarray/ndarray/pull/1095">rust-ndarray/ndarray#1095</a></p>
</li>
<li>
<p>New constructor <code>from_diag_elem</code> by [<a href="https://github.com/jturner314"><code>`@jturner314</code></a>]</p>`
<p><a href="https://github-redirect.dependabot.com/rust-ndarray/ndarray/pull/1076">rust-ndarray/ndarray#1076</a></p>
</li>
<li>
<p><code>Parallel::with_min_len</code> method for parallel iterators by [<a href="https://github.com/adamreichold"><code>`@adamreichold</code></a>]</p>`
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="075199dcd1"><code>075199d</code></a> 0.15.4</li>
<li><a href="dca300ae2b"><code>dca300a</code></a> doc: Slight tweaks to the introduction paragraphs of ArrayBase</li>
<li><a href="ebe9e98d43"><code>ebe9e98</code></a> Fix typos in push/append docs</li>
<li><a href="25e2863774"><code>25e2863</code></a> doc: Give crate feature flags its own doc page</li>
<li><a href="752809254e"><code>7528092</code></a> API: Rename split_re_im to split_complex</li>
<li><a href="892dab3575"><code>892dab3</code></a> Release notes for 0.15.4</li>
<li><a href="7e70a901f8"><code>7e70a90</code></a> Add in/to_slice_memory_order for ArrayView/Mut</li>
<li><a href="d281b55a54"><code>d281b55</code></a> Fix typo in docs</li>
<li><a href="5e6ebf5296"><code>5e6ebf5</code></a> clippy: if_then_panic is no longer enabled by default (also changed name)</li>
<li><a href="0fe046df5d"><code>0fe046d</code></a> Use matrixmultiply cgemm and improve tests</li>
<li>Additional commits viewable in <a href="https://github.com/rust-ndarray/ndarray/compare/0.15.3...0.15.4">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ndarray&package-manager=cargo&previous-version=0.15.3&new-version=0.15.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
700: Bump @testing-library/jest-dom from 5.15.0 to 5.15.1 in /taker-frontend r=thomaseizinger a=dependabot[bot]
Bumps [`@testing-library/jest-dom](https://github.com/testing-library/jest-dom)` from 5.15.0 to 5.15.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/testing-library/jest-dom/releases"><code>`@testing-library/jest-dom</code>'s` releases</a>.</em></p>
<blockquote>
<h2>v5.15.1</h2>
<h2><a href="https://github.com/testing-library/jest-dom/compare/v5.15.0...v5.15.1">5.15.1</a> (2021-11-23)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>wrong deprecate error message (<a href="https://github-redirect.dependabot.com/testing-library/jest-dom/issues/422">#422</a>) (<a href="dfcefa2e02">dfcefa2</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="dfcefa2e02"><code>dfcefa2</code></a> fix: wrong deprecate error message (<a href="https://github-redirect.dependabot.com/testing-library/jest-dom/issues/422">#422</a>)</li>
<li>See full diff in <a href="https://github.com/testing-library/jest-dom/compare/v5.15.0...v5.15.1">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=`@testing-library/jest-dom&package-manager=npm_and_yarn&previous-version=5.15.0&new-version=5.15.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)`
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
701: Bump @types/node from 16.11.9 to 16.11.10 in /taker-frontend r=thomaseizinger a=dependabot[bot]
Bumps [`@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)` from 16.11.9 to 16.11.10.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=`@types/node&package-manager=npm_and_yarn&previous-version=16.11.9&new-version=16.11.10)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)`
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
702: Bump framer-motion from 5.3.1 to 5.3.2 in /taker-frontend r=thomaseizinger a=dependabot[bot]
Bumps [framer-motion](https://github.com/framer/motion) from 5.3.1 to 5.3.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/framer/motion/blob/main/CHANGELOG.md">framer-motion's changelog</a>.</em></p>
<blockquote>
<h2>[5.3.2] 2021-11-23</h2>
<h3>Fixed</h3>
<ul>
<li>Ensuring forced renders are batched so sibling <code>AnimatePresence</code> renders are triggered together. <a href="https://github-redirect.dependabot.com/framer/motion/issues/1358">Issue</a></li>
<li>Viewport enter/leave event handlers are passed <code>IntersectionObserverEntry</code> or <code>null</code> if <code>IntersectionObserver</code> is not supported on the device. <a href="https://github-redirect.dependabot.com/framer/motion/issues/1364">Issue</a></li>
<li>No longer applying touch scroll-disabling styles if <code>dragListener</code> is set to <code>false</code>. <a href="https://github-redirect.dependabot.com/framer/motion/issues/1341">Issue</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="bfece69ac7"><code>bfece69</code></a> 5.3.2</li>
<li><a href="2a85032769"><code>2a85032</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/framer/motion/issues/1363">#1363</a> from framer/fix/drag-listener-styles</li>
<li><a href="96b7ace45e"><code>96b7ace</code></a> Fixing test</li>
<li><a href="7baa5b2643"><code>7baa5b2</code></a> Fixing server test</li>
<li><a href="89f7c058c3"><code>89f7c05</code></a> Updating changelog</li>
<li><a href="8980c44f08"><code>8980c44</code></a> Removing touch scroll disabling styles if dragListener is false</li>
<li><a href="ff3a0e5bee"><code>ff3a0e5</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/framer/motion/issues/1365">#1365</a> from framer/fix/viewport-listener-arg</li>
<li><a href="eefe7e00d1"><code>eefe7e0</code></a> Passing IntersectionObserverEntry to viewport listener</li>
<li><a href="68f5f8c9fe"><code>68f5f8c</code></a> Updating changelog</li>
<li><a href="9d68183d25"><code>9d68183</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/framer/motion/issues/1361">#1361</a> from framer/fix/layout-group-animate-presence</li>
<li>Additional commits viewable in <a href="https://github.com/framer/motion/compare/v5.3.1...v5.3.2">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=framer-motion&package-manager=npm_and_yarn&previous-version=5.3.1&new-version=5.3.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
694: Clean up the test harness before allowing config tailoring r=klochowicz a=klochowicz
Some of the tests will use the same parameters as production code to reproduce
and fix issues such as heartbeat timeout during contract setup.
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
695: Remove `maker_cfd::CfdAction` enum r=thomaseizinger a=thomaseizinger
Originally we thought we need this enum because we would need to use
`MessageChannel`s from the rocket layer. But we can actually fully
qualify the address without issues.
We also introduce `xtra_productivity` to remove some of the indirection
that is happening in this file.
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Originally we thought we need this enum because we would need to use
`MessageChannel`s from the rocket layer. But we can actually fully
qualify the address without issues.
We also introduce `xtra_productivity` to remove some of the indirection
that is happening in this file.
690: Move settlement oracle event id into the Dlc r=da-kami a=da-kami
Oracle event-id and Dlc have to exist together, one without the other is incomplete, hence we move the event id inside.
Note that the ID is actually already know to the Dlc as part of the `cet` hashmap, but this was not cleaned up in this patch.
This patch goes towards getting the model boundaries right to transition the architecture towards an event model.
Note: This would theoretically allow us to land auto-rollover, because we don't now pass the correct event-id through. However, we decided that it's better to pull the architecture refactoring through before landing the rollover feature 😬
Co-authored-by: Daniel Karzel <daniel@comit.network>
663: Add connected takers feed r=klochowicz a=klochowicz
- add a new watch channel with information about connected takers from the maker's actor system
- test the watch channel behaviour with a unit test
- add a list of connected takers to maker's UI (for testing/monitoring)
This PR will enable us to write more elaborate assertions (e.g. reconnection of the same taker & resuming its operation) and also enables us to gauge the length & amount of inteactions with the maker
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
Note: Projection actor is used across both taker and maker, so it really should
publish information about connected counterparty.
Taker should use that channel for deriving maker online status.
Oracle event-id and Dlc have to exist together, one without the other is incomplete, hence we move the event id inside.
Note that the ID is actually already know to the Dlc as part of the `cet` hashmap, but this was not cleaned up in this patch.
This patch goes towards getting the model boundaries right to transition the architecture towards an event model.
1. This does not contain JSX syntax so no need for ts_x_.
2. It default-exports a function, implying that we are not going
to export anything else, thus we can rename it to the hook that we
are exporting.
Instead of blocking and awaiting for connection to maker before the start, spawn
the connection attempt in a separate task that will also attempt to reconnect if
the maker goes offline.
Extend the unit test to cover the new behaviour.
Do not shutdown the taker upon connection loss anymore.
Co-authored-by: rishflab <rishflab@hotmail.com>
687: Implement sqlx::Type for more datatypes r=da-kami a=thomaseizinger
This maker our DB code slightly simpler because we can directly use
our newtypes in the query and they are also constructed right away
by sqlx.
`@da-kami` `@klochowicz` Could one of you run `./prepare-db.sh` locally? It doesn't work on my machine for some reason ...
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
686: Only pass the necessary parameters to setup/rollover r=da-kami a=da-kami
Defines the boundaries more clearly which makes it easier when transitioning to the new model.
Co-authored-by: Daniel Karzel <daniel@comit.network>
573: Should not be able to trigger close in `PendingOpen` r=scratchscratchscratchy a=scratchscratchscratchy
fixes https://github.com/itchysats/itchysats/issues/517
Triggering a settlement proposal prior to being `Open` does not make sense.
Co-authored-by: scratchy <scratchy@itchysats.network>
It only makes sense to allow proposing a settlement when in `Open` state.
Theoretically we could argue that it should be allowed in `PendingRefund` and `PendingCommit`, but I don't see an advantage in that.
Note: This only guards the taker side, no guards were added to the maker side because it remains unclear if the deamon should contain logic for this, or we always want to handle acceptance criteria for settlement from the outside.
666: Fixed settlement interval r=da-kami a=da-kami
This work was done as pre-work for #627 which is currently blocked by the model refactor.
I think we should still get these changes in!
Co-authored-by: Daniel Karzel <daniel@comit.network>
A configurable settlement interval for the maker causes friction when implementing auto-rollover, because the settlement interval is not known to the taker.
The settlement interval should not be configurable, thus the configurable settlement interval is removed on the maker side.
The cfd actors and oracle actor use a global constant to decide the settlement interval and oracle even lookahead.
Not pulling the constant into the actors is a conscious decision, it allows us to set this to a different value in the actor tests.
The fact that we use the same constant for cfd actor and oracle actor is an implementation detail.