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

fix serialize/deserialize in transaction.ts with stable sort #23024

Closed
wants to merge 4 commits into from

Conversation

0xx400
Copy link

@0xx400 0xx400 commented Feb 9, 2022

Problem

see #21722

Sorting pubkey alphabetically could lead to mismatch with offline sign process.
When one signer sign transaction with rust (e.g. with solana cli tool) and another with web3. So, need to make order the same in both case.

Summary of Changes

make sort stable to determine result. JS have unstable sort.
Target behaviour is here:

/// including program ids, are placed last in the set. No duplicates and order is preserved.

Rust have stable sort by default.

Fixes #
#21722

@0xx400 0xx400 changed the title Update transaction.ts Update transaction.ts for serialize/deserialize for stable sort Feb 9, 2022
@mergify mergify bot added the community Community contribution label Feb 9, 2022
@mergify mergify bot requested a review from a team February 9, 2022 02:23
@0xx400 0xx400 changed the title Update transaction.ts for serialize/deserialize for stable sort fix serialize/deserialize in transaction.ts with stable sort Feb 9, 2022
@0xx400 0xx400 marked this pull request as draft February 9, 2022 12:46
@0xx400 0xx400 closed this Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant