From 69c5f050bfc1eaad2a1a53a14b53d2a3335735a5 Mon Sep 17 00:00:00 2001 From: Charlie Little Date: Mon, 6 Feb 2023 15:30:10 -0600 Subject: [PATCH 1/7] Use CACHED_QUERIES in query for optional caching --- rest/src/main.rs | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/rest/src/main.rs b/rest/src/main.rs index 8367bc8b..6c99816c 100644 --- a/rest/src/main.rs +++ b/rest/src/main.rs @@ -11,6 +11,9 @@ use std::sync::Arc; use tendermint_rpc as tm; use tm::Client as _; +//TODO: Get actual query strings for cached queries +const CACHED_QUERIES: Vec<&str> = vec!["validators/all"]; + lazy_static::lazy_static! { static ref QUERY_CACHE: Arc>> = Arc::new(RwLock::new(HashMap::new())); } @@ -236,6 +239,10 @@ fn time_now() -> u64 { #[get("/query/")] async fn query(query: &str) -> Result> { + if !QUERY_CACHE.contains(query) { + return execute_query(query); + } + let cache = QUERY_CACHE.clone(); let lock = cache.read_owned().await; let cached_res = lock.get(query).map(|v| v.clone()); @@ -247,14 +254,24 @@ async fn query(query: &str) -> Result> { if let Some((time, res)) = cached_res { if now - time < 15 { - return Ok(res.clone()) + return Ok(res.clone()); } } + let res_b64 = execute_query(query); + + let cache = QUERY_CACHE.clone(); + let mut lock = cache.write_owned().await; + lock.insert(query.to_string(), (now, res_b64.clone())); + drop(lock); + + Ok(res_b64) +} + +async fn execute_query(query: &str) -> Result> { let client = tm::HttpClient::new("http://localhost:26657").unwrap(); - let query_bytes = hex::decode(query) - .map_err(|e| BadRequest(Some(format!("{:?}", e))))?; + let query_bytes = hex::decode(query).map_err(|e| BadRequest(Some(format!("{:?}", e))))?; let res = client .abci_query(None, query_bytes, None, true) @@ -266,14 +283,7 @@ async fn query(query: &str) -> Result> { return Err(BadRequest(Some(msg))); } - let res_b64 = base64::encode(res.value); - - let cache = QUERY_CACHE.clone(); - let mut lock = cache.write_owned().await; - lock.insert(query.to_string(), (now, res_b64.clone())); - drop(lock); - - Ok(res_b64) + base64::encode(res.value) } #[get("/cosmos/staking/v1beta1/delegations/
")] From 5bac00ce3a1dfc14f91efc9febd2ff15b4b3a093 Mon Sep 17 00:00:00 2001 From: Charlie Little Date: Mon, 6 Feb 2023 15:32:37 -0600 Subject: [PATCH 2/7] Format --- rest/src/main.rs | 165 +++++++++++++++++++++++++++++------------------ 1 file changed, 101 insertions(+), 64 deletions(-) diff --git a/rest/src/main.rs b/rest/src/main.rs index 6c99816c..a94b53cf 100644 --- a/rest/src/main.rs +++ b/rest/src/main.rs @@ -1,12 +1,20 @@ #[macro_use] extern crate rocket; -use rocket::serde::json::{json, Value}; +use nomic::{ + app::{InnerApp, Nom, CHAIN_ID}, + app_client, + orga::{ + coins::{Accounts, Address, Amount, Decimal, Staking}, + plugins::*, + query::Query, + }, +}; use rocket::response::status::BadRequest; -use nomic::{app_client, app::{Nom, InnerApp, CHAIN_ID}, orga::{query::Query, coins::{Amount, Accounts, Address, Staking, Decimal}, plugins::*}}; +use rocket::serde::json::{json, Value}; use std::collections::HashMap; -use tokio::sync::RwLock; use std::sync::Arc; +use tokio::sync::RwLock; use tendermint_rpc as tm; use tm::Client as _; @@ -22,7 +30,9 @@ lazy_static::lazy_static! { async fn bank_balances(address: &str) -> Result> { let address: Address = address.parse().unwrap(); - let balance: u64 = app_client().accounts.balance(address) + let balance: u64 = app_client() + .accounts + .balance(address) .await .map_err(|e| BadRequest(Some(format!("{:?}", e))))? .map_err(|e| BadRequest(Some(format!("{:?}", e))))? @@ -50,7 +60,9 @@ async fn bank_balances(address: &str) -> Result> { async fn bank_balances_2(address: &str) -> Result> { let address: Address = address.parse().unwrap(); - let balance: u64 = app_client().accounts.balance(address) + let balance: u64 = app_client() + .accounts + .balance(address) .await .map_err(|e| BadRequest(Some(format!("{:?}", e))))? .map_err(|e| BadRequest(Some(format!("{:?}", e))))? @@ -71,17 +83,17 @@ async fn bank_balances_2(address: &str) -> Result> { async fn auth_accounts(addr_str: &str) -> Result> { let address: Address = addr_str.parse().unwrap(); - let balance: u64 = app_client().accounts.balance(address) + let balance: u64 = app_client() + .accounts + .balance(address) .await .map_err(|e| BadRequest(Some(format!("{:?}", e))))? .map_err(|e| BadRequest(Some(format!("{:?}", e))))? .into(); type NonceQuery = >> as Query>::Query; - let mut nonce: u64 = app_client().query( - NonceQuery::Nonce(address), - |state| state.nonce(address), - ) + let mut nonce: u64 = app_client() + .query(NonceQuery::Nonce(address), |state| state.nonce(address)) .await .map_err(|e| BadRequest(Some(format!("{:?}", e))))? .into(); @@ -109,17 +121,17 @@ async fn auth_accounts(addr_str: &str) -> Result> { async fn auth_accounts2(addr_str: &str) -> Result> { let address: Address = addr_str.parse().unwrap(); - let balance: u64 = app_client().accounts.balance(address) + let balance: u64 = app_client() + .accounts + .balance(address) .await .map_err(|e| BadRequest(Some(format!("{:?}", e))))? .map_err(|e| BadRequest(Some(format!("{:?}", e))))? .into(); type NonceQuery = >> as Query>::Query; - let mut nonce: u64 = app_client().query( - NonceQuery::Nonce(address), - |state| state.nonce(address), - ) + let mut nonce: u64 = app_client() + .query(NonceQuery::Nonce(address), |state| state.nonce(address)) .await .map_err(|e| BadRequest(Some(format!("{:?}", e))))? .into(); @@ -139,7 +151,7 @@ async fn auth_accounts2(addr_str: &str) -> Result> { })) } -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] struct TxRequest { tx: serde_json::Value, @@ -156,11 +168,11 @@ async fn txs(tx: &str) -> Result> { let tx: TxRequest = serde_json::from_str(tx).unwrap(); serde_json::to_vec(&tx.tx).unwrap() } else { - base64::decode(tx) - .map_err(|e| BadRequest(Some(format!("{:?}", e))))? + base64::decode(tx).map_err(|e| BadRequest(Some(format!("{:?}", e))))? }; - - let res = client.broadcast_tx_commit(tx_bytes.into()) + + let res = client + .broadcast_tx_commit(tx_bytes.into()) .await .map_err(|e| BadRequest(Some(format!("{:?}", e))))?; @@ -200,14 +212,13 @@ async fn txs2(tx: &str) -> Result> { let tx_bytes = if let Some('{') = tx.chars().next() { let tx: TxRequest2 = serde_json::from_str(tx).unwrap(); - base64::decode(tx.tx_bytes.as_str()) - .map_err(|e| BadRequest(Some(format!("{:?}", e))))? + base64::decode(tx.tx_bytes.as_str()).map_err(|e| BadRequest(Some(format!("{:?}", e))))? } else { - base64::decode(tx) - .map_err(|e| BadRequest(Some(format!("{:?}", e))))? + base64::decode(tx).map_err(|e| BadRequest(Some(format!("{:?}", e))))? }; - - let res = client.broadcast_tx_commit(tx_bytes.into()) + + let res = client + .broadcast_tx_commit(tx_bytes.into()) .await .map_err(|e| BadRequest(Some(format!("{:?}", e))))?; @@ -234,7 +245,10 @@ async fn txs2(tx: &str) -> Result> { } fn time_now() -> u64 { - std::time::SystemTime::now().duration_since(std::time::SystemTime::UNIX_EPOCH).unwrap().as_secs() as u64 + std::time::SystemTime::now() + .duration_since(std::time::SystemTime::UNIX_EPOCH) + .unwrap() + .as_secs() as u64 } #[get("/query/")] @@ -290,12 +304,17 @@ async fn execute_query(query: &str) -> Result> { async fn staking_delegators_delegations(address: &str) -> Result> { let address: Address = address.parse().unwrap(); - let delegations = app_client().staking.delegations(address) + let delegations = app_client() + .staking + .delegations(address) .await .map_err(|e| BadRequest(Some(format!("{:?}", e))))? .map_err(|e| BadRequest(Some(format!("{:?}", e))))?; - let total_staked: u64 = delegations.iter().map(|(_, d)| -> u64 { d.staked.into() }).sum(); + let total_staked: u64 = delegations + .iter() + .map(|(_, d)| -> u64 { d.staked.into() }) + .sum(); Ok(json!({ "delegation_responses": [ { @@ -316,12 +335,17 @@ async fn staking_delegators_delegations(address: &str) -> Result Result> { let address: Address = address.parse().unwrap(); - let delegations = app_client().staking.delegations(address) + let delegations = app_client() + .staking + .delegations(address) .await .map_err(|e| BadRequest(Some(format!("{:?}", e))))? .map_err(|e| BadRequest(Some(format!("{:?}", e))))?; - let total_staked: u64 = delegations.iter().map(|(_, d)| -> u64 { d.staked.into() }).sum(); + let total_staked: u64 = delegations + .iter() + .map(|(_, d)| -> u64 { d.staked.into() }) + .sum(); Ok(json!({ "height": "0", "result": [ { @@ -366,7 +390,6 @@ async fn distribution_delegatrs_rewards(address: &str) -> Value { // .await // .unwrap(); - // let reward = (delegations // .iter() // .map(|(_, d)| -> u64 { d.liquid.into() }) @@ -394,7 +417,6 @@ async fn distribution_delegatrs_rewards(address: &str) -> Value { } }) } - #[get("/distribution/delegators/
/rewards")] async fn distribution_delegatrs_rewards_2(address: &str) -> Value { // let address = address.parse().unwrap(); @@ -410,7 +432,6 @@ async fn distribution_delegatrs_rewards_2(address: &str) -> Value { // .await // .unwrap(); - // let reward = (delegations // .iter() // .map(|(_, d)| -> u64 { d.liquid.into() }) @@ -440,12 +461,17 @@ async fn distribution_delegatrs_rewards_2(address: &str) -> Value { #[get("/cosmos/mint/v1beta1/inflation")] async fn minting_inflation() -> Result> { - let validators = app_client().staking.all_validators() + let validators = app_client() + .staking + .all_validators() .await .map_err(|e| BadRequest(Some(format!("{:?}", e))))? .map_err(|e| BadRequest(Some(format!("{:?}", e))))?; - let total_staked: u64 = validators.iter().map(|v| -> u64 { v.amount_staked.into() }).sum(); + let total_staked: u64 = validators + .iter() + .map(|v| -> u64 { v.amount_staked.into() }) + .sum(); let total_staked = Amount::from(total_staked + 1); let yearly_inflation = Decimal::from(64_682_541_340_000); let apr = (yearly_inflation / Decimal::from(4) / Decimal::from(total_staked)) @@ -457,12 +483,17 @@ async fn minting_inflation() -> Result> { #[get("/minting/inflation")] async fn minting_inflation_2() -> Result> { - let validators = app_client().staking.all_validators() + let validators = app_client() + .staking + .all_validators() .await .map_err(|e| BadRequest(Some(format!("{:?}", e))))? .map_err(|e| BadRequest(Some(format!("{:?}", e))))?; - let total_staked: u64 = validators.iter().map(|v| -> u64 { v.amount_staked.into() }).sum(); + let total_staked: u64 = validators + .iter() + .map(|v| -> u64 { v.amount_staked.into() }) + .sum(); let total_staked = Amount::from(total_staked + 1); let yearly_inflation = Decimal::from(64_682_541_340_000); let apr = (yearly_inflation / Decimal::from(4) / Decimal::from(total_staked)) @@ -527,9 +558,9 @@ fn ibc_applications_transfer_params() -> Value { }) } +use rocket::fairing::{Fairing, Info, Kind}; use rocket::http::Header; use rocket::{Request, Response}; -use rocket::fairing::{Fairing, Info, Kind}; pub struct CORS; @@ -538,13 +569,16 @@ impl Fairing for CORS { fn info(&self) -> Info { Info { name: "Add CORS headers to responses", - kind: Kind::Response + kind: Kind::Response, } } async fn on_response<'r>(&self, request: &'r Request<'_>, response: &mut Response<'r>) { response.set_header(Header::new("Access-Control-Allow-Origin", "*")); - response.set_header(Header::new("Access-Control-Allow-Methods", "POST, GET, PATCH, OPTIONS")); + response.set_header(Header::new( + "Access-Control-Allow-Methods", + "POST, GET, PATCH, OPTIONS", + )); response.set_header(Header::new("Access-Control-Allow-Headers", "*")); response.set_header(Header::new("Access-Control-Allow-Credentials", "true")); } @@ -552,27 +586,30 @@ impl Fairing for CORS { #[launch] fn rocket() -> _ { - rocket::build().attach(CORS).mount("/", routes![ - bank_balances, - bank_balances_2, - auth_accounts, - auth_accounts2, - txs, - txs2, - query, - staking_delegators_delegations, - // staking_delegators_delegations_2, - staking_delegators_unbonding_delegations, - staking_delegators_unbonding_delegations_2, - distribution_delegatrs_rewards, - distribution_delegatrs_rewards_2, - staking_delegations_2, - minting_inflation, - staking_pool, - staking_pool_2, - bank_total, - ibc_apps_transfer_params, - ibc_applications_transfer_params, - bank_supply_unom, - ]) + rocket::build().attach(CORS).mount( + "/", + routes![ + bank_balances, + bank_balances_2, + auth_accounts, + auth_accounts2, + txs, + txs2, + query, + staking_delegators_delegations, + // staking_delegators_delegations_2, + staking_delegators_unbonding_delegations, + staking_delegators_unbonding_delegations_2, + distribution_delegatrs_rewards, + distribution_delegatrs_rewards_2, + staking_delegations_2, + minting_inflation, + staking_pool, + staking_pool_2, + bank_total, + ibc_apps_transfer_params, + ibc_applications_transfer_params, + bank_supply_unom, + ], + ) } From 22919cc3cb0bda631abe8e62712401cee1935e7e Mon Sep 17 00:00:00 2001 From: Charlie Little Date: Mon, 6 Feb 2023 15:50:54 -0600 Subject: [PATCH 3/7] Update return values in query flow --- rest/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest/src/main.rs b/rest/src/main.rs index a94b53cf..c102bc61 100644 --- a/rest/src/main.rs +++ b/rest/src/main.rs @@ -272,7 +272,7 @@ async fn query(query: &str) -> Result> { } } - let res_b64 = execute_query(query); + let res_b64 = execute_query(query).await?; let cache = QUERY_CACHE.clone(); let mut lock = cache.write_owned().await; @@ -297,7 +297,7 @@ async fn execute_query(query: &str) -> Result> { return Err(BadRequest(Some(msg))); } - base64::encode(res.value) + Ok(base64::encode(res.value)) } #[get("/cosmos/staking/v1beta1/delegations/
")] From 63516d07dc3eecb0fe9b88f98ef55b68d2ef6226 Mon Sep 17 00:00:00 2001 From: Charlie Little Date: Mon, 6 Feb 2023 15:51:54 -0600 Subject: [PATCH 4/7] Use static ref for CACHED_QUERIES --- rest/src/main.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/rest/src/main.rs b/rest/src/main.rs index c102bc61..ddce10c3 100644 --- a/rest/src/main.rs +++ b/rest/src/main.rs @@ -12,18 +12,17 @@ use nomic::{ }; use rocket::response::status::BadRequest; use rocket::serde::json::{json, Value}; -use std::collections::HashMap; +use std::collections::{HashMap, HashSet}; use std::sync::Arc; use tokio::sync::RwLock; use tendermint_rpc as tm; use tm::Client as _; -//TODO: Get actual query strings for cached queries -const CACHED_QUERIES: Vec<&str> = vec!["validators/all"]; - lazy_static::lazy_static! { static ref QUERY_CACHE: Arc>> = Arc::new(RwLock::new(HashMap::new())); + //TODO: Get actual query strings for cached queries + static ref CACHED_QUERIES: HashSet = HashSet::from(["validators/all".to_string()]); } #[get("/cosmos/bank/v1beta1/balances/
")] @@ -253,8 +252,8 @@ fn time_now() -> u64 { #[get("/query/")] async fn query(query: &str) -> Result> { - if !QUERY_CACHE.contains(query) { - return execute_query(query); + if !CACHED_QUERIES.contains(query) { + return execute_query(query).await; } let cache = QUERY_CACHE.clone(); From d24ff51ddd86978658c1e7fbc96f5d396d0666d6 Mon Sep 17 00:00:00 2001 From: Charlie Little Date: Mon, 6 Feb 2023 16:40:35 -0600 Subject: [PATCH 5/7] Update orga dependency --- Cargo.lock | 19 ++- Cargo.toml | 2 +- rest/Cargo.lock | 446 ++++++++++++++++++++++-------------------------- 3 files changed, 223 insertions(+), 244 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 56d42040..c19a8d88 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1594,7 +1594,7 @@ dependencies = [ "prost", "ripemd160", "sha2 0.9.9", - "sha3", + "sha3 0.9.1", "sp-std", ] @@ -1740,7 +1740,7 @@ dependencies = [ "elliptic-curve", "sec1", "sha2 0.9.9", - "sha3", + "sha3 0.9.1", ] [[package]] @@ -2154,7 +2154,7 @@ dependencies = [ [[package]] name = "orga" version = "0.3.1" -source = "git+https://github.com/nomic-io/orga.git?rev=6125c449fa8962c6d897f44a3032ab8161c4e1e0#6125c449fa8962c6d897f44a3032ab8161c4e1e0" +source = "git+https://github.com/nomic-io/orga.git?rev=b942d6d1c6163155b2250a0b1654ef171865b76f#b942d6d1c6163155b2250a0b1654ef171865b76f" dependencies = [ "abci2", "async-trait", @@ -2193,6 +2193,7 @@ dependencies = [ "serde-wasm-bindgen", "serde_json", "sha2 0.10.6", + "sha3 0.10.6", "tar", "tendermint", "tendermint-proto", @@ -2209,7 +2210,7 @@ dependencies = [ [[package]] name = "orga-macros" version = "0.3.1" -source = "git+https://github.com/nomic-io/orga.git?rev=6125c449fa8962c6d897f44a3032ab8161c4e1e0#6125c449fa8962c6d897f44a3032ab8161c4e1e0" +source = "git+https://github.com/nomic-io/orga.git?rev=b942d6d1c6163155b2250a0b1654ef171865b76f#b942d6d1c6163155b2250a0b1654ef171865b76f" dependencies = [ "darling 0.14.2", "heck 0.3.3", @@ -3247,6 +3248,16 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "sha3" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" +dependencies = [ + "digest 0.10.5", + "keccak", +] + [[package]] name = "shlex" version = "1.1.0" diff --git a/Cargo.toml b/Cargo.toml index 98bc9614..cbe5a201 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ default-run = "nomic" [dependencies] bitcoin = { version = "0.28.1", features = ["use-serde"] } bitcoind = { version = "0.21.0", features = ["22_0"], optional = true } -orga = { git = "https://github.com/nomic-io/orga.git", rev = "6125c449fa8962c6d897f44a3032ab8161c4e1e0", features = ["merk-verify"] } +orga = { git = "https://github.com/nomic-io/orga.git", rev = "b942d6d1c6163155b2250a0b1654ef171865b76f", features = ["merk-verify"] } thiserror = "1.0.30" ed = { git = "https://github.com/nomic-io/ed", rev = "9c0e206ffdb59dacb90f083e004e8080713e6ad8" } clap = { version = "3.2.16", features = ["derive"], optional = true } diff --git a/rest/Cargo.lock b/rest/Cargo.lock index 2fcb228e..309699e6 100644 --- a/rest/Cargo.lock +++ b/rest/Cargo.lock @@ -44,7 +44,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfe0133578c0986e1fe3dfcd4af1cc5b2dd6c3dbf534d69916ce16a2701d40ba" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher", "cpufeatures", ] @@ -87,18 +87,6 @@ version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" -[[package]] -name = "arrayref" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - [[package]] name = "arrayvec" version = "0.7.2" @@ -223,7 +211,7 @@ checksum = "5e121dee8023ce33ab248d9ce1493df03c3b38a659b240096fcbd7048ff9c31f" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -439,21 +427,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "blake3" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "cc", - "cfg-if 0.1.10", - "constant_time_eq", - "crypto-mac 0.8.0", - "digest 0.9.0", -] - [[package]] name = "block-buffer" version = "0.9.0" @@ -524,9 +497,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "bzip2-sys" @@ -557,12 +530,6 @@ dependencies = [ "nom", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -657,17 +624,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "colored" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ffc801dacf156c5854b9df4f425a626539c3a6ef7893cc0c5084a23f0b6c59" -dependencies = [ - "atty", - "lazy_static", - "winapi", -] - [[package]] name = "colored" version = "2.0.0" @@ -701,12 +657,6 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "convert_case" version = "0.4.0" @@ -822,7 +772,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -854,16 +804,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "crypto-mac" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" -dependencies = [ - "generic-array", - "subtle", -] - [[package]] name = "crypto-mac" version = "0.11.1" @@ -927,6 +867,76 @@ dependencies = [ "zeroize", ] +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core 0.13.4", + "darling_macro 0.13.4", +] + +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core 0.14.2", + "darling_macro 0.14.2", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core 0.13.4", + "quote", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core 0.14.2", + "quote", + "syn", +] + [[package]] name = "der" version = "0.5.1" @@ -1022,28 +1032,28 @@ dependencies = [ [[package]] name = "ed" -version = "0.2.2-alpha.0" -source = "git+https://github.com/nomic-io/ed?rev=dd28e9f9e7c97827dde943ee8decfcdf25b3cc83#dd28e9f9e7c97827dde943ee8decfcdf25b3cc83" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f205c65ec89e8fdd41f5a522eb5721818dc84c732634a6e48eb1a7b92e0169d" dependencies = [ - "ed-derive 0.2.3", + "ed-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", ] [[package]] name = "ed" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f205c65ec89e8fdd41f5a522eb5721818dc84c732634a6e48eb1a7b92e0169d" +source = "git+https://github.com/nomic-io/ed?rev=9c0e206ffdb59dacb90f083e004e8080713e6ad8#9c0e206ffdb59dacb90f083e004e8080713e6ad8" dependencies = [ - "ed-derive 0.3.0", + "ed-derive 0.3.0 (git+https://github.com/nomic-io/ed?rev=9c0e206ffdb59dacb90f083e004e8080713e6ad8)", "thiserror", ] [[package]] name = "ed-derive" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06a91d774f4b861acaa791bc6165e66d72d3a5d1aa85fc8c0956f5580f863161" +checksum = "e9907e1f07d6b49fc8cfc92870aae890618671e932db9b7b9224d530eddde2cb" dependencies = [ "proc-macro2", "quote", @@ -1053,8 +1063,7 @@ dependencies = [ [[package]] name = "ed-derive" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9907e1f07d6b49fc8cfc92870aae890618671e932db9b7b9224d530eddde2cb" +source = "git+https://github.com/nomic-io/ed?rev=9c0e206ffdb59dacb90f083e004e8080713e6ad8#9c0e206ffdb59dacb90f083e004e8080713e6ad8" dependencies = [ "proc-macro2", "quote", @@ -1114,7 +1123,7 @@ version = "0.8.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dc8abb250ffdda33912550faa54c88ec8b998dec0b2c55ab224921ce11df" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1201,7 +1210,7 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "winapi", @@ -1222,7 +1231,7 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crc32fast", "libc", "miniz_oxide", @@ -1408,7 +1417,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -1419,7 +1428,7 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi 0.10.0+wasi-snapshot-preview1", @@ -1560,7 +1569,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac", "digest 0.9.0", ] @@ -1771,10 +1780,16 @@ dependencies = [ "prost", "ripemd160", "sha2 0.9.9", - "sha3", + "sha3 0.9.1", "sp-std", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.2.3" @@ -1833,7 +1848,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1922,12 +1937,12 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ecdsa", "elliptic-curve", "sec1", "sha2 0.9.9", - "sha3", + "sha3 0.9.1", ] [[package]] @@ -1969,7 +1984,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "winapi", ] @@ -2019,7 +2034,7 @@ version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -2028,7 +2043,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "generator", "scoped-tls", "serde", @@ -2064,32 +2079,14 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" -[[package]] -name = "merk" -version = "1.0.0" -source = "git+https://github.com/nomic-io/merk?rev=a2e46ed40c7b7eeaaed7a94654c18413728f7b8d#a2e46ed40c7b7eeaaed7a94654c18413728f7b8d" -dependencies = [ - "blake3", - "byteorder", - "colored 1.9.3", - "ed 0.2.2-alpha.0", - "failure", - "hex", - "num_cpus", - "rand 0.8.5", - "rocksdb", - "thiserror", - "time 0.1.44", -] - [[package]] name = "merk" version = "2.0.0" source = "git+https://github.com/nomic-io/merk?rev=8009dff26de5718eec709d3aea6d71f7c5188adb#8009dff26de5718eec709d3aea6d71f7c5188adb" dependencies = [ "byteorder", - "colored 2.0.0", - "ed 0.3.0", + "colored", + "ed 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure", "hex", "num_cpus", @@ -2223,37 +2220,7 @@ dependencies = [ [[package]] name = "nomic" -version = "3.0.0" -source = "git+https://github.com/nomic-io/nomic?branch=v4a-legacy-testnet#8e77993acb3917398374fe9deaaa691c0a1ae809" -dependencies = [ - "base64", - "bech32", - "bitcoin 0.28.1", - "bitcoin-script", - "bitcoincore-rpc-async2", - "bitcoind", - "clap", - "csv", - "derive_more", - "ed 0.3.0", - "futures", - "js-sys", - "orga 0.3.0", - "pretty_env_logger", - "rand 0.8.5", - "reqwest", - "serde", - "serde_json", - "tendermint-rpc", - "thiserror", - "tokio", - "toml_edit 0.13.4", - "warp", -] - -[[package]] -name = "nomic" -version = "4.1.1" +version = "4.1.2" dependencies = [ "base64", "bech32", @@ -2261,18 +2228,19 @@ dependencies = [ "bitcoin-script", "bitcoincore-rpc-async2", "bitcoind", + "bytes", "clap", "csv", "derive_more", - "ed 0.3.0", + "ed 0.3.0 (git+https://github.com/nomic-io/ed?rev=9c0e206ffdb59dacb90f083e004e8080713e6ad8)", "futures", "js-sys", - "nomic 3.0.0", - "orga 0.3.1", + "orga", "pretty_env_logger", "rand 0.8.5", "reqwest", "serde", + "serde-big-array", "serde_json", "sha2 0.10.6", "tendermint-rpc", @@ -2289,7 +2257,7 @@ dependencies = [ "base64", "hex", "lazy_static", - "nomic 4.1.1", + "nomic", "rocket", "serde", "serde_json", @@ -2407,7 +2375,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" dependencies = [ "bitflags", - "cfg-if 1.0.0", + "cfg-if", "foreign-types", "libc", "once_cell", @@ -2433,54 +2401,10 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "orga" -version = "0.3.0" -source = "git+https://github.com/nomic-io/orga?branch=v3-legacy#580ae2157dcd4d4e98167c8159b238e5b049d236" -dependencies = [ - "abci2", - "async-trait", - "base64", - "bech32", - "ed 0.3.0", - "ed25519-dalek", - "flate2", - "futures-lite", - "hex", - "hex-literal", - "home", - "is_executable", - "js-sys", - "log", - "merk 1.0.0", - "num-rational", - "num-traits", - "orga-macros 0.2.4", - "prost", - "reqwest", - "ripemd", - "rust_decimal", - "rust_decimal_macros", - "secp256k1 0.22.1", - "seq-macro", - "serde", - "serde_json", - "sha2 0.9.9", - "tar", - "tendermint", - "tendermint-proto", - "tendermint-rpc", - "thiserror", - "toml_edit 0.2.1", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "orga" version = "0.3.1" -source = "git+https://github.com/nomic-io/orga.git?branch=v4#c9a56142dd65bc10d139f5bcb493473e3f8c49f1" +source = "git+https://github.com/nomic-io/orga.git?rev=b942d6d1c6163155b2250a0b1654ef171865b76f#b942d6d1c6163155b2250a0b1654ef171865b76f" dependencies = [ "abci2", "async-trait", @@ -2489,7 +2413,7 @@ dependencies = [ "bincode", "cosmrs", "derive_more", - "ed 0.3.0", + "ed 0.3.0 (git+https://github.com/nomic-io/ed?rev=9c0e206ffdb59dacb90f083e004e8080713e6ad8)", "ed25519-dalek", "flate2", "futures-lite", @@ -2502,11 +2426,11 @@ dependencies = [ "is_executable", "js-sys", "log", - "merk 2.0.0", + "merk", "num-rational", "num-traits", - "orga 0.3.0", - "orga-macros 0.3.1", + "orga-macros", + "paste", "prost", "prost-types", "reqwest", @@ -2516,8 +2440,10 @@ dependencies = [ "secp256k1 0.22.1", "seq-macro", "serde", + "serde-wasm-bindgen", "serde_json", "sha2 0.10.6", + "sha3 0.10.6", "tar", "tendermint", "tendermint-proto", @@ -2531,25 +2457,17 @@ dependencies = [ "web-sys", ] -[[package]] -name = "orga-macros" -version = "0.2.4" -source = "git+https://github.com/nomic-io/orga?branch=v3-legacy#580ae2157dcd4d4e98167c8159b238e5b049d236" -dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "orga-macros" version = "0.3.1" -source = "git+https://github.com/nomic-io/orga.git?branch=v4#c9a56142dd65bc10d139f5bcb493473e3f8c49f1" +source = "git+https://github.com/nomic-io/orga.git?rev=b942d6d1c6163155b2250a0b1654ef171865b76f#b942d6d1c6163155b2250a0b1654ef171865b76f" dependencies = [ + "darling 0.14.2", "heck 0.3.3", "proc-macro2", "quote", + "regex", + "superstruct", "syn", ] @@ -2581,7 +2499,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28141e0cc4143da2443301914478dc976a61ffdb3f043058310c70df2fed8954" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", @@ -2590,9 +2508,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.7" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" [[package]] name = "pbkdf2" @@ -2600,7 +2518,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f05894bce6a1ba4be299d0c5f29563e08af2bc18bb7d48313113bed71e904739" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac", ] [[package]] @@ -2720,7 +2638,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef234e08c11dfcb2e56f79fd70f6f2eb7f025c0ce2333e82f4f0518ecad30c6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "opaque-debug", "universal-hash", @@ -2785,11 +2703,11 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.38" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9027b48e9d4c9175fa2218adf3557f91c1137021739951d4932f5f8268ac48aa" +checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -3089,9 +3007,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.5" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ "aho-corasick", "memchr", @@ -3109,9 +3027,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "remove_dir_all" @@ -3305,7 +3223,7 @@ version = "1.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22dc69eadbf0ee2110b8d20418c0c6edbaefec2811c4963dc17b6344e11fe0f8" dependencies = [ - "arrayvec 0.7.2", + "arrayvec", "num-traits", "serde", ] @@ -3624,6 +3542,26 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-big-array" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3323f09a748af288c3dc2474ea6803ee81f118321775bffa3ac8f7e65c5e90e7" +dependencies = [ + "serde", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_bytes" version = "0.11.5" @@ -3685,7 +3623,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug", @@ -3697,7 +3635,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.5", ] @@ -3724,7 +3662,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug", @@ -3736,7 +3674,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.5", ] @@ -3753,6 +3691,16 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "sha3" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" +dependencies = [ + "digest 0.10.5", + "keccak", +] + [[package]] name = "sharded-slab" version = "0.1.4" @@ -3940,15 +3888,29 @@ dependencies = [ "zeroize", ] +[[package]] +name = "superstruct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f4e1f478a7728f8855d7e620e9a152cf8932c6614f86564c886f9b8141f3201" +dependencies = [ + "darling 0.13.4", + "itertools", + "proc-macro2", + "quote", + "smallvec", + "syn", +] + [[package]] name = "syn" -version = "1.0.90" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704df27628939572cd88d33f171cd6f896f4eaca85252c6e0a72d8d8287ee86f" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -3986,7 +3948,7 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "libc", "redox_syscall", @@ -4477,7 +4439,7 @@ version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -4630,6 +4592,12 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + [[package]] name = "unicode-normalization" version = "0.1.19" @@ -4805,19 +4773,19 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.82" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.82" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" dependencies = [ "bumpalo", "log", @@ -4834,7 +4802,7 @@ version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -4842,9 +4810,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.82" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4852,9 +4820,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.82" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", @@ -4865,9 +4833,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.82" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "web-sys" From bca046267aa942d46a8ab48842b377b8150a8be5 Mon Sep 17 00:00:00 2001 From: Charlie Little Date: Mon, 20 Mar 2023 15:46:04 -0500 Subject: [PATCH 6/7] Update query strings in CACHED_QUERIES --- rest/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest/src/main.rs b/rest/src/main.rs index ddce10c3..c1e16926 100644 --- a/rest/src/main.rs +++ b/rest/src/main.rs @@ -22,7 +22,7 @@ use tm::Client as _; lazy_static::lazy_static! { static ref QUERY_CACHE: Arc>> = Arc::new(RwLock::new(HashMap::new())); //TODO: Get actual query strings for cached queries - static ref CACHED_QUERIES: HashSet = HashSet::from(["validators/all".to_string()]); + static ref CACHED_QUERIES: HashSet = HashSet::from(["010209".to_string()]); } #[get("/cosmos/bank/v1beta1/balances/
")] From a5ed85309c2352352d6a5eae43ad0f163ca96968 Mon Sep 17 00:00:00 2001 From: Charlie Little Date: Mon, 20 Mar 2023 15:50:36 -0500 Subject: [PATCH 7/7] Remove TODO for query string --- rest/src/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/rest/src/main.rs b/rest/src/main.rs index c1e16926..e3b50728 100644 --- a/rest/src/main.rs +++ b/rest/src/main.rs @@ -21,7 +21,6 @@ use tm::Client as _; lazy_static::lazy_static! { static ref QUERY_CACHE: Arc>> = Arc::new(RwLock::new(HashMap::new())); - //TODO: Get actual query strings for cached queries static ref CACHED_QUERIES: HashSet = HashSet::from(["010209".to_string()]); }