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

Coins can't be activated in WASM if enable_spv_proof is true #1471

Closed
sergeyboyko0791 opened this issue Sep 14, 2022 · 4 comments
Closed

Coins can't be activated in WASM if enable_spv_proof is true #1471

sergeyboyko0791 opened this issue Sep 14, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@sergeyboyko0791
Copy link

Almost all UTXO coins has enable_spv_proof: true flag in coins config by default.

@sergeyboyko0791
Copy link
Author

@tonymorony @anarkiVan we should probably remove this flag from the coins repo at all for air_dex

@shamardy
Copy link
Collaborator

shamardy commented Sep 14, 2022

@tonymorony @artemii235 should spv proof be used in AirDEX/Mobile, or will AirDEX/Mobile only connect to trusted electrum servers?

True simple payment verification requires downloading and saving the block headers for every coin when activating for the first time, this will have big storage requirements to activate multiple coins. Also coin activation time will go up, I tested downloading and saving all block headers for BTC and it took about 5 minutes to activate BTC with spv enabled. For other coins with less blocktime than btc, it will take much longer. I discussed this with some solutions before in this comment #1339 (comment).

As for the current issue, as a hotfix I can move enable_spv_proof flag to the electrum server request since this needs to be true for non-trusted servers only and then we can add if a server can be trusted or not to this list https://github.com/KomodoPlatform/coins/tree/master/electrums. What do you think @artemii235?

One last note, this error happens because of this https://github.com/KomodoPlatform/atomicDEX-API/blob/1438bf91bfb8e897ce8ff4d93badbba0a6edbb39/mm2src/coins/utxo/utxo_indexedb_block_header_storage.rs#L27-L29 which causes an infinite loop here https://github.com/KomodoPlatform/atomicDEX-API/blob/1438bf91bfb8e897ce8ff4d93badbba0a6edbb39/mm2src/coins/utxo/utxo_builder/utxo_arc_builder.rs#L226-L234
So, a permanent solution is to implement BlockHeaderStorageOps for IndexedDB but we have to agree on the solution for the problems I discussed above before doing that.

@shamardy shamardy self-assigned this Sep 14, 2022
@shamardy shamardy added the bug Something isn't working label Sep 14, 2022
@anarkiVan
Copy link

@tonymorony @anarkiVan we should probably remove this flag from the coins repo at all for air_dex

I think that we can remove flag for cosmos demo, but after we need a solution for WASM.

@sergeyboyko0791
Copy link
Author

Close as completed

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

3 participants