Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to risc0 1.2.1-rc.1 #138

Merged
merged 11 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 58 additions & 38 deletions Cargo.lock

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

17 changes: 7 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,16 @@ opt-level = 3

# RISC Zero
[workspace.dependencies.bonsai-sdk]
git = "https://github.com/risc0/risc0"
rev = "8801e2e3cd030acea2f03f01bd91f37e47e79e23"
version = "1.2.1-rc.1"
features = ["non_blocking"]

[workspace.dependencies.risc0-build]
git = "https://github.com/risc0/risc0"
rev = "8801e2e3cd030acea2f03f01bd91f37e47e79e23"
version = "1.2.1-rc.1"
features = ["unstable"]

[workspace.dependencies.risc0-zkvm]
git = "https://github.com/risc0/risc0"
rev = "8801e2e3cd030acea2f03f01bd91f37e47e79e23"
default-features = false
features = ["bonsai"]
version = "1.2.1-rc.1"
features = ["unstable"]

# External
[workspace.dependencies]
Expand All @@ -40,7 +36,7 @@ alloy = { version = "0.4.2", features = ["full"] }
alloy-chains = "0.1.38"
alloy-consensus = "0.4.2"
alloy-genesis = "0.4.2"
alloy-primitives = { version = "0.8.8", default-features = false, features = ["k256"] }
alloy-primitives = { version = "0.8.8", default-features = false, features = ["k256", "map-hashbrown"] }
alloy-rlp = "0.3.8"
op-alloy-consensus = "0.4.0"
op-alloy-network = "0.4.0"
Expand Down Expand Up @@ -92,12 +88,13 @@ bincode = "1.3.3"
bytemuck = "1.19.0"
clap = { version = "4.0", features = ["derive"] }
env_logger = "0.11.5"
hashbrown = { version = "0.15.2", features = ["rayon"] }
k256 = { version = "0.13.3", features = ["serde", "pem"] }
log = "0.4.22"
flate2 = "1.0.34"
once_cell = "1.20.2"
pot = "3.0.1"
rkyv = "0.8.9"
rkyv = { version = "0.8.9", features = ["hashbrown-0_15"] }
serde = { version = "1.0.210", features = ["derive"] }
serde_json = { version = "1.0.128", features = ["alloc"] }
serde_with = "3.11.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ By using reth to run the block execution process within the zkVM, we obtain a ZK

## Status

Zeth uses version 1.1.3 of the RISC Zero zkVM and version 1.1.0 of reth (backed by revm 14.0.3), but its other components are not audited for use in production.
Zeth uses version `1.2.1-rc.1` of the RISC Zero zkVM and version 1.1.0 of reth (backed by revm 14.0.3), but its other components are not audited for use in production.

## Prerequisites
1. [rust](https://www.rust-lang.org/tools/install)
Expand Down
15 changes: 11 additions & 4 deletions crates/core-ethereum/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 RISC Zero, Inc.
// Copyright 2024, 2025 RISC Zero, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@ use crate::chain_spec::{DEV, HOLESKY, MAINNET, SEPOLIA};
use anyhow::Context;
use k256::ecdsa::signature::hazmat::PrehashVerifier;
use k256::ecdsa::VerifyingKey;
use reth_chainspec::{ChainSpec, NamedChain};
use reth_chainspec::{ChainSpec, EthereumHardforks, NamedChain};
use reth_consensus::Consensus;
use reth_ethereum_consensus::EthBeaconConsensus;
use reth_evm::execute::{
Expand Down Expand Up @@ -126,8 +126,15 @@ where
let vk = &signers[i];
let sig = tx.signature();

sig.to_k256()
.and_then(|sig| vk.verify_prehash(tx.signature_hash().as_slice(), &sig))
let sig = if !chain_spec.is_homestead_active_at_block(block.number) {
sig.normalize_s()
.map(|s| s.to_k256())
.unwrap_or_else(|| sig.to_k256())
} else {
sig.to_k256()
};

sig.and_then(|sig| vk.verify_prehash(tx.signature_hash().as_slice(), &sig))
.with_context(|| format!("invalid signature for tx {i}"))?;

senders.push(Address::from_public_key(vk))
Expand Down
1 change: 1 addition & 0 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ anyhow.workspace = true
alloy-consensus.workspace = true
alloy-primitives.workspace = true
alloy-rlp.workspace = true
hashbrown.workspace = true
k256.workspace = true
pot.workspace = true
rkyv.workspace = true
Expand Down
Loading
Loading