Skip to content
This repository was archived by the owner on Jul 27, 2022. It is now read-only.

Problem: (CRO-219) Potential inconsistent client state due to concurrent updates#218

Merged
tomtau merged 3 commits intocrypto-com:masterfrom
devashishdxt:multi-threaded-db
Jul 22, 2019
Merged

Problem: (CRO-219) Potential inconsistent client state due to concurrent updates#218
tomtau merged 3 commits intocrypto-com:masterfrom
devashishdxt:multi-threaded-db

Conversation

@devashishdxt
Copy link
Copy Markdown
Contributor

Solution:

  • Combined balance, transaction_history and unspent_transactions in a single keyspace.
  • Use a simplified variant of memento design pattern to buffer all database updates and execute them in the end.

…ent updates

Solution:

- Combined `balance`, `transaction_history` and `unspent_transactions` in a single keyspace.
- Use a simplified variant of [memento](https://refactoring.guru/design-patterns/memento) design pattern to buffer all database updates and execute them in the end.
.get(&input.id)?
.ok_or_else(|| Error::from(ErrorKind::TransactionNotFound))?;

let outputs = match transaction {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

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

lgtm

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 22, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@69100b2). Click here to learn what that means.
The diff coverage is 26.34%.

@@            Coverage Diff            @@
##             master     #218   +/-   ##
=========================================
  Coverage          ?   75.15%           
=========================================
  Files             ?       87           
  Lines             ?     8679           
  Branches          ?        0           
=========================================
  Hits              ?     6523           
  Misses            ?     2156           
  Partials          ?        0
Impacted Files Coverage Δ
client-index/src/index/default_index.rs 0% <0%> (ø)
client-index/src/service/address_service.rs 0% <0%> (ø)
chain-core/src/tx/data/address.rs 88.46% <100%> (ø)
client-common/src/transaction.rs 47.05% <57.14%> (ø)
client-index/src/service/transaction_service.rs 94.82% <92.85%> (ø)

@tomtau tomtau merged commit 74bcafc into crypto-com:master Jul 22, 2019
@leejw51crypto
Copy link
Copy Markdown
Collaborator

lgtm

@devashishdxt devashishdxt deleted the multi-threaded-db branch July 22, 2019 07:29
bors bot added a commit that referenced this pull request Oct 2, 2019
441: Bump ethbloom from 0.7.0 to 0.8.0 r=devashishdxt a=dependabot-preview[bot]

Bumps [ethbloom](https://github.com/paritytech/parity-common) from 0.7.0 to 0.8.0.
<details>
<summary>Commits</summary>

- [`1e9f990`](paritytech/parity-common@1e9f990) update rand to 0.7 (breaking change) ([#217](https://github-redirect.dependabot.com/paritytech/parity-common/issues/217))
- [`f884d77`](paritytech/parity-common@f884d77) Fix deprecation warning ([#168](https://github-redirect.dependabot.com/paritytech/parity-common/issues/168))
- [`b0ec18d`](paritytech/parity-common@b0ec18d) Fix typos ([#229](https://github-redirect.dependabot.com/paritytech/parity-common/issues/229))
- [`28781a0`](paritytech/parity-common@28781a0) Bump parking_lot version ([#227](https://github-redirect.dependabot.com/paritytech/parity-common/issues/227))
- [`bf0ba84`](paritytech/parity-common@bf0ba84) [kvdb-web] bump futures-preview to 0.3.0-alpha.18 ([#225](https://github-redirect.dependabot.com/paritytech/parity-common/issues/225))
- [`31b6479`](paritytech/parity-common@31b6479) [kvdb-web] indexeddb implementation ([#202](https://github-redirect.dependabot.com/paritytech/parity-common/issues/202))
- [`085d18b`](paritytech/parity-common@085d18b) [kvdb-memorydb] Migrated code to 2018 edition, updated parking_lot ([#222](https://github-redirect.dependabot.com/paritytech/parity-common/issues/222))
- [`baf1df9`](paritytech/parity-common@baf1df9) Migrated code to 2018 edition, updated dependencies ([#221](https://github-redirect.dependabot.com/paritytech/parity-common/issues/221))
- [`6a580c1`](paritytech/parity-common@6a580c1) Bump version ([#219](https://github-redirect.dependabot.com/paritytech/parity-common/issues/219))
- [`67a9e7d`](paritytech/parity-common@67a9e7d) Find PendingIterator in Transaction Pool ([#218](https://github-redirect.dependabot.com/paritytech/parity-common/issues/218))
- Additional commits viewable in [compare view](paritytech/parity-common@ethbloom-v0.7.0...ethbloom-v0.8.0)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=ethbloom&package-manager=cargo&previous-version=0.7.0&new-version=0.8.0)](https://dependabot.com/compatibility-score.html?dependency-name=ethbloom&package-manager=cargo&previous-version=0.7.0&new-version=0.8.0)

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)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants