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

[Bug] RetryBackoffService issues when compiling to WASM #1147

Open
ncitron opened this issue Aug 14, 2024 · 0 comments
Open

[Bug] RetryBackoffService issues when compiling to WASM #1147

ncitron opened this issue Aug 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ncitron
Copy link

ncitron commented Aug 14, 2024

Component

provider, pubsub, transports

What version of Alloy are you on?

0.2.1

Operating System

macOS (Apple Silicon)

Describe the bug

When building a provider with a retry layer and compiling to wasm32-unknown-none I get trait errors whenever I attempt to use the resulting provider.

Here is an example of the error. When compiling to a non-wasm target it works fine.

error[E0599]: the method `get_chain_id` exists for struct `RootProvider<RetryBackoffService<Http<Client>>>`, but its trait bounds were not satisfied                                                                                                                                                                                                    
   --> execution/src/rpc/http_rpc.rs:179:14                                                                                                                                                                                                                                                                                                             
    |                                                                                                                                                                                                                                                                                                                                                   
177 |           Ok(self                                                                                                                                                                                                                                                                                                                                 
    |  ____________-                                                                                                                                                                                                                                                                                                                                    
178 | |             .provider                                                                                                                                                                                                                                                                                                                           
179 | |             .get_chain_id()                                                                                                                                                                                                                                                                                                                     
    | |             -^^^^^^^^^^^^ method cannot be called on `RootProvider<RetryBackoffService<Http<Client>>>` due to unsatisfied trait bounds                                                                                                                                                                                                          
    | |_____________|                                                                                                                                                                                                                                                                                                                                   
    |                                                                                                                                                                                                                                                                                                                                                   
    |                                                                                                                                                                                                                                                                                                                                                   
   ::: /Users/ncitron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/alloy-transport-0.2.1/src/layers/retry.rs:87:1                                                                                                                                                                                                                               
    |                                                                                                                                                                                                                                                                                                                                                   
87  |   pub struct RetryBackoffService<S> {                                                                                                                                                                                                                                                                                                             
    |   --------------------------------- doesn't satisfy `_: Transport`                                                                                                                                                                                                                                                                                
    |                                                                                                                                                                                                                                                                                                                                                   
   ::: /Users/ncitron/.cargo/registry/src/index.crates.io-6f17d22bba15001f/alloy-provider-0.2.1/src/provider/root.rs:23:1                                                                                                                                                                                                                               
    |                                                                                                                                                                                                                                                                                                                                                   
23  |   pub struct RootProvider<T, N = Ethereum> {                                                                                                                                                                                                                                                                                                      
    |   ---------------------------------------- doesn't satisfy `_: Provider<RetryBackoffService<Http<Client>>>`                                                                                                                                                                                                                                       
    |                                                                                                                                                                                                                                                                                                                                                   
    = note: the following trait bounds were not satisfied:                                                                                                                                                                                                                                                                                              
            `RetryBackoffService<alloy::transports::alloy_transport_http::Http<Client>>: alloy::transports::Transport`                                                                                                                                                                                                                                  
            which is required by `RootProvider<RetryBackoffService<alloy::transports::alloy_transport_http::Http<Client>>>: Provider<RetryBackoffService<alloy::transports::alloy_transport_http::Http<Client>>>`
@ncitron ncitron added the bug Something isn't working label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant