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: Unable to broadcast ledger transaction on local v1.12.1 build signature verification failed #1258

Closed
taariq opened this issue Feb 8, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@taariq
Copy link
Member

taariq commented Feb 8, 2024

Local build commands
Step 1: $git tag v1.12.1
Step 2: LEDGER_ENABLED=true make build
Step 3: mv palomad /usr/local
Step 4: palomad version returns 1.12.1
Step 5: command used:
palomad tx bank send paloma18xrvj2ffxygkmtqwf3tr6fjqk3w0dgg7m6ucwx paloma1dlwec08s93gykwflpsssuqj0ds03yfmahcjs4x 1000000ugrain --chain-id messenger --gas 3500000 --node https://paloma-rpc.acloud.pp.ua:443 --sign-mode "amino-json" --fees 1000ugrain -b sync

The ledger responds to sign the tx and review the details.

  1. Chain ID: messenger
  2. Account: 5
  3. Sequence: 88
  4. Type: Send
  5. Amount: 1000000ugrain
  6. From: paloma18xrvj2ffxygkmtqwf3tr6fjqk3w0dgg7m6ucwx
  7. To: paloma1dlwec08s93gykwflpsssuqj0ds03yfmahcjs4x
  8. Fee: 1000ugrain
  9. Gas: 3500000
  10. APPROVE?

However, when I click approve on the ledger, I get the console output below. It appears that the account sequence being sent is incorrect. It's always 88 and the account number is always 5. I've tested with different rpc endpoints so I think this is related to the upgrade of go-ledger. So now, I am able to sign, but the signature verification fails.

Output of the error.

auth_info:
  fee:
    amount:
    - amount: "1000"
      denom: ugrain
    gas_limit: "3500000"
    granter: ""
    payer: ""
  signer_infos: []
  tip: null
body:
  extension_options: []
  memo: ""
  messages:
  - '@type': /cosmos.bank.v1beta1.MsgSend
    amount:
    - amount: "1000000"
      denom: ugrain
    from_address: paloma18xrvj2ffxygkmtqwf3tr6fjqk3w0dgg7m6ucwx
    to_address: paloma1dlwec08s93gykwflpsssuqj0ds03yfmahcjs4x
  non_critical_extension_options: []
  timeout_height: "0"
signatures: []
confirm transaction before signing and broadcasting [y/N]: y
code: 4
codespace: sdk
data: ""
events: []
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: 'signature verification failed; please verify account number (5), sequence
  (88) and chain-id (messenger): unauthorized'
timestamp: ""
tx: null
txhash: 85659102E63E8675B76E692D3E33FB6187832C9BCBB48EE6C6D316279C8EE46B

Conclusion: The chain-id is correct so account number and sequence must be incorrect. These appear to be generated by the ledger.

palomad tx bank send [from_key_or_address] [to_address] [amount] [flags] takes the following flags for account and sequence.
-a, --account-number uint The account number of the signing account (offline mode only)
-s, --sequence uint The sequence number of the signing account (offline mode only)
but these are offline mode only.

I was able to reproduce this error on both mac and linux laptops so it appears that MacOS is not the issue.

Found more details on the error:
The node uses the public key of the sender account to verify the signature. When verification failed, the node responds to this error. So you can decode the signature to verify that signerInfos (X Y Z) and signedDoc in the signature must match with the info when you sign.

So now I suspect that the account number or the account sequence is not matching the public key information in the keys. I will try to reload the keys.

@taariq taariq added the bug Something isn't working label Feb 8, 2024
@byte-bandit
Copy link

Closing as user error.

maharifu pushed a commit that referenced this issue Aug 13, 2024
# Background

This adds mutable BytesToSign to the skyway module, they get refreshed
after gas estimate is attached to the batch.

# Testing completed

- [x] test coverage exists or has been added/updated
- [ ] tested in a private testnet

# Breaking changes

- [x] I have checked my code for breaking changes
- [x] If there are breaking changes, there is a supporting migration.
maharifu pushed a commit that referenced this issue Aug 16, 2024
# Background

This adds mutable BytesToSign to the skyway module, they get refreshed
after gas estimate is attached to the batch.

# Testing completed

- [x] test coverage exists or has been added/updated
- [ ] tested in a private testnet

# Breaking changes

- [x] I have checked my code for breaking changes
- [x] If there are breaking changes, there is a supporting migration.
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

2 participants