-
Notifications
You must be signed in to change notification settings - Fork 322
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: Browser tests for UltraHonk #9047
Changes from 9 commits
1e63dba
9869bb1
720b7fd
829fb9f
1787ddd
a63c1fa
9caccfb
29e12b6
deb59fe
d508546
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,10 +268,10 @@ color-name@~1.1.4: | |
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" | ||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== | ||
|
||
commander@^12.0.0: | ||
version "12.0.0" | ||
resolved "https://registry.yarnpkg.com/commander/-/commander-12.0.0.tgz#b929db6df8546080adfd004ab215ed48cf6f2592" | ||
integrity sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA== | ||
commander@^12.1.0: | ||
version "12.1.0" | ||
resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" | ||
integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== | ||
|
||
[email protected]: | ||
version "9.0.0" | ||
|
@@ -931,11 +931,6 @@ [email protected]: | |
y18n "^5.0.5" | ||
yargs-parser "^21.1.1" | ||
|
||
yarn-upgrade-all@^0.7.2: | ||
version "0.7.2" | ||
resolved "https://registry.yarnpkg.com/yarn-upgrade-all/-/yarn-upgrade-all-0.7.2.tgz#5d2afa9230661c55f22d3f848f22258db732ae20" | ||
integrity sha512-iVxmoBuNdpxeahAIehJ039Pp6S8zQ/qTENQRMV5hp7x/2tLGUzytCODIKZFjfUwcRRKT3boGgHheUEWC7+VlQw== | ||
|
||
yauzl@^2.10.0: | ||
version "2.10.0" | ||
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,15 +59,15 @@ function test() { | |
cd $1 | ||
|
||
set +e | ||
start=$(date +%s%3N) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nothing more finegrained than that? |
||
start=$SECONDS | ||
$FLOW_SCRIPT | ||
result=$? | ||
end=$(date +%s%3N) | ||
end=$SECONDS | ||
duration=$((end - start)) | ||
set -eu | ||
|
||
if [ $result -eq 0 ]; then | ||
echo -e "\033[32mPASSED\033[0m ($duration ms)" | ||
echo -e "\033[32mPASSED\033[0m ($duration s)" | ||
else | ||
echo -e "\033[31mFAILED\033[0m" | ||
touch "$error_file" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -375,6 +375,7 @@ | |
"WASI_SDK_PREFIX": "/opt/wasi-sdk", | ||
"CC": "$env{WASI_SDK_PREFIX}/bin/clang", | ||
"CXX": "$env{WASI_SDK_PREFIX}/bin/clang++", | ||
"CXXFLAGS": "-DBB_VERBOSE", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made verbose logging the default for convenience and so we have a record of the WASM benchmark in the CI (until there is a better way in the future, at least). |
||
"AR": "$env{WASI_SDK_PREFIX}/bin/llvm-ar", | ||
"RANLIB": "$env{WASI_SDK_PREFIX}/bin/llvm-ranlib" | ||
}, | ||
|
@@ -392,6 +393,7 @@ | |
{ | ||
"name": "wasm-dbg", | ||
"displayName": "Build for debug WASM", | ||
"binaryDir": "build-wasm-dbg", | ||
"description": "Build with wasi-sdk to create debug wasm", | ||
"inherits": "wasm", | ||
"environment": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
#ifndef __wasm__ | ||
bool verbose_logging = std::getenv("BB_VERBOSE") == nullptr ? false : std::string(std::getenv("BB_VERBOSE")) == "1"; | ||
#else | ||
bool verbose_logging = false; | ||
bool verbose_logging = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could probably remove this #ifndef stuff and only have line 6 |
||
#endif | ||
|
||
// Used for `debug` in log.hpp. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,30 +25,6 @@ secp256k1_ct::g1_ct ecdsa_convert_inputs(Builder* ctx, const bb::secp256k1::g1:: | |
return { x, y }; | ||
} | ||
|
||
// vector of bytes here, assumes that the witness indices point to a field element which can be represented | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function is also used in ecdsa_secp265r1, and my PR lead to a linker error. I tried to explicitly instantiate but I was getting weird errors so I just gave up and moved this function to the header. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hm weird |
||
// with just a byte. | ||
// notice that this function truncates each field_element to a byte | ||
template <std::size_t SIZE, typename Builder> | ||
bb::stdlib::byte_array<Builder> ecdsa_array_of_bytes_to_byte_array(Builder& builder, | ||
std::array<uint32_t, SIZE> vector_of_bytes) | ||
{ | ||
using byte_array_ct = bb::stdlib::byte_array<Builder>; | ||
using field_ct = bb::stdlib::field_t<Builder>; | ||
|
||
byte_array_ct arr(&builder); | ||
|
||
// Get the witness assignment for each witness index | ||
// Write the witness assignment to the byte_array | ||
for (const auto& witness_index : vector_of_bytes) { | ||
|
||
field_ct element = field_ct::from_witness_index(&builder, witness_index); | ||
size_t num_bytes = 1; | ||
|
||
byte_array_ct element_bytes(element, num_bytes); | ||
arr.write(element_bytes); | ||
} | ||
return arr; | ||
} | ||
witness_ct ecdsa_index_to_witness(Builder& builder, uint32_t index) | ||
{ | ||
fr value = builder.get_variable(index); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ set -e | |
if [ -z "$SKIP_CPP_BUILD" ]; then | ||
# Build the wasms and strip debug symbols. | ||
cd ../cpp | ||
cmake --preset wasm-threads && cmake --build --preset wasm-threads | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made it a bit easier to work on command line by suppressing the very verbose CMake configure output. You'll still get a failure message if something goes wrong. |
||
cmake --preset wasm && cmake --build --preset wasm | ||
cmake --preset wasm-threads -DCMAKE_MESSAGE_LOG_LEVEL=Warning && cmake --build --preset wasm-threads | ||
cmake --preset wasm -DCMAKE_MESSAGE_LOG_LEVEL=Warning && cmake --build --preset wasm | ||
./scripts/strip-wasm.sh | ||
cd ../ts | ||
fi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved these tests up for convenience because we care about them most of all.