Skip to content

Commit

Permalink
chore: typo fixes based on cspell (#3319)
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan authored Nov 16, 2023
1 parent 4623d91 commit 8ae44dd
Show file tree
Hide file tree
Showing 153 changed files with 376 additions and 311 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@
* Check that portal address is saved ([#2641](https://github.com/AztecProtocol/aztec-packages/issues/2641)) ([9ebef6e](https://github.com/AztecProtocol/aztec-packages/commit/9ebef6e04d8ddd25649a325f5b3692b42699629e))
* Fixes in deploy scripts ([#2659](https://github.com/AztecProtocol/aztec-packages/issues/2659)) ([f44568b](https://github.com/AztecProtocol/aztec-packages/commit/f44568b8557aac15b4accf901b1ff72efaf2a1da))
* Measure circuit simulation times and input/output sizes ([#2663](https://github.com/AztecProtocol/aztec-packages/issues/2663)) ([027f7ec](https://github.com/AztecProtocol/aztec-packages/commit/027f7ec95f9d761189166936a7c42d08dacf55b7))
* Remove sandbox base image and force_deploy_build. Generalise in check_rebuild. ([#2645](https://github.com/AztecProtocol/aztec-packages/issues/2645)) ([805fe18](https://github.com/AztecProtocol/aztec-packages/commit/805fe18ec1bd207a713cf3438f6d241bf22317fa))
* Remove sandbox base image and force_deploy_build. Generalize in check_rebuild. ([#2645](https://github.com/AztecProtocol/aztec-packages/issues/2645)) ([805fe18](https://github.com/AztecProtocol/aztec-packages/commit/805fe18ec1bd207a713cf3438f6d241bf22317fa))

## [0.8.1](https://github.com/AztecProtocol/aztec-packages/compare/aztec-packages-v0.8.0...aztec-packages-v0.8.1) (2023-10-03)

Expand Down Expand Up @@ -982,7 +982,7 @@
* **cli:** Inspect contract command ([#2248](https://github.com/AztecProtocol/aztec-packages/issues/2248)) ([381706e](https://github.com/AztecProtocol/aztec-packages/commit/381706eaaad7054d620855f7b986e2df3cf62a91)), closes [#2180](https://github.com/AztecProtocol/aztec-packages/issues/2180)
* Define specific Sandbox version when running docker-compose up ([#2238](https://github.com/AztecProtocol/aztec-packages/issues/2238)) ([71da236](https://github.com/AztecProtocol/aztec-packages/commit/71da2360986e5b57f211ca095b95ade2617f4eb8))
* **docs:** Updated docs explaining Sandbox accounts ([#2235](https://github.com/AztecProtocol/aztec-packages/issues/2235)) ([f560066](https://github.com/AztecProtocol/aztec-packages/commit/f560066394c3fc9725be18f320597794e29dc077))
* Optimise sandbox startup time by only initialising the BB solver once. ([#2240](https://github.com/AztecProtocol/aztec-packages/issues/2240)) ([e9cac9c](https://github.com/AztecProtocol/aztec-packages/commit/e9cac9ced3604fdef1d6b298091639fc510cb4fb))
* Optimize sandbox startup time by only initializing the BB solver once. ([#2240](https://github.com/AztecProtocol/aztec-packages/issues/2240)) ([e9cac9c](https://github.com/AztecProtocol/aztec-packages/commit/e9cac9ced3604fdef1d6b298091639fc510cb4fb))
* Remove entrypoint collection ([#2148](https://github.com/AztecProtocol/aztec-packages/issues/2148)) ([e97c94d](https://github.com/AztecProtocol/aztec-packages/commit/e97c94d8bc0659a95f457ba63369fca0dfba47c8))
* Validate nargo version against expected one ([#2254](https://github.com/AztecProtocol/aztec-packages/issues/2254)) ([011c0b7](https://github.com/AztecProtocol/aztec-packages/commit/011c0b7c070f004fcc1c6f9ce8936830c9f496f6))

Expand Down
2 changes: 1 addition & 1 deletion barretenberg/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
},
"typescript.enablePromptUseWorkspaceTsdk": true,
"[cpp]": {
// doesn't conflict with barratenberg.code-workspace settings.
// doesn't conflict with barretenberg.code-workspace settings.
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
},
"[terraform]": {
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Fuzzing build turns off building tests and benchmarks, since they are incompatib

To turn on address sanitizer add `-DADDRESS_SANITIZER=ON`. Note that address sanitizer can be used to explore crashes.
Sometimes you might have to specify the address of llvm-symbolizer. You have to do it with `export ASAN_SYMBOLIZER_PATH=<PATH_TO_SYMBOLIZER>`.
For undefined behaviour sanitizer `-DUNDEFINED_BEHAVIOUR_SANITIZER=ON`.
For undefined behavior sanitizer `-DUNDEFINED_BEHAVIOUR_SANITIZER=ON`.
Note that the fuzzer can be orders of magnitude slower with ASan (2-3x slower) or UBSan on, so it is best to run a non-sanitized build first, minimize the testcase and then run it for a bit of time with sanitizers.

### Test coverage build
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/acir_tests/sol-test/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var input = {
content: base
}
},
settings: { // we require the optimiser
settings: { // we require the optimizer
optimizer: {
enabled: true,
runs: 200
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
message(WARNING "GCC <10 is not supported")
endif()
else()
message(WARNING "Unsuported compiler, use Clang >14 or GCC >10")
message(WARNING "Unsupported compiler, use Clang >14 or GCC >10")
endif()

if(COVERAGE)
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/docs/Fuzzing.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Fuzzing build turns off building tests and benchmarks, since they are incompatib

To turn on address sanitizer add `-DADDRESS_SANITIZER=ON`. Note that address sanitizer can be used to explore crashes.
Sometimes you might have to specify the address of llvm-symbolizer. You have to do it with `export ASAN_SYMBOLIZER_PATH=<PATH_TO_SYMBOLIZER>`.
For undefined behaviour sanitizer `-DUNDEFINED_BEHAVIOUR_SANITIZER=ON`.
For undefined behavior sanitizer `-DUNDEFINED_BEHAVIOUR_SANITIZER=ON`.
Note that the fuzzer can be orders of magnitude slower with ASan (2-3x slower) or UBSan on, so it is best to run a non-sanitized build first, minimize the testcase and then run it for a bit of time with sanitizers.

Building with clang 13 or later is recommended, since libfuzzer contains and by default utilizes the entropic power schedule, which is considered more efficient
Expand Down
6 changes: 3 additions & 3 deletions barretenberg/cpp/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
endif()

# We enable -O1 level optimsations, even when compiling debug wasm, otherwise we get "local count too large" at runtime.
# We prioritise reducing size of final artifacts in release with -Oz.
# We prioritize reducing size of final artifacts in release with -Oz.
if(WASM)
set(CMAKE_CXX_FLAGS_DEBUG "-O1 -g")
set(CMAKE_C_FLAGS_DEBUG "-O1 -g")
Expand Down Expand Up @@ -130,8 +130,8 @@ add_library(
)

if(WASM)
# With binaryen installed, it seems its wasm backend optimiser gets invoked automatically.
# Due to either a bug in the optimiser, or non-standards compliant c++ in crypto/aes, tests start failing with
# With binaryen installed, it seems its wasm backend optimizer gets invoked automatically.
# Due to either a bug in the optimizer, or non-standards compliant c++ in crypto/aes, tests start failing with
# -O3 level optimizations. We force down to -O2 for current workaround.
# TODO: Time has passed, check if this is still needed.
# UPDATE: Uninstall binaryen and any need downstream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ template <typename Curve> class ShplonkVerifier_ {
std::vector<Fr> inverse_vanishing_evals;
inverse_vanishing_evals.reserve(num_claims);
for (const auto& claim : claims) {
// Note: no need for batch inversion; emulated inverison is cheap. (just show known inverse is valid)
// Note: no need for batch inversion; emulated inversion is cheap. (just show known inverse is valid)
inverse_vanishing_evals.emplace_back((z_challenge - claim.opening_pair.challenge).invert());
}

Expand Down
4 changes: 2 additions & 2 deletions barretenberg/cpp/src/barretenberg/common/constexpr_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ template <size_t Start, size_t End, size_t Inc, class F> constexpr void constexp
* The compiler has no alias `X.template <tparam>(args)` for `X.template operator()<tparam>(args)` so we must
* write it explicitly here
*
* To summarise what the next line tells the compiler...
* To summarize what the next line tells the compiler...
* 1. I want to call a member of `f` that expects one or more template parameters
* 2. The member of `f` that I want to call is the function operator
* 3. The template parameter is `Start`
* 4. The funtion operator itself contains no arguments
* 4. The function operator itself contains no arguments
*/
f.template operator()<Start>();

Expand Down
16 changes: 8 additions & 8 deletions barretenberg/cpp/src/barretenberg/common/serialize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,21 +181,21 @@ inline void write(auto& buf, std::integral auto value)
serialize::write(buf, value);
}

// Optimised specialisation for reading arrays of bytes from a raw buffer.
// Optimized specialisation for reading arrays of bytes from a raw buffer.
template <size_t N> inline void read(uint8_t const*& it, std::array<uint8_t, N>& value)
{
std::copy(it, it + N, value.data());
it += N;
}

// Optimised specialisation for writing arrays of bytes to a raw buffer.
// Optimized specialisation for writing arrays of bytes to a raw buffer.
template <size_t N> inline void write(uint8_t*& buf, std::array<uint8_t, N> const& value)
{
std::copy(value.begin(), value.end(), buf);
buf += N;
}

// Optimised specialisation for reading vectors of bytes from a raw buffer.
// Optimized specialisation for reading vectors of bytes from a raw buffer.
inline void read(uint8_t const*& it, std::vector<uint8_t>& value)
{
uint32_t size = 0;
Expand All @@ -205,15 +205,15 @@ inline void read(uint8_t const*& it, std::vector<uint8_t>& value)
it += size;
}

// Optimised specialisation for writing vectors of bytes to a raw buffer.
// Optimized specialisation for writing vectors of bytes to a raw buffer.
inline void write(uint8_t*& buf, std::vector<uint8_t> const& value)
{
write(buf, static_cast<uint32_t>(value.size()));
std::copy(value.begin(), value.end(), buf);
buf += value.size();
}

// Optimised specialisation for reading vectors of bytes from an input stream.
// Optimized specialisation for reading vectors of bytes from an input stream.
inline void read(std::istream& is, std::vector<uint8_t>& value)
{
uint32_t size = 0;
Expand All @@ -222,22 +222,22 @@ inline void read(std::istream& is, std::vector<uint8_t>& value)
is.read(reinterpret_cast<char*>(value.data()), static_cast<std::streamsize>(size));
}

// Optimised specialisation for writing vectors of bytes to an output stream.
// Optimized specialisation for writing vectors of bytes to an output stream.
inline void write(std::ostream& os, std::vector<uint8_t> const& value)
{
write(os, static_cast<uint32_t>(value.size()));
os.write(reinterpret_cast<const char*>(value.data()), static_cast<std::streamsize>(value.size()));
}

// Optimised specialisation for writing arrays of bytes to a vector.
// Optimized specialisation for writing arrays of bytes to a vector.
template <size_t N> inline void write(std::vector<uint8_t>& buf, std::array<uint8_t, N> const& value)
{
buf.resize(buf.size() + N);
auto* ptr = &*buf.end() - N;
write(ptr, value);
}

// Optimised specialisation for writing arrays of bytes to an output stream.
// Optimized specialisation for writing arrays of bytes to an output stream.
template <size_t N> inline void write(std::ostream& os, std::array<uint8_t, N> const& value)
{
os.write(reinterpret_cast<char*>(value.data()), value.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace barretenberg {

/**
* Allocates a bunch of memory slabs sized to serve an UltraPLONK proof construction.
* If you want normal memory allocator behaviour, just don't call this init function.
* If you want normal memory allocator behavior, just don't call this init function.
*
* WARNING: If client code is still holding onto slabs from previous use, when those slabs
* are released they'll end up back in the allocator. That's probably not desired as presumably
Expand Down
4 changes: 2 additions & 2 deletions barretenberg/cpp/src/barretenberg/common/zip_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
* iterates untill the first iterator hits end.
* extends ownership to the end of the for loop, or untill zip goes out of scope.
*
* possibly risky behaviour on clang, gcc for fun(const zip& z) when called as fun(zip(a,b))
* possibly risky behavior on clang, gcc for fun(const zip& z) when called as fun(zip(a,b))
*
*
* Depends on the following behaviour for for loops:
* Depends on the following behavior for for loops:
*
* // in for(x:zip)
* // equiv:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void create_block_constraints(Builder& builder, const BlockConstraint constraint
ASSERT(op.access_type == 0);
field_ct value = poly_to_field_ct(op.value, builder);
field_ct index = poly_to_field_ct(op.index, builder);
// For a ROM table, constant read should be optimised out:
// For a ROM table, constant read should be optimized out:
// The rom_table won't work with a constant read because the table may not be initialized
ASSERT(op.index.q_l != 0);
// We create a new witness w to avoid issues with non-valid witness assignements:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using namespace barretenberg;

// Used to ensure variables are evaluated at runtime and not compile time.
// If EXPECT_EQ macro params are evaluated at compile-time, compiler can optimise them away.
// If EXPECT_EQ macro params are evaluated at compile-time, compiler can optimize them away.
// This triggers compiler errors due to the gtest suite expecting at least one test statement in a TEST macro
void shallow_copy(const fq& in, fq& out)
{
Expand Down
4 changes: 2 additions & 2 deletions barretenberg/cpp/src/barretenberg/ecc/pippenger.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Implement cahe-optimised, parallelisable pippenger implementation
# Implement cache-optimized, parallelizable pippenger implementation

## The problem

Pippenger's algorithm for batched scalar multiplications is the fastest known algorithm for computing a large number of scalar multiplications, with a run time of `O(n / logn)`, where `n` is the number of points being multiplied.

We currently have pippenger implemented in barretenberg, which can process a scalar multiplication in ~4 micro-seconds (for large batches).

However, the algorithm, as it stands, is not parallelisable, due to the highly non-sequential memory access patterns.
However, the algorithm, as it stands, is not parallelizable, due to the highly non-sequential memory access patterns.

## The algorithm

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class join_split_tests : public ::testing::Test {
.creator_pubkey = 0,
.input_nullifier = fr::random_element() };

// Initialise value_notes array as default:
// Initialize value_notes array as default:
for (auto& value_note : value_notes) {
value_note = default_value_note;
value_note.input_nullifier = fr::random_element(); // to ensure uniqueness
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace numeric {
/**
* Returns the number of leading 0 bits for a given integer type.
* Implemented in terms of intrinsics which will use instructions such as `bsr` or `lzcnt` for best performance.
* Undefined behaviour when input is 0.
* Undefined behavior when input is 0.
*/
template <typename T> constexpr inline size_t count_leading_zeros(T const& u);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class DebugEngine : public Engine {
};

/**
* Used by tests to ensure consistent behaviour.
* Used by tests to ensure consistent behavior.
*/
Engine& get_debug_engine(bool reset)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void UltraComposer::compute_witness(CircuitBuilder& circuit_constructor)
}
}

// Initialise the `s_randomness` positions in the s polynomials with 0.
// Initialize the `s_randomness` positions in the s polynomials with 0.
// These will be the positions where we will be adding random scalars to add zero knowledge
// to plookup (search for `Blinding` in plonk/proof_system/widgets/random_widgets/plookup_widget_impl.hpp
// ProverPlookupWidget::compute_sorted_list_polynomial())
Expand Down Expand Up @@ -414,7 +414,7 @@ std::shared_ptr<proving_key> UltraComposer::compute_proving_key(CircuitBuilder&
}
}

// Initialise the last `s_randomness` positions in table polynomials with 0. We don't need to actually randomise
// Initialize the last `s_randomness` positions in table polynomials with 0. We don't need to actually randomize
// the table polynomials.
for (size_t i = 0; i < s_randomness; ++i) {
poly_q_table_column_1[offset] = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ template <typename program_settings> bool VerifierBase<program_settings>::verify

key->program_width = program_settings::program_width;

// Add the proof data to the transcript, according to the manifest. Also initialise the transcript's hash type and
// Add the proof data to the transcript, according to the manifest. Also initialize the transcript's hash type and
// challenge bytes.
transcript::StandardTranscript transcript = transcript::StandardTranscript(
proof.proof_data, manifest, program_settings::hash_type, program_settings::num_challenge_bytes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ barretenberg::fr ProverPermutationWidget<program_width, idpolys, num_roots_cut_o
barretenberg::fr beta = fr::serialize_from_buffer(transcript.get_challenge("beta").begin());
barretenberg::fr gamma = fr::serialize_from_buffer(transcript.get_challenge("beta", 1).begin());

// Initialise the (n + 1)th coefficients of quotient parts so that reuse of proving
// Initialize the (n + 1)th coefficients of quotient parts so that reuse of proving
// keys does not use some residual data from another proof.
key->quotient_polynomial_parts[0][key->circuit_size] = 0;
key->quotient_polynomial_parts[1][key->circuit_size] = 0;
Expand Down Expand Up @@ -486,10 +486,10 @@ barretenberg::fr ProverPermutationWidget<program_width, idpolys, num_roots_cut_o
// TODO: With the reduction from 2 z polynomials to a single z(X), the above no longer applies
// TODO: Fix this to remove the (z(X.ω) - 1).L_{n-1}(X) check

// To summarise, we can't verify claims about z(X) when evaluated at `ω_n`.
// To summarize, we can't verify claims about z(X) when evaluated at `ω_n`.
// But we can verify claims about z(X.ω) when evaluated at `ω_{n-1}`, which is the same thing

// To summarise the summary: If z(ω_n) = 1, then (z(X.ω) - 1).L_{n-1}(X) will be divisible by Z_H*(X)
// To summarize the summary: If z(ω_n) = 1, then (z(X.ω) - 1).L_{n-1}(X) will be divisible by Z_H*(X)
// => add linearly independent term (z(X.ω) - 1).(α^3).L{n-1}(X) into the quotient polynomial to check
// this

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace barretenberg {

// Highly optimised read / write of polynomials in little endian montgomery form.
// Highly optimized read / write of polynomials in little endian montgomery form.
template <typename B> inline void read(B& buf, polynomial& p)
{
uint32_t size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ template <typename Flavor> class ECCVMCircuitBuilder {

[[nodiscard]] size_t get_num_gates() const
{
// TODO(@zac-williamson) once we have a stable base to work off of, optimise this method!
// TODO(@zac-williamson) once we have a stable base to work off of, optimize this method!
// (issue #2218)
const auto msms = get_msms();
const auto flattened_muls = get_flattened_scalar_muls(msms);
Expand Down
Loading

0 comments on commit 8ae44dd

Please sign in to comment.