Skip to content

Commit

Permalink
Merge branch 'main' into refine-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
smtmfft authored May 31, 2024
2 parents 33204b5 + a90476d commit a4ddfaf
Show file tree
Hide file tree
Showing 43 changed files with 2,082 additions and 211 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:
jobs:
build-test:
name: Build and test
runs-on: ubuntu-latest
runs-on: [taiko-runner]
timeout-minutes: 120
strategy:
matrix:
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:

build-test-sgx-with-docker:
name: Build and test sgx with Docker
runs-on: ubuntu-latest
runs-on: [taiko-runner]
timeout-minutes: 60

steps:
Expand All @@ -107,7 +107,7 @@ jobs:

test-lib:
name: Test raiko-lib
runs-on: ubuntu-latest
runs-on: [taiko-runner]
timeout-minutes: 60

steps:
Expand All @@ -121,7 +121,7 @@ jobs:

clippy:
name: clippy
runs-on: ubuntu-latest
runs-on: [taiko-runner]
timeout-minutes: 30

steps:
Expand All @@ -139,7 +139,7 @@ jobs:

fmt:
name: fmt
runs-on: ubuntu-latest
runs-on: [taiko-runner]
timeout-minutes: 10

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/openapi-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:
jobs:
deploy-docs:
name: Generate OpenAPI docs
runs-on: ubuntu-latest
runs-on: [taiko-runner]
environment:
name: ${{ (github.ref == 'refs/heads/main') && 'github-pages' || 'test-environment' }}
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ permissions:

jobs:
release-please:
runs-on: ubuntu-latest
runs-on: [taiko-runner]
steps:
- uses: googleapis/release-please-action@v4
with:
release-type: simple
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
49 changes: 6 additions & 43 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ resolver = "2"
members = [
"lib",
"host",
"primitives",
"provers/sp1/driver",
"provers/sp1/builder",
"provers/risc0/driver",
Expand Down Expand Up @@ -33,7 +32,6 @@ opt-level = 3

# raiko
raiko-lib = { path = "./lib", features = ["std"] }
raiko-primitives = { path = "./primitives" }
raiko-core = { path = "./core" }

# revm
Expand Down
3 changes: 1 addition & 2 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ risc0-driver = { path = "../provers/risc0/driver", optional = true }
sgx-prover = { path = "../provers/sgx/prover", optional = true }

# raiko
raiko-lib = { workspace = true }
raiko-primitives = { workspace = true, features = ["c-kzg"] }
raiko-lib = { workspace = true, features = ["c-kzg"] }

# alloy
alloy-rlp = { workspace = true }
Expand Down
6 changes: 4 additions & 2 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,10 @@ mod tests {
};
use alloy_primitives::Address;
use clap::ValueEnum;
use raiko_lib::consts::{Network, SupportedChainSpecs};
use raiko_primitives::B256;
use raiko_lib::{
consts::{Network, SupportedChainSpecs},
primitives::B256,
};
use serde_json::{json, Value};
use std::{collections::HashMap, env};

Expand Down
12 changes: 6 additions & 6 deletions core/src/preflight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ use raiko_lib::{
decode_anchor, proposeBlockCall, BlockProposed, GuestInput, TaikoGuestInput,
TaikoProverData,
},
primitives::{
eip4844::{kzg_to_versioned_hash, MAINNET_KZG_TRUSTED_SETUP},
mpt::proofs_to_tries,
},
utils::{generate_transactions, to_header, zlib_compress_data},
Measurement,
};
use raiko_primitives::{
eip4844::{kzg_to_versioned_hash, MAINNET_KZG_TRUSTED_SETUP},
mpt::proofs_to_tries,
};
use serde::{Deserialize, Serialize};
use std::{collections::HashSet, sync::Arc};
use tracing::{info, warn};
Expand Down Expand Up @@ -488,7 +488,7 @@ async fn get_block_proposed_event(
};
let event = BlockProposed::decode_log(&log_struct, false)
.map_err(|_| RaikoError::Anyhow(anyhow!("Could not decode log")))?;
if event.blockId == raiko_primitives::U256::from(l2_block_number) {
if event.blockId == raiko_lib::primitives::U256::from(l2_block_number) {
let Some(log_tx_hash) = log.transaction_hash else {
bail!("No transaction hash in the log")
};
Expand Down Expand Up @@ -615,9 +615,9 @@ mod test {
use ethers_core::types::Transaction;
use raiko_lib::{
consts::{Network, SupportedChainSpecs},
primitives::{eip4844::parse_kzg_trusted_setup, kzg::KzgSettings},
utils::decode_transactions,
};
use raiko_primitives::{eip4844::parse_kzg_trusted_setup, kzg::KzgSettings};

use super::*;

Expand Down
9 changes: 7 additions & 2 deletions core/src/provider/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ use std::{collections::HashSet, mem::take};

use alloy_consensus::Header as AlloyConsensusHeader;
use alloy_primitives::Bytes;
use raiko_lib::{builder::OptimisticDatabase, consts::ChainSpec, mem_db::MemDb, utils::to_header};
use raiko_primitives::{Address, B256, U256};
use raiko_lib::{
builder::OptimisticDatabase,
consts::ChainSpec,
mem_db::MemDb,
primitives::{Address, B256, U256},
utils::to_header,
};
use revm::{
primitives::{Account, AccountInfo, Bytecode, HashMap},
Database, DatabaseCommit,
Expand Down
3 changes: 1 addition & 2 deletions host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ risc0-driver = { path = "../provers/risc0/driver", optional = true }
sgx-prover = { path = "../provers/sgx/prover", optional = true }

# raiko
raiko-lib = { workspace = true }
raiko-primitives = { workspace = true, features = ["c-kzg"] }
raiko-lib = { workspace = true, features = ["c-kzg"] }
raiko-core = { workspace = true }

# alloy
Expand Down
30 changes: 20 additions & 10 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,40 @@ version = "0.1.0"
edition = "2021"

[dependencies]
raiko-primitives = { workspace = true }

alloy-rlp = { workspace = true }
alloy-eips = { workspace = true }
alloy-rlp-derive = { workspace = true }
alloy-sol-types = { workspace = true }
alloy-primitives = { workspace = true }
alloy-rpc-types = { workspace = true }
alloy-consensus = { workspace = true }
alloy-network = { workspace = true }

# errors
anyhow = { workspace = true }
libflate = { workspace = true }
once_cell = { workspace = true }
revm = { workspace = true }
thiserror-no-std = { workspace = true }
thiserror = { workspace = true, optional = true }

# serde
serde = { workspace = true }
serde_json = { workspace = true, optional = true }
serde_with = { workspace = true, optional = true }
thiserror-no-std = { workspace = true }

# revm
revm = { workspace = true }
revm-primitives = { workspace = true }

libflate = { workspace = true }
once_cell = { workspace = true }
url = { workspace = true }
hex = { workspace = true }
c-kzg = { workspace = true }
sha2 = { workspace = true }
sha3 = { workspace = true }
rlp = { workspace = true, features = ["std"] }
cfg-if = { workspace = true }

# [target.'cfg(feature = "std")'.dependencies]
thiserror = { workspace = true, optional = true }
flate2 = { workspace = true, optional = true }
log = { workspace = true, optional = true }

Expand All @@ -38,8 +46,11 @@ chrono = { workspace = true, optional = true }

lazy_static = { workspace = true }

tempfile = { workspace = true, optional = true }

[dev-dependencies]
bincode = "1.3"
hex-literal = { workspace = true }

[features]
default = ["std"]
Expand All @@ -55,9 +66,8 @@ std = [
"dep:serde_with",
# "dep:tokio",
]
tracer = [
"revm/serde-json",
]
tracer = ["revm/serde-json"]
sgx = []
sp1 = []
risc0 = []
c-kzg = ["revm-primitives/c-kzg", "dep:tempfile"]
11 changes: 6 additions & 5 deletions lib/src/builder/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ use alloy_primitives::{TxKind, U256};
use anyhow::{anyhow, bail, ensure, Context, Error, Result};
#[cfg(feature = "std")]
use log::debug;
use raiko_primitives::{
alloy_eips::eip4788::SYSTEM_ADDRESS, mpt::MptNode, receipt::Receipt, Bloom, Rlp2718Bytes,
RlpBytes,
};
use revm::{
interpreter::Host,
primitives::{
Expand All @@ -44,7 +40,12 @@ use crate::{
builder::BlockBuilder,
clear_line,
consts::GWEI_TO_WEI,
guest_mem_forget, inplace_print, print_duration,
guest_mem_forget, inplace_print,
primitives::{
alloy_eips::eip4788::SYSTEM_ADDRESS, mpt::MptNode, receipt::Receipt, Bloom, Rlp2718Bytes,
RlpBytes,
},
print_duration,
time::{AddAssign, Duration, Instant},
utils::{check_anchor_tx, generate_transactions},
Measurement,
Expand Down
Loading

0 comments on commit a4ddfaf

Please sign in to comment.