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

@solana/web3.js v2 update #15536

Merged
merged 8 commits into from
Nov 29, 2024
Merged

@solana/web3.js v2 update #15536

merged 8 commits into from
Nov 29, 2024

Conversation

tomasklim
Copy link
Member

@tomasklim tomasklim commented Nov 23, 2024

Description

Resolve #12628

Screenshots:

Screenshot 2024-11-29 at 9 04 41 Screenshot 2024-11-29 at 9 05 32

Copy link

github-actions bot commented Nov 23, 2024

🚀 Expo preview is ready!

  • Project → trezor-suite-preview
  • Platforms → android, ios
  • Scheme → trezorsuitelite
  • Runtime Version → 12
  • More info

Learn more about 𝝠 Expo Github Action

@enjojoy
Copy link
Contributor

enjojoy commented Nov 25, 2024

I tested desktop app + tor issue, it's not present 👍🏻

Copy link

socket-security bot commented Nov 25, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/@solana/[email protected], npm/@solana-program/[email protected]

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@martykan martykan added the build-desktop This will trigger the build of desktop apps for your PR label Nov 25, 2024
@vytick vytick requested a review from a team as a code owner November 25, 2024 21:14
@martykan martykan requested a review from Nodonisko as a code owner November 26, 2024 10:43
@martykan martykan added build-desktop This will trigger the build of desktop apps for your PR and removed build-desktop This will trigger the build of desktop apps for your PR labels Nov 26, 2024
@tomasklim
Copy link
Member Author

@SocketSecurity ignore npm/@solana/[email protected]
@SocketSecurity ignore npm/@solana-program/[email protected]

@enjojoy
Copy link
Contributor

enjojoy commented Nov 26, 2024

I tested desktop app + tor issue, it's not present 👍🏻

Tested again, it closed with no problems @tomasklim

@martykan martykan force-pushed the solana-web3-js-two-dot-oh branch 4 times, most recently from ff99aee to ec2125b Compare November 26, 2024 15:54
@martykan martykan added build-desktop This will trigger the build of desktop apps for your PR and removed build-desktop This will trigger the build of desktop apps for your PR labels Nov 26, 2024
@vytick vytick added the solana label Nov 27, 2024
@tomasklim
Copy link
Member Author

/rebase

Copy link

Copy link

Rebasing failed, please rebase manually.

This change attempts to largely replicate the old account and transaction shapes, but also represents a breaking change as some of the old types (like `PublicKey`) no longer exist in `@solana/web3.js` version 2.

Some type utilties were added so that we could source the _actual_ data shapes from the API calls themselves. For instance, we choose the return type that results from calling `getTransaction` with the config `"encoding": "jsonParsed"` _in particular_.
1. Added an RPC subscriptions instance to the `API` type
2. Added code to throw in the event that the transaction is a durable nonce transaction. A little extra work would have to be done to import and construct the durable nonce transaction confirmer.
3. Added a `FIXME` explaining why it would be better to save the `lastValidBlockhash` at the time the transaction was first given a blockhash lifetime, instead of fetching a too-new one in `pushTransaction`
4. Eliminated all of the custom transaction confirmation code, in favour of the new built-in routines.
5. Added a `FIXME` to note that the `fetch()` API typically doesn't allow you to override the `Origin` header. I didn't test whether your runtime actually allows it or not.

Note that all RPC methods are now cancellable via `AbortController`, if you supply an `AbortSignal` to the send/subscribe methods (ie. `.send({ abortSignal })`)
@tomasklim tomasklim force-pushed the solana-web3-js-two-dot-oh branch from 233b823 to e7d4b2f Compare November 29, 2024 08:12
@tomasklim tomasklim changed the title Test: Solana web3 js two dot oh @solana/web3.js v2 update Nov 29, 2024
steveluscher and others added 3 commits November 29, 2024 09:21
…ls` to `@solana/web3.js` v2

1. Corrected a decimal amount in one of the fixtures. That `amount` field is denominated in basis points.
2. Deleted most of the custom transaction instruction formatting code, in favour of the new auto-generated program clients for the System, Compute Budget, and Token programs.
3. Added a note that `lastValidBlockHeight` is sometimes `undefined` in tests
@tomasklim tomasklim force-pushed the solana-web3-js-two-dot-oh branch from e7d4b2f to 52c2551 Compare November 29, 2024 08:22
Copy link
Member

@martykan martykan left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Contributor

@vytick vytick left a comment

Choose a reason for hiding this comment

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

Thanks for the help @steveluscher 🙏

@tomasklim tomasklim merged commit 712c824 into develop Nov 29, 2024
68 of 69 checks passed
@tomasklim tomasklim deleted the solana-web3-js-two-dot-oh branch November 29, 2024 08:51
@bosomt
Copy link
Contributor

bosomt commented Dec 2, 2024

QA OK

Info:

Suite version: desktop 24.12.0 (ba5174e)
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) TrezorSuiteDev/24.12.0 Chrome/130.0.6723.91 Electron/33.1.0 Safari/537.36
OS: MacIntel
Screen: 1512x982
Device: Trezor T3T1 2.8.6 regular (revision 688bddc887b8bb660640cc6e40a99036f2e87f1f)
Transport: BridgeTransport 2.0.33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-desktop This will trigger the build of desktop apps for your PR solana
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Can't close Trezor Suite with Tor On and Solana account active
6 participants