Skip to content

Abstract kvdb with cache#120

Closed
ordian wants to merge 44 commits into
masterfrom
ao-abstract-kvdb-with-cache
Closed

Abstract kvdb with cache#120
ordian wants to merge 44 commits into
masterfrom
ao-abstract-kvdb-with-cache

Conversation

@ordian
Copy link
Copy Markdown
Contributor

@ordian ordian commented Apr 4, 2019

The caching logic for kvdb is orthogonal to rocksdb and can be reused by other kvdb implementations.
Notable changes:

  • iterator now acquires read lock on the db, which prevents error in case of db being closed in a separate thread (for parity-ethereum it can happen after warp sync is complete). The downside is if close is called on the same thread as iter, it will deadlock (let _ = rwlock.read(); let _ = rwlock.write()).
  • db transactions now allocate (Box), not sure if it's possible to avoid that (see TODOs for reviewers).

ordian added 30 commits January 21, 2019 18:40
* master: (284 commits)
  fix(serde deser): remove needless `len` check
  Update ci to crate removal.
  fix(deser): fix indexing into `str` bug
  Clean deprecated crate.
  Remove deps to hashdb, memdb, patricia-trie, keccak-hash.
  add uint operator benchmarks (#82)
  Update repo url
  Add issue number
  Fix ethereum-types tests
  readme: remove broken appveyor badge
  Update parity-crypto to ring v0.14 (#99)
  update impl-codec and update primitive-types (#101)
  primitive types new release
  Use TryFrom trait
  Use local path deps
  Deal with remaining merge issues
  update parity-codec for primitive types (#98)
  Update uint to 0.6
  Add more conversion functions for U128
  typo: duplicate features key
  ...
ordian added 11 commits March 26, 2019 14:53
* master:
  Fix fixed-hash (#110)
  Update transaction-pool/src/error.rs
  tx-pool: I think I copied and pasted some spaces from somewhere
  tx-pool: remove more spaces
  tx-pool: where did those spaces come from
  tx-pool: make error generic over hash
  tx-pool: replace error-chain with vanilla error impl
* master:
  Fix impl-rlp for uint in primitive-types (#117)
* master:
  change dependencies of `keccak-hash`and `trie-standardmap` (#111)
  bring appveyor back (#118)
  Extract `should_replace` from Scoring and supply pooled txs from same sender (#116)
@ordian ordian mentioned this pull request Apr 4, 2019
Comment thread kvdb/src/lib.rs
}

pub trait TransactionHandler {
// TODO: how to avoid boxing?
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.

This would require existential types right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Probably, also by fixing rust-lang/rust#51386

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.

…so I guess that for the time being boxing is as good as it gets?

Copy link
Copy Markdown
Contributor Author

@ordian ordian May 6, 2019

Choose a reason for hiding this comment

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

I was hoping someone could with a better design, which would remove this requirement. Also I don't know how impactful this boxing is.

@ordian ordian mentioned this pull request Nov 28, 2019
4 tasks
@dvdplm
Copy link
Copy Markdown
Contributor

dvdplm commented Dec 19, 2019

@ordian is this still relevant, i.e. should still be reviewed?

@ordian
Copy link
Copy Markdown
Contributor Author

ordian commented Dec 19, 2019

@dvdplm this could be useful for lmdb and sled kvdb impls, but I can update it next year.

@ordian
Copy link
Copy Markdown
Contributor Author

ordian commented Jan 9, 2020

Let's close it for now.

@ordian ordian closed this Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants