Rename crates and subdirs (#231)

This commit is contained in:
Shoaib Ahmed 2024-10-01 18:27:57 +04:00 committed by GitHub
parent 0bb0aa1e4b
commit e500407681
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
88 changed files with 265 additions and 261 deletions

342
Cargo.lock generated
View file

@ -1260,6 +1260,18 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "cw-client"
version = "0.1.0"
dependencies = [
"anyhow",
"cosmrs",
"hex",
"reqwest 0.12.8",
"serde",
"serde_json",
]
[[package]]
name = "cw-multi-test"
version = "2.1.1"
@ -1280,36 +1292,6 @@ dependencies = [
"thiserror",
]
[[package]]
name = "cw-proof"
version = "0.1.0"
dependencies = [
"clap",
"cosmrs",
"displaydoc",
"hex",
"ics23",
"prost 0.13.3",
"serde",
"serde_with",
"tendermint 0.38.1",
"tendermint-rpc",
]
[[package]]
name = "cw-prover"
version = "0.1.0"
dependencies = [
"clap",
"cosmrs",
"cw-proof",
"hex",
"serde_json",
"tendermint 0.38.1",
"tendermint-rpc",
"tokio",
]
[[package]]
name = "cw-storage-plus"
version = "2.0.0"
@ -2652,9 +2634,9 @@ dependencies = [
[[package]]
name = "httparse"
version = "1.9.4"
version = "1.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9"
checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946"
[[package]]
name = "httpdate"
@ -3116,7 +3098,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
dependencies = [
"cfg-if",
"windows-targets 0.48.5",
"windows-targets 0.52.6",
]
[[package]]
@ -4066,16 +4048,6 @@ dependencies = [
"elliptic-curve",
]
[[package]]
name = "print-fmspc"
version = "0.1.0"
dependencies = [
"dcap-qvl",
"hex",
"serde_json",
"tokio",
]
[[package]]
name = "proc-macro-crate"
version = "3.2.0"
@ -4223,66 +4195,17 @@ dependencies = [
"prost 0.13.3",
]
[[package]]
name = "quartz"
version = "0.1.0"
dependencies = [
"anyhow",
"async-trait",
"base64 0.22.1",
"cargo-generate",
"cargo_metadata",
"clap",
"clearscreen",
"color-eyre",
"cosmrs",
"cosmwasm-std",
"dirs 5.0.1",
"displaydoc",
"figment",
"futures-util",
"hex",
"k256",
"miette",
"once_cell",
"prost 0.13.3",
"quartz-common",
"quartz-tee-ra",
"regex",
"reqwest 0.12.8",
"serde",
"serde_json",
"subtle-encoding",
"target-lexicon",
"tempfile",
"tendermint 0.38.1",
"tendermint-light-client",
"tendermint-rpc",
"thiserror",
"tm-prover",
"tokio",
"toml",
"tonic",
"tracing",
"tracing-subscriber",
"wasmd-client",
"watchexec",
"watchexec-events",
"watchexec-signals",
"xxhash-rust",
]
[[package]]
name = "quartz-common"
version = "0.1.0"
dependencies = [
"quartz-cw",
"quartz-enclave",
"quartz-contract-core",
"quartz-enclave-core",
"quartz-proto",
]
[[package]]
name = "quartz-cw"
name = "quartz-contract-core"
version = "0.1.0"
dependencies = [
"ciborium",
@ -4292,15 +4215,45 @@ dependencies = [
"hex",
"k256",
"quartz-dcap-verifier-msgs",
"quartz-tcbinfo-msgs",
"quartz-tee-ra",
"serde",
"serde_json",
"serde_with",
"sha2 0.10.8",
"tcbinfo-msgs",
"thiserror",
]
[[package]]
name = "quartz-cw-proof"
version = "0.1.0"
dependencies = [
"clap",
"cosmrs",
"displaydoc",
"hex",
"ics23",
"prost 0.13.3",
"serde",
"serde_with",
"tendermint 0.38.1",
"tendermint-rpc",
]
[[package]]
name = "quartz-cw-prover"
version = "0.1.0"
dependencies = [
"clap",
"cosmrs",
"hex",
"quartz-cw-proof",
"serde_json",
"tendermint 0.38.1",
"tendermint-rpc",
"tokio",
]
[[package]]
name = "quartz-dcap-verifier"
version = "0.1.0"
@ -4322,7 +4275,7 @@ dependencies = [
]
[[package]]
name = "quartz-enclave"
name = "quartz-enclave-core"
version = "0.1.0"
dependencies = [
"anyhow",
@ -4331,15 +4284,16 @@ dependencies = [
"color-eyre",
"cosmrs",
"cosmwasm-std",
"cw-proof",
"ecies",
"futures-util",
"hex",
"k256",
"mc-sgx-dcap-sys-types",
"quartz-cw",
"quartz-contract-core",
"quartz-cw-proof",
"quartz-proto",
"quartz-tee-ra",
"quartz-tm-stateless-verifier",
"rand",
"reqwest 0.12.8",
"serde",
@ -4349,13 +4303,22 @@ dependencies = [
"tendermint-light-client",
"tendermint-rpc",
"thiserror",
"tm-stateless-verifier",
"tokio",
"tonic",
"tower 0.5.1",
"urlencoding",
]
[[package]]
name = "quartz-print-fmspc"
version = "0.1.0"
dependencies = [
"dcap-qvl",
"hex",
"serde_json",
"tokio",
]
[[package]]
name = "quartz-proto"
version = "0.1.0"
@ -4365,6 +4328,85 @@ dependencies = [
"tonic-build",
]
[[package]]
name = "quartz-rs"
version = "0.1.0"
dependencies = [
"anyhow",
"async-trait",
"base64 0.22.1",
"cargo-generate",
"cargo_metadata",
"clap",
"clearscreen",
"color-eyre",
"cosmrs",
"cosmwasm-std",
"cw-client",
"dirs 5.0.1",
"displaydoc",
"figment",
"futures-util",
"hex",
"k256",
"miette",
"once_cell",
"prost 0.13.3",
"quartz-common",
"quartz-tee-ra",
"quartz-tm-prover",
"regex",
"reqwest 0.12.8",
"serde",
"serde_json",
"subtle-encoding",
"target-lexicon",
"tempfile",
"tendermint 0.38.1",
"tendermint-light-client",
"tendermint-rpc",
"thiserror",
"tokio",
"toml",
"tonic",
"tracing",
"tracing-subscriber",
"watchexec",
"watchexec-events",
"watchexec-signals",
"xxhash-rust",
]
[[package]]
name = "quartz-tcbinfo"
version = "0.1.0"
dependencies = [
"cosmwasm-schema",
"cosmwasm-std",
"cw-multi-test",
"cw-storage-plus",
"cw2",
"der",
"getrandom",
"hex",
"mc-attestation-verifier",
"p256",
"quartz-tcbinfo-msgs",
"quartz-tee-ra",
"schemars",
"serde",
"serde_json",
"thiserror",
"x509-cert",
]
[[package]]
name = "quartz-tcbinfo-msgs"
version = "0.1.0"
dependencies = [
"cosmwasm-schema",
]
[[package]]
name = "quartz-tee-ra"
version = "0.1.0"
@ -4387,6 +4429,35 @@ dependencies = [
"x509-parser",
]
[[package]]
name = "quartz-tm-prover"
version = "0.1.0"
dependencies = [
"clap",
"color-eyre",
"cosmrs",
"futures",
"quartz-cw-proof",
"serde",
"serde_json",
"tendermint 0.38.1",
"tendermint-light-client",
"tendermint-light-client-detector",
"tendermint-rpc",
"tokio",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "quartz-tm-stateless-verifier"
version = "0.1.0"
dependencies = [
"displaydoc",
"tendermint 0.38.1",
"tendermint-light-client",
]
[[package]]
name = "quick-error"
version = "1.2.3"
@ -5484,36 +5555,6 @@ version = "0.12.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
[[package]]
name = "tcbinfo"
version = "0.1.0"
dependencies = [
"cosmwasm-schema",
"cosmwasm-std",
"cw-multi-test",
"cw-storage-plus",
"cw2",
"der",
"getrandom",
"hex",
"mc-attestation-verifier",
"p256",
"quartz-tee-ra",
"schemars",
"serde",
"serde_json",
"tcbinfo-msgs",
"thiserror",
"x509-cert",
]
[[package]]
name = "tcbinfo-msgs"
version = "0.1.0"
dependencies = [
"cosmwasm-schema",
]
[[package]]
name = "tempfile"
version = "3.10.1"
@ -5853,35 +5894,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tm-prover"
version = "0.1.0"
dependencies = [
"clap",
"color-eyre",
"cosmrs",
"cw-proof",
"futures",
"serde",
"serde_json",
"tendermint 0.38.1",
"tendermint-light-client",
"tendermint-light-client-detector",
"tendermint-rpc",
"tokio",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "tm-stateless-verifier"
version = "0.1.0"
dependencies = [
"displaydoc",
"tendermint 0.38.1",
"tendermint-light-client",
]
[[package]]
name = "tokio"
version = "1.40.0"
@ -6392,18 +6404,6 @@ version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"
[[package]]
name = "wasmd-client"
version = "0.1.0"
dependencies = [
"anyhow",
"cosmrs",
"hex",
"reqwest 0.12.8",
"serde",
"serde_json",
]
[[package]]
name = "watchexec"
version = "4.1.0"

View file

@ -81,18 +81,18 @@ mc-sgx-dcap-sys-types = { version = "0.11.0", default-features = false }
mc-attestation-verifier = { version = "0.4.3", default-features = false }
# quartz
cw-proof = { path = "crates/contracts/cw-proof", default-features = false }
quartz-cw-proof = { path = "crates/contracts/cw-proof", default-features = false }
quartz-common = { path = "crates/common", default-features = false }
quartz-cw = { path = "crates/contracts/quartz-cw", default-features = false }
quartz-dcap-verifier-msgs = { path = "crates/contracts/quartz-dcap-verifier/msgs", default-features = false }
quartz-enclave = { path = "crates/enclave/quartz-enclave", default-features = false }
quartz-proto = { path = "crates/enclave/quartz-proto", default-features = false }
quartz-tee-ra = { path = "crates/contracts/quartz-tee-ra", default-features = false }
tcbinfo = { path = "crates/contracts/tcbinfo", default-features = false, features = ["library"] }
tcbinfo-msgs = { path = "crates/contracts/tcbinfo/msgs", default-features = false }
tm-prover = { path = "crates/utils/tm-prover", default-features = false }
tm-stateless-verifier = { path = "crates/contracts/tm-stateless-verifier", default-features = false }
wasmd-client = { path = "crates/utils/wasmd-client", default-features = false }
quartz-contract-core = { path = "crates/contracts/core", default-features = false }
quartz-dcap-verifier-msgs = { path = "crates/contracts/dcap-verifier/msgs", default-features = false }
quartz-enclave-core = { path = "crates/enclave/core", default-features = false }
quartz-proto = { path = "crates/enclave/proto", default-features = false }
quartz-tee-ra = { path = "crates/contracts/tee-ra", default-features = false }
quartz-tcbinfo = { path = "crates/contracts/tcbinfo", default-features = false, features = ["library"] }
quartz-tcbinfo-msgs = { path = "crates/contracts/tcbinfo/msgs", default-features = false }
quartz-tm-prover = { path = "crates/utils/tm-prover", default-features = false }
quartz-tm-stateless-verifier = { path = "crates/contracts/tm-stateless-verifier", default-features = false }
cw-client = { path = "crates/utils/cw-client", default-features = false }
[profile.release]
opt-level = "z"

View file

@ -1,5 +1,5 @@
[package]
name = "quartz"
name = "quartz-rs"
version.workspace = true
authors.workspace = true
edition.workspace = true
@ -9,6 +9,10 @@ repository.workspace = true
keywords = ["blockchain", "cosmos", "tendermint", "cycles", "quartz"]
readme = "README.md"
[[bin]]
name = "quartz"
path = "src/main.rs"
[dependencies]
async-trait.workspace = true
cargo-generate.workspace = true
@ -50,8 +54,8 @@ cosmwasm-std.workspace = true
tendermint.workspace = true
tendermint-light-client.workspace = true
tendermint-rpc = { workspace = true, features = ["websocket-client", "http-client"] }
tm-prover = { workspace = true }
quartz-tm-prover = { workspace = true }
quartz-common = { workspace = true, features = ["full"] }
quartz-tee-ra = { workspace = true }
wasmd-client.workspace = true
cw-client.workspace = true
tempfile.workspace = true

View file

@ -3,11 +3,11 @@ use std::path::Path;
use async_trait::async_trait;
use cargo_metadata::MetadataCommand;
use color_eyre::owo_colors::OwoColorize;
use cw_client::{CliWasmdClient, WasmdClient};
use reqwest::Url;
use serde_json::json;
use tendermint_rpc::HttpClient;
use tracing::{debug, info};
use wasmd_client::{CliWasmdClient, WasmdClient};
use super::utils::{
helpers::block_tx_commit,
@ -70,11 +70,11 @@ async fn deploy(
) -> Result<(u64, String), anyhow::Error> {
let httpurl = Url::parse(&format!("http://{}", config.node_url))?;
let tmrpc_client = HttpClient::new(httpurl.as_str())?;
let wasmd_client = CliWasmdClient::new(Url::parse(httpurl.as_str())?);
let cw_client = CliWasmdClient::new(Url::parse(httpurl.as_str())?);
info!("🚀 Deploying {} Contract", args.label);
let code_id = if config.contract_has_changed(wasm_bin_path).await? {
let deploy_output: WasmdTxResponse = serde_json::from_str(&wasmd_client.deploy(
let deploy_output: WasmdTxResponse = serde_json::from_str(&cw_client.deploy(
&config.chain_id,
&config.tx_sender,
wasm_bin_path.display().to_string(),
@ -99,7 +99,7 @@ async fn deploy(
info!("🚀 Instantiating {}", args.label);
let init_output: WasmdTxResponse = serde_json::from_str(&wasmd_client.init(
let init_output: WasmdTxResponse = serde_json::from_str(&cw_client.init(
&config.chain_id,
&config.tx_sender,
code_id,

View file

@ -4,13 +4,13 @@ use anyhow::anyhow;
use async_trait::async_trait;
use color_eyre::owo_colors::OwoColorize;
use cosmrs::tendermint::chain::Id as ChainId; // TODO see if this redundancy in dependencies can be decreased
use cw_client::{CliWasmdClient, WasmdClient};
use futures_util::stream::StreamExt;
use quartz_tm_prover::{config::Config as TmProverConfig, prover::prove};
use reqwest::Url;
use serde_json::json;
use tendermint_rpc::{query::EventType, HttpClient, SubscriptionClient, WebSocketClient};
use tm_prover::{config::Config as TmProverConfig, prover::prove};
use tracing::{debug, info};
use wasmd_client::{CliWasmdClient, WasmdClient};
use super::utils::{helpers::block_tx_commit, types::WasmdTxResponse};
use crate::{
@ -51,7 +51,7 @@ async fn handshake(args: HandshakeRequest, config: Config) -> Result<String, any
let wsurl = format!("ws://{}/websocket", config.node_url);
let tmrpc_client = HttpClient::new(httpurl.as_str())?;
let wasmd_client = CliWasmdClient::new(Url::parse(httpurl.as_str())?);
let cw_client = CliWasmdClient::new(Url::parse(httpurl.as_str())?);
let (trusted_height, trusted_hash) = read_cached_hash_height(&config).await?;
@ -62,7 +62,7 @@ async fn handshake(args: HandshakeRequest, config: Config) -> Result<String, any
.await?;
let output: WasmdTxResponse = serde_json::from_str(
wasmd_client
cw_client
.tx_execute(
&args.contract.clone(),
&config.chain_id,
@ -109,7 +109,7 @@ async fn handshake(args: HandshakeRequest, config: Config) -> Result<String, any
// Submit SessionSetPubKey to contract
let output: WasmdTxResponse = serde_json::from_str(
wasmd_client
cw_client
.tx_execute(
&args.contract.clone(),
&ChainId::from_str("testing")?,
@ -124,7 +124,7 @@ async fn handshake(args: HandshakeRequest, config: Config) -> Result<String, any
block_tx_commit(&tmrpc_client, output.txhash).await?;
info!("SessionSetPubKey tx committed");
let output: WasmdTxResponse = wasmd_client.query_tx(&output.txhash.to_string())?;
let output: WasmdTxResponse = cw_client.query_tx(&output.txhash.to_string())?;
let wasm_event = output
.events

View file

@ -2,6 +2,7 @@ use std::time::Duration;
use anyhow::anyhow;
use cosmrs::{AccountId, ErrorReport};
use cw_client::{CliWasmdClient, WasmdClient};
use regex::Regex;
use reqwest::Url;
use subtle_encoding::bech32::decode as bech32_decode;
@ -11,7 +12,6 @@ use tendermint_rpc::{
};
use tokio::fs::{self};
use tracing::debug;
use wasmd_client::{CliWasmdClient, WasmdClient};
use crate::{config::Config, error::Error};
@ -62,9 +62,9 @@ pub async fn block_tx_commit(client: &HttpClient, tx: Hash) -> Result<TmTxRespon
pub fn query_latest_height_hash(node_url: &String) -> Result<(Height, Hash), Error> {
let httpurl = Url::parse(&format!("http://{}", node_url))
.map_err(|e| Error::GenericErr(e.to_string()))?;
let wasmd_client = CliWasmdClient::new(httpurl);
let cw_client = CliWasmdClient::new(httpurl);
let (trusted_height, trusted_hash) = wasmd_client
let (trusted_height, trusted_hash) = cw_client
.trusted_height_hash()
.map_err(|e| Error::GenericErr(e.to_string()))?;

View file

@ -1,8 +1,8 @@
use quartz_common::proto::{
core_client::CoreClient, InstantiateRequest, SessionCreateRequest, SessionSetPubKeyRequest,
};
use quartz_tm_prover::config::ProofOutput;
use serde_json::{json, Value as JsonValue};
use tm_prover::config::ProofOutput;
use crate::error::Error;

View file

@ -10,13 +10,13 @@ authors.workspace = true
[features]
full = ["contract", "enclave", "proto"]
contract = ["dep:quartz-cw"]
enclave = ["dep:quartz-enclave", "proto"]
contract = ["dep:quartz-contract-core"]
enclave = ["dep:quartz-enclave-core", "proto"]
proto = ["dep:quartz-proto"]
mock-sgx-cw = ["quartz-cw/mock-sgx"]
mock-sgx-enclave = ["quartz-enclave/mock-sgx"]
mock-sgx-cw = ["quartz-contract-core/mock-sgx"]
mock-sgx-enclave = ["quartz-enclave-core/mock-sgx"]
[dependencies]
quartz-cw = { workspace = true, optional = true }
quartz-contract-core = { workspace = true, optional = true }
quartz-proto = { workspace = true, optional = true }
quartz-enclave = { workspace = true, optional = true }
quartz-enclave-core = { workspace = true, optional = true }

View file

@ -1,6 +1,6 @@
#[cfg(feature = "contract")]
pub use quartz_cw as contract;
pub use quartz_contract_core as contract;
#[cfg(feature = "enclave")]
pub use quartz_enclave as enclave;
pub use quartz_enclave_core as enclave;
#[cfg(feature = "proto")]
pub use quartz_proto::quartz as proto;

View file

@ -1,5 +1,5 @@
[package]
name = "quartz-cw"
name = "quartz-contract-core"
version.workspace = true
authors.workspace = true
edition.workspace = true
@ -34,7 +34,7 @@ cosmwasm-std.workspace = true
# quartz
quartz-dcap-verifier-msgs.workspace = true
quartz-tee-ra.workspace = true
tcbinfo-msgs.workspace = true
quartz-tcbinfo-msgs.workspace = true
[dev-dependencies]
serde_json.workspace = true

View file

@ -3,12 +3,12 @@ use cosmwasm_std::{
to_json_binary, Deps, DepsMut, Env, MessageInfo, QueryRequest, Response, StdResult, WasmQuery,
};
use quartz_dcap_verifier_msgs::QueryMsg as DcapVerifierQueryMsg;
use quartz_tcbinfo_msgs::{GetTcbInfoResponse, QueryMsg as TcbInfoQueryMsg};
use quartz_tee_ra::{
intel_sgx::dcap::{Collateral, TrustedIdentity, TrustedMrEnclaveIdentity},
Error as RaVerificationError,
};
use serde::{de::DeserializeOwned, Serialize};
use tcbinfo_msgs::{GetTcbInfoResponse, QueryMsg as TcbInfoQueryMsg};
use crate::{
error::Error,

View file

@ -1,5 +1,5 @@
[package]
name = "cw-proof"
name = "quartz-cw-proof"
version.workspace = true
authors.workspace = true
edition.workspace = true

View file

@ -1,5 +1,5 @@
[package]
name = "tcbinfo"
name = "quartz-tcbinfo"
version.workspace = true
authors.workspace = true
edition.workspace = true
@ -45,7 +45,7 @@ cw-storage-plus.workspace = true
# quartz
quartz-tee-ra.workspace = true
tcbinfo-msgs.workspace = true
quartz-tcbinfo-msgs.workspace = true
# patch indirect deps
getrandom = { version = "0.2.15", features = ["js"] }

View file

@ -1,5 +1,5 @@
[package]
name = "tcbinfo-msgs"
name = "quartz-tcbinfo-msgs"
version.workspace = true
authors.workspace = true
edition.workspace = true

View file

@ -1,5 +1,5 @@
use cosmwasm_schema::write_api;
use tcbinfo_msgs::{ExecuteMsg, InstantiateMsg, QueryMsg};
use quartz_tcbinfo_msgs::{ExecuteMsg, InstantiateMsg, QueryMsg};
fn main() {
write_api! {

View file

@ -5,9 +5,9 @@ use cw2::set_contract_version;
use der::{DateTime, DecodePem};
use mc_attestation_verifier::{CertificateChainVerifier, SignedTcbInfo};
use p256::ecdsa::VerifyingKey;
use quartz_tcbinfo_msgs::{ExecuteMsg, GetTcbInfoResponse, InstantiateMsg, QueryMsg};
use quartz_tee_ra::intel_sgx::dcap::certificate_chain::TlsCertificateChainVerifier;
use serde_json::Value;
use tcbinfo_msgs::{ExecuteMsg, GetTcbInfoResponse, InstantiateMsg, QueryMsg};
use x509_cert::Certificate;
use crate::{
@ -15,7 +15,7 @@ use crate::{
state::{TcbInfo, DATABASE, ROOT_CERTIFICATE},
};
// version info for migration info
const CONTRACT_NAME: &str = "crates.io:tcbinfo";
const CONTRACT_NAME: &str = "crates.io:quartz_tcbinfo";
const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");
#[cfg_attr(not(feature = "library"), entry_point)]

View file

@ -2,9 +2,9 @@ use cosmwasm_std::{
to_json_binary, Addr, CosmosMsg, CustomQuery, Querier, QuerierWrapper, StdResult, WasmMsg,
WasmQuery,
};
use quartz_tcbinfo_msgs::{ExecuteMsg, GetTcbInfoResponse, QueryMsg};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use tcbinfo_msgs::{ExecuteMsg, GetTcbInfoResponse, QueryMsg};
const FMSPC: &str = "00606a000000";

View file

@ -2,7 +2,7 @@
mod tests {
use cosmwasm_std::{testing::MockApi, Addr, Coin, Empty, Uint128};
use cw_multi_test::{App, AppBuilder, Contract, ContractWrapper, Executor};
use tcbinfo_msgs::InstantiateMsg;
use quartz_tcbinfo_msgs::InstantiateMsg;
use crate::helpers::CwTemplateContract;
@ -68,7 +68,7 @@ mod tests {
}
mod add_tcbinfo {
use tcbinfo_msgs::ExecuteMsg;
use quartz_tcbinfo_msgs::ExecuteMsg;
use super::*;

View file

@ -1,5 +1,5 @@
[package]
name = "tm-stateless-verifier"
name = "quartz-tm-stateless-verifier"
version.workspace = true
authors.workspace = true
edition.workspace = true

View file

@ -1,5 +1,5 @@
[package]
name = "quartz-enclave"
name = "quartz-enclave-core"
version.workspace = true
authors.workspace = true
edition.workspace = true
@ -10,7 +10,7 @@ keywords = ["blockchain", "cosmos", "tendermint", "cycles", "quartz"]
readme = "README.md"
[features]
mock-sgx = ["quartz-cw/mock-sgx"]
mock-sgx = ["quartz-contract-core/mock-sgx"]
[dependencies]
# external
@ -44,8 +44,8 @@ tendermint-light-client.workspace = true
tendermint-rpc = { workspace = true, features=["websocket-client", "http-client"] }
# quartz
cw-proof.workspace = true
quartz-cw.workspace = true
quartz-cw-proof.workspace = true
quartz-contract-core.workspace = true
quartz-proto.workspace = true
quartz-tee-ra.workspace = true
tm-stateless-verifier.workspace = true
quartz-tm-stateless-verifier.workspace = true

View file

@ -5,7 +5,7 @@ use std::{
};
use mc_sgx_dcap_sys_types::sgx_ql_qve_collateral_t;
use quartz_cw::{
use quartz_contract_core::{
msg::{
execute::attested::{
Attestation, DcapAttestation, HasUserData, MockAttestation, RawDcapAttestation,
@ -102,7 +102,7 @@ impl Attestor for DcapAttestor {
version.minor_version = 1;
let mut root_crl =
include_bytes!("../../../contracts/quartz-tee-ra/data/root_crl.der").to_vec();
include_bytes!("../../../contracts/tee-ra/data/root_crl.der").to_vec();
root_crl.push(0);
sgx_collateral.root_ca_crl = root_crl.as_ptr() as _;
sgx_collateral.root_ca_crl_size = root_crl.len() as u32;
@ -117,8 +117,8 @@ impl Attestor for DcapAttestor {
sgx_collateral.pck_crl_issuer_chain = pck_crl_issuer_chain.as_ptr() as _;
sgx_collateral.pck_crl_issuer_chain_size = pck_crl_issuer_chain.len() as u32;
let root_cert = include_str!("../../../contracts/quartz-tee-ra/data/root_ca.pem");
let tcb_cert = include_str!("../../../contracts/quartz-tee-ra/data/tcb_signer.pem");
let root_cert = include_str!("../../../contracts/tee-ra/data/root_ca.pem");
let tcb_cert = include_str!("../../../contracts/tee-ra/data/tcb_signer.pem");
let mut tcb_chain = [tcb_cert, root_cert].join("\n").as_bytes().to_vec();
tcb_chain.push(0);
sgx_collateral.tcb_info_issuer_chain = tcb_chain.as_ptr() as _;
@ -132,7 +132,7 @@ impl Attestor for DcapAttestor {
sgx_collateral.qe_identity_issuer_chain_size = tcb_chain.len() as u32;
const QE_IDENTITY_JSON: &str =
include_str!("../../../contracts/quartz-tee-ra/data/qe_identity.json");
include_str!("../../../contracts/tee-ra/data/qe_identity.json");
sgx_collateral.qe_identity = QE_IDENTITY_JSON.as_ptr() as _;
sgx_collateral.qe_identity_size = QE_IDENTITY_JSON.len() as u32;

View file

@ -5,13 +5,9 @@ use std::{
time::Duration,
};
use cw_proof::proof::{
cw::{CwProof, RawCwProof},
Proof,
};
use futures_util::StreamExt;
use k256::ecdsa::SigningKey;
use quartz_cw::{
use quartz_contract_core::{
msg::{
execute::{
attested::Attested, session_create::SessionCreate,
@ -21,6 +17,10 @@ use quartz_cw::{
},
state::{Config, LightClientOpts, Nonce, Session},
};
use quartz_cw_proof::proof::{
cw::{CwProof, RawCwProof},
Proof,
};
use quartz_proto::quartz::{
core_server::{Core, CoreServer},
InstantiateRequest as RawInstantiateRequest, InstantiateResponse as RawInstantiateResponse,
@ -29,6 +29,7 @@ use quartz_proto::quartz::{
SessionSetPubKeyRequest as RawSessionSetPubKeyRequest,
SessionSetPubKeyResponse as RawSessionSetPubKeyResponse,
};
use quartz_tm_stateless_verifier::make_provider;
use rand::Rng;
use serde::{Deserialize, Serialize};
use tendermint::{block::Height, Hash};
@ -41,7 +42,6 @@ use tendermint_rpc::{
query::{EventType, Query},
SubscriptionClient, WebSocketClient,
};
use tm_stateless_verifier::make_provider;
use tonic::{
body::BoxBody,
codegen::http,

View file

@ -5,7 +5,7 @@ use std::{
};
use hex::FromHexError;
use quartz_cw::msg::{
use quartz_contract_core::msg::{
execute::{
attested::{Attested, RawAttested},
session_create::{RawSessionCreate, SessionCreate},

View file

@ -1,5 +1,5 @@
[package]
name = "wasmd-client"
name = "cw-client"
version.workspace = true
edition.workspace = true
rust-version.workspace = true

View file

@ -1,5 +1,5 @@
[package]
name = "cw-prover"
name = "quartz-cw-prover"
version.workspace = true
authors.workspace = true
edition.workspace = true
@ -21,7 +21,7 @@ tendermint.workspace = true
tendermint-rpc.workspace = true
# quartz
cw-proof.workspace = true
quartz-cw-proof.workspace = true
[dev-dependencies]
hex.workspace = true

View file

@ -24,7 +24,7 @@ use std::{
use clap::{Parser, Subcommand};
use cosmrs::AccountId;
use cw_proof::proof::{
use quartz_cw_proof::proof::{
cw::{CwProof, RawCwProof},
key::CwAbciKey,
Proof,
@ -134,7 +134,7 @@ fn write_proof_to_file(proof_file: PathBuf, proof: RawCwProof) -> Result<(), Box
#[cfg(test)]
mod tests {
use cw_proof::proof::{
use quartz_cw_proof::proof::{
cw::{CwProof, RawCwProof},
Proof,
};

View file

@ -1,5 +1,5 @@
[package]
name = "print-fmspc"
name = "quartz-print-fmspc"
version.workspace = true
edition.workspace = true
rust-version.workspace = true

View file

@ -1,5 +1,5 @@
[package]
name = "tm-prover"
name = "quartz-tm-prover"
version.workspace = true
authors.workspace = true
edition.workspace = true
@ -32,4 +32,4 @@ tendermint-light-client.workspace = true
tendermint-light-client-detector.workspace = true
# quartz
cw-proof.workspace = true
quartz-cw-proof.workspace = true

View file

@ -3,7 +3,7 @@ use std::{num::ParseIntError, str::FromStr};
use clap::Parser;
use color_eyre::eyre::{eyre, Result};
use cosmrs::AccountId;
use cw_proof::proof::cw::RawCwProof;
use quartz_cw_proof::proof::cw::RawCwProof;
use serde::{Deserialize, Serialize};
use tendermint_light_client::types::{Hash, Height, LightBlock, TrustThreshold};
use tendermint_rpc::HttpClientUrl;

View file

@ -1,6 +1,6 @@
use clap::Parser;
use color_eyre::eyre::Result;
use tm_prover::{config::Config, prover::prove};
use quartz_tm_prover::{config::Config, prover::prove};
use tracing_subscriber::{util::SubscriberInitExt, EnvFilter};
#[tokio::main]

View file

@ -13,11 +13,11 @@ use color_eyre::{
eyre::{eyre, Result},
Report,
};
use cw_proof::{
use futures::future::join_all;
use quartz_cw_proof::{
error::ProofError,
proof::{cw::CwProof, key::CwAbciKey, Proof},
};
use futures::future::join_all;
use tendermint::{crypto::default::Sha256, evidence::Evidence, Hash};
use tendermint_light_client::{
builder::LightClientBuilder,

View file

@ -46,8 +46,8 @@ transfers-contract = { path = "../contracts", default-features = false }
# quartz
quartz-common = { git = "ssh://git@github.com/informalsystems/cycles-quartz.git", features=["full"] }
wasmd-client = { git = "ssh://git@github.com/informalsystems/cycles-quartz.git" }
tm-prover = { git = "ssh://git@github.com/informalsystems/cycles-quartz.git" }
cw-client = { git = "ssh://git@github.com/informalsystems/cycles-quartz.git" }
quartz-tm-prover = { git = "ssh://git@github.com/informalsystems/cycles-quartz.git" }
[dev-dependencies]

View file

@ -17,7 +17,7 @@ use quartz_common::{
use reqwest::Url;
use serde_json::json;
use tendermint_rpc::{event::Event, query::EventType, SubscriptionClient, WebSocketClient};
use tm_prover::{config::Config as TmProverConfig, prover::prove};
use quartz_tm_prover::{config::Config as TmProverConfig, prover::prove};
use tonic::Request;
use tracing::info;
use transfers_contract::msg::{
@ -25,7 +25,7 @@ use transfers_contract::msg::{
AttestedMsg, ExecuteMsg,
QueryMsg::{GetRequests, GetState},
};
use wasmd_client::{CliWasmdClient, QueryResult, WasmdClient};
use cw_client::{CliWasmdClient, QueryResult, WasmdClient};
use crate::{
proto::{settlement_server::Settlement, QueryRequest, UpdateRequest},
@ -168,15 +168,15 @@ async fn transfer_handler<A: Attestor>(
) -> Result<()> {
let chain_id = &ChainId::from_str(&ws_config.chain_id)?;
let httpurl = Url::parse(&format!("http://{}", ws_config.node_url))?;
let wasmd_client = CliWasmdClient::new(httpurl.clone());
let cw_client = CliWasmdClient::new(httpurl.clone());
// Query contract state
let resp: QueryResult<Vec<TransferRequest>> = wasmd_client
let resp: QueryResult<Vec<TransferRequest>> = cw_client
.query_smart(contract, json!(GetRequests {}))
.map_err(|e| anyhow!("Problem querying contract state: {}", e))?;
let requests = resp.data;
let resp: QueryResult<HexBinary> = wasmd_client
let resp: QueryResult<HexBinary> = cw_client
.query_smart(contract, json!(GetState {}))
.map_err(|e| anyhow!("Problem querying contract state: {}", e))?;
let state = resp.data;
@ -249,7 +249,7 @@ async fn transfer_handler<A: Attestor>(
});
// Post response to chain
let output = wasmd_client.tx_execute(
let output = cw_client.tx_execute(
contract,
chain_id,
2000000,
@ -270,10 +270,10 @@ async fn query_handler<A: Attestor>(
) -> Result<()> {
let chain_id = &ChainId::from_str(&ws_config.chain_id)?;
let httpurl = Url::parse(&format!("http://{}", ws_config.node_url))?;
let wasmd_client = CliWasmdClient::new(httpurl);
let cw_client = CliWasmdClient::new(httpurl);
// Query contract state
let resp: QueryResult<HexBinary> = wasmd_client
let resp: QueryResult<HexBinary> = cw_client
.query_smart(contract, json!(GetState {}))
.map_err(|e| anyhow!("Problem querying contract state: {}", e))?;
let state = resp.data;
@ -316,7 +316,7 @@ async fn query_handler<A: Attestor>(
});
// Post response to chain
let output = wasmd_client.tx_execute(
let output = cw_client.tx_execute(
contract,
chain_id,
2000000,