Skip to content

Commit b2602e5

Browse files
jonathanpwangUbuntu
andauthored
feat: patch ruint U256 (#18)
* feat: patch ruint with u256 intrinsics * chore: patch * undo local * chore: cargo update --------- Co-authored-by: Ubuntu <ubuntu@ip-172-31-88-141.ec2.internal>
1 parent a616bab commit b2602e5

File tree

8 files changed

+86
-58
lines changed

8 files changed

+86
-58
lines changed

Cargo.lock

Lines changed: 45 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ axvm-keccak256-circuit = { git = "ssh://git@github.com/axiom-crypto/afs-prototyp
132132
axvm-keccak256-transpiler = { git = "ssh://git@github.com/axiom-crypto/afs-prototype.git", default-features = false }
133133
axvm-rv32im-circuit = { git = "ssh://git@github.com/axiom-crypto/afs-prototype.git", default-features = false }
134134
axvm-rv32im-transpiler = { git = "ssh://git@github.com/axiom-crypto/afs-prototype.git", default-features = false }
135+
axvm-bigint-circuit = { git = "ssh://git@github.com/axiom-crypto/afs-prototype.git", default-features = false }
136+
axvm-bigint-transpiler = { git = "ssh://git@github.com/axiom-crypto/afs-prototype.git", default-features = false }
135137
axvm-algebra-circuit = { git = "ssh://git@github.com/axiom-crypto/afs-prototype.git", default-features = false }
136138
axvm-algebra-transpiler = { git = "ssh://git@github.com/axiom-crypto/afs-prototype.git", default-features = false }
137139
axvm-ecc-circuit = { git = "ssh://git@github.com/axiom-crypto/afs-prototype.git", default-features = false }

bin/client-eth/Cargo.lock

Lines changed: 25 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/client-eth/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ axvm = { git = "ssh://git@github.com/axiom-crypto/afs-prototype.git", features =
1515
"std",
1616
] }
1717
axvm-keccak256-guest = { git = "ssh://git@github.com/axiom-crypto/afs-prototype.git" }
18+
axvm-bigint-guest = { git = "ssh://git@github.com/axiom-crypto/afs-prototype.git", features = ["export-intrinsics"] }
1819
axvm-algebra-guest = { git = "ssh://git@github.com/axiom-crypto/afs-prototype.git" }
1920
axvm-ecc-guest = { git = "ssh://git@github.com/axiom-crypto/afs-prototype.git" }
2021
axvm-platform = { git = "ssh://git@github.com/axiom-crypto/afs-prototype.git" }
@@ -41,6 +42,7 @@ revm = { git = "ssh://git@github.com/axiom-crypto/revm", branch = "v43-patched"
4142
revm-primitives = { git = "ssh://git@github.com/axiom-crypto/revm", branch = "v43-patched" }
4243
revm-interpreter = { git = "ssh://git@github.com/axiom-crypto/revm", branch = "v43-patched" }
4344
revm-precompile = { git = "ssh://git@github.com/axiom-crypto/revm", branch = "v43-patched" }
45+
ruint = { git = "ssh://git@github.com/axiom-crypto/uint", branch = "v1.12.3-patched" }
4446

4547
[profile.release]
4648
panic = "abort"

bin/client-eth/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use core::mem::transmute;
22

33
use axvm::io::{println, read, reveal};
4+
#[allow(unused_imports)]
5+
use axvm_bigint_guest; // trigger extern u256 (this may be unneeded)
46
use axvm_ecc_guest::k256::Secp256k1Coord;
57
#[allow(unused_imports)]
68
use axvm_keccak256_guest; // trigger extern native-keccak256

bin/host/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ reth-primitives.workspace = true
2727
# axvm
2828
axvm-build = { workspace = true }
2929
axvm-transpiler = { workspace = true }
30+
axvm-rv32im-circuit = { workspace = true }
3031
axvm-algebra-circuit = { workspace = true }
32+
axvm-bigint-circuit = { workspace = true }
3133
axvm-ecc-circuit = { workspace = true }
3234
axvm-circuit = { workspace = true }
3335
axvm-native-recursion = { workspace = true, features = ["static-verifier"] }

bin/host/src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ use ax_stark_sdk::{
44
};
55
use axvm_algebra_circuit::ModularExtension;
66
use axvm_benchmarks::utils::BenchmarkCli;
7+
use axvm_bigint_circuit::Int256;
78
use axvm_circuit::arch::{instructions::exe::AxVmExe, SystemConfig, VmConfig, VmExecutor};
89
use axvm_ecc_circuit::{WeierstrassExtension, SECP256K1_CONFIG};
910
use axvm_native_compiler::conversion::CompilerOptions;
1011
use axvm_native_recursion::halo2::utils::CacheHalo2ParamsReader;
12+
use axvm_rv32im_circuit::Rv32M;
1113
use axvm_sdk::{
1214
commit::commit_app_exe,
1315
config::{AggConfig, AggStarkConfig, AppConfig, Halo2Config, SdkVmConfig},
@@ -83,12 +85,16 @@ fn reth_vm_config(
8385
if collect_metrics {
8486
system_config.collect_metrics = true;
8587
}
88+
let int256 = Int256::default();
89+
// The builder will do this automatically, but we set it just in case.
90+
let rv32m = Rv32M { range_tuple_checker_sizes: int256.range_tuple_checker_sizes };
8691
SdkVmConfig::builder()
8792
.system(system_config.into())
8893
.rv32i(Default::default())
89-
.rv32m(Default::default())
94+
.rv32m(rv32m)
9095
.io(Default::default())
9196
.keccak(Default::default())
97+
.bigint(int256)
9298
.modular(ModularExtension::new(vec![
9399
SECP256K1_CONFIG.modulus.clone(),
94100
SECP256K1_CONFIG.scalar.clone(),

run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ cd ../..
1414

1515
mkdir -p rpc-cache
1616
source .env
17-
MODE=prove # can be execute, prove, or prove-e2e
17+
MODE=execute # can be execute, prove, or prove-e2e
1818
RUSTFLAGS="-Ctarget-cpu=native" RUST_BACKTRACE=1 OUTPUT_PATH="metrics.json" cargo run --bin rsp --release -- --$MODE --block-number 18884864 --rpc-url $RPC_1 --cache-dir rpc-cache

0 commit comments

Comments
 (0)