chore: fix sync issue on account, add change trust keyring txn type and update fee multiplier#110
chore: fix sync issue on account, add change trust keyring txn type and update fee multiplier#110stanleyyconsensys wants to merge 12 commits into
Conversation
| * The base fee multiplier for the Stellar network. | ||
| */ | ||
| baseFeeMultiplier: parseIntegerStruct(1, 1.2), | ||
| baseFeeMultiplier: parseIntegerStruct(1, 1.5), |
There was a problem hiding this comment.
1.2 is too low
| * @see https://developers.stellar.org/docs/learn/fundamentals/fees-resource-limits-metering#ledger-limits | ||
| */ | ||
| simulationFeeMultiplier: parseIntegerStruct(1, 1.5), | ||
| simulationFeeMultiplier: parseIntegerStruct(1, 2), |
There was a problem hiding this comment.
exp some txn fail with 1.5, try 2
| Unknown = 'unknown', | ||
| } | ||
|
|
||
| enum KeyringTransactionTypeLabel { |
There was a problem hiding this comment.
the label to match the client detect
token approve is too generic, which can be a contract token approve
so we use more specific name for that
| async handle(origin: string, request: JsonRpcRequest): Promise<Json> { | ||
| const result = | ||
| (await withCatchAndThrowSnapError(async () => { | ||
| this.#logger.debug('Handle keyring request', { |
There was a problem hiding this comment.
add log to debug
There was a problem hiding this comment.
Pull request overview
This PR adjusts keyring transaction typing for Stellar trustline (change-trust) operations and changes how on-chain account sync emits balance and asset-list updates to resolve client sync/reconciliation issues.
Changes:
- Map trustline opt-in/opt-out transactions to
TransactionType.TokenApprove/TransactionType.TokenDisapproveand add adetails.typeLabelhint for UI differentiation. - Change on-chain sync event payload behavior: emit balances only for on-chain-visible assets and replay asset-list add/remove each sync; add extra debug logging around emits.
- Increase default transaction fee multiplier config values.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/snap/src/services/transaction/KeyringTransactionBuilder.ts | Map change-trust requests to approve/disapprove transaction types and attach a UI type label via details. |
| packages/snap/src/services/transaction/KeyringTransactionBuilder.test.ts | Update tests to assert new transaction types and details.typeLabel for trustline operations. |
| packages/snap/src/services/on-chain-account/OnChainAccountSynchronizeService.ts | Adjust sync delta computation to omit tombstones/zero SEP-41 from balance payload and replay asset-list visibility each sync; add debug logs for emitted payloads. |
| packages/snap/src/services/on-chain-account/OnChainAccountSynchronizeService.test.ts | Update tests to reflect new balance/asset-list emission semantics. |
| packages/snap/src/handlers/keyring/keyring.ts | Add debug logging around keyring request handling. |
| packages/snap/src/config.ts | Update default fee multiplier configuration values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * The base fee multiplier for the Stellar network. | ||
| */ | ||
| baseFeeMultiplier: parseIntegerStruct(1, 1.2), | ||
| baseFeeMultiplier: parseIntegerStruct(1, 1.5), |
| * @see https://developers.stellar.org/docs/learn/fundamentals/fees-resource-limits-metering#ledger-limits | ||
| */ | ||
| simulationFeeMultiplier: parseIntegerStruct(1, 1.5), | ||
| simulationFeeMultiplier: parseIntegerStruct(1, 2), |
Explanation
References
Checklist