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

How to import WrapDatabaseAsync #1996

Open
paulatsydney opened this issue Jan 14, 2025 · 3 comments
Open

How to import WrapDatabaseAsync #1996

paulatsydney opened this issue Jan 14, 2025 · 3 comments
Labels
good first issue Good for newcomers

Comments

@paulatsydney
Copy link

In the example uniswap_v2_usdc_swap, it creates a type as following:
pub type AlloyCacheDB = CacheDB<WrapDatabaseAsync<AlloyDB<Http, Ethereum, RootProvider<Http>>>>;

I want to follow this approach, however I can't find out how to import WrapDatabaseAsync.
In the example it simples use revm::database_interface::WrapDatabaseAsync. However in my code, database_interface doesn't exist in revm.
My REVM version is 19.3.0.

If I check the documentation, I can see that this is a pub struct. https://bluealloy.github.io/revm/docs/revm_database_interface/async_db/struct.WrapDatabaseAsync.html

Appreciate if anyone could give a help.

@rakita
Copy link
Member

rakita commented Jan 23, 2025

You would need a asyncdb feature enabled

@jezsung
Copy link

jezsung commented Feb 10, 2025

@paulatsydney @rakita
Running the following command says the feature asyncdb doesn't exist:

cargo add revm --features asyncdb

    Updating crates.io index
      Adding revm v19.4.0 to dependencies
error: unrecognized feature for crate revm: asyncdb
disabled features:
    arbitrary, asm-keccak, dev, ethersdb, hashbrown, kzg-rs, memory_limit
    negate-optimism-default-handler, optimism, optimism-default-handler
    optional_balance_check, optional_beneficiary_reward, optional_block_gas_limit
    optional_eip3607, optional_gas_refund, optional_no_base_fee, serde, serde-json
    test-utils
enabled features:
    alloydb, blst, c-kzg, portable, secp256k1, std

Am I missing something?

@rakita
Copy link
Member

rakita commented Mar 13, 2025

Hey it seems asyncdb needs to be added to revm crate and it needs to activate database/asyncdb

@rakita rakita added good first issue Good for newcomers and removed question labels Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants