Skip to content

Small skeleton for interface abstraction.#14

Merged
rakita merged 1 commit intomasterfrom
rakita/db_table
Oct 6, 2022
Merged

Small skeleton for interface abstraction.#14
rakita merged 1 commit intomasterfrom
rakita/db_table

Conversation

@rakita
Copy link
Collaborator

@rakita rakita commented Oct 4, 2022

The main point for this pull request is to show Table trait abstraction and how it is used inside ExecutorDb. Table is then implemented by Db

Details: I am not sure what are best options to have: as maybe having TableMut and Table to have inesrt as &mut self, or maybe an additional get_ref function that would return reference value.

Added a few more types and some dummy interfaces for consensus and executor.

Copy link
Collaborator

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

Mostly nits, however I'm not sure if this is enough though. MDBX is structured as a top-level Environment from which you get transactions. Each transaction can then fetch/put values from underlying databases which are loaded from a transaction as well. The way libmdbx is structured requires some generics and lifetimes - generics are for the environment type that specifies how the write-map behaves, as well as for the transaction permissions (RW or RO).

I think the way you can think of MDBX is that Environment is the database and the databases in MDBX are tables, so at least the abstractions should account for the difference between tables, the main database and some notion of transactions. Not sure though - wdyt?

@rakita
Copy link
Collaborator Author

rakita commented Oct 5, 2022

Mostly nits, however I'm not sure if this is enough though. MDBX is structured as a top-level Environment from which you get transactions. Each transaction can then fetch/put values from underlying databases which are loaded from a transaction as well. The way libmdbx is structured requires some generics and lifetimes - generics are for the environment type that specifies how the write-map behaves, as well as for the transaction permissions (RW or RO).

I think the way you can think of MDBX is that Environment is the database and the databases in MDBX are tables, so at least the abstractions should account for the difference between tables, the main database and some notion of transactions. Not sure though - wdyt?

There is probably some space for different designs, but I see that merging the Table as it is now is probably going to get in the way of proper implementation. Removing it.

@rakita rakita changed the title Database Table abstraction Small skeleton for interface abstraction. Oct 6, 2022
@rakita rakita changed the base branch from rakita/primitives_skeleton to master October 6, 2022 12:49
@rakita rakita merged commit 074f452 into master Oct 6, 2022
@gakonst gakonst deleted the rakita/db_table branch October 6, 2022 19:48
BrianBland pushed a commit to BrianBland/reth that referenced this pull request Jul 17, 2023
anonymousGiga added a commit to anonymousGiga/reth that referenced this pull request Feb 20, 2024
yutianwu pushed a commit to yutianwu/reth that referenced this pull request Jun 13, 2024
release: prepare for v0.1.0-beta.1
AshinGau pushed a commit to AshinGau/reth that referenced this pull request Sep 20, 2024
…igmxyz#14)

- Implement committing states for partition and scheduler
- Perform `cargo fix -p reth-grevm --allow-dirty`
AshinGau pushed a commit to AshinGau/reth that referenced this pull request Oct 13, 2024
…igmxyz#14)

- Implement committing states for partition and scheduler
- Perform `cargo fix -p reth-grevm --allow-dirty`
shemnon added a commit to shemnon/reth that referenced this pull request Jan 20, 2026
* test(optimism): Test that sequence stops before a gap (paradigmxyz#18228)

* feat(optimism): Warn if `FlashBlockService` has stopped (paradigmxyz#18227)

* chore: safe None check (paradigmxyz#18225)

* chore: improve flashblock logs (paradigmxyz#18232)

* fix(download): use updated merkle base URL (paradigmxyz#18236)

* chore(engine): add better logs and spans for execution (paradigmxyz#18240)

* chore(trie): use instrument instead of manual span (paradigmxyz#18239)

* fix: filter zero storage values when computing withdrawals root in genesis header (paradigmxyz#18213)

* perf(reth-optimism-flashblocks): rm redundant clone (paradigmxyz#18196)

* perf(txpool): eliminate allocations in basefee enforcement (paradigmxyz#18218)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* docs: update urls in docs (paradigmxyz#18245)

* feat(optimism): Respond to ping messages with pong in `WsFlashBlockStream` (paradigmxyz#18212)

* test(optimism): Test that `WsFlashBlockStream` pongs a ping (paradigmxyz#18217)

* chore: downgrade debug to trace  for peer reputation logs (paradigmxyz#18250)

* chore: unify engine downloader targets (paradigmxyz#18248)

* fix(optimism): Compare parent hash and latest hash to invalidate cached flashblock (paradigmxyz#18238)

* feat(optimism): Decode text messages in `WsFlashBlockStream` (paradigmxyz#18257)

* chore: remove redundant payload trait bounds (paradigmxyz#18262)

* feat(optimism): Respond to close messages in `WsFlashBlockStream` (paradigmxyz#18256)

* fix(optimism): Reconnect if ws stream ends in `WsFlashBlockStream` (paradigmxyz#18226)

* test(optimism): Test that UTF-8 encoded messages are received in `WsFlashBlockStream` (paradigmxyz#18269)

* chore: log prune settings on unwind (paradigmxyz#18270)

* chore: extract `validate_against_parent_gas_limit` into separate fn (paradigmxyz#18277)

* perf: rm redundant collect (paradigmxyz#18281)

* perf: build local pending block without updates (paradigmxyz#18271)

* perf(db): do not heap-allocate the stage key per query (paradigmxyz#18284)

* chore(txpool): add sanity tests for blob fee bit handling (paradigmxyz#18258)

* fix: check prune checkpoints for unwind target limit (paradigmxyz#18263)

* perf: optimize send raw batching (paradigmxyz#18280)

* perf: specialize single batch request (paradigmxyz#18289)

* chore: delist unused deps with `cargo-machete` (paradigmxyz#18259)

* test(optimism): Test that close message is responded to in `WsFlashBlockStream` (paradigmxyz#18268)

* perf: specialize validate_transactions_with_origin for task validator (paradigmxyz#18288)

* feat(metrics): add `TxPoolValidatorMetrics` to track inflight validation jobs (paradigmxyz#18295)

* feat(gpo): add default fee price argument (paradigmxyz#18297)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* feat: introduce setting for delegated txs slots (paradigmxyz#18298)

* feat: expose `EvmEnv` to `caller_gas_allowance` (paradigmxyz#18302)

* perf: specialize len 1 (paradigmxyz#18307)

* chore: fix various typos in comments and documentation (paradigmxyz#18296)

* perf(e2e-test-utils): optimize block checking by fetching header instead of full block (paradigmxyz#18254)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* feat: introduce maybe_pending method to StateProviderFactory (paradigmxyz#18260)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* chore: clippy happy (paradigmxyz#18310)

* feat(download): support zst archives in reth download (paradigmxyz#18237)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* chore: introduce validationtask with capacity (paradigmxyz#18291)

* chore(deps): weekly `cargo update` (paradigmxyz#18312)

Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>

* fix(rpc): error code `eth_sendRawTransactionSync` timeout (paradigmxyz#18252)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* chore(trie): dont warn on blinded node reveals (paradigmxyz#18317)

* refactor(optimism): Extract pending block building responsibility out of `FlashBlockService` (paradigmxyz#18247)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* refactor: change PendingPool and PendingTransaction visibility to pub (paradigmxyz#18267)

* refactor(engine): persistence logic (paradigmxyz#18318)

* feat(optimism): flashblock completed sequences (paradigmxyz#18272)

* feat(trie): Add helper sub-command (paradigmxyz#18301)

* ci: pin Rust to 1.88 when building for Windows in Cross (paradigmxyz#18320)

* docs(reth-bench): fix markdown (paradigmxyz#18322)

* fix(bench): fix deadlock in test data generation (paradigmxyz#18321)

* fix(stateless): verify_execution_witness doc for pre-state mismatch (paradigmxyz#18319)

* fix: DB benches (paradigmxyz#18314)

* chore: bump version 1.7.0 (paradigmxyz#18323)

---------

Co-authored-by: Roman Hodulák <roman.hodulak@polyglot-software.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Dan Cline <6798349+Rjected@users.noreply.github.com>
Co-authored-by: Ivan Wang <wff19940326@gmail.com>
Co-authored-by: nk_ysg <nk_ysg@163.com>
Co-authored-by: YK <chiayongkang@hotmail.com>
Co-authored-by: quantix9 <quantix9@proton.me>
Co-authored-by: Hai | RISE <150876604+hai-rise@users.noreply.github.com>
Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
Co-authored-by: Mablr <59505383+mablr@users.noreply.github.com>
Co-authored-by: zhygis <5236121+Zygimantass@users.noreply.github.com>
Co-authored-by: James Niken <155266991+dizer-ti@users.noreply.github.com>
Co-authored-by: Femi Bankole <llordbanks500@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
Co-authored-by: Brian Picciano <me@mediocregopher.com>
Co-authored-by: kien-rise <157339831+kien-rise@users.noreply.github.com>
Co-authored-by: Alexey Shekhirin <5773434+shekhirin@users.noreply.github.com>
Co-authored-by: Julio <30329843+julio4@users.noreply.github.com>
Co-authored-by: radik878 <radikpadik76@gmail.com>
will-2012 pushed a commit to will-2012/reth that referenced this pull request Jan 31, 2026
* feat: add bsc snapshot table

* Update crates/storage/db-api/src/tables/mod.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Clyde <clyde.m@nodereal.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

3 participants