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

"Failed to deserialize bytes into message using CBOR" #1184

Open
binarybaron opened this issue Oct 25, 2022 · 15 comments
Open

"Failed to deserialize bytes into message using CBOR" #1184

binarybaron opened this issue Oct 25, 2022 · 15 comments

Comments

@binarybaron
Copy link
Collaborator

Describe the bug
Initiating a swap fails. This might be due to the asb and cli using different versions of the software. CLI uses latest preview release. ASB is self-compiled and a few weeks old. I'll compile to use the latest asb version and try again.

Debug logs
CLI:

{"timestamp":"2022-10-25T10:59:47.19448Z","level":"INFO","fields":{"message":"Logging initialized to /Users/****/Library/Application Support/xmr-btc-swap/cli/testnet/logs"}}
{"timestamp":"2022-10-25T10:59:47.194646Z","level":"DEBUG","fields":{"message":"Using existing sqlite database."}}
{"timestamp":"2022-10-25T10:59:47.20193Z","level":"DEBUG","fields":{"message":"Reading in seed from /Users/****/Library/Application Support/xmr-btc-swap/cli/testnet/seed.pem"}}
{"timestamp":"2022-10-25T10:59:49.605923Z","level":"DEBUG","fields":{"message":"RPC exec path: /Users/****/Library/Application Support/xmr-btc-swap/cli/testnet/monero/monero-wallet-rpc"}}
{"timestamp":"2022-10-25T10:59:50.781407Z","level":"DEBUG","fields":{"message":"RPC version output: Monero 'Fluorine Fermi' (v0.18.0.0-release)\n"}}
{"timestamp":"2022-10-25T10:59:50.781648Z","level":"DEBUG","fields":{"message":"Starting monero-wallet-rpc","port":"50409"}}
{"timestamp":"2022-10-25T10:59:54.305927Z","level":"DEBUG","fields":{"message":"Opened Monero wallet","monero_wallet_name":"swap-tool-blockchain-monitoring-wallet"}}
{"timestamp":"2022-10-25T10:59:54.948195Z","level":"DEBUG","fields":{"message":"Network layer initialized","peer_id":"12D3KooWQyzX7EHaF7WpDRftAeVbKMzk9WEuy6Kx5qeSCUB8mspU"}}
{"timestamp":"2022-10-25T10:59:54.948262Z","level":"DEBUG","fields":{"message":"Requesting quote"}}
{"timestamp":"2022-10-25T10:59:55.083714Z","level":"INFO","fields":{"message":"Connected to Alice at /dns4/asb.unstoppableswap.net/tcp/9939/p2p/12D3KooWJS3D2aN2Y4MNbDm66jCfkUSVpqW1u2TdURSqriny2CfX"}}
{"timestamp":"2022-10-25T10:59:55.127538Z","level":"INFO","fields":{"message":"Received quote","price":"0.00763674 BTC","minimum_amount":"0.00010000 BTC","maximum_amount":"0.07880419 BTC"}}
{"timestamp":"2022-10-25T10:59:55.39672Z","level":"INFO","fields":{"message":"Determined swap amount","amount":"0.00010768 BTC","fees":"0.00000122 BTC"}}
{"timestamp":"2022-10-25T10:59:55.40431Z","level":"DEBUG","fields":{"message":"Advancing state","state":"quote has been requested"}}
{"timestamp":"2022-10-25T10:59:55.664812Z","level":"DEBUG","fields":{"message":"Estimated fee for transaction","weight":"548","fee_rate":"1","sats_per_vbyte":"137.0"}}
{"timestamp":"2022-10-25T10:59:55.664907Z","level":"WARN","fields":{"message":"Estimated fee of 137.0 is smaller than the min relay fee, defaulting to min relay fee 1000"}}
{"timestamp":"2022-10-25T10:59:55.927878Z","level":"DEBUG","fields":{"message":"Estimated fee for transaction","weight":"596","fee_rate":"1","sats_per_vbyte":"149.0"}}
{"timestamp":"2022-10-25T10:59:55.927955Z","level":"WARN","fields":{"message":"Estimated fee of 149.0 is smaller than the min relay fee, defaulting to min relay fee 1000"}}
Error: Failed to complete swap

Caused by:
    0: Failed to deserialize bytes into message using CBOR
    1: EOF while parsing a value

ASB:

....
asb  | 2022-10-25 10:59:56 DEBUG Estimated fee for transaction weight=548 fee_rate=1 sats_per_vbyte=137.0
asb  | 2022-10-25 10:59:56  WARN Estimated fee of 137.0 is smaller than the min relay fee, defaulting to min relay fee 1000
asb  | 2022-10-25 10:59:56 DEBUG Estimated fee for transaction weight=548 fee_rate=1 sats_per_vbyte=137.0
asb  | 2022-10-25 10:59:56  WARN Estimated fee of 137.0 is smaller than the min relay fee, defaulting to min relay fee 1000
asb  | 2022-10-25 10:59:57 ERROR Communication error: Failed to read message2: Failed to deserialize bytes into message using CBOR: invalid type: byte array, expected a script peer=12D3KooWQyzX7EHaF7WpDRftAeVbKMzk9WEuy6Kx5qeSCUB8mspU

Lost/trapped Funds
No

Platform (please complete the following information):

  • CLI or ASB [eg. CLI]
  • Software Version [e.g. 0.8.3]
  • Operating System: [e.g. Ubuntu]
@binarybaron
Copy link
Collaborator Author

@delta1 Any idea what could be causing this? Could it be related to the bdk update? It's preventing me from working on the GUI :/

@delta1
Copy link
Collaborator

delta1 commented Oct 26, 2022

Hey @binarybaron I do suspect it's the bdk change because of this error message:

invalid type: byte array, expected a script

Because the bump in rust-bitcoin that accompanied this changed the type of bitcoin witness scripts

Can you please try with swap/asb compiled from the same commit and specify what it is? I will try reproduce and get on fixing it.

@binarybaron
Copy link
Collaborator Author

Can you please try with swap/asb compiled from the same commit and specify what it is? I will try reproduce and get on fixing it.

Will do. I'm compiling the new version on my server at this very moment.

If it's the reason this is happening, would you be okay with just reversing the upgrade from bdk 0.16 to 0.23? If there aren't any critical security fixes in the upgrade and if there is no need for the new features, I don't see a reason to upgrade if breaks backwards compatability.

@delta1
Copy link
Collaborator

delta1 commented Oct 26, 2022

would you be okay with just reversing the upgrade from bdk 0.16 to 0.23

Not really, I'd much rather make a new release for 0.12.

What changes do you have to 0.11? Can they be upstreamed here? Then we can do a backport release of that into 0.11.1 for you.

If there aren't any critical security fixes in the upgrade

I can't answer without an investigation and is a very good reason to stay current with their releases

@delta1
Copy link
Collaborator

delta1 commented Oct 26, 2022

I'll take a look at making a 0.11.1 release with everything except the bdk changes

@binarybaron
Copy link
Collaborator Author

would you be okay with just reversing the upgrade from bdk 0.16 to 0.23

Not really, I'd much rather make a new release for 0.12.

What changes do you have to 0.11? Can they be upstreamed here? Then we can do a backport release of that into 0.11.1 for you.

If there aren't any critical security fixes in the upgrade

I can't answer without an investigation and is a very good reason to stay current with their releases

I understand your point but I think we have to consider the costs-benefits. The upgrade changes the internal data structures therefore a database created by the old version is not compatible with the latest version. We are essentially forcing users to delete their whole database just to be able to use the cli again.
The GUI also uses the tx_lock saved in the database to display amounts, fees etc. The upgrade completely breaks the "History" tab (page where you can look at past swaps).

@delta1
Copy link
Collaborator

delta1 commented Oct 27, 2022

I hear you, but what I’m saying is that we can make a release that excludes it - using the master branch can never guarantee non-breaking changes.

@delta1
Copy link
Collaborator

delta1 commented Oct 27, 2022

@binarybaron here's a branch with everything from that bdk upgrade removed https://github.com/comit-network/xmr-btc-swap/tree/0.11.x

Want to give it a shot? I'm waiting on CI then I'll do a release from that branch of 0.11.1

@delta1
Copy link
Collaborator

delta1 commented Oct 28, 2022

@binarybaron here's a branch with everything from that bdk upgrade removed https://github.com/comit-network/xmr-btc-swap/tree/0.11.x

Want to give it a shot? I'm waiting on CI then I'll do a release from that branch of 0.11.1

@binarybaron please try this branch - there's a CI/test failure that I'm only going to fix if this works for you

@binarybaron
Copy link
Collaborator Author

Sorry, forgot to reply. Running asb on https://github.com/comit-network/xmr-btc-swap/releases/tag/0.11.0 and CLI on the branch you provided fixes the issue

@delta1
Copy link
Collaborator

delta1 commented Oct 28, 2022

No worries, happy to hear that. Let me take a quick look at this broken test and make a release for you.

@lescuer97
Copy link
Collaborator

if this is ready and tests passed can we close this?

@delta1
Copy link
Collaborator

delta1 commented Nov 14, 2022

Well, it's not an issue with 0.11.x but is likely to remain incompatible with master/the next major release 0.12

@delta1 delta1 closed this as completed Nov 14, 2022
@delta1 delta1 reopened this Nov 14, 2022
@delta1
Copy link
Collaborator

delta1 commented Nov 14, 2022

Actually want to keep this open so I can remember to try fix it

@lescuer97
Copy link
Collaborator

perfect no problem

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

No branches or pull requests

3 participants