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

Can't create a Smart Wallet from Web UI using a Ledger #6347

Closed
Tartuffo opened this issue Sep 28, 2022 · 5 comments · Fixed by #6388
Closed

Can't create a Smart Wallet from Web UI using a Ledger #6347

Tartuffo opened this issue Sep 28, 2022 · 5 comments · Fixed by #6388
Assignees
Labels
bug Something isn't working Dapp & UI Support

Comments

@Tartuffo
Copy link
Contributor

Tartuffo commented Sep 28, 2022

Describe the bug

When trying to create a Smart Wallet using a Ledger + Keplr, you get the error message in the screenshot below.

To Reproduce

Attempt to create a smart wallet using a Ledger with Keplr.

Expected behavior

It should work, or give a more meaningful error message.

Platform Environment

Unknown

Additional context

Stack trace:

lockdown.umd.js:6551 Failed to accept offer (Error#9)
lockdown.umd.js:6512 Error#9: Multiple types are registered with Amino type identifier 'swingset/WalletAction': '/agoric.swingset.MsgWalletAction', '/agoric.swingset.MsgWalletSpendAction'. Thus fromAmino cannot be performed.
logError	@	lockdown.umd.js:6512
lockdown.umd.js:6534   at t.AminoTypes.fromAmino (https://wallet.agoric.app/wallet/static/js/main.ee775e33.js:2:241770)
  at https://wallet.agoric.app/wallet/static/js/main.ee775e33.js:2:304137
  at Array.map (<anonymous>)
  at E.signAmino (https://wallet.agoric.app/wallet/static/js/main.ee775e33.js:2:304113)
  at async E.signAndBroadcast (https://wallet.agoric.app/wallet/static/js/main.ee775e33.js:2:303157)
  at async Object.submitSpendAction (https://wallet.agoric.app/wallet/static/js/main.ee775e33.js:102:2166375)
DevTools failed to load source map: Could not load content for chrome-extension://dmkamcknogkgcdfhhbddcghachkejeap/browser-polyfill.js.map: System error: net::ERR_BLOCKED_BY_CLIENT
lockdown.umd.js:6551 
{accountNumber: 134, sequence: 0}
lockdown.umd.js:6551 sign spend action 
{address: 'agoric15v3haayjfj9ycyfsqj7gs4grxktgpgkndpv95h', msgs: Array(1), fee: {…}}
lockdown.umd.js:6551 Failed to accept offer (Error#10)
lockdown.umd.js:6512 Error#10: Multiple types are registered with Amino type identifier 'swingset/WalletAction': '/agoric.swingset.MsgWalletAction', '/agoric.swingset.MsgWalletSpendAction'. Thus fromAmino cannot be performed.
lockdown.umd.js:6534   at t.AminoTypes.fromAmino (https://wallet.agoric.app/wallet/static/js/main.ee775e33.js:2:241770)
  at https://wallet.agoric.app/wallet/static/js/main.ee775e33.js:2:304137
  at Array.map (<anonymous>)
  at E.signAmino (https://wallet.agoric.app/wallet/static/js/main.ee775e33.js:2:304113)
  at async E.signAndBroadcast (https://wallet.agoric.app/wallet/static/js/main.ee775e33.js:2:303157)
  at async Object.submitSpendAction (https://wallet.agoric.app/wallet/static/js/main.ee775e33.js:102:2166375)

Screenshots

ledger-error-message

@Tartuffo Tartuffo added bug Something isn't working Dapp & UI Support labels Sep 28, 2022
@turadg
Copy link
Member

turadg commented Sep 28, 2022

@dckc to diagnose and confirm a fix won't require any changes outside the client

@dckc
Copy link
Member

dckc commented Sep 28, 2022

I tried a clue from @michaelfig to synchronize aminoType with golang code, but now we're back to the symptoms I saw Jul 25:

provisionWallet Error: Broadcasting transaction failed with code 4 (codespace: sdk). Log: signature verification failed; please verify account number (145), sequence (0) and chain-id (agoricollinet-41): unauthorized
  at SigningStargateClient.broadcastTx (stargateclient.ts:412:1)
  at async Object.submitProvision (keyManagement.js:453:1)
  at async provisionWallet (ProvisionDialog.jsx:35:1)

@dckc dckc changed the title Can't create a Smart Wallet using a Ledger Can't create a Smart Wallet from Web UI using a Ledger Sep 28, 2022
@turadg turadg assigned michaelfig and unassigned turadg Sep 29, 2022
@dckc
Copy link
Member

dckc commented Oct 3, 2022

f390f08 is some progress I made last Weds.

@dckc
Copy link
Member

dckc commented Oct 4, 2022

@dckc to diagnose and confirm a fix won't require any changes outside the client

While a clear diagnosis eludes me and @michaelfig , I did confirm that it works from the agd CLI, which makes it pretty clear that a fix won't require any changes outside the client.

agd --node=https://ollinet.rpc.agoric.net:443 tx swingset provision-one nick agoric168rp3ugmpu0jtla5wjkdlqg20rpv65xxzkh8yp SMART_WALLET --from lx --chain-id agoricollinet-42 --sign-mode=amino-json -> https://ollinet.explorer.agoric.net/agoric/tx/453B7AE3CCF0E0746BEF731AFF127ACDBCC8D76C78BC837B9C836FB9E9EE18DF 2022-10-03 13:54

And agd --node=https://ollinet.rpc.agoric.net:443 query vstorage data published.wallet.agoric168rp3ugmpu0jtla5wjkdlqg20rpv65xxzkh8yp.current shows that the wallet was provisioned.

@dckc
Copy link
Member

dckc commented Oct 4, 2022

... I did confirm that it works from the agd CLI, which makes it pretty clear that a fix won't require any changes outside the client.

I take that back... we got some feedback on our Amino support in our x/swingset Cosmos SDK module.

Current theory: the chain and the agd client used the same (incomplete) mapping to Amino, so the signature verified even though it was missing the type/value wrapper. And when CosmJS signed the correct wrapper, the chain wasn’t expecting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Dapp & UI Support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants