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): Implement trie_blake2_256_verify_proof host function #1920

Merged
merged 69 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
7dd7c4b
feat: add verify_proof function
EclesioMeloJunior Oct 8, 2021
e6a3415
chore: adding helpers
EclesioMeloJunior Oct 8, 2021
cff7280
chore: build the tree from proof slice
EclesioMeloJunior Oct 11, 2021
2d816a4
chore: remove Nibbles custom type
EclesioMeloJunior Oct 11, 2021
6a4552a
Merge branch 'development' into eclesio/verify-proof
EclesioMeloJunior Oct 11, 2021
e6a02d8
chore: fix lint warns
EclesioMeloJunior Oct 11, 2021
71cb795
Merge branch 'eclesio/verify-proof' of github.com:ChainSafe/gossamer …
EclesioMeloJunior Oct 11, 2021
e92276b
chore: add benchmark tests
EclesioMeloJunior Oct 11, 2021
493dddb
chore: fix deepsource warns
EclesioMeloJunior Oct 12, 2021
c129de5
Merge branch 'development' into eclesio/verify-proof
EclesioMeloJunior Oct 13, 2021
4de95ec
Merge branch 'development' into eclesio/verify-proof
EclesioMeloJunior Oct 13, 2021
9455e13
chore: redefine LoadFromProof function
EclesioMeloJunior Oct 13, 2021
e8d4912
chore: remove logs
EclesioMeloJunior Oct 13, 2021
10dd296
chore: address comments
EclesioMeloJunior Oct 14, 2021
34b8dd0
Merge branch 'development' into eclesio/verify-proof
EclesioMeloJunior Oct 15, 2021
35abff5
Merge branch 'development' into eclesio/verify-proof
EclesioMeloJunior Oct 15, 2021
e3debb7
Merge branch 'development' into eclesio/verify-proof
EclesioMeloJunior Oct 18, 2021
8e4a1c1
chore: fix the condition to load the proof
EclesioMeloJunior Oct 18, 2021
76893e2
chore: address comments
EclesioMeloJunior Oct 18, 2021
7ee1756
Merge branch 'development' into eclesio/verify-proof
EclesioMeloJunior Oct 19, 2021
c07ab85
chore: create test cases
EclesioMeloJunior Oct 19, 2021
7f24a65
chore: improve find function
EclesioMeloJunior Oct 19, 2021
5a6d3f8
chore: use map to avoid duplicate keys
EclesioMeloJunior Oct 19, 2021
8bd6a33
chore: add test cases to duplicate values and nil values
EclesioMeloJunior Oct 19, 2021
f4081ba
chore: fix unused param lint error
EclesioMeloJunior Oct 19, 2021
d8a5e41
chore: use the shortest form
EclesioMeloJunior Oct 19, 2021
6465be8
chore: use set just for find dupl keys
EclesioMeloJunior Oct 19, 2021
6204ba4
Merge branch 'development' into eclesio/verify-proof
EclesioMeloJunior Oct 19, 2021
c0a88a9
chore: fixing test cases
EclesioMeloJunior Oct 19, 2021
8836808
Merge branch 'eclesio/verify-proof' into eclesio/runtime-verify-proof
EclesioMeloJunior Oct 19, 2021
0193014
wip: waiting w3f response about host fun
EclesioMeloJunior Oct 19, 2021
8406e94
chore: trie without rtm prefix
EclesioMeloJunior Oct 20, 2021
7fe1e94
feat: add ext_trie_blake2_256_verify_proof_version_1 host function
EclesioMeloJunior Oct 22, 2021
ee4a4a4
Merge branch 'development' into eclesio/runtime-verify-proof
EclesioMeloJunior Oct 22, 2021
3c92e65
Merge branch 'development' into eclesio/runtime-verify-proof
EclesioMeloJunior Oct 22, 2021
b23be22
chore: remove uneeded condition
EclesioMeloJunior Oct 22, 2021
cf034a0
Merge branch 'eclesio/runtime-verify-proof' of github.com:ChainSafe/g…
EclesioMeloJunior Oct 22, 2021
81ce63d
chore: put back test main
EclesioMeloJunior Oct 22, 2021
a426769
chore: fix tests
EclesioMeloJunior Oct 22, 2021
5c28b75
Merge branch 'development' into eclesio/runtime-verify-proof
EclesioMeloJunior Oct 25, 2021
fd00ea1
chore: group param to one type
EclesioMeloJunior Oct 25, 2021
5a31f8e
chore: improve verify proof condition and simplify errors comments
EclesioMeloJunior Oct 25, 2021
d006213
Merge branch 'development' into eclesio/runtime-verify-proof
EclesioMeloJunior Oct 25, 2021
05c28d0
Merge branch 'development' into eclesio/runtime-verify-proof
EclesioMeloJunior Oct 25, 2021
020b04c
Merge branch 'development' into eclesio/runtime-verify-proof
EclesioMeloJunior Oct 26, 2021
ec95003
Merge branch 'development' into eclesio/runtime-verify-proof
EclesioMeloJunior Oct 27, 2021
df5c7db
Merge branch 'development' into eclesio/runtime-verify-proof
noot Oct 27, 2021
d16881e
Merge branch 'development' into eclesio/runtime-verify-proof
noot Oct 27, 2021
c4eb31f
Merge branch 'development' into eclesio/runtime-verify-proof
noot Oct 27, 2021
de632e8
Merge branch 'development' into eclesio/runtime-verify-proof
EclesioMeloJunior Oct 28, 2021
b879c61
Merge branch 'development' into eclesio/runtime-verify-proof
noot Oct 28, 2021
be909f2
Merge branch 'development' into eclesio/runtime-verify-proof
EclesioMeloJunior Oct 29, 2021
c988651
Merge branch 'development' into eclesio/runtime-verify-proof
EclesioMeloJunior Oct 29, 2021
321dcb6
Merge branch 'development' into eclesio/runtime-verify-proof
EclesioMeloJunior Oct 29, 2021
2960125
chore: remove tmp dir after test finish
EclesioMeloJunior Nov 1, 2021
3cb4bf4
chore: update tests
EclesioMeloJunior Nov 1, 2021
371ce96
chore: use map on tests
EclesioMeloJunior Nov 1, 2021
76e8c44
chore: fix lint warns
EclesioMeloJunior Nov 1, 2021
a49d819
Merge branch 'development' into eclesio/runtime-verify-proof
EclesioMeloJunior Nov 1, 2021
53ed87b
chore: update the polkadot-runtime commit
EclesioMeloJunior Nov 1, 2021
3cbe155
Merge branch 'eclesio/runtime-verify-proof' of github.com:ChainSafe/g…
EclesioMeloJunior Nov 1, 2021
b2c1d13
chore: remove comment, add parallel to tests
EclesioMeloJunior Nov 3, 2021
8f29223
chore: fix deepsource warns
EclesioMeloJunior Nov 5, 2021
92828de
Merge branch 'development' into eclesio/runtime-verify-proof
EclesioMeloJunior Nov 5, 2021
54f98cb
chore: create a client rather than the default client
EclesioMeloJunior Nov 5, 2021
b46a01a
chore: update verify-proof trie root param to u32
EclesioMeloJunior Nov 8, 2021
c684da5
chore: change host api commit
EclesioMeloJunior Nov 8, 2021
245cb35
Merge branch 'development' into eclesio/runtime-verify-proof
EclesioMeloJunior Nov 9, 2021
2ada338
using ioutil.ReadAll
EclesioMeloJunior Nov 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/runtime/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ func GetRuntimeBlob(testRuntimeFilePath, testRuntimeURL string) error {
return nil
}

/* #nosec */
resp, err := http.DefaultClient.Get(testRuntimeURL)
resp, err := http.Get(testRuntimeURL)
qdm12 marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return err
}
Expand All @@ -95,7 +94,7 @@ func GetRuntimeBlob(testRuntimeFilePath, testRuntimeURL string) error {
if err != nil {
return err
}
defer resp.Body.Close() //nolint
defer resp.Body.Close() //nolint:errcheck

return ioutil.WriteFile(testRuntimeFilePath, respBody, os.ModePerm)
}
Expand Down
2 changes: 2 additions & 0 deletions lib/runtime/wasmer/imports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,8 @@ func Test_ext_trie_blake2_256_verify_proof_version_1(t *testing.T) {

for name, testcase := range testcases {
t.Run(name, func(t *testing.T) {
t.Parallel()

hashEnc, err := scale.Marshal(testcase.root)
qdm12 marked this conversation as resolved.
Show resolved Hide resolved
require.NoError(t, err)

Expand Down