diff --git a/.gitignore b/.gitignore index 26154489a5..cb0a311337 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/*.redb /.idea/ /.vagrant /docs/build @@ -5,7 +6,6 @@ /fuzz/corpus /fuzz/coverage /fuzz/target -/index.redb /ord.log /target /test-times.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d4c692aeb..c8aec17aae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ Changelog ========= +[0.11.1](https://github.com/ordinals/ord/releases/tag/0.11.1) - 2023-11-09 +-------------------------------------------------------------------------- + +### Fixed +- Use new RPC client in Reorg::get_block_with_retries (#2650) + +### Misc +- Refactor varint encoding (#2645) + [0.11.0](https://github.com/ordinals/ord/releases/tag/0.11.0) - 2023-11-07 -------------------------------------------------------------------------- diff --git a/Cargo.lock b/Cargo.lock index df103c0fca..1c178013e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -574,9 +574,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" +checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" dependencies = [ "memchr", "serde", @@ -1747,9 +1747,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lock_api" @@ -2064,7 +2064,7 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ord-litecoin" -version = "0.11.0" +version = "0.11.1" dependencies = [ "anyhow", "async-trait", @@ -2607,7 +2607,7 @@ dependencies = [ "bitflags 2.4.1", "errno", "libc", - "linux-raw-sys 0.4.10", + "linux-raw-sys 0.4.11", "windows-sys 0.48.0", ] @@ -2655,9 +2655,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ "base64 0.21.5", ] @@ -2878,9 +2878,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "socket2" @@ -3127,9 +3127,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", "bytes", @@ -3144,9 +3144,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 93ee1c95a2..ba369e1964 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ord-litecoin" description = "◉ Ordinal wallet and block explorer for litecoin" -version = "0.11.0" +version = "0.11.1" license = "CC0-1.0" edition = "2021" autotests = false diff --git a/src/index/fetcher.rs b/src/index/fetcher.rs index 774405b9f5..9bb38d9e80 100644 --- a/src/index/fetcher.rs +++ b/src/index/fetcher.rs @@ -1,10 +1,7 @@ use { - crate::Options, - anyhow::{anyhow, Result}, + super::*, base64::Engine, - bitcoin::{Transaction, Txid}, hyper::{client::HttpConnector, Body, Client, Method, Request, Uri}, - serde::Deserialize, serde_json::{json, Value}, }; diff --git a/src/index/reorg.rs b/src/index/reorg.rs index fc6164282c..3102cdc7d7 100644 --- a/src/index/reorg.rs +++ b/src/index/reorg.rs @@ -85,7 +85,8 @@ impl Reorg { if (height < SAVEPOINT_INTERVAL || height % SAVEPOINT_INTERVAL == 0) && index - .client + .options + .bitcoin_rpc_client()? .get_blockchain_info()? .headers .saturating_sub(height) diff --git a/src/runes/varint.rs b/src/runes/varint.rs index debef86e44..2f088cd222 100644 --- a/src/runes/varint.rs +++ b/src/runes/varint.rs @@ -11,21 +11,12 @@ pub fn encode_to_vec(mut n: u128, v: &mut Vec) { let mut out = [0; 19]; let mut i = 18; - loop { - let mut byte = n.to_le_bytes()[0] & 0b0111_1111; - - if i < 18 { - byte |= 0b1000_0000; - } - - out[i] = byte; - - if n < 0b1000_0000 { - break; - } + out[i] = n.to_le_bytes()[0] & 0b0111_1111; + while n > 0b0111_1111 { n = n / 128 - 1; i -= 1; + out[i] = n.to_le_bytes()[0] | 0b1000_0000; } v.extend_from_slice(&out[i..]);