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

LDK in std mode #856

Merged
merged 2 commits into from
Nov 16, 2023
Merged

LDK in std mode #856

merged 2 commits into from
Nov 16, 2023

Conversation

TonyGiorgio
Copy link
Contributor

@TonyGiorgio TonyGiorgio commented Nov 15, 2023

Binary size is 9.7MB, I think it went up a little bit but not much.

Tested almost all functionality before and after the upgrade, no issues.

@TonyGiorgio TonyGiorgio changed the title Fedimint LDK in std mode Nov 16, 2023
@TonyGiorgio TonyGiorgio marked this pull request as ready for review November 16, 2023 04:41
@benthecarman
Copy link
Collaborator

I think with this we can start using lightning-background-sync, might be worth doing in a follow up though

@TonyGiorgio
Copy link
Contributor Author

I think with this we can start using lightning-background-sync, might be worth doing in a follow up though

I think the copy/paste was originally for sync + send stuff we had to remove.

@benthecarman
Copy link
Collaborator

I think the copy/paste was originally for sync + send stuff we had to remove.

Yeah IIRC thats because the stuff we were using didn't have sync + send in no-std

@TonyGiorgio
Copy link
Contributor Author

Getting a lot of errors switching to their background processor:

585  | pub async fn process_events_async<                                                                                                                                                                                                            
     |              -------------------- required by a bound in this function                                                                                                                                                                        
...                                                                                                                                                                                                                                                  
603  |     CM: 'static + Deref<Target = ChannelManager<CW, T, ES, NS, SP, F, R, L>> + Send + Sync,                                                                                                                                                   
     |                                                                                ^^^^ required by this bound in `process_events_async`                                                                                                          
help: consider further restricting this bound                                                                                                                                                                                                        
     |                                                                                                                                                                                                                                               
177  | impl<S: MutinyStorage + std::marker::Sync> Node<S> {                                                                                                                                                                                          
     |                       +++++++++++++++++++                                                                                                                                                                                                     
                                                                                                                                                                                                                                                     
error[E0277]: `S` cannot be sent between threads safely                                                                                                                                                                                              
    --> mutiny-core/src/node.rs:493:21                                                                                                                                                                                                               
     |                                                                                                                                                                                                                                               
489  |                 if let Err(e) = process_events_async(                                                                                                                                                                                         
     |                                 -------------------- required by a bound introduced by this call                                                                                                                                              
...                                                                                                                                                                                                                                                  
493  |                     background_processor_channel_manager.clone(),                                                                                                                                                                             
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `S` cannot be sent between threads safely                                                                                                                                    
     |                                                                                                                            

Which comes from our own trait:

pub trait MutinyStorage: Clone + Sized + 'static {

and I suppose we have probably done quite a bit of that everywhere. Was that due to the Mutex type we were using or something? I thought really comes from the fact that we're limited to single threaded in wasm anyways.

@benthecarman
Copy link
Collaborator

Okay let's just ignore it for now then, can attempt it later.

@TonyGiorgio TonyGiorgio merged commit 3827f18 into master Nov 16, 2023
9 checks passed
@TonyGiorgio TonyGiorgio deleted the fedimint-v2 branch November 16, 2023 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants