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 msg_data type #2275

Merged
merged 2 commits into from
Nov 15, 2024
Merged

Fix msg_data type #2275

merged 2 commits into from
Nov 15, 2024

Conversation

kamilsa
Copy link
Contributor

@kamilsa kamilsa commented Nov 15, 2024

Referenced issues

None

Description of the Change

Fixes issue:

Nov 15 07:45:25 kagomekusama kagome[169038]: [2024-11-15 07:45:25.334] [error]     Mismatched function type. Expected: FuncType {params{i32 , i32 , i32} returns{i64}} , Got: FuncType {params{i32 , i32 , i64} returns{i64}}
Nov 15 07:45:25 kagomekusama kagome[169038]: [2024-11-15 07:45:25.334] [error]     When linking module: "env" , function name: "ext_crypto_ecdsa_sign_prehashed_version_1"
Nov 15 07:45:25 kagomekusama kagome[169038]: [2024-11-15 07:45:25.334] [error]     At AST node: import description
Nov 15 07:45:25 kagomekusama kagome[169038]: [2024-11-15 07:45:25.334] [error]     At AST node: import section
Nov 15 07:45:25 kagomekusama kagome[169038]: [2024-11-15 07:45:25.334] [error]     At AST node: module
Nov 15 07:45:25 kagomekusama kagome[169038]: 24.11.15 07:45:25.334750  pvf              Warning   ApprovalDistribution  Approval validation failed.(parachain id=2274, relay parent=0x36e8…00c5, error=WasmEdge(769) incompatible import type)

Was caused by the wrong type of msg_data parameter in ext_crypto_ecdsa_sign_prehashed_version_1 function.

Instead of WasmSpan, WasmPointer should be used assuming size is 32 according to polkadot-sdk's implementation https://github.com/paritytech/polkadot-sdk/blob/5bc571b0f2de67bd650a8c852c0afdd438377f3f/substrate/primitives/io/src/lib.rs#L1046

Possible Drawbacks

None

Checklist Before Opening a PR

Before you open a Pull Request (PR), please make sure you've completed the following steps and confirm by answering 'Yes' to each item:

  1. Code is formatted: Have you run your code through clang-format to ensure it adheres to the project's coding standards? Yes
  2. Code is documented: Have you added comments and documentation to your code according to the guidelines in the project's contributing guidelines? Yes
  3. Self-review: Have you reviewed your own code to ensure it is free of typos, syntax errors, logical errors, and unresolved TODOs or FIXME without linking to an issue? Yes
  4. Zombienet Tests: Have you ensured that the zombienet tests are passing? Zombienet is a network simulation and testing tool used in this project. It's important to ensure that these tests pass to maintain the stability and reliability of the project. Yes

@kamilsa kamilsa marked this pull request as ready for review November 15, 2024 09:55
@kamilsa kamilsa enabled auto-merge (squash) November 15, 2024 14:48
@kamilsa kamilsa merged commit 153ed85 into master Nov 15, 2024
16 of 21 checks passed
@kamilsa kamilsa deleted the fix/ecdsa-sign-prehashed branch November 15, 2024 14:50
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