From ac078d72ded7d7a8ba71fecb68ed429ad13f7eaa Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Wed, 21 Aug 2024 21:30:38 -0700 Subject: [PATCH] remove some prints & fix a bug --- Cargo.lock | 40 +++++++++---------- kinode/Cargo.toml | 2 +- kinode/packages/app_store/chain/src/lib.rs | 1 - .../packages/app_store/ui/package-lock.json | 2 + .../kns_indexer/kns_indexer/src/lib.rs | 11 +---- kinode/src/eth/subscription.rs | 6 --- lib/Cargo.toml | 2 +- 7 files changed, 26 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dcad6afd..58e0870f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,7 +111,7 @@ dependencies = [ [[package]] name = "alloy" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-consensus 0.2.1", "alloy-contract", @@ -173,7 +173,7 @@ dependencies = [ [[package]] name = "alloy-consensus" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-eips 0.2.1", "alloy-primitives", @@ -186,7 +186,7 @@ dependencies = [ [[package]] name = "alloy-contract" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -263,7 +263,7 @@ dependencies = [ [[package]] name = "alloy-eips" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -298,7 +298,7 @@ dependencies = [ [[package]] name = "alloy-genesis" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-primitives", "alloy-serde 0.2.1", @@ -345,7 +345,7 @@ dependencies = [ [[package]] name = "alloy-json-rpc" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -378,7 +378,7 @@ dependencies = [ [[package]] name = "alloy-network" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-consensus 0.2.1", "alloy-eips 0.2.1", @@ -398,7 +398,7 @@ dependencies = [ [[package]] name = "alloy-network-primitives" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-primitives", "alloy-serde 0.2.1", @@ -462,7 +462,7 @@ dependencies = [ [[package]] name = "alloy-provider" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-chains", "alloy-consensus 0.2.1", @@ -497,7 +497,7 @@ dependencies = [ [[package]] name = "alloy-pubsub" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-json-rpc 0.2.1", "alloy-primitives", @@ -558,7 +558,7 @@ dependencies = [ [[package]] name = "alloy-rpc-client" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-json-rpc 0.2.1", "alloy-primitives", @@ -609,7 +609,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-rpc-types-eth 0.2.1", "alloy-serde 0.2.1", @@ -637,7 +637,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-consensus 0.2.1", "alloy-eips 0.2.1", @@ -676,7 +676,7 @@ dependencies = [ [[package]] name = "alloy-serde" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-primitives", "serde", @@ -700,7 +700,7 @@ dependencies = [ [[package]] name = "alloy-signer" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-primitives", "async-trait", @@ -713,7 +713,7 @@ dependencies = [ [[package]] name = "alloy-signer-local" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-consensus 0.2.1", "alloy-network 0.2.1", @@ -838,7 +838,7 @@ dependencies = [ [[package]] name = "alloy-transport" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-json-rpc 0.2.1", "base64 0.22.1", @@ -871,7 +871,7 @@ dependencies = [ [[package]] name = "alloy-transport-http" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-json-rpc 0.2.1", "alloy-transport 0.2.1", @@ -885,7 +885,7 @@ dependencies = [ [[package]] name = "alloy-transport-ws" version = "0.2.1" -source = "git+https://github.com/bitful-pannul/alloy.git?rev=c73e70d#c73e70dab6069246bbf20162fbe17c5b11d0c668" +source = "git+https://github.com/bitful-pannul/alloy.git?rev=bd900b4#bd900b4564410c376c811629afcf8e269a0a0896" dependencies = [ "alloy-pubsub", "alloy-transport 0.2.1", @@ -3755,7 +3755,7 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "lib" -version = "0.9.0" +version = "0.9.1" dependencies = [ "alloy 0.2.1", "kit 0.6.8", diff --git a/kinode/Cargo.toml b/kinode/Cargo.toml index b6ae0bd8..1409ab1b 100644 --- a/kinode/Cargo.toml +++ b/kinode/Cargo.toml @@ -26,7 +26,7 @@ simulation-mode = [] [dependencies] aes-gcm = "0.10.3" -alloy = { git = "https://github.com/bitful-pannul/alloy.git", rev = "c73e70d", features = [ +alloy = { git = "https://github.com/bitful-pannul/alloy.git", rev = "bd900b4", features = [ "consensus", "contract", "json-rpc", diff --git a/kinode/packages/app_store/chain/src/lib.rs b/kinode/packages/app_store/chain/src/lib.rs index e4d3ed5d..87a9768e 100644 --- a/kinode/packages/app_store/chain/src/lib.rs +++ b/kinode/packages/app_store/chain/src/lib.rs @@ -138,7 +138,6 @@ fn handle_message(our: &Address, state: &mut State, message: &Message) -> anyhow } } else { // attempt to resubscribe - println!("attempting resub"); state .kimap .provider diff --git a/kinode/packages/app_store/ui/package-lock.json b/kinode/packages/app_store/ui/package-lock.json index 54d87528..f65b58a3 100644 --- a/kinode/packages/app_store/ui/package-lock.json +++ b/kinode/packages/app_store/ui/package-lock.json @@ -3749,6 +3749,8 @@ }, "node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/napi-wasm/-/napi-wasm-1.1.0.tgz", + "integrity": "sha512-lHwIAJbmLSjF9VDRm9GoVOy9AGp3aIvkjv+Kvz9h16QR3uSVYH78PNQUnT2U4X53mhlnV2M7wrhibQ3GHicDmg==", "inBundle": true, "license": "MIT" }, diff --git a/kinode/packages/kns_indexer/kns_indexer/src/lib.rs b/kinode/packages/kns_indexer/kns_indexer/src/lib.rs index 484e8eaa..068662ec 100644 --- a/kinode/packages/kns_indexer/kns_indexer/src/lib.rs +++ b/kinode/packages/kns_indexer/kns_indexer/src/lib.rs @@ -131,9 +131,6 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { eth_provider.subscribe_loop(1, mints_filter.clone()); eth_provider.subscribe_loop(2, notes_filter.clone()); - // if block in state is < current_block, get logs from that part. - println!("syncing old logs..."); - // if subscription results come back in the wrong order, we store them here // until the right block is reached. @@ -142,6 +139,8 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { // let mut pending_requests: BTreeMap> = BTreeMap::new(); let mut pending_notes: BTreeMap> = BTreeMap::new(); + // if block in state is < current_block, get logs from that part. + println!("syncing old logs..."); fetch_and_process_logs( ð_provider, &mut state, @@ -449,12 +448,6 @@ fn handle_log( .entry(block_number) .or_default() .push((decoded, 0)); - - if !state.listening_newblocks && !pending_notes.is_empty() { - print_to_terminal(0, "subscribing to newHeads..."); - listen_to_new_blocks_loop(); // sub_id: 3 - state.listening_newblocks = true; - } } } _log => { diff --git a/kinode/src/eth/subscription.rs b/kinode/src/eth/subscription.rs index 7d2d5ce1..f9240b0a 100644 --- a/kinode/src/eth/subscription.rs +++ b/kinode/src/eth/subscription.rs @@ -259,7 +259,6 @@ async fn build_subscription( } let alloy_sub_id = rx.local_id(); let alloy_sub_id: alloy::primitives::U256 = alloy_sub_id.clone().into(); - println!("{target} making sub {:?}", alloy_sub_id); return Ok(Ok((rx, chain_id))); } Err(rpc_error) => { @@ -395,7 +394,6 @@ async fn maintain_local_subscription( }, value = rx.recv() => { let Ok(value) = value else { - println!("sub failed: {:?}\r", value.unwrap_err()); break; }; let result: SubscriptionResult = match serde_json::from_str(value.get()) { @@ -444,10 +442,6 @@ fn unsubscribe(rx: RawSubscription, chain_id: &u64, providers: &Providers) { continue; }; let x = pubsub.unsubscribe(alloy_sub_id); - println!( - "we just tried unsubscribing {:?} unsubscribed: {:?}\r", - alloy_sub_id, x - ); } } diff --git a/lib/Cargo.toml b/lib/Cargo.toml index a11d6d7c..811a5c9a 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -15,7 +15,7 @@ kit = { git = "https://github.com/kinode-dao/kit", tag = "v0.6.8" } tokio = "1.28" [dependencies] -alloy = { git = "https://github.com/bitful-pannul/alloy.git", rev = "c73e70d", features = [ +alloy = { git = "https://github.com/bitful-pannul/alloy.git", rev = "bd900b4", features = [ "json-rpc", "rpc-types", "rpc-types-eth",