Skip to content

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

Merged
edwardmack merged 9 commits intodevelopmentfrom
ed/impl_ext_crypto_ecdsa_verify_version_2
Oct 25, 2021
Merged

feat(lib/runtime/wasmer) implement ext_crypto_ecdsa_verify_version_2#1912
edwardmack merged 9 commits intodevelopmentfrom
ed/impl_ext_crypto_ecdsa_verify_version_2

Conversation

@edwardmack
Copy link
Copy Markdown
Contributor

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
Copy Markdown

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.

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown

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