Skip to content
Snippets Groups Projects
  1. Jul 05, 2024
  2. May 29, 2024
    • STEVAN Antoine's avatar
      make `.nushell/` a proper module (!123) · 45540a7c
      STEVAN Antoine authored
      this MR turns `./.nushell/` into a directory module by
      - adding `mod.nu`
      - exporting all the modules
      
      all uses of `.nushell/` have been fixed to not mention `.nu` internal modules anymore.
      
      > 💡 **Note**  
      > the `.nushell venv` module has been removed because, when the `$venv.VENV` activation script is not there, Nushell can't parse the whole `.nushell` module, which is very annoying to have to rely of the state of the external filesystem to be able to simply parse a module...
      45540a7c
  3. May 28, 2024
    • STEVAN Antoine's avatar
      split `examples/` into `benchmarks/` and `bins/` (dragoon/komodo!117) · bb626120
      STEVAN Antoine authored
      ## new structure for the repository
      - benchmarks are in `./benchmarks/` and can be run with either `cargo run --package benchmarks --bin <bench>` or the commands in `./benchmarks/README.md`
      ```
      ├── Cargo.toml
      ├── README.md
      └── src
          └── bin
              ├── commit.rs
              ├── fec.rs
              ├── linalg.rs
              ├── operations
              │   ├── curve_group.rs
              │   └── field.rs
              ├── recoding.rs
              ├── setup.rs
              └── setup_size.rs
      ```
      
      - examples are now in `./bins/` as standalone binaries and can be run either with `cargo run --package <pkg>` or with the help of the `cargo bin` command from `.nushell/cargo.nu`
      ```
      ├── curves
      │   ├── Cargo.toml
      │   ├── README.md
      │   └── src
      │       └── main.rs
      ├── inbreeding
      │   ├── build.nu
      │   ├── Cargo.toml
      │   ├── consts.nu
      │   ├── mod.nu
      │   ├── plot.nu
      │   ├── README.md
      │   ├── run.nu
      │   └── src
      │       ├── environment.rs
      │       ├── main.rs
      │       └── strategy.rs
      ├── rank
      │   ├── Cargo.toml
      │   └── src
      │       └── main.rs
      └── rng
          ├── Cargo.toml
          └── src
              └── main.rs
      ```
      
      - Nushell modules are now located in `./.nushell/`
      
      ## changelog
      apart from the changes to the general structure of the repo:
      - `binary.nu` -> `.nushell/binary.nu`
      - new `cargo bin` command from `.nushell/cargo.nu`
      - `error throw` is now defined in `.nushell/error.nu`
      - main TOML has been greatly simplified because the dependencies of "examples" have been moved to the associated crates
      - the rest is basically the same but in the new structure
      bb626120
  4. Mar 26, 2024
  5. Jan 25, 2024
  6. Jan 23, 2024
    • STEVAN Antoine's avatar
      allow passing any matrix as parameter to encoding process (!27) · 0c48f632
      STEVAN Antoine authored
      ## changelog
      - add `--encoding-method` to `komodo prove`
      - pass the encoding matrix to `encode` and `fec::encode` instead of `k` and `n`, these two parameters can be extracted without further check by looking at the shape of the encoding matrix
      - the global recoding vector is now extracted from the encoding matrix instead of recomputing it (see new `Matrix::get_col` implementation)
      - `linalg` and `Matrix::{random, vandermonde}` have been made public (see new `Matrix::random` implementation)
      - the computation of `Matrix::vandermonde` has been optimized
      0c48f632
  7. Jan 17, 2024
    • STEVAN Antoine's avatar
      improvements on the API (!19) · 1b89bb2c
      STEVAN Antoine authored
      ## changes to the API of `komodo.nu`
      - there is no `--powers-file` anymore => the location of the blocks and the powers is controlled via the `$env.KOMODO_HOME` environment variable which defaults to `$env.XDG_DATA_HOME/komodo/` and then `~/.local/share/komodo/`
      - a new `komodo clean` command to empty the `$env.KOMODO_HOME` directory
      - a new `komodo` command to get some basic help
      - `komodo setup` now expects a number of bytes rather than a filename to build a trusted setup
      1b89bb2c
    • STEVAN Antoine's avatar
      test binary module and rename things for clarity (!18) · 6133eda1
      STEVAN Antoine authored
      wait for !17
      
      ## changelog
      - add `bytes from_int: [int -> binary, list<int> -> binary]` to `binary.nu`
      - add `bytes to_int: binary -> list<int>` to `binary.nu`
      - add `tests/binary.nu` to test `binary.nu`
      - run `tests/binary.nu` in the CI
      - for clarity
        - rename `BYTES` to `FILE` in `tests/cli.nu`
        - rename `bytes` to `input` in `komodo.nu`
      6133eda1
    • STEVAN Antoine's avatar
      better error handling and internals (!17) · 016cb2dd
      STEVAN Antoine authored
      in this MR
      - all `unwrap`s and `expect`s have been removed from any `.rs` module that is not `main.rs` => the goal is to never panic from inside the library and let `main.rs` handle the errors
      - in `main.rs` the new `throw_error` function is used to return a message on `stderr` and exit the runtime with a code => then `komodo.nu` picks it up and gives a nicer error to the user
      - the internals of `komodo.nu` also have been greatly simplified without feature changes
      
      > **Note**  
      > because `throw_error` does not return anything and some of the places where there might be errors in `main.rs` need to return a value, some `unwrap_or_else` need to have an `unreachable!` statement in them to show the compiler it's ok if there's no value on the `Err` branch
      >
      > it would be nice to find a better way of doing this 🤔
      016cb2dd
  8. Jan 16, 2024
    • STEVAN Antoine's avatar
      transition to a hash-only application (!16) · e19e3d77
      STEVAN Antoine authored
      in this MR
      - only the hashes of blocks are shown and `komodo ...` expects hashes and not full paths to the blocks
      - completion has been added for the `komodo` command
      - a `komodo ls` command has been added to help with listing blocks
      
      
      > **Note**  
      > everything happens in `blocks/` for now and it's hardcoded
      e19e3d77
    • STEVAN Antoine's avatar
      some miscellaneous work (!15) · 3371ccc9
      STEVAN Antoine authored
      ## changelog
      - add an `inspect` command to `komodo` through `main.rs`
      - remove the useless `Shard.mul` implementation and tests
      - because `i` is a `u128`, use `i.to_le_bytes()` instead of `[i as u8]` in calls to `E::ScalarField::from_le_bytes_mod_order`
      - add to `tests/cli.nu` the cases tha should fail
      - merge together the tests in `lib.rs`, e.g. `verify_2`, `verify_4` and `verify_6` become a simpler `verification`
      - add some documentation and NOTEs
      - `impl`ement `Display` for `Block` to dump it to `stdout`
      - print more detailed test cases when a test fails
      3371ccc9
    • STEVAN Antoine's avatar
      add support for decoding recoded shards (dragoon/komodo!13) · 4493022b
      STEVAN Antoine authored
      - should close dragoon/komodo#3
      - based on top of dragoon/komodo!12
      
      > **Note**  
      > - commits containing "_DEBUG_" will be removed once this is done
      > - this MR is based on dragoon/komodo!12 and will be rebased on top of `main` once dragoon/komodo!12 lands
      
      i think this is best [reviewed commit by commit](dragoon/komodo!13 (58cec473))
      4493022b
  9. Jan 12, 2024
    • STEVAN Antoine's avatar
      test all shard permutations in the CLI test (!14) · 94b544af
      STEVAN Antoine authored
      related to
      - !13
      
      ## description
      in !13, i noticed that decoding can be pretty sensitive to the order of the shards...
      this is why i thought testing all possible permutations of the shards could be beneficial 🤔
      
      see the [run attached to this MR](https://gitlab.isae-supaero.fr/dragoon/komodo/-/jobs/11281#L1120) to see all the combinations of shards used in the tests, e.g. `[0, 2, 3]` means that shards `0`, `2` and `3` have been used and shards `1` and `4` have been "_lost_" 
      
      ## changelog
      this MR
      - adds an inline `math` module to `tests/cli.nu` which defines
        - `choose` which computes all the sets of $k$ choose $n$ in $[|0, ..., n - 1|]$
        - `perm` which computes all the permutations on $[|0, ..., n - 1|]$
        - see the inline `_test_choose` and `_test_perm` commands for concrete examples of their behaviours
      - compute all the permutation of $k'$ choose $n$ shards, where $k'$ ranges from $k$ to $n$
      - run the reconstruction test on all these cases
      - moves the CLI example from `README.md` to `examples/cli.nu`
      
      > **Note**  
      > also removes the newline added to the stdout of `komodo` commands, so that the output is prettier, without spurious empty lines
      94b544af
  10. Jan 10, 2024
  11. Dec 06, 2023
  12. Nov 30, 2023
Loading