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

Add Module::validate API from Wasmtime #840

Merged
merged 4 commits into from Dec 8, 2023
Merged

Conversation

Robbepop
Copy link
Collaborator

@Robbepop Robbepop commented Dec 8, 2023

Closes #839.

Instead return a proper wasmi error indicating usage of unsupported Wasm features.
We do not need this buffer until we actually plan to perform validation in parllel.
@paritytech-cicd-pr
Copy link

BENCHMARKS

NATIVEWASMTIME
BENCHMARKMASTERPRDIFFMASTERPRDIFFWASMTIME OVERHEAD
execute/
br_table
1.52ms 1.47ms 🟢 -3.65% 1.30ms 1.30ms ⚪ 0.16% 🟢 -11%
execute/
call/host/1
45.00µs 45.46µs ⚪ 1.02% 64.34µs 63.08µs 🟢 -1.96% 🟢 39%
execute/
call/rec
166.83µs 166.81µs ⚪ -0.02% 344.40µs 348.54µs 🔴 1.20% 🔴 109%
execute/
count_until
6.64ms 6.69ms ⚪ 0.85% 7.52ms 7.52ms ⚪ 0.04% 🟢 12%
execute/
divrem
6.23ms 6.22ms ⚪ -0.17% 7.09ms 6.96ms 🟢 -1.74% 🟢 12%
execute/
factorial/iter
235.66µs 238.61µs ⚪ 1.25% 298.53µs 307.39µs 🔴 2.97% 🟢 29%
execute/
factorial/rec
684.26µs 678.60µs ⚪ -0.83% 1.26ms 1.27ms ⚪ 0.83% 🟡 88%
execute/
fibonacci/iter
1.31ms 1.30ms ⚪ -0.41% 1.26ms 1.26ms ⚪ 0.26% 🟢 -3%
execute/
fibonacci/rec
6.26ms 6.11ms 🟢 -2.43% 12.68ms 13.09ms 🔴 3.19% 🔴 114%
execute/
fibonacci/tail
1.36ms 1.37ms ⚪ 0.08% 3.58ms 3.63ms 🔴 1.30% 🔴 165%
execute/
fuse
7.41ms 7.38ms ⚪ -0.34% 11.42ms 11.42ms ⚪ -0.04% 🟡 55%
execute/
global/bump
1.32ms 1.32ms ⚪ 0.04% 1.54ms 1.54ms ⚪ 0.02% 🟢 17%
execute/
global/get_const
703.90µs 715.63µs ⚪ 1.67% 751.55µs 750.73µs ⚪ -0.11% 🟢 5%
execute/
is_even/rec
1.09ms 1.11ms ⚪ 2.00% 2.19ms 2.21ms ⚪ 1.09% 🟡 100%
execute/
memory/fill_bytes
1.08ms 1.08ms ⚪ 0.43% 1.32ms 1.32ms ⚪ 0.00% 🟢 22%
execute/
memory/sum_bytes
1.10ms 1.09ms ⚪ -0.46% 1.25ms 1.25ms ⚪ -0.14% 🟢 15%
execute/
memory/vec_add
2.97ms 2.95ms ⚪ -0.70% 3.62ms 3.62ms ⚪ -0.18% 🟢 22%
execute/
recursive_scan
187.20µs 186.16µs ⚪ -0.55% 379.47µs 382.65µs ⚪ 0.84% 🔴 106%
execute/
recursive_trap
15.41µs 15.46µs ⚪ 0.28% 33.80µs 34.66µs 🔴 2.53% 🔴 124%
execute/
regex_redux
597.29µs 595.46µs ⚪ -0.31% 1.02ms 1.04ms 🔴 2.03% 🟡 75%
execute/
rev_complement
446.87µs 447.16µs ⚪ 0.06% 624.05µs 633.44µs 🔴 1.51% 🟢 42%
execute/
tiny_keccak
350.34µs 350.79µs ⚪ 0.13% 376.36µs 378.85µs ⚪ 0.66% 🟢 8%
execute/
trunc_f2i
616.24µs 616.40µs ⚪ 0.03% 963.52µs 962.58µs ⚪ -0.10% 🟡 56%
instantiate/
wasm_kernel
54.22µs 54.16µs ⚪ -0.10% 55.49µs 56.28µs 🔴 1.43% 🟢 4%
overhead/
call/typed/0
1.22ms 1.22ms ⚪ 0.14% 766.55µs 763.00µs ⚪ -0.46% 🟢 -38%
overhead/
call/typed/16
1.61ms 1.60ms ⚪ -0.94% 1.92ms 1.93ms ⚪ 0.45% 🟢 21%
overhead/
call/untyped/0
1.63ms 1.61ms ⚪ -1.34% 1.21ms 1.22ms ⚪ 0.81% 🟢 -24%
overhead/
call/untyped/16
2.49ms 2.56ms 🔴 2.83% 3.75ms 3.87ms 🔴 3.13% 🟡 51%
translate/
bz2/checked/default
1.40ms 1.41ms ⚪ 0.94% 2.64ms 2.63ms ⚪ -0.57% 🟡 86%
translate/
bz2/checked/fuel
1.45ms 1.47ms ⚪ 1.11% 2.72ms 2.75ms ⚪ 1.27% 🟡 88%
translate/
bz2/unchecked/default
1.13ms 1.13ms ⚪ -0.16% 2.01ms 2.01ms ⚪ -0.11% 🟡 78%
translate/
bz2/unchecked/fuel
1.18ms 1.18ms ⚪ 0.08% 2.07ms 2.13ms 🔴 3.13% 🟡 81%
translate/
erc1155/checked/default
287.40µs 286.82µs ⚪ -0.20% 512.91µs 504.16µs 🟢 -1.71% 🟡 76%
translate/
erc1155/checked/fuel
308.30µs 309.44µs ⚪ 0.37% 533.00µs 534.54µs ⚪ 0.29% 🟡 73%
translate/
erc1155/unchecked/default
235.32µs 235.63µs ⚪ 0.13% 392.95µs 393.18µs ⚪ 0.06% 🟡 67%
translate/
erc1155/unchecked/fuel
253.07µs 254.52µs ⚪ 0.57% 408.54µs 420.08µs 🔴 2.83% 🟡 65%
translate/
erc20/checked/default
141.02µs 139.94µs ⚪ -0.77% 246.94µs 243.74µs ⚪ -1.30% 🟡 74%
translate/
erc20/checked/fuel
149.43µs 148.52µs ⚪ -0.61% 253.47µs 253.36µs ⚪ -0.04% 🟡 71%
translate/
erc20/unchecked/default
113.62µs 113.54µs ⚪ -0.07% 188.10µs 190.68µs ⚪ 1.37% 🟡 68%
translate/
erc20/unchecked/fuel
121.84µs 120.69µs ⚪ -0.94% 192.75µs 199.62µs 🔴 3.56% 🟡 65%
translate/
erc721/checked/default
200.14µs 198.56µs ⚪ -0.79% 356.54µs 350.52µs 🟢 -1.69% 🟡 77%
translate/
erc721/checked/fuel
210.55µs 211.92µs ⚪ 0.65% 363.82µs 365.70µs ⚪ 0.52% 🟡 73%
translate/
erc721/unchecked/default
160.00µs 160.70µs ⚪ 0.43% 270.31µs 269.33µs ⚪ -0.36% 🟡 68%
translate/
erc721/unchecked/fuel
169.60µs 169.79µs ⚪ 0.11% 276.21µs 283.04µs 🔴 2.47% 🟡 67%
translate/
pulldown_cmark/checked/default
3.80ms 3.81ms ⚪ 0.23% 7.03ms 6.96ms ⚪ -1.01% 🟡 83%
translate/
pulldown_cmark/checked/fuel
3.92ms 3.93ms ⚪ 0.23% 7.17ms 7.25ms ⚪ 1.10% 🟡 85%
translate/
pulldown_cmark/unchecked/default
3.10ms 3.12ms ⚪ 0.57% 5.41ms 5.39ms ⚪ -0.51% 🟡 73%
translate/
pulldown_cmark/unchecked/fuel
3.21ms 3.23ms ⚪ 0.51% 5.54ms 5.66ms 🔴 2.24% 🟡 75%
translate/
spidermonkey/checked/default
89.53ms 89.33ms ⚪ -0.21% 168.14ms 165.61ms 🟢 -1.50% 🟡 85%
translate/
spidermonkey/checked/fuel
93.11ms 92.27ms ⚪ -0.90% 170.82ms 171.75ms ⚪ 0.54% 🟡 86%
translate/
spidermonkey/unchecked/default
71.46ms 71.78ms ⚪ 0.45% 126.01ms 125.90ms ⚪ -0.09% 🟡 75%
translate/
spidermonkey/unchecked/fuel
75.00ms 74.72ms ⚪ -0.38% 128.94ms 131.64ms 🔴 2.10% 🟡 76%
translate/
wasm_kernel/checked/default
5.11ms 5.11ms ⚪ -0.03% 9.42ms 9.18ms 🟢 -2.55% 🟡 80%
translate/
wasm_kernel/checked/fuel
5.30ms 5.28ms ⚪ -0.39% 9.67ms 9.59ms ⚪ -0.85% 🟡 82%
translate/
wasm_kernel/unchecked/default
4.11ms 4.12ms ⚪ 0.26% 7.15ms 7.14ms ⚪ -0.12% 🟡 73%
translate/
wasm_kernel/unchecked/fuel
4.26ms 4.27ms ⚪ 0.10% 7.35ms 7.48ms 🔴 1.79% 🟡 75%

Link to pipeline

@Robbepop Robbepop merged commit bed9ae4 into master Dec 8, 2023
20 checks passed
@Robbepop Robbepop deleted the rf-add-validation-api branch December 8, 2023 14:24
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.

Add Module::validate API
2 participants