Instead of always keeping track of the next 24 hours of announcements,
we instruct the `oracle::Actor` to fetch (if necessary) announcements
based on new orders.
At the moment this results in removing code which allowed us to fetch
several announcements in parallel, but we will need to reintroduce it
once we let the `daemon`s create CFDs with multiple attestation
events.
281: Monitor CETs based on a script pubkey in the transaction r=luckysori a=luckysori
Fixes#238.
Instead of passing in a script which may or may not be part of a CET (because some CETs only pay to one party), we take the script pubkey from an output of the transaction itself.
Co-authored-by: Lucas Soriano del Pino <l.soriano.del.pino@gmail.com>
Instead of passing in a script which may or may not be part of a
CET (because some CETs only pay to one party), we take the script
pubkey from an output of the transaction itself.
283: Give each app a different name r=luckysori a=luckysori
This might be stupid, but it makes it easier to know who is who.
Co-authored-by: Lucas Soriano del Pino <l.soriano.del.pino@gmail.com>
279: More oracle actor fixes r=thomaseizinger a=thomaseizinger
- Re-organize oracle module a bit
- Parallelize fetching of announcements via self messages
- Add error message to JSON deserializer
- Don't fail attestation sync just because it is not attested yet
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
268: Transition `PendingOpen` to `PendingOpen` upon attestation r=da-kami a=da-kami
In a real-world scenario this should actually never happen, but it is still weird to see `PendingOpen` jump to `Open` when testing with timelocks and attestations.
Since this is "more correct" we distinguish fine-granular.
Co-authored-by: Daniel Karzel <daniel@comit.network>
269: Fix monitoring r=da-kami a=da-kami
In this protocol we *can* actually have transactions with the same script, hence, we have to handle the `GetHistoryRes` by `Txid`.
To make this easier to understand we group the `Vec<Vec<GetHistoryRes>>` by `Txid` into `HashMap<Txid, GetHistroyRes>`.
Note: The assumption is, that only `GetHistroyRes` is returned for the `Txid`+`Script` combination.
fixes#260
Co-authored-by: Daniel Karzel <daniel@comit.network>
270: Some oracle fixes r=thomaseizinger a=thomaseizinger
- Only fetch announcements we don't already have
- Await futures in random order
- Use the same code for computing the next attestation event
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
274: Bump thiserror from 1.0.29 to 1.0.30 r=thomaseizinger a=dependabot[bot]
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.29 to 1.0.30.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/dtolnay/thiserror/releases">thiserror's releases</a>.</em></p>
<blockquote>
<h2>1.0.30</h2>
<ul>
<li>Make <code>#[source]</code> attribute usable on a field of type <code>Box<dyn Error + Send + Sync + UnwindSafe + 'static></code> (<a href="https://github-redirect.dependabot.com/dtolnay/thiserror/issues/155">#155</a>, thanks <a href="https://github.com/cosmicexplorer"><code>`@cosmicexplorer</code></a>)</li>`
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="672e9525bb"><code>672e952</code></a> Release 1.0.30</li>
<li><a href="5c62f5ed44"><code>5c62f5e</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/dtolnay/thiserror/issues/155">#155</a> from cosmicexplorer/derive-unwindsafe</li>
<li><a href="2fd08ccb50"><code>2fd08cc</code></a> add UnwindSafe impl for AsDynError</li>
<li><a href="00956f1f8c"><code>00956f1</code></a> Ui test changes for trybuild 1.0.49</li>
<li><a href="035abbd652"><code>035abbd</code></a> Add actions job to notice outdated dependencies</li>
<li><a href="f072c626ef"><code>f072c62</code></a> Update ui test files</li>
<li><a href="791a98eb93"><code>791a98e</code></a> Update ui test suite to nightly-2021-10-07</li>
<li><a href="ed234d41b5"><code>ed234d4</code></a> Declare minimum Rust version in Cargo metadata</li>
<li><a href="bda41eb005"><code>bda41eb</code></a> Skip clippy job on pull requests</li>
<li>See full diff in <a href="https://github.com/dtolnay/thiserror/compare/1.0.29...1.0.30">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=thiserror&package-manager=cargo&previous-version=1.0.29&new-version=1.0.30)](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>
257: Sign and broadcast collaborative settlement r=klochowicz a=klochowicz
Taker sends his signature to the maker, which allows the maker to sign and
broadcast the settled transaction.
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
We keep seeing this in the logs, after a final tx went in:
```
2021-10-11 16:58:18 ERROR Could not find script in own state for txid b542cbc1920bdd926d79fb17377eda7152ed944ec64a1b09ce68dd11d9e7467e, ignoring
```
This happens because multiple transactions have the same script (e.g. CET, refund).
Once the CET is final we remove it from monitoring, which results in the txid not being available when matching.
We always replaced it with `remaining`, but when populating `awaiting_status` upon sync we only go by the keys, so we actually fill in the script status again.
We should remove the complete entry if we want to make sure that we don't want to process it anymore.
Note: Kept seeing monitoring logs for things that were already past Finality (...) so we looked into this.
In this protocol we *can* actually have transactions with the same script, hence, we have to handle the `GetHistoryRes` by `Txid`.
To make this easier to understand we group the `Vec<Vec<GetHistoryRes>>` by `Txid` into `HashMap<Txid, GetHistroyRes>`.
Note: The assumption is, that only `GetHistroyRes` is returned for the `Txid`+`Script` combination.
In a real-world scenario this should actually never happen, but it is still weird to see `PendingOpen` jump to `Open` when testing with timelocks and attestations.
Since this is "more correct" we distinguish fine-granular.
Co-authored-by: Lucas <lucas@comit.network>
256: 2nd cet trial fixes r=da-kami a=da-kami
I wish I could have had the brainpower and dicipline to do the last commit in multiple atomic commits.
Quite a nightmare "fixing" all these things. Too many moving parts and complex code.
`@thomaseizinger` maybe you can help me split it up?
Co-authored-by: Daniel Karzel <daniel@comit.network>
267: Make HTTP listen address configurable r=bonomat a=bonomat
Maker and taker by default only listened on localhost:XXXX. Given our architecture it is very likely that the taker and maker might run on remote machine.
Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>
The DLC does not concern the UI, hence the amounts should be handles in satoshi.
Note: This commit enforces db reset of CFDs that are stored in `as_btc`.
We are looping over multiple CFDs when trying to publish the CET.
If we fail inside the loop then the next CFD(s) are not processed and CETs might not get published properly.
This should make the code more resilient.
Reasoning:
The state transition can fail, hence the result.
It can, however, happen that there is no failure, but we still did not transition to a new state.
In such cases we don't want to save the state in the database because it would be an unwanted duplicated entry.
The `Attestation` in the `oracle` module has `Desiarialization` rules that conflict with loading it from the db.
We should not reuse domain structs between modules anyway, so this was cleaned up by introducing a dedicated `model::Attestation` and mapping to `oracle::Attestation`.