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

feat(lib/runtime/wasmer) implement ext_crypto_ecdsa_verify_version_2 #1912

Merged
merged 9 commits into from
Oct 25, 2021

Conversation

edwardmack
Copy link
Member

Changes

  • Implement ext_crypto_ecdsa_verify_version_2 host api function.

Tests

go test -run ^Test_ext_crypto_ecdsa_verify_version_2$ github.com/ChainSafe/gossamer/lib/runtime/wasmer -v

Issues

Primary Reviewer

@codecov
Copy link

codecov bot commented Oct 20, 2021

Codecov Report

Merging #1912 (4a63617) into development (579a791) will increase coverage by 0.07%.
The diff coverage is 63.88%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #1912      +/-   ##
===============================================
+ Coverage        59.74%   59.81%   +0.07%     
===============================================
  Files              188      188              
  Lines            19163    19199      +36     
===============================================
+ Hits             11448    11484      +36     
- Misses            5833     5835       +2     
+ Partials          1882     1880       -2     
Flag Coverage Δ
unit-tests 59.81% <63.88%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/runtime/constants.go 0.00% <ø> (ø)
lib/runtime/wasmer/imports.go 45.83% <63.88%> (+0.50%) ⬆️
lib/babe/babe.go 51.04% <0.00%> (ø)
dot/network/service.go 70.43% <0.00%> (+1.15%) ⬆️
lib/grandpa/vote_message.go 84.56% <0.00%> (+1.23%) ⬆️
dot/network/notifications.go 75.67% <0.00%> (+1.62%) ⬆️
lib/grandpa/message.go 65.68% <0.00%> (+1.96%) ⬆️
lib/babe/epoch.go 66.66% <0.00%> (+2.15%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 579a791...4a63617. Read the comment docs.

lib/runtime/wasmer/imports_test.go Outdated Show resolved Hide resolved
lib/runtime/wasmer/imports_test.go Outdated Show resolved Hide resolved
lib/runtime/wasmer/imports.go Show resolved Hide resolved
lib/runtime/wasmer/imports.go Show resolved Hide resolved
lib/runtime/wasmer/imports_test.go Show resolved Hide resolved
lib/runtime/wasmer/imports_test.go Outdated Show resolved Hide resolved
lib/runtime/wasmer/imports_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@qdm12 qdm12 left a comment

Choose a reason for hiding this comment

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

AFAIK LGTM!

@qdm12
Copy link
Contributor

qdm12 commented Oct 22, 2021

Quick dumb question, can't we have this in Go code? ECDSA verification should be trivial (and performant) to do in Go 🤔

@edwardmack
Copy link
Member Author

Quick dumb question, can't we have this in Go code? ECDSA verification should be trivial (and performant) to do in Go thinking

I think we are using Go code, the github.com/ChainSafe/gossamer/lib/crypto/secp256k1 library is based on github.com/ethereum/go-ethereum/crypto/secp256k1 which I believe is Go code. Maybe I'm misunderstanding the question.

@qdm12
Copy link
Contributor

qdm12 commented Oct 22, 2021

I think we are using Go code, the github.com/ChainSafe/gossamer/lib/crypto/secp256k1 library is based on github.com/ethereum/go-ethereum/crypto/secp256k1 which I believe is Go code. Maybe I'm misunderstanding the question.

Sorry bad formulation & bad understanding I had. So for example ext_crypto_ecdsa_verify_version_2 is exposed with cgo to wasmer so it can run these at runtime right?

@edwardmack
Copy link
Member Author

edwardmack commented Oct 22, 2021

Sorry bad formulation & bad understanding I had. So for example ext_crypto_ecdsa_verify_version_2 is exposed with cgo to wasmer so it can run these at runtime right?

Right, the ext_ functions are wasm import functions that the runtime expects the host container to implement. These functions will be called by the runtime.

@edwardmack edwardmack merged commit 2a418f0 into development Oct 25, 2021
@edwardmack edwardmack deleted the ed/impl_ext_crypto_ecdsa_verify_version_2 branch October 25, 2021 17:48
@github-actions
Copy link

github-actions bot commented Dec 3, 2021

🎉 This PR is included in version 0.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

timwu20 pushed a commit to timwu20/gossamer that referenced this pull request Dec 6, 2021
…hainSafe#1912)

* implement ext_crypto_ecdsa_verify_version_2

* remove comment

* cleanup tests

* add to tests

* update test to use map and assert

Co-authored-by: noot <36753753+noot@users.noreply.github.com>
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.

implement ext_crypto_ecdsa_verify_version_2
4 participants