Skip to content

Commit 06a2229

Browse files
authored
chore: update sp1 to 5.2.1 (#62)
* chore: bump SP1 to v5.2.1 * chore: bump RSP and Reth
1 parent ec6ff21 commit 06a2229

File tree

13 files changed

+2114
-1301
lines changed

13 files changed

+2114
-1301
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ sp1-cc-client-executor = {path = "./crates/client-executor"}
4545
sp1-cc-host-executor = {path = "./crates/host-executor"}
4646

4747
# sp1
48-
sp1-sdk = "5.0.0"
49-
sp1-zkvm = "5.0.0"
50-
sp1-build = "5.0.0"
48+
sp1-sdk = "5.2.1"
49+
sp1-zkvm = "5.2.1"
50+
sp1-build = "5.2.1"
5151

5252
# rsp
53-
rsp-rpc-db = { git = "https://github.com/succinctlabs/rsp", rev = "881ba190e758e01e72399df462ac99864930ddb0" }
54-
rsp-witness-db = { git = "https://github.com/succinctlabs/rsp", rev = "881ba190e758e01e72399df462ac99864930ddb0" }
55-
rsp-primitives = { git = "https://github.com/succinctlabs/rsp", rev = "881ba190e758e01e72399df462ac99864930ddb0" }
56-
rsp-client-executor = { git = "https://github.com/succinctlabs/rsp", rev = "881ba190e758e01e72399df462ac99864930ddb0" }
57-
rsp-mpt = { git = "https://github.com/succinctlabs/rsp", rev = "881ba190e758e01e72399df462ac99864930ddb0" }
53+
rsp-rpc-db = { git = "https://github.com/succinctlabs/rsp", tag = "reth-1.7.0" }
54+
rsp-witness-db = { git = "https://github.com/succinctlabs/rsp", tag = "reth-1.7.0" }
55+
rsp-primitives = { git = "https://github.com/succinctlabs/rsp", tag = "reth-1.7.0" }
56+
rsp-client-executor = { git = "https://github.com/succinctlabs/rsp", tag = "reth-1.7.0" }
57+
rsp-mpt = { git = "https://github.com/succinctlabs/rsp", tag = "reth-1.7.0" }
5858

5959
# rsp-rpc-db = { path = "../rsp/crates/storage/rpc-db" }
6060
# rsp-witness-db = { path = "../rsp/crates/storage/witness-db" }
@@ -63,71 +63,71 @@ rsp-mpt = { git = "https://github.com/succinctlabs/rsp", rev = "881ba190e758e01e
6363
# rsp-mpt = { path = "../rsp/crates/mpt"}
6464

6565
# reth
66-
reth-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false, features = [
66+
reth-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false, features = [
6767
"alloy-compat",
6868
"std",
6969
] }
70-
reth-codecs = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
71-
reth-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
72-
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
73-
reth-optimism-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
74-
reth-optimism-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
75-
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
76-
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
77-
reth-revm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false, features = [
70+
reth-codecs = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
71+
reth-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
72+
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
73+
reth-optimism-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
74+
reth-optimism-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
75+
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
76+
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
77+
reth-revm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false, features = [
7878
"std",
7979
] }
80-
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false, features = [
80+
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false, features = [
8181
"std",
8282
] }
83-
reth-storage-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false, features = [
83+
reth-storage-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false, features = [
8484
"std",
8585
] }
86-
reth-trie = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
87-
reth-trie-common = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
88-
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
89-
reth-execution-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
90-
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
91-
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
92-
reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
93-
reth-ethereum-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.10", default-features = false }
86+
reth-trie = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
87+
reth-trie-common = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
88+
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
89+
reth-execution-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
90+
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
91+
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
92+
reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
93+
reth-ethereum-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.7.0", default-features = false }
9494

9595
# revm
96-
revm = { version = "22.0.1", features = [
96+
revm = { version = "29.0.0", features = [
9797
"std",
9898
"optional_balance_check"
9999
], default-features = false }
100-
revm-primitives = { version = "18.0.0", features = [
100+
revm-primitives = { version = "20.2.1", features = [
101101
"std",
102102
], default-features = false }
103-
op-revm = { version = "3.0.2", default-features = false }
103+
op-revm = { version = "10.0.0", default-features = false }
104104

105105
# alloy
106-
alloy-primitives = "1.0"
107-
alloy-consensus = { version = "0.14.0", default-features = false }
108-
alloy-contract = { version = "0.14.0", default-features = false }
109-
alloy-eips = { version = "0.14.0", default-features = false }
110-
alloy-node-bindings = { version = "0.14.0", default-features = false }
111-
alloy-provider = { version = "0.14.0", default-features = false, features = [
106+
alloy-primitives = "1.3.1"
107+
alloy-consensus = { version = "1.0.30", default-features = false }
108+
alloy-contract = { version = "1.0.30", default-features = false }
109+
alloy-eips = { version = "1.0.30", default-features = false }
110+
alloy-node-bindings = { version = "1.0.30", default-features = false }
111+
alloy-provider = { version = "1.0.30", default-features = false, features = [
112112
"reqwest",
113113
] }
114-
alloy-rpc-types = { version = "0.14.0", default-features = false, features = [
114+
alloy-rpc-types = { version = "1.0.30", default-features = false, features = [
115115
"eth",
116116
] }
117-
alloy-rpc-types-eth = { version = "0.14.0", default-features = false }
118-
alloy-serde = { version = "0.14.0" }
119-
alloy-transport = { version = "0.14.0" }
117+
alloy-rpc-types-eth = { version = "1.0.30", default-features = false }
118+
alloy-serde = { version = "1.0.30" }
119+
alloy-transport = { version = "1.0.30" }
120120

121121
alloy-rlp = "0.3.10"
122-
alloy-trie = "0.8.1"
123-
alloy-sol-types = { version = "1.0" }
124-
alloy-sol-macro = { version = "1.0" }
125-
alloy = { version = "0.14.0" }
122+
alloy-trie = "0.9.1"
123+
alloy-sol-types = { version = "1.3.1" }
124+
alloy-sol-macro = { version = "1.3.1" }
125+
alloy = { version = "1.0.30" }
126126

127-
alloy-evm = { version = "0.4.0", default-features = false }
128-
alloy-op-evm = { version = "0.4.0", default-features = false }
127+
alloy-evm = { version = "0.20.1", default-features = false }
128+
alloy-op-evm = { version = "0.20.1", default-features = false }
129129

130-
sha2 = "0.10.8"
130+
sha2 = "0.10.9"
131131
beacon-api-client = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "ba43147eb71b07e21e156e2904549405f87bc9a6" }
132132
ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "ba43147eb71b07e21e156e2904549405f87bc9a6" }
133133
async-trait = "0.1.88"
@@ -140,7 +140,7 @@ rust.rust_2018_idioms = { level = "deny", priority = -1 }
140140
rustdoc.all = "warn"
141141

142142
[patch.crates-io]
143-
sha2-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", tag = "patch-sha2-0.10.8-sp1-4.0.0" }
143+
sha2-v0-10-9 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", tag = "patch-sha2-0.10.9-sp1-4.0.0" }
144144
sha3-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha3", tag = "patch-sha3-0.10.8-sp1-4.0.0" }
145145
crypto-bigint = { git = "https://github.com/sp1-patches/RustCrypto-bigint", tag = "patch-0.5.5-sp1-4.0.0" }
146146
tiny-keccak = { git = "https://github.com/sp1-patches/tiny-keccak", tag = "patch-2.0.2-sp1-4.0.0" }

crates/client-executor/src/io.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use revm::{
2424
state::Bytecode,
2525
Context, MainBuilder, MainContext,
2626
};
27-
use revm_primitives::{Address, B256, U256};
27+
use revm_primitives::{B256, U256};
2828
use rsp_client_executor::{error::ClientError, io::WitnessInput};
2929
use rsp_mpt::EthereumState;
3030
use rsp_primitives::genesis::Genesis;
@@ -69,16 +69,6 @@ impl WitnessInput for EvmSketchInput {
6969
self.anchor.header().state_root
7070
}
7171

72-
#[inline(always)]
73-
fn state_requests(&self) -> impl Iterator<Item = (&Address, &Vec<U256>)> {
74-
// Workaround for https://github.com/rust-lang/rust/issues/36375
75-
if true {
76-
unimplemented!()
77-
} else {
78-
std::iter::empty()
79-
}
80-
}
81-
8272
#[inline(always)]
8373
fn bytecodes(&self) -> impl Iterator<Item = &Bytecode> {
8474
self.bytecodes.iter()

crates/host-executor/src/sketch.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{collections::BTreeSet, marker::PhantomData};
1+
use std::{collections::BTreeSet, fmt, marker::PhantomData};
22

33
use alloy_consensus::ReceiptEnvelope;
44
use alloy_eips::{eip2718::Eip2718Error, Decodable2718, Encodable2718};
@@ -11,7 +11,7 @@ use reth_primitives::EthPrimitives;
1111
use revm::{context::result::ExecutionResult, database::CacheDB};
1212
use rsp_mpt::EthereumState;
1313
use rsp_primitives::{account_proof::eip1186_proof_to_account_proof, genesis::Genesis};
14-
use rsp_rpc_db::RpcDb;
14+
use rsp_rpc_db::{BasicRpcDb, RpcDb};
1515
use sp1_cc_client_executor::{
1616
io::{EvmSketchInput, Primitives},
1717
Anchor, ContractInput,
@@ -28,7 +28,7 @@ pub struct EvmSketch<P, PT> {
2828
/// The anchor to execute our view functions on.
2929
pub anchor: Anchor,
3030
/// The [`RpcDb`] used to back the EVM.
31-
pub rpc_db: RpcDb<P, AnyNetwork>,
31+
pub rpc_db: BasicRpcDb<P, AnyNetwork>,
3232
/// The receipts used to retrieve event logs.
3333
pub receipts: Option<Vec<ReceiptEnvelope>>,
3434
/// The provider used to fetch data.
@@ -45,7 +45,7 @@ impl EvmSketch<(), EthPrimitives> {
4545

4646
impl<P, PT> EvmSketch<P, PT>
4747
where
48-
P: Provider<AnyNetwork> + Clone,
48+
P: Provider<AnyNetwork> + fmt::Debug + Clone,
4949
PT: Primitives,
5050
{
5151
/// Executes a smart contract call.
@@ -171,7 +171,7 @@ where
171171
.inner
172172
.clone()
173173
.try_into_header()
174-
.map_err(|h| HostError::HeaderConversionError(h.number))?,
174+
.map_err(|_| HostError::HeaderConversionError(height))?,
175175
);
176176
}
177177

@@ -180,7 +180,7 @@ where
180180
genesis: self.genesis,
181181
ancestor_headers,
182182
state,
183-
bytecodes: self.rpc_db.get_bytecodes(),
183+
bytecodes: self.rpc_db.bytecodes(),
184184
receipts: self.receipts,
185185
})
186186
}

crates/host-executor/src/sketch_builder.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use alloy_eips::BlockId;
44
use alloy_provider::{network::AnyNetwork, Provider, RootProvider};
55
use reth_primitives::EthPrimitives;
66
use rsp_primitives::genesis::Genesis;
7-
use rsp_rpc_db::RpcDb;
7+
use rsp_rpc_db::BasicRpcDb;
88
use sp1_cc_client_executor::io::Primitives;
99
use url::Url;
1010

@@ -156,11 +156,21 @@ where
156156
pub async fn build(self) -> Result<EvmSketch<P, PT>, HostError> {
157157
let anchor = self.anchor_builder.build(self.block).await?;
158158
let block_number = anchor.header().number;
159+
let previous_block_id = BlockId::number(block_number - 1);
160+
let previous_block = self
161+
.provider
162+
.get_block(previous_block_id)
163+
.await?
164+
.ok_or_else(|| HostError::BlockNotFoundError(previous_block_id))?;
159165

160166
let sketch = EvmSketch {
161167
genesis: self.genesis,
162168
anchor,
163-
rpc_db: RpcDb::new(self.provider.clone(), block_number),
169+
rpc_db: BasicRpcDb::new(
170+
self.provider.clone(),
171+
block_number,
172+
previous_block.header.state_root,
173+
),
164174
receipts: None,
165175
provider: self.provider,
166176
phantom: PhantomData,

crates/host-executor/src/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async fn test_multiplexer() -> eyre::Result<()> {
7272

7373
let rates = getRatesCall::abi_decode_returns(&public_values.contractOutput)?;
7474

75-
println!("rates: {:?}", rates);
75+
println!("rates: {rates:?}");
7676

7777
Ok(())
7878
}

examples/example-deploy/host/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ async fn main() -> eyre::Result<()> {
5050

5151
let decoded_address: Address = Address::abi_decode(&check_coinbase)?;
5252

53-
println!("Coinbase address: {:?}", decoded_address);
53+
println!("Coinbase address: {decoded_address:?}");
5454
Ok(())
5555
}

examples/multiplexer/host/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ async fn main() -> eyre::Result<()> {
9393

9494
// Print the fetched rates.
9595
let rates = getRatesCall::abi_decode_returns(&public_vals.contractOutput)?;
96-
println!("Got these rates: \n{:?}", rates);
96+
println!("Got these rates:");
97+
println!("{rates:?}");
9798

9899
// Verify proof and public values.
99100
client.verify(&proof, &vk).expect("verification failed");

examples/optimism/host/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ async fn main() -> eyre::Result<()> {
5858

5959
// Print the fetched rates.
6060
let base_fee = IL1Block::basefeeCall::abi_decode_returns(&public_vals.contractOutput)?;
61-
println!("Base fee: \n{:?}", base_fee);
61+
println!("Base fee:");
62+
println!("{base_fee:?}");
6263

6364
Ok(())
6465
}

examples/uniswap/host/src/basic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ async fn main() -> eyre::Result<()> {
128128
let sqrt_price_x96 = slot0Call::abi_decode_returns(&public_vals.contractOutput)?.sqrtPriceX96;
129129
let sqrt_price = f64::from(sqrt_price_x96) / 2f64.powi(96);
130130
let price = sqrt_price * sqrt_price;
131-
println!("Proven exchange rate is: {}%", price);
131+
println!("Proven exchange rate is: {price}%");
132132

133133
// Save the proof, public values, and vkey to a json file.
134134
save_fixture(vk.bytes32(), &proof);

0 commit comments

Comments
 (0)