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

chore: update feature-dan to development #6280

Merged
merged 18 commits into from
Apr 15, 2024

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Apr 15, 2024

Motivation and Context

There was a bug in the wallet when using non-interactive that was fixed in #6245

How Has This Been Tested?

What process can a PR reviewer use to test or verify this change?

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

dependabot bot and others added 17 commits March 26, 2024 13:36
…i_ledger_wallet (tari-project#6236)

Bumps [borsh](https://github.com/near/borsh-rs) from 0.10.3 to 1.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/near/borsh-rs/releases">borsh's
releases</a>.</em></p>
<blockquote>
<h2>borsh-derive-v1.0.0</h2>
<p>No release notes provided.</p>
<h2>borsh-v1.0.0</h2>
<blockquote>
<p>The year is 2653 and the best yet-to-be citizens of the Terran
Federation are fighting
and mostly just dying in a relentless interstellar war against the
Arachnids.
Yet the structure of our society has changed through the course of this
confrontation.</p>
<p>The members of the Arachnid brain caste and queens have infiltrated
the circles of our
most influential political and industrial leaders. Either directly, or
via the Arachnid technology
called &quot;Brain Bugs&quot;. This tech alone can accomplish what the
Arachnid starship paratroopers
will not ever be capable to do.</p>
<p>Simple, straightforward and performant serialization libraries can
set us in course to remedy this dangerous
stalemate situation by cleaning the minds of its users from even the
tiniest of Brain Bugs.</p>
</blockquote>
<h2>Robert A. Heinlein, 1959 (a newspaper ad)</h2>
<h3>[Thanks]</h3>
<p><code>borsh-rs</code> <code>1.0.0</code> release was first conceived
and then brought into existence by minds of:</p>
<ul>
<li>Amirhossein Akhlaghpour <a
href="https://github.com/Mehrbod2002"><code>@​Mehrbod2002</code></a></li>
<li>Benji Smith <a
href="https://github.com/Benjins"><code>@​Benjins</code></a></li>
<li>dj8yf0μl <a
href="https://github.com/dj8yfo"><code>@​dj8yfo</code></a></li>
<li>iho <a href="https://github.com/iho"><code>@​iho</code></a></li>
<li>Jacob Lindahl <a
href="https://github.com/encody"><code>@​encody</code></a></li>
<li>Pavel Lazureykis <a
href="https://github.com/lazureykis"><code>@​lazureykis</code></a></li>
<li>Tomas Zemanovic <a
href="https://github.com/tzemanovic"><code>@​tzemanovic</code></a></li>
</ul>
<p>Contributors, who imposed powerful impact on the past, present and
future of this library are specially recognized:</p>
<ul>
<li>Michal Nazarewicz <a
href="https://github.com/mina86"><code>@​mina86</code></a> - for
revisiting <code>BorshSchema</code> feature, rethinking it, bringing up
great ideas and coming up with the
fairly involved algorithm of <code>max_serialized_size</code>
implementation.</li>
<li>Alex Kladov <a
href="https://github.com/matklad"><code>@​matklad</code></a> - for
maintaining a superhuman ability of context switching in under 2 minutes
and scanning through 15k lines of code
in under 10 minutes, while leaving out under 1% relevant details.</li>
<li>Marco Ieni <a
href="https://github.com/MarcoIeni"><code>@​MarcoIeni</code></a> - for
developing <a
href="https://github.com/MarcoIeni/release-plz">release-plz</a>
automation.</li>
<li>Vlad Frolov <a
href="https://github.com/frol"><code>@​frol</code></a> - for keeping an
eye on the big picture and striking just the right balance between
performance and versatility, ease of use and extensibility and tons of
other such hard to reconcile pairs.</li>
</ul>
<h3>[Migration guides]</h3>
<p>This section contains links to short documents, describing problems
encountered during update of <code>borsh</code>
version to <code>v1.0.0</code> for related repositories.</p>
<ul>
<li><a
href="https://github.com/near/borsh-rs/blob/master/docs/migration_guides/v0.10.2_to_v1.0.0_nearcore.md">v0.10.2
-&gt; v1.0.0 for <code>nearcore</code></a></li>
<li><a
href="https://github.com/near/borsh-rs/blob/master/docs/migration_guides/v0.9_to_v1.0.0_near_sdk_rs.md">v0.9.3
-&gt; v1.0.0 for <code>near-sdk-rs</code></a></li>
</ul>
<h3>[Summary of changes]</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/near/borsh-rs/blob/master/CHANGELOG.md">borsh's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/near/borsh-rs/compare/borsh-v0.10.3...borsh-v1.0.0">1.0.0</a>
- 2023-10-03</h2>
<blockquote>
<p>The year is 2653 and the best yet-to-be citizens of the Terran
Federation are fighting
and mostly just dying in a relentless interstellar war against the
Arachnids.
Yet the structure of our society has changed through the course of this
confrontation.</p>
<p>The members of the Arachnid brain caste and queens have infiltrated
the circles of our
most influential political and industrial leaders. Either directly, or
via the Arachnid technology
called &quot;Brain Bugs&quot;. This tech alone can accomplish what the
Arachnid starship paratroopers
will not ever be capable to do.</p>
<p>Simple, straightforward and performant serialization libraries can
set us in course to remedy this dangerous
stalemate situation by cleaning the minds of its users from even the
tiniest of Brain Bugs.</p>
</blockquote>
<h2>Robert A. Heinlein, 1959 (a newspaper ad)</h2>
<h3>[Thanks]</h3>
<p><code>borsh-rs</code> <code>1.0.0</code> release was first conceived
and then brought into existence by minds of:</p>
<ul>
<li>Amirhossein Akhlaghpour <a
href="https://github.com/Mehrbod2002"><code>@​Mehrbod2002</code></a></li>
<li>Benji Smith <a
href="https://github.com/Benjins"><code>@​Benjins</code></a></li>
<li>dj8yf0μl <a
href="https://github.com/dj8yfo"><code>@​dj8yfo</code></a></li>
<li>iho <a href="https://github.com/iho"><code>@​iho</code></a></li>
<li>Jacob Lindahl <a
href="https://github.com/encody"><code>@​encody</code></a></li>
<li>Pavel Lazureykis <a
href="https://github.com/lazureykis"><code>@​lazureykis</code></a></li>
<li>Tomas Zemanovic <a
href="https://github.com/tzemanovic"><code>@​tzemanovic</code></a></li>
</ul>
<p>Contributors, who imposed powerful impact on the past, present and
future of this library are specially recognized:</p>
<ul>
<li>Michal Nazarewicz <a
href="https://github.com/mina86"><code>@​mina86</code></a> - for
revisiting <code>BorshSchema</code> feature, rethinking it, bringing up
great ideas and coming up with the
fairly involved algorithm of <code>max_serialized_size</code>
implementation.</li>
<li>Alex Kladov <a
href="https://github.com/matklad"><code>@​matklad</code></a> - for
maintaining a superhuman ability of context switching in under 2 minutes
and scanning through 15k lines of code
in under 10 minutes, while leaving out under 1% relevant details.</li>
<li>Marco Ieni <a
href="https://github.com/MarcoIeni"><code>@​MarcoIeni</code></a> - for
developing <a
href="https://github.com/MarcoIeni/release-plz">release-plz</a>
automation.</li>
<li>Vlad Frolov <a
href="https://github.com/frol"><code>@​frol</code></a> - for keeping an
eye on the big picture and striking just the right balance between
performance and versatility, ease of use and extensibility and tons of
other such hard to reconcile pairs.</li>
</ul>
<h3>[Migration guides]</h3>
<p>This section contains links to short documents, describing problems
encountered during update of <code>borsh</code>
version to <code>v1.0.0</code> for related repositories.</p>
<ul>
<li><a
href="https://github.com/near/borsh-rs/blob/master/docs/migration_guides/v0.10.2_to_v1.0.0_nearcore.md">v0.10.2
-&gt; v1.0.0 for <code>nearcore</code></a></li>
<li><a
href="https://github.com/near/borsh-rs/blob/master/docs/migration_guides/v0.9_to_v1.0.0_near_sdk_rs.md">v0.9.3
-&gt; v1.0.0 for <code>near-sdk-rs</code></a></li>
</ul>
<h3>[Summary of changes]</h3>
<ul>
<li>Library's structure was made more modular and optimized with respect
to visibility</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/near/borsh-rs/commit/6e7fc2844555bcd621405988220f6a4fc7ed67ba"><code>6e7fc28</code></a>
chore: release 1.0.0 (<a
href="https://redirect.github.com/near/borsh-rs/issues/240">#240</a>)</li>
<li><a
href="https://github.com/near/borsh-rs/commit/773827ca95caafc6c20153292223e229719efd66"><code>773827c</code></a>
doc: <code>nearcore</code> migration guide to 1.0.0 (<a
href="https://redirect.github.com/near/borsh-rs/issues/198">#198</a>)</li>
<li><a
href="https://github.com/near/borsh-rs/commit/031230de04c572f47183e428a4364b987e835d90"><code>031230d</code></a>
doc: <code>near-sdk-rs</code> migration guide to <code>1.0.0</code> (<a
href="https://redirect.github.com/near/borsh-rs/issues/201">#201</a>)</li>
<li><a
href="https://github.com/near/borsh-rs/commit/75d91ec5cb482817e8ebcc52d965f9935675ae5f"><code>75d91ec</code></a>
chore: release (<a
href="https://redirect.github.com/near/borsh-rs/issues/239">#239</a>)</li>
<li><a
href="https://github.com/near/borsh-rs/commit/079c278e007a7efc5d9744aa4ab44d350508a3a8"><code>079c278</code></a>
doc: add examples for <code>borsh::to_vec</code>,
<code>borsh::to_writer</code>, `borsh::object_len...</li>
<li><a
href="https://github.com/near/borsh-rs/commit/57f9c258d779c4b7daec38ad16433475b4e14599"><code>57f9c25</code></a>
chore!: completely remove deprecated
<code>BorshSerialize::try_to_vec</code> (<a
href="https://redirect.github.com/near/borsh-rs/issues/221">#221</a>)</li>
<li><a
href="https://github.com/near/borsh-rs/commit/bb5248e3bde451e992f5636dbc74ecdcfc59645b"><code>bb5248e</code></a>
feat: add <code>borsh::object_length</code> helper (<a
href="https://redirect.github.com/near/borsh-rs/issues/236">#236</a>)</li>
<li><a
href="https://github.com/near/borsh-rs/commit/d2c63ac50361961380cfd558c3ed56c62ff55557"><code>d2c63ac</code></a>
chore: release (<a
href="https://redirect.github.com/near/borsh-rs/issues/217">#217</a>)</li>
<li><a
href="https://github.com/near/borsh-rs/commit/63cf36dcdc4a0960c623fb59b8192adcdf3d38fd"><code>63cf36d</code></a>
chore!: rename <code>&quot;Tuple\&lt;T0, T1, T2...&gt;&quot;</code>
-&gt; <code>&quot;(T0, T1, T2...)&quot;</code> (`schema::Decl...</li>
<li><a
href="https://github.com/near/borsh-rs/commit/499f446a5ff6d920177790270179d20d50c6276f"><code>499f446</code></a>
chore!: rename <code>&quot;nil&quot;</code> -&gt;
<code>&quot;()&quot;</code>, <code>&quot;string&quot;</code> -&gt;
<code>&quot;String&quot;</code>, <code>&quot;nonzero_u16&quot;</code>
-...</li>
<li>Additional commits viewable in <a
href="https://github.com/near/borsh-rs/compare/borsh-v0.10.3...borsh-v1.0.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=borsh&package-manager=cargo&previous-version=0.10.3&new-version=1.0.0)](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 show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@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)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/tari-project/tari/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Description
---
Added dynamic growth size to LMBD, where it will grow with the
configured size as well an optional shortfall size that could not be
written. This is especially relevant during block sync of many full
blocks where the output SMT has grown very large.

Motivation and Context
---
Block sync did not work with many full blocks.
```rust
2024-03-25 07:27:14.304496100 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 5 time(s) in this transaction)
2024-03-25 07:27:14.317099900 [lmdb] DEBUG (\node_05\esmeralda\data/base_node\db) LMDB MB, mapsize was grown from 1616 MB to 1632 MB, increased by 16 MB
2024-03-25 07:27:14.319843700 [c::bn::block_sync] WARN  Chain storage error: DB transaction was too large (3 operations)
2024-03-25 07:27:14.319864400 [c::bn::block_sync] WARN  Block sync failed: No more sync peers available: Block sync failed
2024-03-25 07:27:14.319969400 [c::cs::database] INFO  Rewinding headers from height 6325 to 1627
```

How Has This Been Tested?
---
System-level archival sync-from-scratch test on esmeralda after a
coin-split and transaction stress test.

Before the fix, blocks tari-project#1544 to tari-project#1584. Multiple resizes for the same set
of write operations was required, with the final one resulting in block
sync failure.
```rust
2024-03-25 07:19:35.346281600 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 1 time(s) in this transaction)
2024-03-25 07:19:35.654103900 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 2 time(s) in this transaction)
2024-03-25 07:19:35.952783600 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 3 time(s) in this transaction)
2024-03-25 07:19:41.198100900 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 1 time(s) in this transaction)
2024-03-25 07:19:41.519953900 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 2 time(s) in this transaction)
2024-03-25 07:19:41.827079500 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 3 time(s) in this transaction)
2024-03-25 07:19:42.136522700 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 4 time(s) in this transaction)
2024-03-25 07:20:29.331297000 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 1 time(s) in this transaction)
2024-03-25 07:20:29.755442600 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 2 time(s) in this transaction)
2024-03-25 07:20:30.119457000 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 3 time(s) in this transaction)
2024-03-25 07:20:30.491588200 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 4 time(s) in this transaction)
2024-03-25 07:20:30.868365300 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 5 time(s) in this transaction)
```
After the fix, blocks tari-project#1544 to tari-project#1584. Only a single resize each time for
a set of write operations was required.
```rust
2024-03-25 16:40:28.814566400 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 1 time(s) in this transaction)
2024-03-25 16:42:05.167759000 [c::cs::lmdb_db::lmdb_db] INFO  Database resize required (resized 1 time(s) in this transaction)
```

What process can a PR reviewer use to test or verify this change?
---
Code review

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
Description
---
remove ahash as dependancy


ahash is not used directly but is a sub dependency,
Description
---
- Improved wallet sql queries in:
  - `fn update_last_validation_timestamps`
- `async fn select_utxos` + `pub fn fetch_unspent_outputs_for_spending`
- Added the `balance_enquiry_cooldown_period` config option back in that
was removed by a previous PR to minimize balance query impacts for busy
console wallets.

Motivation and Context
---
The console wallet could not efficiently submit transactions if it had
many unspent outputs (> 80,000) in its database.

How Has This Been Tested?
---
System-level stress testing. Previously, each of these selections,
`fetch_unspent_outputs_for_spending` up to `final_selection`, would take
multiple seconds.
```rust
2024-03-21 06:44:12.344337500 [wallet::output_manager_service] TRACE select_utxos profile - fetch_unspent_outputs_for_spending: 4000 outputs, 577 ms (at 577)
2024-03-21 06:44:12.346397400 [wallet::output_manager_service] TRACE select_utxos profile - final_selection: 1 outputs from 4000, 2 ms (at 579)
2024-03-21 06:44:13.547512200 [wallet::output_manager_service] TRACE select_utxos profile - fetch_unspent_outputs_for_spending: 4000 outputs, 557 ms (at 557)
2024-03-21 06:44:13.549151900 [wallet::output_manager_service] TRACE select_utxos profile - final_selection: 1 outputs from 4000, 1 ms (at 559)
2024-03-21 06:44:15.137607600 [wallet::output_manager_service] TRACE select_utxos profile - fetch_unspent_outputs_for_spending: 4000 outputs, 552 ms (at 552)
2024-03-21 06:44:15.139724100 [wallet::output_manager_service] TRACE select_utxos profile - final_selection: 1 outputs from 4000, 2 ms (at 554)
2024-03-21 06:44:16.432081200 [wallet::output_manager_service] TRACE select_utxos profile - fetch_unspent_outputs_for_spending: 4000 outputs, 593 ms (at 593)
2024-03-21 06:44:16.433796800 [wallet::output_manager_service] TRACE select_utxos profile - final_selection: 1 outputs from 4000, 1 ms (at 594)
2024-03-21 06:44:17.691752400 [wallet::output_manager_service] TRACE select_utxos profile - fetch_unspent_outputs_for_spending: 4000 outputs, 583 ms (at 583)
2024-03-21 06:44:17.693400000 [wallet::output_manager_service] TRACE select_utxos profile - final_selection: 1 outputs from 4000, 1 ms (at 584)
```

What process can a PR reviewer use to test or verify this change?
---
Code review.
System-level stress test (optional).

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
Description
---
This adds a new grpc call to take a block template and add coinbases to
it as desired. The callee is required to ensure that the coinbases
amounts provided are correct and per consensus.

Motivation and Context
---
This is to allow external miners to create a block with 1 sided coinbase
utxo's to be added without having to create them as this necessitates
the inclusion of all Tari crypto libraries.

How Has This Been Tested?
---
New unit and cucumber tests
)

Description
---
Added validation checks to ensure an input in a block that is also an
output in the same block will be accepted when syncing blocks.

Motivation and Context
---
Blocks with zero confirmation inputs and outputs could not be synced
with block sync.

Previous for block `tari-project#3316` and input/output
`00eaffe31d4c535fb678248078524f9b91f183ca344e6ed52c4ca56f6e50a425`:
```rust
2024-03-26 11:40:08.989607400 [c::cs::lmdb_db::lmdb_db] DEBUG Fetch output: 00eaffe31d4c535fb678248078524f9b91f183ca344e6ed52c4ca56f6e50a425
2024-03-26 11:40:08.989617600 [c::cs::lmdb_db::lmdb_db] DEBUG Fetch output: 00eaffe31d4c535fb678248078524f9b91f183ca344e6ed52c4ca56f6e50a425 NOT found in index
2024-03-26 11:40:08.991003900 [c::cs::lmdb_db::lmdb_db] TRACE [apply_db_transaction] WriteOperation: Delete orphan with hash: 8a0ac6b1581eedffffcde3b05613b5ec525cd0575cb5a93a5f2bcbe0917957f6
2024-03-26 11:40:08.991035700 [c::cs::lmdb_db::lmdb_db] DEBUG delete_orphan: request to delete orphan block 8a0ac6b1581eedffffcde3b05613b5ec525cd0575cb5a93a5f2bcbe0917957f6 that was not found.
2024-03-26 11:40:08.991047800 [c::cs::lmdb_db::lmdb_db] TRACE [apply_db_transaction] WriteOperation: Insert bad block tari-project#3316 8a0ac6b1581eedffffcde3b05613b5ec525cd0575cb5a93a5f2bcbe0917957f6
2024-03-26 11:40:08.991068000 [c::cs::lmdb_db::lmdb_db] DEBUG Cleaned out 0 stale bad blocks
2024-03-26 11:40:08.993916100 [c::cs::lmdb_db::lmdb_db] TRACE Database completed 2 operation(s) in 3ms
2024-03-26 11:40:08.996400500 [c::bn::block_sync] WARN  Block validation failed: Contains an unknown input
2024-03-26 11:40:08.997329500 [c::bn::block_sync] WARN  Block validation failed: Contains an unknown input
2024-03-26 11:40:08.997882300 [c::bn::sync] DEBUG Sync peer 7dcc333714f9b31ebda93edec1 removed from the sync peer list because Contains an unknown input
2024-03-26 11:40:08.997900900 [c::bn::sync] WARN  Banned sync peer 7dcc333714f9b31ebda93edec1 for 7200s because Contains an unknown input
2024-03-26 11:40:08.997914500 [c::bn::block_sync] WARN  Block sync failed: No more sync peers available: Block sync failed
```
This PR:
```rust
2024-03-26 13:57:51.006006700 [c::cs::lmdb_db::lmdb_db] DEBUG Fetch output: 00eaffe31d4c535fb678248078524f9b91f183ca344e6ed52c4ca56f6e50a425
2024-03-26 13:57:51.006025600 [c::cs::lmdb_db::lmdb_db] DEBUG Fetch output: 00eaffe31d4c535fb678248078524f9b91f183ca344e6ed52c4ca56f6e50a425 NOT found in index
2024-03-26 13:57:51.008880000 [c::cs::lmdb_db::lmdb_db] DEBUG Fetch output: 00f6bce621663a88a0dd0a156d3d4adabb7fc7f38077052f54da5297c52def10
2024-03-26 13:57:51.008910600 [c::cs::lmdb_db::lmdb_db] DEBUG Fetch output: 00f6bce621663a88a0dd0a156d3d4adabb7fc7f38077052f54da5297c52def10 Found (0ee73f94629ecacd0d9118d5852e42831b8f71a0ce56e2b18cc20506b1d3135c00f6bce621663a88a0dd0a156d3d4adabb7fc7f38077052f54da5297c52def10)
...
2024-03-26 13:57:51.463387100 [c::cs::lmdb_db::lmdb_db] DEBUG Fetch output: 00eaffe31d4c535fb678248078524f9b91f183ca344e6ed52c4ca56f6e50a425 NOT found in index
2024-03-26 13:57:51.463541300 [c::val::helpers] WARN  Input: (6c8f19486e43c051fb9f308d5eaa6b06a726d0cf1c17c713453d904faf405c56, 00eaffe31d4c535fb678248078524f9b91f183ca344e6ed52c4ca56f6e50a425) does not exist in the database yet
...
2024-03-26 13:57:55.618675800 [c::cs::lmdb_db::lmdb_db] TRACE Inserting output (`6c8f19486e43c051fb9f308d5eaa6b06a726d0cf1c17c713453d904faf405c56`, `00eaffe31d4c535fb678248078524f9b91f183ca344e6ed52c4ca56f6e50a425`)
2024-03-26 13:57:55.618713200 [c::cs::lmdb_db::lmdb] TRACE Inserted 72 bytes with key '00eaffe31d4c535fb678248078524f9b91f183ca344e6ed52c4ca56f6e50a425' into 'txos_hash_to_index_db'
2024-03-26 13:57:55.618729500 [c::cs::lmdb_db::lmdb] TRACE Inserted 1121 bytes with key '8a0ac6b1581eedffffcde3b05613b5ec525cd0575cb5a93a5f2bcbe0917957f600eaffe31d4c535fb678248078524f9b91f183ca344e6ed52c4ca56f6e50a425' into 'utxos_db'
2024-03-26 13:57:55.745300700 [c::cs::lmdb_db::lmdb_db] TRACE Inserting input (`6c8f19486e43c051fb9f308d5eaa6b06a726d0cf1c17c713453d904faf405c56`, `00eaffe31d4c535fb678248078524f9b91f183ca344e6ed52c4ca56f6e50a425`)
2024-03-26 13:57:55.745324500 [c::cs::lmdb_db::lmdb] TRACE Inserted 72 bytes with key '00eaffe31d4c535fb678248078524f9b91f183ca344e6ed52c4ca56f6e50a425' into 'deleted_txo_hash_to_header_index'
```

How Has This Been Tested?
---
System-level testing

What process can a PR reviewer use to test or verify this change?
---
Code review

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->

Co-authored-by: SW van Heerden <swvheerden@gmail.com>
Description
---
Bumps the nightly toolchain to `nightly-2024-02-04` in preparation for a
curve library update.

Motivation and Context
---
An upcoming curve library update in tari-project#6228 will require moving the
nightly toolchain. In preparation, this PR moves it as far as it can go
without breaking. This lets us take care of lints now.

How Has This Been Tested?
---
Existing CI (but with the updated toolchain) passes.

What process can a PR reviewer use to test or verify this change?
---
Check that CI passes, that the nightly toolchain update is consistently
applied, and that all code changes reflect only lint fixes.
Description
---
Under certain conditions, it is possible to let the mempool panic when
is inserting an empty transaction. This PR prevents it.

Motivation and Context
---
HAZOP finding

How Has This Been Tested?
---
Unit tests added

What process can a PR reviewer use to test or verify this change?
---
Review code changes and unit tests

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
Description
---
- Allow wallet type from the wallet database to have preference. This
will allow old wallets without wallet-type fields to be accepted as
software wallets when added to the config file.
- Set `newline_style = "Auto"` as we do not use JavaScript cucumber
anymore; this was an issue on Windows.

Motivation and Context
---
- Wallets prior to the wallet-type PR could not be used.
- Performing `cargo fmt` in Windows where the git preference has been
set to _check out as is and commit unix style_ forced `CRLF`. `Auto`
will give preference to the actual line-endings.

How Has This Been Tested?
---
System-level testing

What process can a PR reviewer use to test or verify this change?
---

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
Description
---
- Improved the LMDB resizing during block sync of many consecutive full
blocks; this is required due to how the SMT works currently as it is
replaced for every new block.
- Added SMT database write profiling measurements.

Motivation and Context
---
See above.

How Has This Been Tested?
---
- System-level testing in Windows and Ubuntu - archival node fresh block
sync of many full blocks as generated during a stress test on
`esmeralda`.
- `fn insert_tip_smt(&self, txn: &WriteTransaction<'_>, smt:
&OutputSmt)` always succeeded with these settings.


![image](https://github.com/tari-project/tari/assets/39146854/fadd5c51-f98b-43b3-8cae-1c4fcdf58850)


![image](https://github.com/tari-project/tari/assets/39146854/411a1ef2-663c-4c34-838b-fde74042da99)


What process can a PR reviewer use to test or verify this change?
---
Code review

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
Bumps [h2](https://github.com/hyperium/h2) from 0.3.24 to 0.3.26.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/hyperium/h2/releases">h2's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.26</h2>
<h2>What's Changed</h2>
<ul>
<li>Limit number of CONTINUATION frames for misbehaving
connections.</li>
</ul>
<p>See <a
href="https://seanmonstar.com/blog/hyper-http2-continuation-flood/">https://seanmonstar.com/blog/hyper-http2-continuation-flood/</a>
for more info.</p>
<h2>v0.3.25</h2>
<h2>What's Changed</h2>
<ul>
<li>perf: optimize header list size calculations by <a
href="https://github.com/Noah-Kennedy"><code>@​Noah-Kennedy</code></a>
in <a
href="https://redirect.github.com/hyperium/h2/pull/750">hyperium/h2#750</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/hyperium/h2/compare/v0.3.24...v0.3.25">https://github.com/hyperium/h2/compare/v0.3.24...v0.3.25</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/hyperium/h2/blob/v0.3.26/CHANGELOG.md">h2's
changelog</a>.</em></p>
<blockquote>
<h1>0.3.26 (April 3, 2024)</h1>
<ul>
<li>Limit number of CONTINUATION frames for misbehaving
connections.</li>
</ul>
<h1>0.3.25 (March 15, 2024)</h1>
<ul>
<li>Improve performance decoding many headers.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/hyperium/h2/commit/357127e279c06935830fe2140378312eac801494"><code>357127e</code></a>
v0.3.26</li>
<li><a
href="https://github.com/hyperium/h2/commit/1a357aaefc7243fdfa9442f45d90be17794a4004"><code>1a357aa</code></a>
fix: limit number of CONTINUATION frames allowed</li>
<li><a
href="https://github.com/hyperium/h2/commit/5b6c9e0da092728d702dff3607626aafb7809d77"><code>5b6c9e0</code></a>
refactor: cleanup new unused warnings (<a
href="https://redirect.github.com/hyperium/h2/issues/757">#757</a>)</li>
<li><a
href="https://github.com/hyperium/h2/commit/3a798327211345b9b2bf797e2e4f3aca4e0ddfee"><code>3a79832</code></a>
v0.3.25</li>
<li><a
href="https://github.com/hyperium/h2/commit/94e80b1c72bec282bb5d13596803e6fb341fec4c"><code>94e80b1</code></a>
perf: optimize header list size calculations (<a
href="https://redirect.github.com/hyperium/h2/issues/750">#750</a>)</li>
<li>See full diff in <a
href="https://github.com/hyperium/h2/compare/v0.3.24...v0.3.26">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=h2&package-manager=cargo&previous-version=0.3.24&new-version=0.3.26)](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 show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@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)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/tari-project/tari/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ari-project#6248)

Description
---
- Fixed an error where the monerod server connection attempt would not
timeout if it did not succeed.
- Added dynamic and robust monerod detection to the merge mining proxy
as an optional alternative to the monerod URLs specified in the config.
If enabled, dynamically detected monerod servers will be ordered
according to the best response times.

Motivation and Context
---
Merge mining with monero mining recently had issues (stopped) due to a
configured public monerod server not stopped being responsive anymore.

How Has This Been Tested?
---
- Added new unit tests for dynamic monerod detection
- Performed system-level testing

Example unit test output:
```rust
0: MonerodEntry { address_type: "clear", url: "http://213.227.135.106:18081", height: 3119866, up: true, web_compatible: false, network: "mainnet", last_checked: "5 hours ago", up_history: [true, true, true, true, true, true], response_time: Some(429.0735ms) }
1: MonerodEntry { address_type: "clear", url: "http://hatchi-home.ddns.net:18089", height: 3119865, up: true, web_compatible: false, network: "mainnet", last_checked: "5 hours ago", up_history: [true, true, true, true, true, true], response_time: Some(492.1296ms) }
2: MonerodEntry { address_type: "clear", url: "http://01.its-a-node.org:18081", height: 3119865, up: true, web_compatible: false, network: "mainnet", last_checked: "5 hours ago", up_history: [true, true, true, true, true, true], response_time: Some(526.3674ms) }
3: MonerodEntry { address_type: "clear", url: "http://moneronode.xyz:18089", height: 3119865, up: true, web_compatible: false, network: "mainnet", last_checked: "5 hours ago", up_history: [true, true, true, true, true, true], response_time: Some(679.1088ms) }
4: MonerodEntry { address_type: "clear", url: "http://23.137.254.9:18081", height: 3119866, up: true, web_compatible: false, network: "mainnet", last_checked: "5 hours ago", up_history: [true, true, true, true, true, true], response_time: Some(704.3092ms) }
```

Example merge mining proxy startup log:
```rust
2024-04-04 15:45:59.087723700 [reqwest::connect] DEBUG starting new connection: https://monero.fail/
2024-04-04 15:46:02.023687700 [reqwest::connect] DEBUG starting new connection: http://213.227.135.106:18081/
2024-04-04 15:46:02.454594200 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(430.95ms)' for Monerod server at: http://213.227.135.106:18081/getheight
2024-04-04 15:46:02.454749300 [reqwest::connect] DEBUG starting new connection: https://monero.homeqloud.com/
2024-04-04 15:46:03.452241100 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(997.53ms)' for Monerod server at: https://monero.homeqloud.com/getheight
2024-04-04 15:46:03.452339500 [reqwest::connect] DEBUG starting new connection: http://23.137.254.9:18081/
2024-04-04 15:46:04.147777700 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(695.48ms)' for Monerod server at: http://23.137.254.9:18081/getheight
2024-04-04 15:46:04.147896500 [reqwest::connect] DEBUG starting new connection: http://dudeistnl.duckdns.org:18089/
2024-04-04 15:46:04.836452600 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(688.62ms)' for Monerod server at: http://dudeistnl.duckdns.org:18089/getheight
2024-04-04 15:46:04.836536800 [reqwest::connect] DEBUG starting new connection: http://monero1.com:18089/
2024-04-04 15:46:05.681670400 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(845.16ms)' for Monerod server at: http://monero1.com:18089/getheight
2024-04-04 15:46:05.681869000 [reqwest::connect] DEBUG starting new connection: http://xmr-pruned.p2pool.uk:18089/
2024-04-04 15:46:06.257987100 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(576.16ms)' for Monerod server at: http://xmr-pruned.p2pool.uk:18089/getheight
2024-04-04 15:46:06.258112500 [reqwest::connect] DEBUG starting new connection: https://xmr-au-1.cryptovps.io/
2024-04-04 15:46:08.079965500 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(1.82s)' for Monerod server at: https://xmr-au-1.cryptovps.io/getheight
2024-04-04 15:46:08.080055500 [reqwest::connect] DEBUG starting new connection: http://l4nk0r.dev:18089/
2024-04-04 15:46:09.128763700 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(1.05s)' for Monerod server at: http://l4nk0r.dev:18089/getheight
2024-04-04 15:46:09.128873200 [reqwest::connect] DEBUG starting new connection: http://nexper-xmr-node.tplinkdns.com:18081/
2024-04-04 15:46:09.893416200 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(764.58ms)' for Monerod server at: http://nexper-xmr-node.tplinkdns.com:18081/getheight
2024-04-04 15:46:09.893494700 [reqwest::connect] DEBUG starting new connection: http://202.169.99.195:18089/
2024-04-04 15:46:11.131535500 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(1.24s)' for Monerod server at: http://202.169.99.195:18089/getheight
2024-04-04 15:46:11.131644200 [reqwest::connect] DEBUG starting new connection: http://node0-eu.monero.love:18089/
2024-04-04 15:46:11.795190600 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(663.59ms)' for Monerod server at: http://node0-eu.monero.love:18089/getheight
2024-04-04 15:46:11.795278100 [reqwest::connect] DEBUG starting new connection: http://01.its-a-node.org:18081/
2024-04-04 15:46:12.524508500 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(729.26ms)' for Monerod server at: http://01.its-a-node.org:18081/getheight
2024-04-04 15:46:12.524641700 [reqwest::connect] DEBUG starting new connection: http://rucknium.me:18081/
2024-04-04 15:46:12.971353900 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(446.77ms)' for Monerod server at: http://rucknium.me:18081/getheight
2024-04-04 15:46:12.971458900 [reqwest::connect] DEBUG starting new connection: http://node.sethforprivacy.com:18089/
2024-04-04 15:46:13.770796600 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(799.37ms)' for Monerod server at: http://node.sethforprivacy.com:18089/getheight
2024-04-04 15:46:13.770910900 [reqwest::connect] DEBUG starting new connection: http://nihilism.network:18081/
2024-04-04 15:46:14.230763700 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(459.89ms)' for Monerod server at: http://nihilism.network:18081/getheight
2024-04-04 15:46:14.230878600 [reqwest::connect] DEBUG starting new connection: http://xmr.godz.co.uk:18081/
2024-04-04 15:46:15.087522500 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(856.68ms)' for Monerod server at: http://xmr.godz.co.uk:18081/getheight
2024-04-04 15:46:15.087649000 [reqwest::connect] DEBUG starting new connection: https://datura.network:18081/
2024-04-04 15:46:15.783401900 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(695.80ms)' for Monerod server at: https://datura.network:18081/getheight
2024-04-04 15:46:15.783478600 [reqwest::connect] DEBUG starting new connection: http://nodexmr.rctrusts.com:18089/
2024-04-04 15:46:17.400284700 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(1.62s)' for Monerod server at: http://nodexmr.rctrusts.com:18089/getheight
2024-04-04 15:46:17.400376500 [reqwest::connect] DEBUG starting new connection: https://node-xmr.encryp.ch:18089/
2024-04-04 15:46:18.352391400 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(952.04ms)' for Monerod server at: https://node-xmr.encryp.ch:18089/getheight
2024-04-04 15:46:18.352499100 [reqwest::connect] DEBUG starting new connection: http://moneropay.techthis.online:18089/
2024-04-04 15:46:19.560547300 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(1.21s)' for Monerod server at: http://moneropay.techthis.online:18089/getheight
2024-04-04 15:46:19.560642800 [reqwest::connect] DEBUG starting new connection: http://node.monero.love:18089/
2024-04-04 15:46:20.226728400 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(666.12ms)' for Monerod server at: http://node.monero.love:18089/getheight
2024-04-04 15:46:20.226892600 [reqwest::connect] DEBUG starting new connection: http://hatchi-home.ddns.net:18089/
2024-04-04 15:46:20.699821700 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(472.97ms)' for Monerod server at: http://hatchi-home.ddns.net:18089/getheight
2024-04-04 15:46:20.699945900 [reqwest::connect] DEBUG starting new connection: http://moneronode.xyz:18089/
2024-04-04 15:46:21.382450000 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(682.55ms)' for Monerod server at: http://moneronode.xyz:18089/getheight
2024-04-04 15:46:21.382544100 [reqwest::connect] DEBUG starting new connection: http://node.c3pool.org:18081/
2024-04-04 15:46:22.229697200 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(847.18ms)' for Monerod server at: http://node.c3pool.org:18081/getheight
2024-04-04 15:46:22.229821600 [reqwest::connect] DEBUG starting new connection: https://node.chaoswg.dev/
2024-04-04 15:46:23.233010600 [minotari_mm_proxy::monero_detect] DEBUG Response time 'Some(1.00s)' for Monerod server at: https://node.chaoswg.dev/getheight
```

What process can a PR reviewer use to test or verify this change?
---
- Review code changes
- Run system-level tests

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
Description
---
This PR fixes
- Index out of bounds errors / panics
- Standardizes function return and input types of ints
- Adds new gif and link metadata type

Motivation and Context
---
- Prevent panics in the ffi
- Make development easier (no casting between int types for ffi clients)
- Provide new metadata type

How Has This Been Tested?
---
Manually by the mobile team.
Description
---
Cherry picks this pr for dev:
tari-project#6244

---------

Co-authored-by: Stan Bondi <sdbondi@users.noreply.github.com>
Description
---
This only keeps only a single copy of the smt in memory

Motivation and Context
---
Writing and load the smt from disc every time is inefficient and take
long, this keeps in in memory.
Keeping a single copy in an `Arc<RwLock<>>` alles the node to keep a
single copy and use it.

How Has This Been Tested?
---
unit tests and manual.

---------

Co-authored-by: Hansie Odendaal <39146854+hansieodendaal@users.noreply.github.com>
Description
Fix the tag from Cargo.toml, with awk matching multiple times, use regex
to match online beginning of line
Do the same for binary builds, not see an break, but think it might
happen


Motivation and Context
Fix the docker image builds
Added some comments for the ffi builds

How Has This Been Tested?
Builds in local fork

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
Description
---
Updates a few `Encryptable` implementations to make domains canonical.

Closes tari-project#6274.

Motivation and Context
---
As noted in tari-project#6274, concatenation of variable-length data when generating
`Encryptable` domains for AEAD associated data is not canonical for
several types, and could result in collisions.

This PR updates the affected implementations to use fixed-size length
prepending.

How Has This Been Tested?
---
Existing tests.

What process can a PR reviewer use to test or verify this change?
---
Ensure that all `Encryptable` implementations have canonical domain
encodings that cannot collide.

BREAKING CHANGE: Affects the way that local encrypted data is
authenticated, so existing encrypted databases will not function
correctly.
@sdbondi sdbondi requested review from a team as code owners April 15, 2024 11:19
@ghpbot-tari-project ghpbot-tari-project added the CR-too_long Changes Requested - Your PR is too long label Apr 15, 2024
Copy link

github-actions bot commented Apr 15, 2024

Test Results (Integration tests)

30 tests   30 ✅  12m 0s ⏱️
11 suites   0 💤
 2 files     0 ❌

Results for commit 00cdbb0.

♻️ This comment has been updated with latest results.

@ghpbot-tari-project ghpbot-tari-project added P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged labels Apr 15, 2024
Copy link

github-actions bot commented Apr 15, 2024

Test Results (CI)

    3 files    120 suites   40m 37s ⏱️
1 278 tests 1 278 ✅ 0 💤 0 ❌
3 826 runs  3 826 ✅ 0 💤 0 ❌

Results for commit 00cdbb0.

♻️ This comment has been updated with latest results.

* development:
  fix!: avoid `Encryptable` domain collisions (tari-project#6275)
  ci(fix): docker image build fix and ci improvements (tari-project#6270)
  feat: keep smt memory (tari-project#6265)
  feat: show warning when GRPC method is disallowed (tari-project#6246)
  fix(chat): metadata panic (tari-project#6247)
  feat: add monerod detection as an option to the merge mining proxy (tari-project#6248)
  chore(deps): bump h2 from 0.3.24 to 0.3.26 (tari-project#6250)
  feat: improve lmdb dynamic growth (tari-project#6242)
  feat: allow wallet type from db to have preference (tari-project#6245)
  feat: prevent mempool panic (tari-project#6239)
  ci: bump nightly version (tari-project#6241)
  feat: add validation for zero confirmation block sync (tari-project#6237)
  feat: new template with coinbase call (tari-project#6226)
  feat: improve wallet sql queries (tari-project#6232)
  chore: remove ahash as dependancy (tari-project#6238)
  feat: add dynamic growth to lmdb (tari-project#6231)
  chore(deps): bump borsh from 0.10.3 to 1.0.0 in /applications/minotari_ledger_wallet (tari-project#6236)
@sdbondi sdbondi force-pushed the update-feature-dan2 branch from 9afd2c8 to 00cdbb0 Compare April 15, 2024 11:25
@stringhandler stringhandler merged commit 0c50234 into tari-project:feature-dan2 Apr 15, 2024
15 of 16 checks passed
@sdbondi sdbondi deleted the update-feature-dan2 branch May 3, 2024 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CR-too_long Changes Requested - Your PR is too long P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants