eco-stake / restake

Auto-compounder script for Cosmos Validators using REStake
https://restake.app
MIT License
357 stars 307 forks source link

Restake doesn't work when accountNumber is 0 #638

Closed netlinx2 closed 1 year ago

netlinx2 commented 2 years ago

Everything on Restake works for me. No problem with any chain i'm using. But for Teritori i can not enable Restake. I can claim, delegate or redelegate TORI, but if i try to enable Restake, the transaction always fails with the following Error message:

Failed to broadcast: Error when broadcasting tx E7338FC0EA356CF183E317172473584F75CB4DF359975056FD4DCB660331300C at height 0. Code: 4; Raw log: signature verification failed; please verify account number (0) and chain-id (teritori-1): unauthorized

Here are the data details:

{ "txBody": { "messages": [ { "granter": "tori1ss4krazunlfnc8munks4uvsa5c42vlwrgy4hyq", "grantee": "tori1e44rluarkdw56dy2turnwjtvtg4wqvs0slzdv4", "grant": { "authorization": { "typeUrl": "/cosmos.staking.v1beta1.StakeAuthorization", "value": "EjQKMnRvcml2YWxvcGVyMXRqaDZ3cGo2ZDlrcGtmcmN5Z2xrc2V2a2hodGs5Z203Y3c3ZWt1IAE=" }, "expiration": "2023-10-06T22:00:00.000Z" } } ], "memo": "", "timeoutHeight": "0", "extensionOptions": [], "nonCriticalExtensionOptions": [] }, "authInfo": { "signerInfos": [ { "publicKey": { "typeUrl": "/cosmos.crypto.secp256k1.PubKey", "value": "CiEC2TNI/UsuVsMde9SY8ZJqxJ1B4bFQp5ivUMLvsHtfHls=" }, "modeInfo": { "single": { "mode": "SIGN_MODE_DIRECT" } }, "sequence": "9" } ], "fee": { "amount": [ { "denom": "utori", "amount": "0" } ], "gasLimit": "96175", "payer": "", "granter": "" } }, "chainId": "teritori-1", "accountNumber": "0" }

I already deleted the Teritori network from Keplr and reinstalled it from scratch, but the error remains. I also tried diefferent validators, but it's the same problem for all of them. Again: Anything else works perfectly!

tombeynon commented 2 years ago

Interesting! This is because your wallet's accountNumber is 0, i.e. was created at genesis I assume. I found this issue and will try to get a similar fix in place soon: https://github.com/cosmos/cosmjs/issues/549

In the meantime there's not much else you can do, other than use a different wallet I'm afraid.

netlinx2 commented 2 years ago

Many thanks for the quick reply! Will wait for the fix as using a different wallet is not an option for me.

tombeynon commented 2 years ago

@netlinx2 this is very difficult to test since I don't have a wallet with this accountNumber - would you mind seeing if https://test.restake.app/ solves the problem for you?

netlinx2 commented 2 years ago

@tombeynon Unfortunately not. The error message is exactly the same on test.restake.app

tombeynon commented 2 years ago

@netlinx2 Could you refresh a few times and try again?

netlinx2 commented 2 years ago

I did but it's still the same error

netlinx2 commented 2 years ago

It's really strange. I'm using Restake with about 16 chains. One of them is Teritori. They all work without any problems. Even for Teritori I can successfully delegate, redelegate and claim. It's just the Enable Restake thing where the transaction fails.

netlinx2 commented 2 years ago

Hey @tombeynon! Is there anything else I can do to help finding the bug?

tombeynon commented 2 years ago

I'm actually a bit stuck as to what to do next. I'm wondering if it could be a Keplr bug (https://github.com/chainapsis/keplr-wallet/issues/422) but I'm going to do some more testing and see what else I can come up with.

To clarify the issue, this only affects the Authz related transactions because REStake defaults to using Amino signing, but authz transactions cannot be sent in Amino format until the chains upgrade (same issue as ledger support). Therefore Authz transactions use protobuf direct signing which is where this error presents itself.

In the meantime, the Ledger instructions would work if you wanted to create the necessary REStake grants using the CLI instead. I'll update this issue when I have more info.

netlinx2 commented 2 years ago

Refresh what? Just the normal Restake page? Or Testnet page?


Von: Tom Beynon @.> Gesendet: Friday, October 7, 2022 4:22:29 PM An: eco-stake/restake @.> Cc: Michael Hermanns @.>; Mention @.> Betreff: Re: [eco-stake/restake] Restake doesn't work when accountNumber is 0 (Issue #638)

@netlinx2https://github.com/netlinx2 Could you refresh a few times and try again?

— Reply to this email directly, view it on GitHubhttps://github.com/eco-stake/restake/issues/638#issuecomment-1271663439, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APBNHX4RTISRCJNGGBSSXYLWCAW2LANCNFSM6AAAAAAQ7RD54I. You are receiving this because you were mentioned.Message ID: @.***>


HOME & MARINE electronic systems GmbH

Office Bremen Office Hamburg Adam-Opel-Str. 15 Nagelsweg 33-35 28237 Bremen 20097 Hamburg Germany Germany

Tel: +49 (0) 421 - 8306170 Fax: +49 (0) 421 - 830617299 Contact: @.**@.> Internet: www.home-marine.com https://www.home-marine.com Privacy (deu.): www.home-marine.com/datenschutz.html https://www.home-marine.com/datenschutz.html Privacy (eng.): www.home-marine.com/data-protection.html https://www.home-marine.com/data-protection.html

Company Director: Heink Steffens, Markus Roßkamp Company Registration Number: Bremen HRB 23624 HB Vat-N°: DE 205 211 926

Diese Email inklusive Anhang ist vertraulich und kann rechtlich geschützte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese Email irrtümlich erhalten haben, informieren Sie bitte sofort den Absender über die Antwortfunktion und vernichten Sie diese Email. Das Kopieren oder Speichern sowie die Weitergabe dieser Email sind in diesem Falle nicht gestattet. This email and any attachments are confidential and may also be legally privileged. If you are not the named recipient or received this email in error, please notify the sender immediately by reply email and delete this message from your system. Please do not disclose the contents to another person, do not use it for any purpose, or store or copy the information in any medium.

panache56 commented 2 years ago

has anyone found a solution for that problem ? I have exactly the same and it's quite frustrating to can't restake. Thanks for technicals answers and for the work made by the team

tombeynon commented 2 years ago

Unfortunately not yet. Maybe just to triple check, can you confirm whether or not this version of REStake works for you? https://test.restake.app/

techmik commented 2 years ago

I tried at https://test.restake.app/ and got the same error if that helps

tombeynon commented 1 year ago

@techmik thanks so much for your help, all very useful info. I'll update here as soon as I've made some more progress.

techmik commented 1 year ago

@tombeynon it seems like restake is working with teritori except in the case where the validator cannot accept more staking

restake-tori-error

my other 2 validators are restaking fine, just this one that is overcapacity will not restake and only throws that error if I manually compound

netlinx2 commented 1 year ago

Hi @tombeynon , I just want to let you know, that enabling Restake for Teritori now works. Not sure what have changed though. I haven't deleted and added the chain again. But there have been some updates for Keplr for sure. Anyway, it works since today!

tombeynon commented 1 year ago

Well that's great news!! Suggests it might have been a Keplr bug in that case. @techmik @panache56 are you seeing the same?

Regarding the max delegation on Teritori @techmik, that makes sense it would error in that way. I'll raise a separate issue to deal with this.

panache56 commented 1 year ago

just used restake yesterday and it's working like a charm, guess this update took care of this bug, thanks a lot team !

tombeynon commented 1 year ago

Brilliant news, closing this issue then 💥

Thanks for all your help!