-
Notifications
You must be signed in to change notification settings - Fork 423
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
Use timeout_height from signed amino doc #3772
Use timeout_height from signed amino doc #3772
Conversation
In institutional cases, the signature process may take a while. This is why we override: ``` sequence: signedSequence ``` Since maybe the sequence number has changes since the dApp sent its requested sign doc to the wallet - the wallet may update the sequence number to a new value, and the dApp should use the returned value - which was signed on. The same reasoning should follow for `timeout_height` which is a newer addition to the protocol than sequence number.
@sam-utila is attempting to deploy a commit to the OsmoLabs Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe change modifies the Changes
Sequence Diagram(s)sequenceDiagram
participant AccountStore
participant SignDoc
participant Signed
AccountStore->>SignDoc: Retrieve timeout_height
SignDoc-->>AccountStore: signDoc.timeout_height
AccountStore->>Signed: Retrieve timeout_height
Signed-->>AccountStore: signed.timeout_height
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Additional comments not posted (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (3)
packages/stores/src/account/base.ts (3)
Line range hint
287-293
: Improve error handling ingetWalletRepo
.Consider adding more specific error messages or handling for cases where the wallet repository is not found.
- throw new Error(`Chain ${chainNameOrId} is not provided.`); + throw new Error(`Wallet repository for chain '${chainNameOrId}' is not found. Please ensure the chain ID is correct and the wallet is connected.`);
Line range hint
374-377
: Check for nullability ingetWallet
.Ensure that the
wallet
variable is not null before accessing properties. Consider adding a null check or handling for thewallet
variable.- const walletInfo = wallet.walletInfo as CosmosRegistryWallet; + const walletInfo = wallet?.walletInfo as CosmosRegistryWallet;
Line range hint
1024-1027
: Clarify error message insignDirect
.The error message "Failed to retrieve account from signer" could be more informative by including the signer address.
- throw new Error("Failed to retrieve account from signer"); + throw new Error(`Failed to retrieve account from signer for address: ${signerAddress}`);
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@sam-utila how did you notice this? |
Basically timeout_height bytes are part of the But So if there are multiple signers for the transactions - the wallet is not allowed to touch However - if I'm the only signer - why not? |
@sam-utila can you update to the latest branch of stage please |
What is the purpose of the change:
In institutional cases, the signature process may take a while.
This is why we override:
Since maybe the sequence number has changes since the dApp sent its requested sign doc to the wallet - the wallet may update the sequence number to a new value, and the dApp should use the returned value - which was signed on.
The same reasoning should follow for
timeout_height
which is a newer addition to the protocol than sequence number.Linear Task
N/A
Brief Changelog
Use timeout_height from signed amino doc
Testing and Verifying
This change has been tested locally using our own extension wallet that modifies timeout height