Skip to content

chore: fix sync issue on account, add change trust keyring txn type and update fee multiplier#110

Open
stanleyyconsensys wants to merge 12 commits into
mainfrom
fix/sync-issue-on-account-and-txn
Open

chore: fix sync issue on account, add change trust keyring txn type and update fee multiplier#110
stanleyyconsensys wants to merge 12 commits into
mainfrom
fix/sync-issue-on-account-and-txn

Conversation

@stanleyyconsensys

@stanleyyconsensys stanleyyconsensys commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Explanation

image

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@stanleyyconsensys stanleyyconsensys requested a review from a team as a code owner June 15, 2026 09:03
@stanleyyconsensys stanleyyconsensys changed the base branch from main to feat/map-sep41-receive June 15, 2026 09:06
Comment thread packages/snap/src/config.ts Outdated
* The base fee multiplier for the Stellar network.
*/
baseFeeMultiplier: parseIntegerStruct(1, 1.2),
baseFeeMultiplier: parseIntegerStruct(1, 1.5),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.2 is too low

Comment thread packages/snap/src/config.ts Outdated
* @see https://developers.stellar.org/docs/learn/fundamentals/fees-resource-limits-metering#ledger-limits
*/
simulationFeeMultiplier: parseIntegerStruct(1, 1.5),
simulationFeeMultiplier: parseIntegerStruct(1, 2),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exp some txn fail with 1.5, try 2

Unknown = 'unknown',
}

enum KeyringTransactionTypeLabel {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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', {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add log to debug

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.TokenDisapprove and add a details.typeLabel hint 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.

Comment thread packages/snap/src/config.ts Outdated
* The base fee multiplier for the Stellar network.
*/
baseFeeMultiplier: parseIntegerStruct(1, 1.2),
baseFeeMultiplier: parseIntegerStruct(1, 1.5),
Comment thread packages/snap/src/config.ts Outdated
* @see https://developers.stellar.org/docs/learn/fundamentals/fees-resource-limits-metering#ledger-limits
*/
simulationFeeMultiplier: parseIntegerStruct(1, 1.5),
simulationFeeMultiplier: parseIntegerStruct(1, 2),
Comment thread packages/snap/src/handlers/keyring/keyring.ts
Comment thread packages/snap/src/handlers/keyring/keyring.ts
Comment thread packages/snap/src/services/on-chain-account/OnChainAccountSynchronizeService.ts Outdated
Comment thread packages/snap/src/services/on-chain-account/OnChainAccountSynchronizeService.ts Outdated
@stanleyyconsensys stanleyyconsensys changed the title Fix/sync issue on account and txn fix: sync issue on account, add change trust keyring txn type and update fee multiplier Jun 15, 2026
@stanleyyconsensys stanleyyconsensys changed the title fix: sync issue on account, add change trust keyring txn type and update fee multiplier chore: fix sync issue on account, add change trust keyring txn type and update fee multiplier Jun 15, 2026
Base automatically changed from feat/map-sep41-receive to main June 15, 2026 10:04

@khanti42 khanti42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants