At the middleware we were defining some types that actually are dependant on the backend no matter how we define them in the middleware. For example, we were hardcoding the `Hash` and `Value` types and their related behaviour (eg. `.to_fields()`) to be based on the length of 4 field elements, but that's not a choice of the middleware, and in fact this is determined by the backend itself. On the same time, those types and related methods do not belong to the backend, since conceptually they are part of the middleware reasoning. The intention of this PR is not to prematurely abstract the library, but to avoid inconsistencies where a type or parameter is defined in the middleware to have certain carachteristic and later in the backend it gets used differently. The idea is that those types and parameters (eg. lengths) have a single source of truth in the code; and in the case of the "base types" (hash, value, etc) this is determined by the backend being used under the hood, not by a choice of the middleware parameters. The idea with this approach, is that the frontend & middleware should not need to import the proving library used by the backend (eg. plonky2, plonky3, etc). As mentioned earlier, the `Hash` and `Value` types are types belonging at the middleware, and is the middleware who reasons about them, but depending on the backend being used, the `Hash` and `Value` types will have different sizes. So it's the backend being used who actually defines their nature under the hood. For example with a plonky2 backend, these types will have a length of 4 field elements, whereas with a plonky3 backend they will have a length of 8 field eleements. Note that his approach does not introduce new traits or abstract code, just makes use of rust features to define 'base types' that are being used in the middleware.
16 lines
571 B
Markdown
16 lines
571 B
Markdown
# POD2
|
|
|
|
## Usage
|
|
- Run tests: `cargo test --release`
|
|
- Rustfmt: `cargo fmt`
|
|
- Check [typos](https://github.com/crate-ci/typos): `typos -c .github/workflows/typos.toml`
|
|
|
|
## Book
|
|
The `book` contains the specification of POD2. A rendered version of the site can be found at: https://0xparc.github.io/pod2/
|
|
|
|
To run it locally:
|
|
- Requirements
|
|
- [mdbook](https://github.com/rust-lang/mdBook): `cargo install mdbook`
|
|
- [mdbook-katex](https://github.com/lzanini/mdbook-katex): `cargo install mdbook-katex`
|
|
- Go to the book directory: `cd book`
|
|
- Run the mdbook: `mdbook serve`
|