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

Bump polkadot api versions #563

Merged
merged 14 commits into from
Sep 26, 2024
Merged

Bump polkadot api versions #563

merged 14 commits into from
Sep 26, 2024

Conversation

ebma
Copy link
Member

@ebma ebma commented Sep 25, 2024

Due to the runtime upgrade to polkadot v1.1.0 on Foucoco, the portal is not able to properly connect to Foucoco anymore.
When loading the Spacewalk or Staking pages, the following error is thrown

index.37e81365.js:120 Uncaught (in promise) RpcError: -32000: Client error: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
WASM backtrace:
error while executing at wasm backtrace:
    0: 0x683a84 - <unknown>!rust_begin_unwind
    1: 0xc2b8 - <unknown>!core::panicking::panic_fmt::h7d22643b0becf577
    2: 0x210e69 - <unknown>!TransactionPaymentApi_query_info
    at checkError (index.37e81365.js:120:411854)
    at RpcCoder.decodeResponse (index.37e81365.js:120:412261)
    at WsProvider.__internal__onSocketMessageResult (index.37e81365.js:120:425224)
    at WebSocket.__internal__onSocketMessage (index.37e81365.js:120:424911)

This is because some RPC methods were deprecated and are not available anymore.

Solution

We only need to bump the polkadot.js dependency versions. The later versions are aware of the RPC method deprecation and handle the change properly.

@ebma ebma requested a review from a team September 25, 2024 16:14
Copy link

netlify bot commented Sep 25, 2024

Deploy Preview for rococo-souffle-a625f5 ready!

Name Link
🔨 Latest commit 18f5f70
🔍 Latest deploy log https://app.netlify.com/sites/rococo-souffle-a625f5/deploys/66f5705057acaf0008a991ff
😎 Deploy Preview https://deploy-preview-563--rococo-souffle-a625f5.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@gianfra-t gianfra-t left a comment

Choose a reason for hiding this comment

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

Looks good ✅, just some clarification comments.

src/helpers/substrate.ts Outdated Show resolved Hide resolved
src/pages/staking/CollatorsTable.tsx Outdated Show resolved Hide resolved
src/helpers/substrate.ts Outdated Show resolved Hide resolved
Copy link
Member

@TorstenStueber TorstenStueber left a comment

Choose a reason for hiding this comment

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

👍

src/helpers/substrate.ts Outdated Show resolved Hide resolved
@ebma
Copy link
Member Author

ebma commented Sep 26, 2024

I was able to simplify this further and get rid of the fee name checks. The problem was that I missed updating the pendulum-chain/types package to the latest version as well. Thus, there were multiple different polkadot-types versions available in the app and the IDE got confused. Building the app failed when just using the frozen field as before because the pendulum-types were overriding the polkadot-types.

Neither our old v0.9.42 runtimes are using miscFrozen or feeFrozen nor the new v1.1.0 runtime. These fields must have been removed some time ago already though I didn't manage to find out when exactly.

This is great as it makes the changes of this PR even simpler.

Copy link
Member

@TorstenStueber TorstenStueber left a comment

Choose a reason for hiding this comment

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

Nice that you could simplify this further as 0.9.42 already used the new types.

By the way: the removal of src/services/stats/index.tsx is an unrelated change, correct? You just wanted to clean it up here because you saw that it is not used anywhere?

@ebma
Copy link
Member Author

ebma commented Sep 26, 2024

Yes, tsc complained because the stats page was still using miscFrozen and feeFrozen. Since we don't use it anyway, I removed it. IIRC it was used some time ago to expose token-api data with a Netlify function but we replaced this already a long time ago with our dedicated token-api.

@ebma ebma merged commit b93d255 into main Sep 26, 2024
1 check passed
@ebma ebma deleted the bump-polkadot-api-versions branch September 26, 2024 14:32
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.

4 participants