Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Wasm verifies in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
zemse committed Dec 18, 2023
1 parent 91172b2 commit 917e51b
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 161 deletions.
8 changes: 8 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[target.wasm32-unknown-unknown]
rustflags = ["-C", "target-feature=+atomics,+bulk-memory,+mutable-globals", "-C", "link-arg=--max-memory=4294967296"]

[unstable]
build-std = ["panic_abort", "std"]

[build]
target = "x86_64-apple-darwin"
152 changes: 17 additions & 135 deletions Cargo.lock

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

42 changes: 27 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ edition = "2021"
name = "exploit"
path = "src/main.rs"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
# anvil
anvil = { git = "https://github.com/foundry-rs/foundry.git", package = "anvil", features = [ "default" ], rev = "dea5405", optional = true }
Expand All @@ -15,7 +18,7 @@ ethers = { git = "https://github.com/gakonst/ethers-rs", optional = true }
partial-mpt = { git = "https://github.com/zemse/partial-mpt", branch = "main", optional = true }

# zkevm
bus-mapping = { git = "https://github.com/privacy-scaling-explorations/zkevm-circuits", branch = "main", features = [ "test" ], optional = true }
bus-mapping = { git = "https://github.com/privacy-scaling-explorations/zkevm-circuits", branch = "main", optional = true }
eth-types = { git = "https://github.com/privacy-scaling-explorations/zkevm-circuits", branch = "main", optional = true }
zkevm-circuits = { git = "https://github.com/privacy-scaling-explorations/zkevm-circuits", branch = "main", optional = true }
halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", tag = "v2023_04_20", optional = true }
Expand All @@ -39,31 +42,40 @@ svm-rs = { version = "0.3.3", optional = true }
semver = { version = "1.0", features = ["serde"], optional = true }
home = { version = "0.5.5", optional = true }

# [target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
getrandom = { version = "0.2", features = ["js"], optional = true }
wasm-bindgen = { version = "0.2.81", features = ["serde-serialize"], optional = true }
# wasm
js-sys = { version = "0.3", optional = true }
wasm-bindgen = { version = "0.2.84", features = ["serde-serialize"], optional = true }
rayon = { version = "1.5", optional = true }
wasm-bindgen-rayon = { version = "1.0", optional = true }
web-sys = { version = "0.3", features = ["Request", "Window", "Response"], optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
js-sys = { version = "0.3", optional = true }
# console_error_panic_hook = { version = "0.1.7", optional = true }
console_error_panic_hook = { version = "0.1.7", optional = true }

[patch."https://github.com/privacy-scaling-explorations/zkevm-circuits"]
bus-mapping = { git = "https://github.com/zemse/zkevm-circuits", rev = "fb284230", optional = true }
eth-types = { git = "https://github.com/zemse/zkevm-circuits", rev = "fb284230", optional = true }
zkevm-circuits = { git = "https://github.com/zemse/zkevm-circuits", rev = "fb284230", optional = true }
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
getrandom = { version = "0.2", features = ["js"], optional = true }

# for local development only
# [patch."https://github.com/privacy-scaling-explorations/zkevm-circuits"]
# bus-mapping = { path = "../zkevm-circuits/bus-mapping", optional = true }
# eth-types = { path = "../zkevm-circuits/eth-types", optional = true }
# zkevm-circuits = { path = "../zkevm-circuits/zkevm-circuits", optional = true }
# bus-mapping = { git = "https://github.com/zemse/zkevm-circuits", rev = "fb284230", features = [ "wasm" ], optional = true }
# eth-types = { git = "https://github.com/zemse/zkevm-circuits", rev = "fb284230", optional = true }
# zkevm-circuits = { git = "https://github.com/zemse/zkevm-circuits", rev = "fb284230", optional = true }

# for local development only
[patch."https://github.com/privacy-scaling-explorations/zkevm-circuits"]
bus-mapping = { path = "../zkevm-circuits/bus-mapping", features = [ "wasm" ], optional = true }
eth-types = { path = "../zkevm-circuits/eth-types", optional = true }
zkevm-circuits = { path = "../zkevm-circuits/zkevm-circuits", optional = true }

[features]
default = ["dep_wasm"]
dep_binary = ["dep_mainnet_fork", "dep_zkevm", "dep_misc"]
dep_mainnet_fork = ["anvil", "anvil-core", "ethers", "partial-mpt"]
dep_zkevm = ["bus-mapping", "eth-types", "zkevm-circuits", "halo2_proofs", "snark-verifier", "ethers-core", "itertools", "rand_chacha"]
dep_misc = ["tokio", "futures", "dotenv", "clap", "serde", "serde_json", "regex", "reqwest", "pinata-sdk", "svm-rs", "semver", "home"]
dep_wasm = ["getrandom", "wasm-bindgen", "rayon", "wasm-bindgen-rayon", "web-sys", "wasm-bindgen-futures", "js-sys"]
dep_wasm = [
"halo2_proofs", "zkevm-circuits",
"getrandom",
"wasm-bindgen",
"console_error_panic_hook",
"rayon", "wasm-bindgen-rayon", "web-sys", "wasm-bindgen-futures",
"js-sys"
]
Loading

0 comments on commit 917e51b

Please sign in to comment.