Skip to content

Commit

Permalink
Move custom Goldilocks field implementation into the verifier contract
Browse files Browse the repository at this point in the history
  • Loading branch information
ekovalev committed Dec 18, 2024
1 parent 9e5dad5 commit d6390a0
Show file tree
Hide file tree
Showing 7 changed files with 437 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions examples/plonky2-verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ homepage.workspace = true
repository.workspace = true

[dependencies]
gcore = { workspace = true, features = ["codec"] }
gstd.workspace = true
num = { workspace = true, features = ["alloc"] }
plonky2.workspace = true
plonky2_field.workspace = true
serde = { workspace = true, features = ["derive", "alloc"] }

[build-dependencies]
gear-wasm-builder.workspace = true
Expand Down
10 changes: 9 additions & 1 deletion examples/plonky2-verifier/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use gear_wasm_builder::WasmBuilder;

fn main() {
gear_wasm_builder::build();
// We are forcing recommended nightly toolchain due to the need to compile this
// program with `oom-handler` feature. The WASM binary of this program is then
// used by the `oom_handler_works` pallet test.
WasmBuilder::new()
.exclude_features(vec!["std"])
.with_forced_recommended_toolchain() // NOTE: Don't use this in production programs!
.build();
}
2 changes: 1 addition & 1 deletion examples/plonky2-verifier/src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

//! Circuit config for a custom `Goldilocks` field implementation from `gstd`.
use gstd::primitives::goldilocks_field::GoldilocksFieldWrapper;
use super::goldilocks_field::GoldilocksFieldWrapper;
use plonky2::{hash::poseidon::PoseidonHash, plonk::config::GenericConfig};
use plonky2_field::extension::quadratic::QuadraticExtension;

Expand Down
Loading

0 comments on commit d6390a0

Please sign in to comment.